50
package.json
50
package.json
@@ -59,32 +59,32 @@
|
||||
"changelog": true
|
||||
},
|
||||
"dependencies": {
|
||||
"@algolia/client-search": "^4.14.3",
|
||||
"@algolia/client-search": "^4.16.0",
|
||||
"@babel/core": "7.21.3",
|
||||
"@babel/plugin-transform-modules-commonjs": "7.21.2",
|
||||
"@babel/plugin-transform-typescript": "7.21.3",
|
||||
"@babel/types": "^7.21.0",
|
||||
"@babel/types": "^7.21.3",
|
||||
"@fastify/cookie": "8.3.0",
|
||||
"@fastify/multipart": "7.4.2",
|
||||
"@fastify/multipart": "7.5.0",
|
||||
"@fastify/static": "6.9.0",
|
||||
"@innei/next-async": "0.3.0",
|
||||
"@nestjs/common": "9.3.9",
|
||||
"@nestjs/core": "9.3.9",
|
||||
"@nestjs/common": "9.3.12",
|
||||
"@nestjs/core": "9.3.12",
|
||||
"@nestjs/event-emitter": "1.4.1",
|
||||
"@nestjs/mapped-types": "*",
|
||||
"@nestjs/platform-fastify": "9.3.9",
|
||||
"@nestjs/platform-socket.io": "9.3.9",
|
||||
"@nestjs/platform-fastify": "9.3.12",
|
||||
"@nestjs/platform-socket.io": "9.3.12",
|
||||
"@nestjs/schedule": "2.2.0",
|
||||
"@nestjs/swagger": "6.2.1",
|
||||
"@nestjs/throttler": "4.0.0",
|
||||
"@nestjs/websockets": "9.3.9",
|
||||
"@nestjs/websockets": "9.3.12",
|
||||
"@socket.io/redis-adapter": "7.2.0",
|
||||
"@socket.io/redis-emitter": "4.1.1",
|
||||
"@typegoose/auto-increment": "3.0.0",
|
||||
"@typegoose/typegoose": "10.3.3",
|
||||
"@types/jsonwebtoken": "9.0.1",
|
||||
"algoliasearch": "4.15.0",
|
||||
"axios": "^1.3.3",
|
||||
"algoliasearch": "4.16.0",
|
||||
"axios": "^1.3.4",
|
||||
"axios-retry": "3.4.0",
|
||||
"bcrypt": "5.1.0",
|
||||
"cache-manager": "4.1.0",
|
||||
@@ -102,21 +102,21 @@
|
||||
"get-image-colors": "4.0.1",
|
||||
"image-size": "1.0.2",
|
||||
"inquirer": "*",
|
||||
"isbot": "3.6.6",
|
||||
"isbot": "3.6.7",
|
||||
"js-yaml": "*",
|
||||
"json5": "2.2.3",
|
||||
"jsonwebtoken": "9.0.0",
|
||||
"jszip": "3.10.1",
|
||||
"linkedom": "0.14.24",
|
||||
"linkedom": "0.14.25",
|
||||
"lodash": "*",
|
||||
"lru-cache": "7.18.3",
|
||||
"marked": "4.2.12",
|
||||
"marked": "4.3.0",
|
||||
"mime-types": "*",
|
||||
"mkdirp": "*",
|
||||
"mongoose": "7.0.2",
|
||||
"mongoose": "7.0.3",
|
||||
"mongoose-aggregate-paginate-v2": "1.0.6",
|
||||
"mongoose-lean-getters": "0.4.0",
|
||||
"mongoose-lean-id": "0.3.0",
|
||||
"mongoose-lean-id": "0.5.0",
|
||||
"mongoose-lean-virtuals": "0.9.1",
|
||||
"mongoose-paginate-v2": "1.7.1",
|
||||
"nanoid": "3.3.4",
|
||||
@@ -128,7 +128,7 @@
|
||||
"reflect-metadata": "0.1.13",
|
||||
"rxjs": "7.8.0",
|
||||
"semver": "7.3.8",
|
||||
"slugify": "1.6.5",
|
||||
"slugify": "1.6.6",
|
||||
"snakecase-keys": "5.4.5",
|
||||
"ua-parser-js": "1.0.34",
|
||||
"vm2": "3.9.14",
|
||||
@@ -139,9 +139,9 @@
|
||||
"devDependencies": {
|
||||
"@innei/eslint-config-ts": "0.9.8",
|
||||
"@innei/prettier": "0.9.8",
|
||||
"@nestjs/cli": "9.2.0",
|
||||
"@nestjs/cli": "9.3.0",
|
||||
"@nestjs/schematics": "9.0.4",
|
||||
"@nestjs/testing": "9.3.9",
|
||||
"@nestjs/testing": "9.3.12",
|
||||
"@swc/core": "1.3.4",
|
||||
"@types/babel__core": "7.20.0",
|
||||
"@types/bcrypt": "5.0.0",
|
||||
@@ -151,10 +151,10 @@
|
||||
"@types/fs-extra": "11.0.1",
|
||||
"@types/get-image-colors": "4.0.2",
|
||||
"@types/js-yaml": "4.0.5",
|
||||
"@types/lodash": "4.14.191",
|
||||
"@types/lodash": "4.14.192",
|
||||
"@types/marked": "4.0.8",
|
||||
"@types/mime-types": "2.1.1",
|
||||
"@types/mongoose-aggregate-paginate-v2": "1.0.6",
|
||||
"@types/mongoose-aggregate-paginate-v2": "1.0.7",
|
||||
"@types/node": "18.14.6",
|
||||
"@types/nodemailer": "6.4.7",
|
||||
"@types/qs": "6.9.7",
|
||||
@@ -164,14 +164,14 @@
|
||||
"@vercel/ncc": "0.36.1",
|
||||
"cron": "*",
|
||||
"cross-env": "7.0.3",
|
||||
"eslint": "^8.34.0",
|
||||
"eslint": "^8.37.0",
|
||||
"eslint-plugin-unused-imports": "2.0.0",
|
||||
"husky": "8.0.3",
|
||||
"ioredis": "5.3.1",
|
||||
"lint-staged": "13.1.4",
|
||||
"prettier": "2.8.4",
|
||||
"lint-staged": "13.2.0",
|
||||
"prettier": "2.8.7",
|
||||
"rimraf": "3.0.2",
|
||||
"rollup": "*",
|
||||
"rollup": "^3.20.2",
|
||||
"rollup-plugin-swc": "0.2.1",
|
||||
"socket.io": "4.6.1",
|
||||
"source-map-support": "*",
|
||||
@@ -184,7 +184,7 @@
|
||||
"zx": "7.2.0"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"mongodb-memory-server": "8.11.5",
|
||||
"mongodb-memory-server": "8.12.1",
|
||||
"redis-memory-server": "0.6.0"
|
||||
},
|
||||
"resolutions": {
|
||||
|
||||
1888
pnpm-lock.yaml
generated
1888
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
@@ -74,7 +74,7 @@ export class CommentController {
|
||||
@IsMaster() isMaster: boolean,
|
||||
) {
|
||||
const { id } = params
|
||||
const data: CommentModel = await this.commentService.model
|
||||
const data: CommentModel | null = await this.commentService.model
|
||||
.findOne({
|
||||
_id: id,
|
||||
})
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { LeanDocument, Types } from 'mongoose'
|
||||
import { Types } from 'mongoose'
|
||||
import { URL } from 'url'
|
||||
|
||||
import {
|
||||
@@ -10,7 +10,7 @@ import {
|
||||
forwardRef,
|
||||
} from '@nestjs/common'
|
||||
import { DocumentType } from '@typegoose/typegoose'
|
||||
import { BeAnObject, ReturnModelType } from '@typegoose/typegoose/lib/types'
|
||||
import { ReturnModelType } from '@typegoose/typegoose/lib/types'
|
||||
|
||||
import { BusinessException } from '~/common/exceptions/biz.exception'
|
||||
import { CannotFindException } from '~/common/exceptions/cant-find.exception'
|
||||
@@ -121,7 +121,7 @@ export class CommentService {
|
||||
doc: Partial<CommentModel>,
|
||||
type?: CommentRefTypes,
|
||||
) {
|
||||
let ref: LeanDocument<DocumentType<WriteBaseModel, BeAnObject>>
|
||||
let ref: (WriteBaseModel & { _id: any }) | null = null
|
||||
if (type) {
|
||||
const model = this.getModelByRefType(type)
|
||||
|
||||
|
||||
@@ -3,7 +3,6 @@ import { ClassConstructor, plainToInstance } from 'class-transformer'
|
||||
import { ValidatorOptions, validateSync } from 'class-validator'
|
||||
import cluster from 'cluster'
|
||||
import { cloneDeep, mergeWith } from 'lodash'
|
||||
import { LeanDocument } from 'mongoose'
|
||||
|
||||
import {
|
||||
BadRequestException,
|
||||
@@ -11,8 +10,7 @@ import {
|
||||
Logger,
|
||||
ValidationPipe,
|
||||
} from '@nestjs/common'
|
||||
import { DocumentType, ReturnModelType } from '@typegoose/typegoose'
|
||||
import { BeAnObject } from '@typegoose/typegoose/lib/types'
|
||||
import { ReturnModelType } from '@typegoose/typegoose'
|
||||
|
||||
import { EventScope } from '~/constants/business-event.constant'
|
||||
import { RedisKeys } from '~/constants/cache.constant'
|
||||
@@ -263,8 +261,8 @@ export class ConfigsService {
|
||||
|
||||
get getMaster() {
|
||||
// HINT: 需要注入 this 的指向
|
||||
return this.userService.getMaster.bind(this.userService) as () => Promise<
|
||||
LeanDocument<DocumentType<UserModel, BeAnObject>>
|
||||
>
|
||||
return this.userService.getMaster.bind(
|
||||
this.userService,
|
||||
) as () => Promise<UserModel>
|
||||
}
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@ export class LinkService {
|
||||
})
|
||||
.lean()
|
||||
|
||||
let nextModel: LinkModel
|
||||
let nextModel: LinkModel | null
|
||||
if (existedDoc) {
|
||||
switch (existedDoc.state) {
|
||||
case LinkState.Pass:
|
||||
|
||||
@@ -227,7 +227,7 @@ export class NoteController {
|
||||
const { nid } = params
|
||||
const { password, single: isSingle } = query
|
||||
const condition = isMaster ? {} : { hide: false }
|
||||
const current: NoteModel = await this.noteService.model
|
||||
const current: NoteModel | null = await this.noteService.model
|
||||
.findOne({
|
||||
nid,
|
||||
...condition,
|
||||
|
||||
@@ -57,7 +57,7 @@ export class NoteService {
|
||||
condition: FilterQuery<DocumentType<NoteModel>> = {},
|
||||
projection: any = undefined,
|
||||
) {
|
||||
const latest: NoteModel = await this.noteModel
|
||||
const latest: NoteModel | null = await this.noteModel
|
||||
.findOne(condition, projection)
|
||||
.sort({
|
||||
created: -1,
|
||||
|
||||
Reference in New Issue
Block a user