Commit Graph

141 Commits

Author SHA1 Message Date
renovate[bot]
650995cf30 fix(deps): update dependency mongodb to v4.17.1 2023-10-01 04:56:46 +00:00
renovate[bot]
6969b567c5 fix(deps): update dependency @immobiliarelabs/fastify-sentry to v7.1.1 2023-10-01 03:27:53 +00:00
renovate[bot]
a087b1e27e fix(deps): update dependency @fastify/swagger to v8.10.1 2023-10-01 02:28:46 +00:00
renovate[bot]
3d3992d3dd chore(deps): update dependency @types/supertest to v2.0.13 2023-09-30 18:41:50 +00:00
renovate[bot]
e41390b846 chore(deps): update dependency @types/jsonwebtoken to v9.0.3 2023-09-30 00:44:28 +00:00
renovate[bot]
45fedd84e4 fix(deps): update dependency mongodb to v4.17.0 [security] 2023-09-28 16:03:53 +00:00
Muhammed Mustafa
060b0d7aab
chore(deps): update new api packages (#51549)
Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>
2023-09-28 19:15:15 +04:00
renovate[bot]
a383fee2a6 chore(deps): update dependency @types/express-session to v1.17.8 2023-09-23 22:11:29 +00:00
renovate[bot]
cf0e3c79ab fix(deps): update prisma monorepo to v5.3.1 2023-09-16 20:08:00 +00:00
renovate[bot]
96f2cc100e chore(deps): update jest monorepo 2023-09-16 06:41:07 +00:00
Oliver Eyton-Williams
05d19b8b42
feat: create docker images for new api (#51538) 2023-09-13 02:15:25 +05:30
Oliver Eyton-Williams
c0719934ac
chore(config): migrate constants to TS (#51485) 2023-09-06 18:27:34 +05:30
renovate[bot]
e17ebed40e fix(deps): update dependency jsonwebtoken to v9.0.2 2023-09-02 17:48:29 +00:00
renovate[bot]
3d4f8e1ddc fix(deps): update prisma monorepo to v5.2.0 2023-08-27 00:39:30 +00:00
renovate[bot]
f05706fa0d chore(deps): update dependency jest to v29.6.4 2023-08-26 17:01:13 +00:00
renovate[bot]
8bd01750f6 chore(deps): update dependency dotenv-cli to v7.3.0 2023-08-19 15:36:40 +00:00
renovate[bot]
b18dcecfb3 chore(deps): update dependency @fastify/type-provider-typebox to v3.5.0 2023-08-19 12:36:12 +00:00
Rene Pot
df49297de2
feat(api): improve performance with profanity filter replacement (#51112)
Co-authored-by: Naomi Carrigan <nhcarrigan@gmail.com>
2023-08-08 15:27:41 -07:00
renovate[bot]
21cfbf3a43 fix(deps): update prisma monorepo to v5.1.1 2023-08-07 14:58:58 +00:00
renovate[bot]
98d2032c58 chore(deps): update dependency @fastify/type-provider-typebox to v3.4.0 2023-08-05 10:06:17 +00:00
Oliver Eyton-Williams
f3da82518a
feat(api): email service (#50637)
Co-authored-by: Naomi Carrigan <nhcarrigan@gmail.com>
2023-08-04 18:57:59 -07:00
Naomi Carrigan
0aa1ad0d09
feat: require JSDoc in new api (#50429)
Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>
2023-08-03 21:50:54 +05:30
Muhammed Mustafa
8b9ca4c3ab
chore(client): bump prisma to v5 (#51131) 2023-08-03 11:59:15 +02:00
renovate[bot]
af6c4febf9 fix(deps): update dependency fastify to v4.21.0 2023-07-30 01:34:37 +00:00
renovate[bot]
6eaa03ab06 chore(deps): update dependency pino-pretty to v10.2.0 2023-07-29 22:55:02 +00:00
renovate[bot]
75ed177a7c chore(deps): update jest monorepo to v29.6.2 2023-07-29 10:20:23 +00:00
renovate[bot]
fab90da45c fix(deps): update dependency fastify to v4.20.0 2023-07-22 16:40:39 +00:00
renovate[bot]
9fd8a65767 chore(deps): update dependency pino-pretty to v10.1.0 2023-07-22 14:12:44 +00:00
Oliver Eyton-Williams
5482650dd0
feat(api): project-completed (#50701)
Co-authored-by: Mrugesh Mohapatra <1884376+raisedadead@users.noreply.github.com>
Co-authored-by: Niraj Nandish <nirajnandish@icloud.com>
2023-07-17 12:03:17 +04:00
renovate[bot]
8dea66d7b0 chore(deps): update dependency @fastify/type-provider-typebox to v3.3.0 2023-07-15 06:24:25 +00:00
Oliver Eyton-Williams
6e787d3336
feat(api): add /user/get-session-user (#50557)
Co-authored-by: Shaun Hamilton <shauhami020@gmail.com>
2023-07-11 16:28:56 +00:00
renovate[bot]
03323180fd chore(deps): update jest monorepo to v29.6.1 2023-07-09 04:51:55 +00:00
renovate[bot]
9105945b97 fix(deps): update dependency jsonwebtoken to v9.0.1 2023-07-09 00:13:51 +00:00
renovate[bot]
c5c02ce8a9 fix(deps): update dependency fastify to v4.19.2 2023-07-08 19:34:31 +00:00
renovate[bot]
8512ef948a chore(deps): update dependency pino-pretty to v10.0.1 2023-07-08 12:07:19 +00:00
renovate[bot]
10204613b9 fix(deps): update dependency fastify to v4.19.1 2023-07-02 18:44:15 +00:00
renovate[bot]
c94cd4e58e fix(deps): update dependency fastify to v4.19.0 2023-07-02 07:37:56 +00:00
renovate[bot]
8763713907 fix(deps): update prisma monorepo to v4.16.2 2023-07-02 01:49:34 +00:00
renovate[bot]
986fa8c9a1 chore(deps): update dependency ts-jest to v29.1.1 2023-07-01 12:03:02 +00:00
renovate[bot]
e6b88035cf
fix(deps): update dependency jsonwebtoken to v9 [security] (#50837)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-06-30 17:36:48 +05:30
Oliver Eyton-Williams
16c0949a4b
feat(api): user/user-token (#50721)
Co-authored-by: Shaun Hamilton <shauhami020@gmail.com>
2023-06-29 10:36:44 +00:00
renovate[bot]
ca581d395c fix(deps): update prisma monorepo to v4.16.1 2023-06-25 07:52:07 +00:00
renovate[bot]
99782e4ede fix(deps): update dependency fastify to v4.18.0 2023-06-11 03:56:47 +00:00
Oliver Eyton-Williams
65239ee68b
feat(api): allow redirection with message (#50525)
Co-authored-by: Muhammed Mustafa <MuhammedElruby@gmail.com>
2023-06-07 15:30:12 +02:00
renovate[bot]
b16f7fe042 fix(deps): update prisma monorepo to v4.15.0 2023-06-04 01:52:16 +00:00
Sem Bauke
c5deeccd3f
feat: update my username endpoint (#50271)
Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>
2023-06-02 07:04:50 +02:00
Oliver Eyton-Williams
39857b5aa4
test(api): schema security (#50413)
* test: confirm all schemas pass basic validation

* refactor: use tested schemas in routes

* chore: move ajv to dev deps
2023-05-24 09:31:13 -07:00
renovate[bot]
78f31aa966 fix(deps): update prisma monorepo to v4.14.1 2023-05-20 15:42:06 +00:00
Oliver Eyton-Williams
c3c912db07
feat(api): add csrf protection (#50275)
Co-authored-by: Sboonny <muhammed@freecodecamp.org>
2023-05-18 17:06:40 +05:30
renovate[bot]
0fef335292
fix(deps): update dependency @immobiliarelabs/fastify-sentry to v6 (#50388)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-05-16 15:21:28 -07:00
renovate[bot]
dd7e7b58f2
fix(deps): update dependency @fastify/middie to 8.3 (#50384)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-05-15 13:43:53 +03:00
renovate[bot]
decb2e87b6
fix(deps): update dependency fastify to v4.17.0 (#50230)
* fix(deps): update dependency fastify to v4.17.0

* add missing code in error object

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Sboonny <muhammed@freecodecamp.org>
2023-05-15 11:17:09 +03:00
renovate[bot]
e2716c35ea
fix(deps): update prisma monorepo to v4.14.0 (#50377)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-05-15 11:12:59 +03:00
renovate[bot]
427414a24b chore(deps): update dependency @fastify/type-provider-typebox to v3.2.0 2023-05-07 08:05:16 +00:00
renovate[bot]
dd931ab4a1 fix(deps): update dependency @fastify/middie to 8.2 2023-05-07 05:43:12 +00:00
Oliver Eyton-Williams
7572f99f74
refactor(api): remove unused endpoints (#50252)
Also adds "dev" as an alias because I keep trying to use it.
2023-05-02 19:54:05 +03:00
Oliver Eyton-Williams
1567894c36
fix(api): use connection string from .env (#50201) 2023-04-27 23:06:43 +01:00
renovate[bot]
cf8dc73fae fix(deps): update prisma monorepo to v4.13.0 2023-04-27 05:32:16 +00:00
renovate[bot]
998069441e chore(deps): update dependency @fastify/type-provider-typebox to v3.1.0 2023-04-23 22:27:54 +00:00
Muhammed Mustafa
daa23a3d83
feat(api): swap to immobiliarelabs sentry plugin (#50041) 2023-04-17 13:10:23 -07:00
renovate[bot]
59743ad3fb fix(deps): update dependency @sentry/node to v7.48.0 2023-04-15 22:45:37 +00:00
renovate[bot]
9d3bf49ed8
fix(deps): update prisma monorepo to v4.12.0 (#50018)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-04-10 19:26:23 +05:30
renovate[bot]
ad1ba2e982 fix(deps): update dependency @sentry/node to v7.47.0 2023-04-09 13:58:10 +00:00
renovate[bot]
5b2c82d29f chore(deps): update dependency ts-jest to v29.1.0 2023-04-09 03:31:24 +00:00
Muhammed Mustafa
1d8e9fb0b7
feat(api): create sentry plugin (#49731)
* feat(api): add sentry plugin

Apply suggestions from code review

Revert "feat(api): add sentry plugin"

This reverts commit fcde4ee03e9b83e335a6a2bccd490490e9993597.

install sentryNode

WIP: create sentry debug

WIP: find out why use errorhandler isn't typed correct

install sentry

add the deleted sentry code

create sentry plugin

* fix error found through sentry

* Polish sentry plugin

Co-authored-by: Niraj Nandish <nirajnandish@icloud.com>

* duplicate the changes made in the other plugin

* add done to seterrorHandler

* Fix a typo in sentry option

Co-authored-by: Naomi Carrigan <nhcarrigan@gmail.com>

* Stop the dns from running if a DSN wasn't provided

Co-authored-by: Naomi Carrigan <nhcarrigan@gmail.com>

* Polish the function and check the variable value

Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>

* check the dsn dashboard in the env

* export dsn value if it isn't sentrydashboard

Co-authored-by: Naomi Carrigan <nhcarrigan@gmail.com>

* when the value is undefined init errors

* revert the if statement

* throw an error whenever an environment variable is not right

---------

Co-authored-by: Niraj Nandish <nirajnandish@icloud.com>
Co-authored-by: Naomi Carrigan <nhcarrigan@gmail.com>
Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>
2023-04-05 08:35:23 -07:00
renovate[bot]
b48d12714a
fix(deps): update dependency @sinclair/typebox to v0.26.6 (#49855)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>
2023-04-03 09:13:36 +00:00
Oliver Eyton-Williams
06d4076a45
feat(api): dev login (#49880)
Co-authored-by: Mrugesh Mohapatra <hi@mrugesh.dev>
2023-03-29 18:08:38 +05:30
Oliver Eyton-Williams
a128dd8fcd
chore(api): compile TS into /dist (#49812
* chore: compile TS into /dist

Having the output co-located with the source meant that the js would be
imported by default. Given that we don't recompile on source changes,
this means the server got 'stuck' at the point of compilation and would
only register changes on build.

Also, compiling to a dist directory should make it easier to build when
we want to deploy. That said, the motivation is mostly DX.

* fix: put schema.prisma in the default location
2023-03-28 19:42:20 +05:30
renovate[bot]
afa246942e fix(deps): update dependency fastify to v4.15.0 2023-03-26 15:59:50 +00:00
renovate[bot]
7f21c5b4ae fix(deps): update dependency nodemon to v2.0.22 2023-03-26 03:01:14 +00:00
Niraj Nandish
1dcba784fd
feat(api): API documentation with Swagger UI (#49791) 2023-03-24 10:00:51 +01:00
Oliver Eyton-Williams
a0f958189e
chore: update api test suite and include it in run test (#49794) 2023-03-23 16:57:11 +00:00
Oliver Eyton-Williams
36b06be8ce
chore: extend lint:ts to cover api (#49793)
* fix: include express-session types + suppress err

* chore: add api to lint:ts

* fix: remove unnecessary typeRoots config
2023-03-22 17:59:46 +05:30
renovate[bot]
607111978a
fix(deps): update prisma monorepo to v4.11.0 (#49758)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-03-19 12:25:26 +05:30
Oliver Eyton-Williams
17d7fc0af5
feat(api): use pino-pretty for dev logging (#49713)
feat: use pino-pretty for dev logging
2023-03-16 15:42:01 +00:00
Tom
7aeb4ab76b
feat(api): setup jest in new api (#49709)
* feat(api): setup jest in new api

* feat: sample tests
2023-03-16 20:33:40 +05:30
Oliver Eyton-Williams
c2d149ba85
feat(api): create a demo type provider for typebox (#49536)
* feat: create a demo type provider for typebox

* feat: validate reply + share type

* fix: prettify
2023-03-15 14:21:25 +00:00
Oliver Eyton-Williams
fa7955dc75
feat(api): add prisma as orm (#49413) 2023-03-14 17:29:55 +00:00
renovate[bot]
748dea033c fix(deps): update dependency fastify to v4.14.1 2023-03-11 19:45:28 +00:00
Niraj Nandish
4769a448e1
feat(api): sessions management (#49499)
Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>
2023-03-09 20:36:33 +05:30
renovate[bot]
933b909111 fix(deps): update dependency fastify to v4.14.0 2023-03-05 10:44:01 +00:00
renovate[bot]
72321ad76b fix(deps): update dependency nodemon to v2.0.21 2023-03-04 17:30:13 +00:00
Oliver Eyton-Williams
d7848ae01a
feat: migrate to pnpm for better workspace DX (#49293)
* feat: npm -> pnpm 

This resolves the issues with the gatsby client (gatsby-plugin-pnpm
deals with the fact that gatsby is relying on its own dependencies
being de-duped)
and challenge-editor (which doesn't seem to want to automatically install
codemirror and needed its own eslint config)

* fix: correct mocha path for curriculum tests

* fix: use select workspace with -F not -w

* fix: reorganise packages and restrict hoisting

pnpm works best if the workspaces keep their own dependencies, since
dependencies are not flattened and then what node resolves from a
require is predictable.

@types seem to be a special case and more care is required to prevent
them getting smushed together in the root (hence the .npmrc)

* fix: add types for tools + root

* fix: decouple challenge-auditor from client

* fix: add ui-components types

* fix(client): use the latest types for react 16

* fix: prettify

* fix: prettierignore pnpm-lock

* fix: relax hoisting

Turns out pnpm works just fine with types. I don't know what was going
wrong before, but there are no-longer any type conflicts.

* fix: add @redux-saga/core to fix eslint issue

It seems to only be redux-saga that import/named can't cope with, so it
is probably okay to work around this one.

* chore: add chai to tools/scripts/build

* fix: add store to root for cypress

* fix: allow cypress to download binaries

If we want to keep preventing cypress from downloading binaries, we can
figure out a workaround, but I'm allowing it to ease the transition to
pnpm.

My guess about why this is happening is that npm triggers Cypress's
postinstall script, but pnpm does not (because pnpm install only
installs if necessary, perferring to link)

* chore: re-enable pre/post scripts

* fix: update build scripts for client

Co-authored-by: Shaun Hamilton <shauhami020@gmail.com>

* chore: update engines to use pnpm


* fix: enable choice of (super)block for tests

Only 'nix machines for now.

* chore: pin pnpm to version 7

* chore: remove last npms

Except web + curriculum-server. I'll update them when I start work on
them again.

* fix: lockfile check to catch any package-locks

* fix(action): install pnpm for upcoming tests

* chore: add nodemon to new api

Co-authored-by: Shaun Hamilton <shauhami020@gmail.com>
2023-03-02 18:17:44 +00:00
renovate[bot]
e0975e21e5 fix(deps): update dependency fastify to v4.13.0 2023-02-26 07:19:37 +00:00
renovate[bot]
b36bf511d5
fix(deps): update dependency @fastify/mongodb to v6.2.0 (#49512)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-02-25 17:49:32 +02:00
renovate[bot]
ab2b6907d2 fix(deps): update dependency fastify to v4.10.2 [security] 2023-02-24 22:43:58 +00:00
Mrugesh Mohapatra
7199f033fb
feat(next-api): basic authentication setup (#49378)
* feat(next-api): add fastify-auth0-verify plugin

* feat(next-api): add fastify-jwt-authz plugin

* feat(next-api): accept privacy endpoint with scopes support

* fix(next-api): ignore eslint and ts errors

They will be fixed in a future PR when the package with errors has been updated

Co-authored-by: Niraj Nandish <nirajnandish@icloud.com>
Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>
2023-02-24 17:26:40 +05:30
Oliver Eyton-Williams
f35ab4d0ba
refactor: clean up types and tsconfig (#49360) 2023-02-24 17:25:53 +05:30
Shaun Hamilton
37ed23ef38
feat(api): add node:test (#48437) 2023-02-24 17:25:22 +05:30
Shaun Hamilton
f7644bec68
feat(api): example middleware (#48434)
* feat(api): add middleware example

* feat(api): add `@fastify/middie`, reorder for alphabetness

* [skip-ci] [skip ci]
2023-02-24 17:25:21 +05:30
Shaun Hamilton
6d46f61fe9
refactor(api): shiny new api (#48432) 2023-02-24 17:23:15 +05:30