mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-06-05 21:04:28 +08:00
refactor(api): replace mongodb with bson (#67680)
This commit is contained in:
parent
782a99a9df
commit
6b3b8c0949
@ -9,7 +9,7 @@ import {
|
||||
ExamEnvironmentQuestionSet,
|
||||
ExamEnvironmentChallenge
|
||||
} from '@prisma/client';
|
||||
import { ObjectId } from 'mongodb';
|
||||
import { ObjectId } from 'bson';
|
||||
import { examEnvironmentPostExamAttempt } from '../src/exam-environment/schemas/index.js';
|
||||
|
||||
const defaultUserId = '5bd30e0f1caf6ac3ddddddb5';
|
||||
|
||||
@ -17,6 +17,7 @@
|
||||
"@sentry/node": "9.47.1",
|
||||
"ajv": "8.20.0",
|
||||
"ajv-formats": "3.0.1",
|
||||
"bson": "7.2.0",
|
||||
"date-fns": "4.1.0",
|
||||
"date-fns-tz": "3.2.0",
|
||||
"dotenv": "16.6.1",
|
||||
@ -27,7 +28,6 @@
|
||||
"jsonwebtoken": "9.0.3",
|
||||
"lodash": "4.18.1",
|
||||
"lodash-es": "4.18.1",
|
||||
"mongodb": "6.21.0",
|
||||
"nanoid": "3",
|
||||
"no-profanity": "1.5.1",
|
||||
"nodemailer": "6.10.1",
|
||||
|
||||
@ -14,7 +14,7 @@ import {
|
||||
} from 'vitest';
|
||||
import jwt, { JwtPayload } from 'jsonwebtoken';
|
||||
import { DailyCodingChallengeLanguage, type Prisma } from '@prisma/client';
|
||||
import { ObjectId } from 'mongodb';
|
||||
import { ObjectId } from 'bson';
|
||||
import { omit } from 'lodash-es';
|
||||
|
||||
import { createUserInput } from '../../utils/create-user.js';
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import type { FastifyPluginCallbackTypebox } from '@fastify/type-provider-typebox';
|
||||
import { ObjectId } from 'mongodb';
|
||||
import { ObjectId } from 'bson';
|
||||
import { FastifyInstance, FastifyReply } from 'fastify';
|
||||
import jwt from 'jsonwebtoken';
|
||||
import { PrismaClientKnownRequestError } from '@prisma/client/runtime/library.js';
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import type { Prisma } from '@prisma/client';
|
||||
import { ObjectId } from 'mongodb';
|
||||
import { ObjectId } from 'bson';
|
||||
import { omit } from 'lodash-es';
|
||||
import {
|
||||
describe,
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import { Experience, Portfolio } from '@prisma/client';
|
||||
import { type FastifyPluginCallbackTypebox } from '@fastify/type-provider-typebox';
|
||||
import { ObjectId } from 'mongodb';
|
||||
import { ObjectId } from 'bson';
|
||||
import { omit } from 'lodash-es';
|
||||
|
||||
import { isRestricted } from '../helpers/is-restricted.js';
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { ObjectId } from 'mongodb';
|
||||
import { ObjectId } from 'bson';
|
||||
|
||||
// This is trivial, but makes it simple to refactor if we swap monogodb for
|
||||
// bson, say.
|
||||
|
||||
@ -128,6 +128,9 @@ importers:
|
||||
ajv-formats:
|
||||
specifier: 3.0.1
|
||||
version: 3.0.1(ajv@8.20.0)
|
||||
bson:
|
||||
specifier: 7.2.0
|
||||
version: 7.2.0
|
||||
date-fns:
|
||||
specifier: 4.1.0
|
||||
version: 4.1.0
|
||||
@ -158,9 +161,6 @@ importers:
|
||||
lodash-es:
|
||||
specifier: 4.18.1
|
||||
version: 4.18.1
|
||||
mongodb:
|
||||
specifier: 6.21.0
|
||||
version: 6.21.0(@aws-sdk/credential-providers@3.521.0)(socks@2.8.7)
|
||||
nanoid:
|
||||
specifier: '3'
|
||||
version: 3.3.12
|
||||
|
||||
Loading…
Reference in New Issue
Block a user