Commit graph

36 commits

Author SHA1 Message Date
Bruce Berrios bbc8c837df
Move quote moderation logic to quotes (#2590)
* Move quote moderation logic to quotes

* Add note

* Fix issue
2022-02-27 18:37:51 +01:00
Bruce Berrios 6b1e9efe73
Fix quote ratings (#2586) by Bruception
* Fix quote ratings

* Reorder logic

* Update message

* Fix consistency
2022-02-25 19:22:44 +01:00
Bruce Berrios 4daf76e7d9
Migrate config client to ts (#2588) by Bruception 2022-02-25 19:20:38 +01:00
Bruce Berrios 8b23cdd7dc
Migrate some controller files (#2584)
* Migrate some controller files

* Rename variable
2022-02-24 13:14:33 +01:00
Bruce Berrios 1ba7a76b86
Migrate middlewares to TypeScript (#2574)
* Migrate middlewares

* Update workflow

* Fix ignore

* Fix

* Fix

* Remove babel loader from root dependencies

* Remove mongoDb
2022-02-23 10:03:38 -05:00
Miodec f00bc98db8 moved database down message to the top of the if stack 2022-02-23 13:07:18 +01:00
Bruce Berrios f9d6f52c15
Api overhaul (#2555) by Bruception
* Feat:Update response structure (#2427)

* Fix:response and error structure

* update:response message

* update:response class

* update

* Update response message

Co-authored-by: Mustafiz Kaifee Mumtaz <mustafiz.mumtaz@freecharge.com>

* Add MonkeyToken foundation (#2487) by Bruception

* Api changes (#2492)

* API changes

* Remove unused import

* Add Ape client (#2513)

* Add all endpoints (#2514)

* Merged backend typescript into api overhaul (#2515)

* Install typescript and add backend tsconfig

Cannot yet build due to a number of compilation errors in JS code

Signed-off-by: Brian Evans <ebrian101@gmail.com>

* Fix typescript compilation errors

Signed-off-by: Brian Evans <ebrian101@gmail.com>

* Migrated backend to ES modules

Switched to import export syntax

Signed-off-by: Brian Evans <ebrian101@gmail.com>

* Add typescript declaration for anticheat

Signed-off-by: Brian Evans <ebrian101@gmail.com>

* Rename top level files to .ts

Fix service account json file typing

Signed-off-by: Brian Evans <ebrian101@gmail.com>

* Add dev build scripts for backend typescript

Signed-off-by: Brian Evans <ebrian101@gmail.com>

* Removed empty lines and switched to using db

Cleaned up imports by removing needless empty lines and migrated to the new db.js instead of mongodb.js.

Signed-off-by: Brian Evans <ebrian101@gmail.com>

* Fixed backend commonjs syntax to ES module syntax

Signed-off-by: Brian Evans <ebrian101@gmail.com>

* Add build to backend start script

Signed-off-by: Brian Evans <ebrian101@gmail.com>

* Migrate some endpoints to Ape

* Strict equals

* Remove artifact

* ape -> Ape

* Ape migration p2 (#2522)

* Migrate leaderboard endpoints to ape

* Fixed comment

* Init backend types

* Fail

* Return

* Migrate Quotes to Ape (#2528)

* Migrate quotes to Ape

* Fix backend response

* Fix issue

* Fix rate limit (#2533)

* fix rate limit

* Fix import

* Fix issues

* Ape migration p4 (#2547)

* Migrate results endpoints to ape

* Remove unused import

* Remove unused import

* Fix loaders

* Make function async

* Hide try saving results

* Migrate some users endpoints to Ape (#2548)

* Complete Ape Migration (#2553)

* Complete ape migration

* Fix preset

* Return preset data

* Add typings

* Move captcha reset

* Read from params

* Fix result tags endpoint

* Fix stuck loader

* fixed lb memory not saving

* fixed quote rating popup not showing up for new users

Co-authored-by: Mustafiz Kaifee <49086821+Mustafiz04@users.noreply.github.com>
Co-authored-by: Mustafiz Kaifee Mumtaz <mustafiz.mumtaz@freecharge.com>
Co-authored-by: Brian Evans <53117772+mrbrianevans@users.noreply.github.com>
Co-authored-by: Miodec <bartnikjack@gmail.com>
2022-02-22 20:55:48 +01:00
Miodec c7a200b476 checking if token wasnt revoked
added error if token was revoked
fixed token errors
2022-02-09 14:18:49 +01:00
Bruce Berrios 76bcc4bd56
Add request validation to user endpoints (#2423) by Bruception
* Add request validation to user endpoints

* Remove tag id log

* Remove verbs from endpoints

* Remove old code

* Remove uid

* Fix

* Remove name from URI

* Rename utils

* Fix
2022-02-07 20:22:39 +01:00
Bruce Berrios 957b4cf1a8
Endpoint schemas/Improved Auth Middleware (#2411) by Bruception
* Lots of stuff

* Changed code order

* Change message

* Use strict comparison

* Fix Bearer auth

* changed failed validation message

* removed full stops

Co-authored-by: Miodec <bartnikjack@gmail.com>
2022-02-04 21:18:22 +01:00
Miodec 61f39b64b9 handling one possible exception 2022-02-04 13:06:09 +01:00
Miodec f1c60b93c1 typo 2022-02-03 22:42:46 +01:00
Miodec 89c86ecd95 showing value 2022-02-03 22:39:49 +01:00
Miodec b0c9362735 stringify 2022-02-03 22:24:31 +01:00
Miodec 1aab7ab39f added more info 2022-02-03 22:21:32 +01:00
Miodec 2fdf28fcf3 updated status code 2022-02-03 21:59:02 +01:00
Bruce Berrios 92a503df71
Refactor Quote Endpoints (#2388) by Bruception
* Refactor quotes route

* Add request validation

* removed unnecessary configuration check

* using const

Co-authored-by: Miodec <bartnikjack@gmail.com>
2022-02-01 19:47:41 +01:00
Bruce Berrios 101c227599
Add Dynamic Server Configuration (#2385) by Bruception
* Add no frontend script

* Define context middleware

* Define base configuration schema

* Define configuration DAO

* Setup context middleware and live configuration fetch

* Remove patch configuration method

* Rename files for consistency

* Use plain object check

* Use plain object

* modified base configuration

* renamed config property

* brought back 2 properties

Co-authored-by: Miodec <bartnikjack@gmail.com>
2022-01-31 22:47:58 +01:00
Bruce Berrios 974e50ec48
Add quote reporting feature (#2372) by Bruception
* Add initial quote reporting logic

* Remove report status

* Add initial frontend

* Add submit logic

* Add report quote button to rating popup

* Refactor quoteId argument

* Remove console log

* Add captcha to request validation schema

* Use captcha id for value and reset

* Update report data schema

* Hide report popup on complete

* quote search styling update

* updated report quote styling

* tofixed

* tofixed

* moved report button to the result screen
styling changes

* resetting captcha after hiding to avoid ugly animation

* select2 styling update

* lowercase

Co-authored-by: Miodec <bartnikjack@gmail.com>
2022-01-31 00:53:56 +01:00
Bruce Berrios 7ce9146c7d
Add initial report quote endpoint (#2367) by Bruception
* Add initial report quote endpoint

* Tune rate limiter for report quote

* Tune rate limiter

* Increase max comment size

* Add supported languages to schema validation

* Fix naming
2022-01-29 22:03:02 +01:00
Rizwan Mustafa 938d469388
Fixed typo (#2300) 2022-01-14 16:20:04 +01:00
Jack 0624fbbc87 fixed one typo 2021-11-30 00:52:47 +00:00
Cameron e56d534f33
fix: endpoints share the same rate limit (#2136) by CameronCT
* fix: cleaned rate limiter

* chore: separated ratelimits per request

* fix: bug where leaderboards would crash
2021-11-30 00:49:05 +00:00
Jack ecb11e0f9d increased limit on getting basic user data 2021-11-19 12:52:08 +00:00
Jack dfe4590813 added dev mode to request auth 2021-09-07 15:04:50 +01:00
Jack d95b9a6db1 increased rate limit on localhost 2021-08-29 17:33:51 +01:00
Jack 9c84b32a76 updated the key generator for rate limitng logic 2021-08-27 22:43:08 +01:00
Jack 423990ab3b added api rate limiting 2021-08-27 21:40:38 +01:00
Miodec 7106318b0d removed log 2021-08-18 01:41:42 +01:00
Miodec 367b104679 better errors 2021-08-18 01:41:29 +01:00
Miodec 4f96abd87d not using stack param 2021-08-18 01:17:13 +01:00
Miodec 1e6f90f60f changed error code 2021-08-18 01:05:58 +01:00
Miodec d2648fff07 throwing instead of calling next - maybe it will fix double errors 2021-08-17 21:35:44 +01:00
Miodec 2c01c5f817 fixed tiny bug with token finding 2021-06-16 20:56:00 +01:00
Dharmaraj 216c0637c1 Added MonkeyError class 2021-06-06 22:56:12 +05:30
Dharmaraj 4c560a437f Added Auth Router and DAO 2021-06-06 22:02:37 +05:30