chore(api): upgrade typebox to 1.0 (#62969)

Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>
This commit is contained in:
Shaun Hamilton
2025-10-24 03:52:35 +02:00
committed by GitHub
parent 02e1e1c331
commit dd08d1ae1c
4 changed files with 99 additions and 112 deletions
+2 -3
View File
@@ -11,12 +11,10 @@
"@fastify/oauth2": "8.1.2",
"@fastify/swagger": "9.4.0",
"@fastify/swagger-ui": "5.2.0",
"@fastify/type-provider-typebox": "5.1.0",
"@fastify/type-provider-typebox": "6.1.0",
"@growthbook/growthbook": "1.3.1",
"@prisma/client": "6.16.2",
"@sentry/node": "9.1.0",
"@sinclair/typebox": "^0.34.33",
"@types/pino": "^7.0.5",
"ajv": "8.17.1",
"ajv-formats": "3.0.1",
"date-fns": "4.1.0",
@@ -37,6 +35,7 @@
"pino-pretty": "10.2.3",
"query-string": "7.1.3",
"stripe": "16.0.0",
"typebox": "1.0.43",
"validator": "13.15.15"
},
"description": "The freeCodeCamp.org open-source codebase and curriculum",
+2 -2
View File
@@ -1,7 +1,7 @@
import fastifyOauth2, { type OAuth2Namespace } from '@fastify/oauth2';
import { type FastifyPluginCallbackTypebox } from '@fastify/type-provider-typebox';
import { Type } from '@sinclair/typebox';
import { Value } from '@sinclair/typebox/value';
import { Type } from 'typebox';
import { Value } from 'typebox/value';
import fp from 'fastify-plugin';
import { isError } from 'lodash-es';
+3 -4
View File
@@ -1,9 +1,8 @@
import { Type } from '@fastify/type-provider-typebox';
import { DailyCodingChallengeLanguage } from '@prisma/client';
import { examResults, profileUI, savedChallenge } from '../types.js';
const languages = Object.values(DailyCodingChallengeLanguage).map(k =>
Type.Literal(k)
const languages = Type.Array(
Type.Union([Type.Literal('javascript'), Type.Literal('python')])
);
export const getSessionUser = {
@@ -58,7 +57,7 @@ export const getSessionUser = {
Type.Object({
id: Type.String(),
completedDate: Type.Number(),
languages: Type.Array(Type.Union(languages))
languages
})
),
currentChallengeId: Type.String(),