Commit graph

613 commits

Author SHA1 Message Date
Miodec
632b7e4bf6 Merge branch 'master' of https://github.com/Miodec/monkeytype 2022-05-21 00:13:13 +02:00
Miodec
4710a70e0c overriding result name to be sure 2022-05-21 00:12:50 +02:00
Bruce Berrios
294ff4c95a
Remove uid from last result (#2998) 2022-05-19 20:44:24 +02:00
Bruce Berrios
1384e9f81d
Add pretty check (#2990) bruception
* Add pretty check

* test

* test

* Add pretty check

* Add condition check

* Enforce style on code changes

* Update scripts

* Any src
2022-05-19 11:31:18 +02:00
Jack
46e0c5c960
Auto ban (#2984)
* added auto ban if user triggers anticheat too much

* updated base configuration

* autoban is optional

* storing updated autoban array

* only checking autoban in time 15 and 60

* miliseconds

* removed unnecessary if check

* returning if already banned

* storing now in variable
greater not greater equal

* moved constant outside function

* using partial type

* renamed variables

* renamed to autoBanTimestamps

* added autoban tests

* increased coverage minimum

* slightly better test

* added autoBanTimestamps checks to other tests
2022-05-16 21:03:44 +02:00
Miodec
699ddd8737 renamed field 2022-05-13 09:41:41 +02:00
Bruce Berrios
6c666f12ba
Add user creation flow test (#2971) bruception 2022-05-13 09:05:57 +02:00
Bruce Berrios
0a371b531a
Add more tests (#2965) Bruception and sondrekje
* Cover updateName

* Test clearPb, export getUsersCollection for testing purposes

* Add base coverage

* Month -> thirty days

Co-authored-by: Sondre Kjempekjenn <sondre.kjempekjenn@gmail.com>
2022-05-11 14:08:06 +02:00
Miodec
41c142b49a blocking users from submitting results if they need to change name 2022-05-08 20:47:45 +02:00
Miodec
616d068e2f needsToUpdateName > needsToChangeName 2022-05-08 16:59:45 +02:00
Miodec
0a1ac828e7 moved invalid name check higher 2022-05-08 16:58:57 +02:00
Miodec
0a4a7eabe7 added test to make sure users cant take an unavailable name 2022-05-08 14:54:15 +02:00
Miodec
a0f6fabf10 is name available is async 2022-05-08 14:24:02 +02:00
Miodec
1baa5c1651 not checking last name change if user needs to change name 2022-05-08 13:20:18 +02:00
Bruce Berrios
cdbc0bf770
Add logic to handle duplicate names (#2958) 2022-05-08 08:59:12 +02:00
Bruce Berrios
ee5ef57d89
Delete bot dal (#2953) 2022-05-06 17:36:23 -05:00
Evan
d9ffcfb4ee
Preparing for George Update (#2895)
* bot-commands rename

* removed bot dal

* reomoved unnecessary configuration entry

* quotes:code_javascript: Add regex-heavy quote. (#2929) markstos

* quotes:code_javascript: Add regex-heavy quote.

This quote contains a long regex that will be a workout for typing
symbols and numbers.

Source code can be confirmed to available under an open source license
here: https://github.com/markstos/parse-coordinates/blob/master/index.js

* fixed length

Co-authored-by: Miodec <bartnikjack@gmail.com>

* fixed script names

* fixed incorrect path

* definitely didnt forget about those

Co-authored-by: Miodec <bartnikjack@gmail.com>
Co-authored-by: Mark Stosberg <mark@rideamigos.com>
Co-authored-by: Jack <jack@monkeytype.com>
2022-05-06 23:48:15 +02:00
Miodec
6d52d8ce1b fixed incorrect path 2022-05-05 23:28:02 +02:00
Bruce Berrios
8095dd6bfc
Add test step in pr-check action (#2942) Bruception
* Add test step in pr-check action

* Add jest action

* Specify wd

* Remove action

* Remove test

* Add anti-cheat check
2022-05-05 23:06:40 +02:00
Sondre Kjempekjenn
afd288a717
Testing - mock setup for redis (#2944) 2022-05-05 14:05:31 -04:00
Bruce Berrios
91220a5bdc
Move backend source files into src folder (#2943) 2022-05-05 19:27:00 +02:00
Bruce Berrios
38ed2f60aa
Remove await (#2941)
* Remove await

* Remove async

* Remove await server
2022-05-05 11:13:09 -04:00
Sondre Kjempekjenn
88a587c5c2
Feature/backend test (#2937) sondrekje
* Switch to ts-node-dev for development

* Minimal setup for backend testing

* Basic controller test

* __tests__ directory

* Delete old DB client

* Improve tests, ensure DB cleanup only runs for inMemory DB
2022-05-05 15:19:31 +02:00
Bruce Berrios
73f21c9cc5
Remove class syntax from george (#2935)
* Remove class syntax from george

* Remove boolean
2022-05-05 02:00:12 +02:00
Bruce Berrios
e5c295cfe4
Remove class syntax from db client (#2940) Bruception
Co-authored-by: Jack <jack@monkeytype.com>
2022-05-05 01:57:51 +02:00
Sondre Kjempekjenn
9634b93fc3
Add docker-compose and instructions to README (#2939) sondrekje 2022-05-05 01:52:17 +02:00
Miodec
bf8862fe74 not exiting in dev mode when redis connection failed
closes #2930
2022-05-04 19:27:34 +02:00
Miodec
8524646380 renamed folder dao to dal 2022-05-04 01:51:25 +02:00
Miodec
ec8ec49b71 Merge branch 'master' of https://github.com/Miodec/monkeytype 2022-05-04 01:48:29 +02:00
Bruce Berrios
6ee84b2484
DAO -> DAL (#2928)
* DAO -> DAL

* This what?

Co-authored-by: Jack <jack@monkeytype.com>
2022-05-04 01:47:51 +02:00
Miodec
de97d798eb moved data validation to anticheat repo 2022-05-04 01:44:13 +02:00
Miodec
b27f5c935b removed todo 2022-05-04 01:21:07 +02:00
Miodec
ca2c82db38 removed unused types 2022-05-04 01:20:26 +02:00
Jack
e6982f293d
Small Dao dals (#2927)
* converted preset dao to dal

* psa dao > dal

* typo

* config dao > dal

* public stats dao > dal

* fixed bad merge

* removed this

* removed comment
2022-05-04 00:43:58 +02:00
Bruce Berrios
9b7b5feb71
BotDAO -> BotDAL (#2926) bruception 2022-05-04 00:38:57 +02:00
Miodec
49befe4f76 unborked the code 2022-05-04 00:34:38 +02:00
Miodec
61292dfb8c fixed previous commit 2022-05-04 00:23:31 +02:00
Miodec
a4ca55cb73 converted report dao to dal 2022-05-04 00:17:34 +02:00
Bruce Berrios
12a63b1cb4
Ape keys dal (#2925) bruception
* Convert Ape-keys DAO to DAL

* Fix this reference
2022-05-04 00:13:48 +02:00
Miodec
a41bcad72d further stripping results of empty / zero values and then resetting them back to default when downloading results 2022-04-28 16:05:53 +02:00
Miodec
ebea7078bd removed quote length if result is not quote
closes #2898
2022-04-28 15:57:50 +02:00
Miodec
89e99fa668 added get last result to public api
closes #2893
2022-04-28 12:39:18 +02:00
Miodec
e419187d2c added get stats endpoint
closes #2892
2022-04-28 12:22:54 +02:00
Miodec
0b24ec2afb also serving at docs 2022-04-28 12:22:26 +02:00
Rizwan Mustafa
369f96691e
Refactor User DAL (#2857) rizwan
* Create romanian quotes (#2846) DKparadox

* Create romanian

* Add files via upload

* Rename romanian quotes.json to romanian.json

* Delete romanian

* Update romanian.json

* Update romanian.json (#2852) DKparadox

* Refactor User DAL

* Remove unnecessary check

* Add stack var in getUser

* removed unnecessary throw

* Fix error

Co-authored-by: DKparadox <93858181+DKparadox@users.noreply.github.com>
Co-authored-by: Miodec <bartnikjack@gmail.com>
2022-04-27 16:42:17 +02:00
Miodec
5f47133b31 added better error message
closes #2871
2022-04-27 16:08:03 +02:00
Jack
9ca477da54
Added tape mode (#2862)
* added config param for tape mode

* added settings section

* added commands

* moving caret to the correct place with tape mode is active

* only jumping line when not using tape mode

* prettier

* scrolling tape

* restarting test when tape mode changed

* showing one line when tape mode is active

* added function for scrolling words horizontally

* scrolling tape when layout emulator is enabled

* removed left margin when tape is active

* disable tape for some challenges

* fixed incorrect caret position when going back to a previous word

* ignoring no-this-alias

* fixed lines scrolling to often when tape mode was disabled

* storing caret width in a variable

* not allowing tape mode and show all lines together

* removed unnecessary comment
2022-04-24 17:04:46 +02:00
Evan
58505a9f31
Fix Collection Types (#2864) 2022-04-24 01:37:05 +02:00
Jack
b60e6905ce
Made username non optional (#2859)
* reduced code repetition

* throwing error when no name provided

* stopping signout if no current user

* expanded to 16 chars

* moved code to popup file

* added google sign up popup

* checking if name is available in the backend

* deleting account if popup was closed
uncommented sign up process
addd functions to enable and disable input

* added google sign up event to avoid circular dependency

* hiding by default

* name is no longer optional
user is deleted if its database object is not found

* using loader to indicate background activity
2022-04-23 19:46:41 +02:00
Jack
bdacc24660
Converted new quotes to typescript (#2844)
* renamed to ts

* added type for new quote

* converted to ts

* renamed dao to dal, fixed logic
2022-04-21 17:23:24 +02:00