* Move http service to separate folder
* Extract utils and constants
* Do not await sync calls
* Removed unused. Do not use unnecessary local var
* Fix ts warnings
* refactor: extract users route in own controller
* skip failing interep tests
* throw error instead of reject promise in `MainService.get`
* Extract posts routes in own controller
* Fix http test. Don't force EXIT
* Add further routes to Posts and Users controllers
* Extract tags route in own controller
* Extract zkchat routes in own controller
* Extract events route in own controller
* fix: use json parser middleware before add user route
* Extract Interep routes in own controller
* Extract Twitter routes in own controller
* refactor: add json parser as pre middleware to all controllers routes
* Remove unused imports
* Rename methods
* add missing `/post/:hash/retweets` route to posts controller
* Update test messages
* Remove unused import
* fixup! refactor: add json parser as pre middleware to all controllers routes
* fix: do not add `/v1` route prefix to twitter and interep controllers
* refactor: add log/json middleware directly at app rather than controllers level
* remove unnecessary `t.end()`
* fix: use last test to force exiting test process
* rename file
* update test script
* fix: use `epxress-async-errors` to catch async errors instead of `wrapHandler`
* add getGroups handler to Users controller
* extract merkle routes in own Controller
* extract static routes in own router/controller
* refactor `http.start`
* chore: order imports
* extract remaining routes in misc controller
* remove initControllers method
* Define SESSION_OPTIONS. Rename constants. Add `ms` dep
* remove console log
* rebase: add search posts endpoint to Posts Controller
* feat: use passport for github, reddit, twitter auth (#54)
* Define `Passport` service
* Define `GithubController`
* aggregate stars received by gh user
* rename `plan` to `proPlan`
* remove passport service
* get receivedStars/proPlan when authenticating
* remove console.logs
* calculate github interep reputation score in passport verify callback
* add types to passport verify cb
* gh auth callback redirects to `redirectUrl`
`redirectUrl` being the query param provided by the client
* remove import
* add types to github util
* fix redirect
* fix: do not reuse authenticate middleware on session endpoint
* fix include provider name in serialized user
* extract github session endpoint in Misc controller
* upsert GH accessToken in DB when authenticating
* can join a gh interep group
* ignore ts missing req.user.userId error
* fix test
* can logout
* chore: update .tool-versions, add pnpm-lock.yaml
* refactor use GitHub personal access token from config
* refactor: add token from db when deserializing
* refactor: extract /logout to Misc Controller
* add passport-witter-oauth2 dep
* add tw oauth config param
* refactor: define common Auth controller and DB
* update package-lock.json
* update config.test.json
* fix test
* uncomment twitter controller
* move session and logout endpoint to AuthController
* add reddit auth
* replace passport-reddit by @r1oga/passport-reddit
* can auth with reddit
* calculate reddit interep reputation on auth
* fix twitter auth scopes
* calculate twitter interep reputation
* refactor
* update config sample
* update package-lock.json
* cleanup: remove GitHub controller
* cleanup: remove githubAuth model
* refactor Auth controller
* catch and log error in passport verify callback
Co-authored-by: tsukino <87639218+0xtsukino@users.noreply.github.com>
* fix db unit tests
Use cloud postgres DB instead of sqlite
* refactor: parallelize async calls
* chore: remove use of `test.db`
* chore: newline
* do not create new db connection, use cached Sequelize instance
* fix:test: force exit at end of DbService tests
* chore: use heroku postgres instance instead of elephantsql for testing
Heroku provides postgres 14.5.
elephantsql has only postgres 11.12
* fix db unit test
* remove unused (redeclared) `parse` function
* test: vectorize `posts.content` column (`tsvector`)
* chore: add `lastArbitrumBlock` config parameter
* feat: add new search endpoint that uses `tsquery`
* fix db unit test
* fix http unit test
* fix db unit test
* fix db unit tests
Use cloud postgres DB instead of sqlite
* refactor: parallelize async calls
* test: force resync in test scripts
To flush tables
* chore: remove use of `test.db`
* chore: newline
* fix: skip failing tests
* remove use of `getMockDB`
* skip process.exit
* do not create new db connection, use cached Sequelize instance
* fix:test: force exit at end of DbService tests
* run `npm run test` in GH test action
`npm run test:coverage` would always fail (we don't meet the coverage threshold)
* chore: use heroku postgres instance instead of elephantsql for testing
Heroku provides postgres 14.5.
elephantsql has only postgres 11.12
* fix db unit test
* remove unused (redeclared) `parse` function
Co-authored-by: tsukino <87639218+0xtsukino@users.noreply.github.com>
* chore: bump webpack to `>5`
* fix: remove `inline` webpack cli option
Enabled by default since `v5`
* fix: set default env var values for environment plugin
To avoid raising undefined errors
Breaking change im v5
See https://webpack.js.org/plugins/environment-plugin/#usage
* fix: rename `loaders` to `rules`
Breaking change in webpack v5
* chore: match 16.x (lts) node versions in GH build and test action
* chore: update `package-lock.json`
* chore: restrict node engine to `">=16 <17"`
* chore: update package-lock.json
* chore: npm audit fix
* chore: fix test GH action step (#1)
* chore: do not `useUnknownInCatchVariables`
* chore: define `goerliHttpProvider` in `config.test.json`
* remove unused constant
* fix db unit test (wrong extra arg)
* add ipfs upload
* add user auth for upload
* insert upload data to postgres
* limit upload to 100mb per user
* wip
* add zkchat endpoint
* update schema
* wip
* add group info
* remove log
* fix semaphore signal hash
* allow file upload for zk post
* udpating interep service
* return zk group type
* verify rln proof
* add server sent event