Skip to content

Commit

Permalink
refactor: gloal replacement of bson
Browse files Browse the repository at this point in the history
  • Loading branch information
KenLSM committed Oct 24, 2023
1 parent 86846b2 commit 9ba398f
Show file tree
Hide file tree
Showing 36 changed files with 36 additions and 36 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import dbHandler from '__tests__/unit/backend/helpers/jest-db'
import { ObjectId } from 'bson-ext'
import { ObjectId } from 'bson'
import { omit } from 'lodash'
import mongoose from 'mongoose'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import dbHandler from '__tests__/unit/backend/helpers/jest-db'
import { ObjectId } from 'bson-ext'
import { ObjectId } from 'bson'
import { pick, times } from 'lodash'
import moment from 'moment-timezone'
import mongoose from 'mongoose'
Expand Down
2 changes: 1 addition & 1 deletion src/app/models/__tests__/form.server.model.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-disable @typescript-eslint/ban-ts-comment */
import { generateDefaultField } from '__tests__/unit/backend/helpers/generate-form-data'
import dbHandler from '__tests__/unit/backend/helpers/jest-db'
import { ObjectId } from 'bson-ext'
import { ObjectId } from 'bson'
import { cloneDeep, map, merge, omit, orderBy, pick, range } from 'lodash'
import mongoose, { Types } from 'mongoose'
import {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import dbHandler from '__tests__/unit/backend/helpers/jest-db'
import { ObjectId } from 'bson-ext'
import { ObjectId } from 'bson'
import { omit } from 'lodash'
import mongoose from 'mongoose'

Expand Down
2 changes: 1 addition & 1 deletion src/app/models/__tests__/form_issue.server.model.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import dbHandler from '__tests__/unit/backend/helpers/jest-db'
import { ObjectId } from 'bson-ext'
import { ObjectId } from 'bson'
import { omit } from 'lodash'
import mongoose from 'mongoose'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import dbHandler from '__tests__/unit/backend/helpers/jest-db'
import { ObjectId } from 'bson-ext'
import { ObjectId } from 'bson'
import mongoose from 'mongoose'

import getFormStatisticsTotalModel from 'src/app/models/form_statistics_total.server.model'
Expand Down
2 changes: 1 addition & 1 deletion src/app/models/__tests__/login.server.model.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-disable @typescript-eslint/ban-ts-comment */
import dbHandler from '__tests__/unit/backend/helpers/jest-db'
import { ObjectId } from 'bson-ext'
import { ObjectId } from 'bson'
import { omit } from 'lodash'
import moment from 'moment-timezone'
import mongoose from 'mongoose'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-disable @typescript-eslint/ban-ts-comment */
import dbHandler from '__tests__/unit/backend/helpers/jest-db'
import { ObjectId } from 'bson-ext'
import { ObjectId } from 'bson'
import mongoose from 'mongoose'

import getAdminFeedbackModel from 'src/app/models/admin_feedback.server.model'
Expand Down
2 changes: 1 addition & 1 deletion src/app/modules/auth/__tests__/auth.service.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import dbHandler from '__tests__/unit/backend/helpers/jest-db'
import { ObjectId } from 'bson-ext'
import { ObjectId } from 'bson'
import mongoose from 'mongoose'
import { err, errAsync, ok, okAsync } from 'neverthrow'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import expressHandler from '__tests__/unit/backend/helpers/jest-express'
import { ObjectId } from 'bson-ext'
import { ObjectId } from 'bson'
import moment from 'moment-timezone'
import { errAsync, okAsync } from 'neverthrow'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import dbHandler from '__tests__/unit/backend/helpers/jest-db'
import { ObjectId } from 'bson-ext'
import { ObjectId } from 'bson'
import { compareAsc } from 'date-fns'
import { omit, times } from 'lodash'
import moment from 'moment-timezone'
Expand Down
2 changes: 1 addition & 1 deletion src/app/modules/form/__tests__/form.utils.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { generateDefaultField } from '__tests__/unit/backend/helpers/generate-form-data'
import { ObjectId } from 'bson-ext'
import { ObjectId } from 'bson'
import { Types } from 'mongoose'

import { FormFieldSchema } from 'src/types'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ObjectId } from 'bson-ext'
import { ObjectId } from 'bson'
import { StatusCodes } from 'http-status-codes'
import { errAsync, okAsync } from 'neverthrow'
import { PassThrough } from 'stream'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ObjectId } from 'bson-ext'
import { ObjectId } from 'bson'
import mongoose from 'mongoose'
import {
PaymentsProductUpdateDto,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-disable @typescript-eslint/ban-ts-comment */
import { generateDefaultField } from '__tests__/unit/backend/helpers/generate-form-data'
import { PresignedPost } from 'aws-sdk/clients/s3'
import { ObjectId } from 'bson-ext'
import { ObjectId } from 'bson'
import { assignIn, cloneDeep, merge, omit, pick } from 'lodash'
import mongoose from 'mongoose'
import { err, errAsync, ok, okAsync } from 'neverthrow'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { generateDefaultField } from '__tests__/unit/backend/helpers/generate-form-data'
import { ObjectId } from 'bson-ext'
import { ObjectId } from 'bson'
import { cloneDeep, omit, tail } from 'lodash'

import { EditFieldActions } from 'src/shared/constants'
Expand Down
2 changes: 1 addition & 1 deletion src/app/modules/form/admin-form/admin-form.controller.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import JoiDate from '@joi/date'
import axios from 'axios'
import { ObjectId } from 'bson-ext'
import { ObjectId } from 'bson'
import { celebrate, Joi as BaseJoi, Segments } from 'celebrate'
import { AuthedSessionData } from 'express-session'
import { StatusCodes } from 'http-status-codes'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import expressHandler from '__tests__/unit/backend/helpers/jest-express'
import { IPersonResponse } from '@opengovsg/myinfo-gov-client'
import { ObjectId } from 'bson-ext'
import { ObjectId } from 'bson'
import { Request } from 'express'
import { err, errAsync, ok, okAsync } from 'neverthrow'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-disable @typescript-eslint/ban-ts-comment */
import { ObjectId } from 'bson-ext'
import { ObjectId } from 'bson'
import mongoose from 'mongoose'
import type { PartialDeep } from 'type-fest'

Expand Down
2 changes: 1 addition & 1 deletion src/app/modules/issue/__tests__/issue.controller.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import expressHandler from '__tests__/unit/backend/helpers/jest-express'
import { ObjectId } from 'bson-ext'
import { ObjectId } from 'bson'
import { merge, omit } from 'lodash'
import { err, errAsync, ok, okAsync } from 'neverthrow'

Expand Down
2 changes: 1 addition & 1 deletion src/app/modules/issue/issue.service.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ObjectId } from 'bson-ext'
import { ObjectId } from 'bson'
import { isEmpty } from 'lodash'
import moment from 'moment-timezone'
import mongoose, { Cursor as QueryCursor, QueryOptions } from 'mongoose'
Expand Down
2 changes: 1 addition & 1 deletion src/app/modules/myinfo/__tests__/myinfo.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import dbHandler from '__tests__/unit/backend/helpers/jest-db'
import { MyInfoGovClient } from '@opengovsg/myinfo-gov-client'
import bcrypt from 'bcrypt'
import { ObjectId } from 'bson-ext'
import { ObjectId } from 'bson'
import jwt from 'jsonwebtoken'
import mongoose from 'mongoose'
import { v4 as uuidv4 } from 'uuid'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import expressHandler from '__tests__/unit/backend/helpers/jest-express'
import { ObjectId } from 'bson-ext'
import { ObjectId } from 'bson'
import { StatusCodes } from 'http-status-codes'
import { err, errAsync, ok, okAsync } from 'neverthrow'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-disable @typescript-eslint/ban-ts-comment */
import dbHandler from '__tests__/unit/backend/helpers/jest-db'
import { ObjectId } from 'bson-ext'
import { ObjectId } from 'bson'
import { clone, omit } from 'lodash'
import mongoose from 'mongoose'
import { errAsync, okAsync } from 'neverthrow'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ObjectId } from 'bson-ext'
import { ObjectId } from 'bson'
import { readFileSync } from 'fs'
import { cloneDeep } from 'lodash'
import moment from 'moment-timezone'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { createAuthedSession } from '__tests__/integration/helpers/express-auth'
import { setupApp } from '__tests__/integration/helpers/express-setup'
import dbHandler from '__tests__/unit/backend/helpers/jest-db'
import { ObjectId } from 'bson-ext'
import { ObjectId } from 'bson'
import mongoose from 'mongoose'
import supertest, { Session } from 'supertest-session'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { createAuthedSession } from '__tests__/integration/helpers/express-auth'
import { setupApp } from '__tests__/integration/helpers/express-setup'
import { buildCelebrateError } from '__tests__/unit/backend/helpers/celebrate'
import dbHandler from '__tests__/unit/backend/helpers/jest-db'
import { ObjectId } from 'bson-ext'
import { ObjectId } from 'bson'
import mongoose from 'mongoose'
import SparkMD5 from 'spark-md5'
import supertest, { Session } from 'supertest-session'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
} from '__tests__/unit/backend/helpers/generate-form-data'
import dbHandler from '__tests__/unit/backend/helpers/jest-db'
import { jsonParseStringify } from '__tests__/unit/backend/helpers/serialize-data'
import { ObjectId } from 'bson-ext'
import { ObjectId } from 'bson'
import { omit } from 'lodash'
import mongoose from 'mongoose'
import supertest, { Session } from 'supertest-session'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
} from '__tests__/integration/helpers/express-auth'
import { setupApp } from '__tests__/integration/helpers/express-setup'
import dbHandler from '__tests__/unit/backend/helpers/jest-db'
import { ObjectId } from 'bson-ext'
import { ObjectId } from 'bson'
import mongoose from 'mongoose'
import { errAsync } from 'neverthrow'
import supertest, { Session } from 'supertest-session'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { setupApp } from '__tests__/integration/helpers/express-setup'
import { ObjectId } from 'bson-ext'
import { ObjectId } from 'bson'
import fs from 'fs'
import { JWTVerifyResult } from 'jose'
import mongoose from 'mongoose'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { setupApp } from '__tests__/integration/helpers/express-setup'
import { buildCelebrateError } from '__tests__/unit/backend/helpers/celebrate'
import dbHandler from '__tests__/unit/backend/helpers/jest-db'
import { jsonParseStringify } from '__tests__/unit/backend/helpers/serialize-data'
import { ObjectId } from 'bson-ext'
import { ObjectId } from 'bson'
import { StatusCodes } from 'http-status-codes'
import { err, errAsync } from 'neverthrow'
import supertest, { Session } from 'supertest-session'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { setupApp } from '__tests__/integration/helpers/express-setup'
import dbHandler from '__tests__/unit/backend/helpers/jest-db'
import MyInfoClient, { IMyInfoConfig } from '@opengovsg/myinfo-gov-client'
import { ObjectId } from 'bson-ext'
import { ObjectId } from 'bson'
import jwt from 'jsonwebtoken'
import { errAsync } from 'neverthrow'
import supertest, { Session } from 'supertest-session'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import MockTwilio from '__tests__/integration/helpers/twilio'
import { generateDefaultField } from '__tests__/unit/backend/helpers/generate-form-data'
import dbHandler from '__tests__/unit/backend/helpers/jest-db'
import bcrypt from 'bcrypt'
import { ObjectId } from 'bson-ext'
import { ObjectId } from 'bson'
import { subMinutes, subYears } from 'date-fns'
import { StatusCodes } from 'http-status-codes'
import _ from 'lodash'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { setupApp } from '__tests__/integration/helpers/express-setup'
import { ObjectId } from 'bson-ext'
import { ObjectId } from 'bson'
import { JWTVerifyResult } from 'jose'
import mongoose from 'mongoose'
import session, { Session } from 'supertest-session'
Expand Down
2 changes: 1 addition & 1 deletion src/app/routes/api/v3/user/__tests__/user.routes.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { createAuthedSession } from '__tests__/integration/helpers/express-auth'
import { setupApp } from '__tests__/integration/helpers/express-setup'
import { buildCelebrateError } from '__tests__/unit/backend/helpers/celebrate'
import dbHandler from '__tests__/unit/backend/helpers/jest-db'
import { ObjectId } from 'bson-ext'
import { ObjectId } from 'bson'
import { pick } from 'lodash'
import mongoose from 'mongoose'
import { errAsync, okAsync } from 'neverthrow'
Expand Down
2 changes: 1 addition & 1 deletion src/shared/util/__tests__/logic.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ObjectId } from 'bson-ext'
import { ObjectId } from 'bson'

import {
getApplicableIfFields,
Expand Down

0 comments on commit 9ba398f

Please sign in to comment.