mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-05-28 18:26:54 +00:00
chore(api): upgrade typebox to 1.0 (#62969)
Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>
This commit is contained in:
+2
-3
@@ -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",
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -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(),
|
||||
|
||||
Reference in New Issue
Block a user