break: remove gql
This commit is contained in:
@@ -4,12 +4,12 @@
|
||||
[](https://github.com/mx-space/mx-server/issues)
|
||||
[](https://github.com/mx-space/mx-server/actions?query=workflow:%22Deploy%22)
|
||||
[](https://github.com/mx-space/mx-server/blob/main/LICENSE)
|
||||
[](https://wakatime.com/badge/github/mx-space/mx-server)
|
||||
[](https://wakatime.com/badge/user/9213dc96-df0d-4e66-b0bb-50f9e04e988c/project/3e6fb54a-082c-4110-bccc-b641bad13882)
|
||||
[](https://hub.docker.com/repository/docker/innei/mx-server)
|
||||
|
||||
> **RESTful API service & GraphQL for Mix Space, powered by [`nestjs`](https://github.com/nestjs/nest), required [`mongoDB`](https://www.mongodb.com/) & [`Redis`](https://redis.io/).**
|
||||
> **RESTful API service for Mix Space, powered by [`nestjs`](https://github.com/nestjs/nest), required [`mongoDB`](https://www.mongodb.com/) & [`Redis`](https://redis.io/).**
|
||||
|
||||
> **适用于 Mix Space 的 RESTful API & GraphQL 服务端应用;基于 [`nestjs`](https://github.com/nestjs/nest) (nodejs),需安装 [`mongoDB`](https://www.mongodb.com/) 和 [`Redis`](https://redis.io/) 方可完整运行。**
|
||||
> **适用于 Mix Space 的 RESTful API 服务端应用;基于 [`nestjs`](https://github.com/nestjs/nest) (nodejs),需安装 [`mongoDB`](https://www.mongodb.com/) 和 [`Redis`](https://redis.io/) 方可完整运行。**
|
||||
|
||||
> v3 还是使用 [`nestjs`](https://github.com/nestjs/nest) 进行重构,之前的版本在 [此仓库](https://github.com/mx-space/server)。
|
||||
|
||||
@@ -66,7 +66,6 @@ docker-compose up -d
|
||||
├── app.config.ts # 主程序配置,数据库、程序、第三方,一切可配置项
|
||||
├── app.controller.ts # 主程序根控制器
|
||||
├── app.module.ts # 主程序根模块,负责各业务模块的聚合
|
||||
├── app.resolver.ts # 主程序根 GraphQL Resolver
|
||||
├── common # 存放中间件
|
||||
│ ├── adapters # Fastify 适配器的配置
|
||||
│ ├── decorator # 业务装饰器
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
import { GraphQLDefinitionsFactory } from '@nestjs/graphql'
|
||||
import { join } from 'path'
|
||||
|
||||
const definitionsFactory = new GraphQLDefinitionsFactory()
|
||||
definitionsFactory.generate({
|
||||
typePaths: ['./*.gql'],
|
||||
path: join(process.cwd(), 'types/graphql.d.ts'),
|
||||
outputAs: 'class',
|
||||
watch: true,
|
||||
})
|
||||
@@ -3,17 +3,6 @@
|
||||
"sourceRoot": "src",
|
||||
"compilerOptions": {
|
||||
"plugins": [
|
||||
{
|
||||
"name": "@nestjs/graphql",
|
||||
"options": {
|
||||
"typeFileNameSuffix": [
|
||||
".input.ts",
|
||||
".args.ts",
|
||||
".dto.ts",
|
||||
".model.ts"
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "@nestjs/swagger",
|
||||
"options": {
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
"license": "MIT",
|
||||
"dashboard": {
|
||||
"repo": "mx-space/mx-admin",
|
||||
"version": "3.14.3"
|
||||
"version": "3.15.1"
|
||||
},
|
||||
"husky": {
|
||||
"hooks": {
|
||||
@@ -67,7 +67,6 @@
|
||||
"@nestjs/common": "8.2.6",
|
||||
"@nestjs/core": "8.2.6",
|
||||
"@nestjs/event-emitter": "1.0.0",
|
||||
"@nestjs/graphql": "9.1.2",
|
||||
"@nestjs/jwt": "8.0.0",
|
||||
"@nestjs/mapped-types": "*",
|
||||
"@nestjs/passport": "8.1.0",
|
||||
@@ -81,7 +80,6 @@
|
||||
"@typegoose/auto-increment": "1.1.0",
|
||||
"@typegoose/typegoose": "9.6.2",
|
||||
"algoliasearch": "4.12.1",
|
||||
"apollo-server-fastify": "3.6.3",
|
||||
"axios": "*",
|
||||
"axios-retry": "3.2.4",
|
||||
"bcrypt": "5.0.1",
|
||||
@@ -98,7 +96,6 @@
|
||||
"fastify-multipart": "5.3.0",
|
||||
"fastify-swagger": "4.15.0",
|
||||
"get-image-colors": "4.0.1",
|
||||
"graphql": "15.8.0",
|
||||
"html-minifier": "4.0.0",
|
||||
"image-size": "1.0.1",
|
||||
"inquirer": "*",
|
||||
|
||||
515
pnpm-lock.yaml
generated
515
pnpm-lock.yaml
generated
@@ -12,7 +12,6 @@ specifiers:
|
||||
'@nestjs/common': 8.2.6
|
||||
'@nestjs/core': 8.2.6
|
||||
'@nestjs/event-emitter': 1.0.0
|
||||
'@nestjs/graphql': 9.1.2
|
||||
'@nestjs/jwt': 8.0.0
|
||||
'@nestjs/mapped-types': '*'
|
||||
'@nestjs/passport': 8.1.0
|
||||
@@ -45,7 +44,6 @@ specifiers:
|
||||
'@types/ua-parser-js': 0.7.36
|
||||
'@vercel/ncc': 0.33.1
|
||||
algoliasearch: 4.12.1
|
||||
apollo-server-fastify: 3.6.3
|
||||
axios: '*'
|
||||
axios-retry: 3.2.4
|
||||
bcrypt: 5.0.1
|
||||
@@ -65,7 +63,6 @@ specifiers:
|
||||
fastify-multipart: 5.3.0
|
||||
fastify-swagger: 4.15.0
|
||||
get-image-colors: 4.0.1
|
||||
graphql: 15.8.0
|
||||
html-minifier: 4.0.0
|
||||
husky: 7.0.4
|
||||
image-size: 1.0.1
|
||||
@@ -116,7 +113,6 @@ dependencies:
|
||||
'@nestjs/common': 8.2.6_6686f1d73a399753b561a58a608807ad
|
||||
'@nestjs/core': 8.2.6_9ccbff94f707ebc59cf3ddcf930aab79
|
||||
'@nestjs/event-emitter': 1.0.0_d86dd164971a98d71cc003a4f36ff106
|
||||
'@nestjs/graphql': 9.1.2_91c3bca9040680d7e362a9e419843305
|
||||
'@nestjs/jwt': 8.0.0_@nestjs+common@8.2.6
|
||||
'@nestjs/mapped-types': 1.0.1_cda5296fe38bb7a3dcdb892503001834
|
||||
'@nestjs/passport': 8.1.0_469354efd308cbdee43194b5fd6a2c15
|
||||
@@ -130,7 +126,6 @@ dependencies:
|
||||
'@typegoose/auto-increment': 1.1.0_mongoose@6.2.0
|
||||
'@typegoose/typegoose': 9.6.2_mongoose@6.2.0
|
||||
algoliasearch: 4.12.1
|
||||
apollo-server-fastify: 3.6.3_graphql@15.8.0
|
||||
axios: 0.25.0
|
||||
axios-retry: 3.2.4
|
||||
bcrypt: 5.0.1
|
||||
@@ -147,7 +142,6 @@ dependencies:
|
||||
fastify-multipart: 5.3.0
|
||||
fastify-swagger: 4.15.0
|
||||
get-image-colors: 4.0.1
|
||||
graphql: 15.8.0
|
||||
html-minifier: 4.0.0
|
||||
image-size: 1.0.1
|
||||
inquirer: 8.2.0
|
||||
@@ -429,44 +423,6 @@ packages:
|
||||
- chokidar
|
||||
dev: true
|
||||
|
||||
/@apollo/protobufjs/1.2.2:
|
||||
resolution: {integrity: sha512-vF+zxhPiLtkwxONs6YanSt1EpwpGilThpneExUN5K3tCymuxNnVq2yojTvnpRjv2QfsEIt/n7ozPIIzBLwGIDQ==}
|
||||
hasBin: true
|
||||
requiresBuild: true
|
||||
dependencies:
|
||||
'@protobufjs/aspromise': 1.1.2
|
||||
'@protobufjs/base64': 1.1.2
|
||||
'@protobufjs/codegen': 2.0.4
|
||||
'@protobufjs/eventemitter': 1.1.0
|
||||
'@protobufjs/fetch': 1.1.0
|
||||
'@protobufjs/float': 1.0.2
|
||||
'@protobufjs/inquire': 1.1.0
|
||||
'@protobufjs/path': 1.1.2
|
||||
'@protobufjs/pool': 1.1.0
|
||||
'@protobufjs/utf8': 1.1.0
|
||||
'@types/long': 4.0.1
|
||||
'@types/node': 10.17.60
|
||||
long: 4.0.0
|
||||
dev: false
|
||||
|
||||
/@apollographql/apollo-tools/0.5.2:
|
||||
resolution: {integrity: sha512-KxZiw0Us3k1d0YkJDhOpVH5rJ+mBfjXcgoRoCcslbgirjgLotKMzOcx4PZ7YTEvvEROmvG7X3Aon41GvMmyGsw==}
|
||||
engines: {node: '>=8', npm: '>=6'}
|
||||
dev: false
|
||||
|
||||
/@apollographql/graphql-playground-html/1.6.29:
|
||||
resolution: {integrity: sha512-xCcXpoz52rI4ksJSdOCxeOCn2DLocxwHf9dVT/Q90Pte1LX+LY+91SFtJF3KXVHH8kEin+g1KKCQPKBjZJfWNA==}
|
||||
dependencies:
|
||||
xss: 1.0.10
|
||||
dev: false
|
||||
|
||||
/@ardatan/aggregate-error/0.0.6:
|
||||
resolution: {integrity: sha512-vyrkEHG1jrukmzTPtyWB4NLPauUw5bQeg4uhn8f+1SSynmrOcyvlb1GKQjjgoBzElLdfXCRYX8UnBlhklOHYRQ==}
|
||||
engines: {node: '>=8'}
|
||||
dependencies:
|
||||
tslib: 2.0.3
|
||||
dev: false
|
||||
|
||||
/@babel/code-frame/7.16.7:
|
||||
resolution: {integrity: sha512-iAXqUn8IIeBTNd72xsFlgaXHkMBMt6y4HJp1tIaK465CWLT/fG1aqB7ykr95gHHmlBdGbFeWWfyB4NJJ0nmeIg==}
|
||||
engines: {node: '>=6.9.0'}
|
||||
@@ -914,82 +870,6 @@ packages:
|
||||
text-decoding: 1.0.0
|
||||
dev: false
|
||||
|
||||
/@graphql-tools/merge/6.2.5_graphql@15.8.0:
|
||||
resolution: {integrity: sha512-T2UEm7L5MeS1ggbGKBkdV9kTqLqSHQM13RrjPzIAYzkFL/mK837sf+oq8h2+R8B+senuHX8akUhMTcU85kcMvw==}
|
||||
peerDependencies:
|
||||
graphql: ^14.0.0 || ^15.0.0
|
||||
dependencies:
|
||||
'@graphql-tools/schema': 7.1.5_graphql@15.8.0
|
||||
'@graphql-tools/utils': 7.10.0_graphql@15.8.0
|
||||
graphql: 15.8.0
|
||||
tslib: 2.0.3
|
||||
dev: false
|
||||
|
||||
/@graphql-tools/merge/8.2.1_graphql@15.8.0:
|
||||
resolution: {integrity: sha512-Q240kcUszhXiAYudjuJgNuLgy9CryDP3wp83NOZQezfA6h3ByYKU7xI6DiKrdjyVaGpYN3ppUmdj0uf5GaXzMA==}
|
||||
peerDependencies:
|
||||
graphql: ^14.0.0 || ^15.0.0 || ^16.0.0
|
||||
dependencies:
|
||||
'@graphql-tools/utils': 8.6.1_graphql@15.8.0
|
||||
graphql: 15.8.0
|
||||
tslib: 2.3.1
|
||||
dev: false
|
||||
|
||||
/@graphql-tools/mock/8.5.1_graphql@15.8.0:
|
||||
resolution: {integrity: sha512-cwwqGs9Rofev1JdMheAseqM/rw1uw4CYb35vv3Kcv2bbyiPF+490xdlHqFeIazceotMFxC60LlQztwb64rsEnw==}
|
||||
peerDependencies:
|
||||
graphql: ^14.0.0 || ^15.0.0 || ^16.0.0
|
||||
dependencies:
|
||||
'@graphql-tools/schema': 8.3.1_graphql@15.8.0
|
||||
'@graphql-tools/utils': 8.6.1_graphql@15.8.0
|
||||
fast-json-stable-stringify: 2.1.0
|
||||
graphql: 15.8.0
|
||||
tslib: 2.3.1
|
||||
dev: false
|
||||
|
||||
/@graphql-tools/schema/7.1.5_graphql@15.8.0:
|
||||
resolution: {integrity: sha512-uyn3HSNSckf4mvQSq0Q07CPaVZMNFCYEVxroApOaw802m9DcZPgf9XVPy/gda5GWj9AhbijfRYVTZQgHnJ4CXA==}
|
||||
peerDependencies:
|
||||
graphql: ^14.0.0 || ^15.0.0
|
||||
dependencies:
|
||||
'@graphql-tools/utils': 7.10.0_graphql@15.8.0
|
||||
graphql: 15.8.0
|
||||
tslib: 2.2.0
|
||||
value-or-promise: 1.0.6
|
||||
dev: false
|
||||
|
||||
/@graphql-tools/schema/8.3.1_graphql@15.8.0:
|
||||
resolution: {integrity: sha512-3R0AJFe715p4GwF067G5i0KCr/XIdvSfDLvTLEiTDQ8V/hwbOHEKHKWlEBHGRQwkG5lwFQlW1aOn7VnlPERnWQ==}
|
||||
peerDependencies:
|
||||
graphql: ^14.0.0 || ^15.0.0 || ^16.0.0
|
||||
dependencies:
|
||||
'@graphql-tools/merge': 8.2.1_graphql@15.8.0
|
||||
'@graphql-tools/utils': 8.6.1_graphql@15.8.0
|
||||
graphql: 15.8.0
|
||||
tslib: 2.3.1
|
||||
value-or-promise: 1.0.11
|
||||
dev: false
|
||||
|
||||
/@graphql-tools/utils/7.10.0_graphql@15.8.0:
|
||||
resolution: {integrity: sha512-d334r6bo9mxdSqZW6zWboEnnOOFRrAPVQJ7LkU8/6grglrbcu6WhwCLzHb90E94JI3TD3ricC3YGbUqIi9Xg0w==}
|
||||
peerDependencies:
|
||||
graphql: ^14.0.0 || ^15.0.0
|
||||
dependencies:
|
||||
'@ardatan/aggregate-error': 0.0.6
|
||||
camel-case: 4.1.2
|
||||
graphql: 15.8.0
|
||||
tslib: 2.2.0
|
||||
dev: false
|
||||
|
||||
/@graphql-tools/utils/8.6.1_graphql@15.8.0:
|
||||
resolution: {integrity: sha512-uxcfHCocp4ENoIiovPxUWZEHOnbXqj3ekWc0rm7fUhW93a1xheARNHcNKhwMTR+UKXVJbTFQdGI1Rl5XdyvDBg==}
|
||||
peerDependencies:
|
||||
graphql: ^14.0.0 || ^15.0.0 || ^16.0.0
|
||||
dependencies:
|
||||
graphql: 15.8.0
|
||||
tslib: 2.3.1
|
||||
dev: false
|
||||
|
||||
/@humanwhocodes/config-array/0.9.3:
|
||||
resolution: {integrity: sha512-3xSMlXHh03hCcCmFc0rbKp3Ivt2PFEJnQUJDDMTJQ2wkECZWdq4GePs2ctc5H8zV+cHPaq8k2vU8mrQjA6iHdQ==}
|
||||
engines: {node: '>=10.10.0'}
|
||||
@@ -1250,10 +1130,6 @@ packages:
|
||||
chalk: 4.1.2
|
||||
dev: true
|
||||
|
||||
/@josephg/resolvable/1.0.1:
|
||||
resolution: {integrity: sha512-CtzORUwWTTOTqfVtHaKRJ0I1kNQd1bpn3sUh8I3nJDVY+5/M/Oe1DnEWzPQvqq/xPIIkzzzIP7mfCoAjFRvDhg==}
|
||||
dev: false
|
||||
|
||||
/@jridgewell/resolve-uri/3.0.4:
|
||||
resolution: {integrity: sha512-cz8HFjOFfUBtvN+NXYSFMHYRdxZMaEl0XypVrhzxBgadKIXhIkRd8aMeHhmF56Sl7SuS8OnUpQ73/k9LE4VnLg==}
|
||||
engines: {node: '>=6.0.0'}
|
||||
@@ -1399,62 +1275,6 @@ packages:
|
||||
reflect-metadata: 0.1.13
|
||||
dev: false
|
||||
|
||||
/@nestjs/graphql/9.1.2_91c3bca9040680d7e362a9e419843305:
|
||||
resolution: {integrity: sha512-ncxmkKmrswnHJ+jLgc6tbkRET6HAyC3gK6WKt1CdPLjvMnXVpFVpyQMFSenNXxAndInw9IgaiSyiJFdRYZVD/w==}
|
||||
peerDependencies:
|
||||
'@apollo/federation': ^0.26.0 || ^0.27.0 || ^0.29.0 || ^0.33.0
|
||||
'@apollo/gateway': ^0.29.0 || ^0.32.0 || ^0.33.0 || ^0.35.0 || ^0.38.0 || ^0.42.0
|
||||
'@apollo/subgraph': ^0.1.2
|
||||
'@nestjs/common': ^8.0.0
|
||||
'@nestjs/core': ^8.0.0
|
||||
apollo-server-core: ^3.0.0
|
||||
apollo-server-express: ^3.1.2
|
||||
apollo-server-fastify: ^3.1.2
|
||||
graphql: ^15.5.1
|
||||
reflect-metadata: ^0.1.13
|
||||
ts-morph: ^11.0.3 || ^12.0.0 || ^13.0.0
|
||||
peerDependenciesMeta:
|
||||
'@apollo/federation':
|
||||
optional: true
|
||||
'@apollo/gateway':
|
||||
optional: true
|
||||
'@apollo/subgraph':
|
||||
optional: true
|
||||
apollo-server-core:
|
||||
optional: true
|
||||
apollo-server-express:
|
||||
optional: true
|
||||
apollo-server-fastify:
|
||||
optional: true
|
||||
ts-morph:
|
||||
optional: true
|
||||
dependencies:
|
||||
'@graphql-tools/merge': 6.2.5_graphql@15.8.0
|
||||
'@graphql-tools/schema': 7.1.5_graphql@15.8.0
|
||||
'@graphql-tools/utils': 7.10.0_graphql@15.8.0
|
||||
'@nestjs/common': 8.2.6_6686f1d73a399753b561a58a608807ad
|
||||
'@nestjs/core': 8.2.6_9ccbff94f707ebc59cf3ddcf930aab79
|
||||
'@nestjs/mapped-types': 1.0.0_cda5296fe38bb7a3dcdb892503001834
|
||||
apollo-server-fastify: 3.6.3_graphql@15.8.0
|
||||
chokidar: 3.5.2
|
||||
fast-glob: 3.2.7
|
||||
graphql: 15.8.0
|
||||
graphql-ws: 5.5.5_graphql@15.8.0
|
||||
iterall: 1.3.0
|
||||
lodash: 4.17.21
|
||||
normalize-path: 3.0.0
|
||||
reflect-metadata: 0.1.13
|
||||
subscriptions-transport-ws: 0.11.0_graphql@15.8.0
|
||||
tslib: 2.3.1
|
||||
uuid: 8.3.2
|
||||
ws: 8.3.0
|
||||
transitivePeerDependencies:
|
||||
- bufferutil
|
||||
- class-transformer
|
||||
- class-validator
|
||||
- utf-8-validate
|
||||
dev: false
|
||||
|
||||
/@nestjs/jwt/8.0.0_@nestjs+common@8.2.6:
|
||||
resolution: {integrity: sha512-fz2LQgYY2zmuD8S+8UE215anwKyXlnB/1FwJQLVR47clNfMeFMK8WCxmn6xdPhF5JKuV1crO6FVabb1qWzDxqQ==}
|
||||
peerDependencies:
|
||||
@@ -1465,20 +1285,6 @@ packages:
|
||||
jsonwebtoken: 8.5.1
|
||||
dev: false
|
||||
|
||||
/@nestjs/mapped-types/1.0.0_cda5296fe38bb7a3dcdb892503001834:
|
||||
resolution: {integrity: sha512-26AW5jHadLXtvHs+M+Agd9KZ92dDlBrmD0rORlBlvn2KvsWs4JRaKl2mUsrW7YsdZeAu3Hc4ukqyYyDdyCmMWQ==}
|
||||
peerDependencies:
|
||||
'@nestjs/common': ^7.0.8 || ^8.0.0
|
||||
class-transformer: ^0.2.0 || ^0.3.0 || ^0.4.0
|
||||
class-validator: ^0.11.1 || ^0.12.0 || ^0.13.0
|
||||
reflect-metadata: ^0.1.12
|
||||
dependencies:
|
||||
'@nestjs/common': 8.2.6_6686f1d73a399753b561a58a608807ad
|
||||
class-transformer: 0.5.1
|
||||
class-validator: 0.13.2
|
||||
reflect-metadata: 0.1.13
|
||||
dev: false
|
||||
|
||||
/@nestjs/mapped-types/1.0.1_cda5296fe38bb7a3dcdb892503001834:
|
||||
resolution: {integrity: sha512-NFvofzSinp00j5rzUd4tf+xi9od6383iY0JP7o0Bnu1fuItAUkWBgc4EKuIQ3D+c2QI3i9pG1kDWAeY27EMGtg==}
|
||||
peerDependencies:
|
||||
@@ -1686,49 +1492,6 @@ packages:
|
||||
- encoding
|
||||
dev: false
|
||||
|
||||
/@protobufjs/aspromise/1.1.2:
|
||||
resolution: {integrity: sha1-m4sMxmPWaafY9vXQiToU00jzD78=}
|
||||
dev: false
|
||||
|
||||
/@protobufjs/base64/1.1.2:
|
||||
resolution: {integrity: sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg==}
|
||||
dev: false
|
||||
|
||||
/@protobufjs/codegen/2.0.4:
|
||||
resolution: {integrity: sha512-YyFaikqM5sH0ziFZCN3xDC7zeGaB/d0IUb9CATugHWbd1FRFwWwt4ld4OYMPWu5a3Xe01mGAULCdqhMlPl29Jg==}
|
||||
dev: false
|
||||
|
||||
/@protobufjs/eventemitter/1.1.0:
|
||||
resolution: {integrity: sha1-NVy8mLr61ZePntCV85diHx0Ga3A=}
|
||||
dev: false
|
||||
|
||||
/@protobufjs/fetch/1.1.0:
|
||||
resolution: {integrity: sha1-upn7WYYUr2VwDBYZ/wbUVLDYTEU=}
|
||||
dependencies:
|
||||
'@protobufjs/aspromise': 1.1.2
|
||||
'@protobufjs/inquire': 1.1.0
|
||||
dev: false
|
||||
|
||||
/@protobufjs/float/1.0.2:
|
||||
resolution: {integrity: sha1-Xp4avctz/Ap8uLKR33jIy9l7h9E=}
|
||||
dev: false
|
||||
|
||||
/@protobufjs/inquire/1.1.0:
|
||||
resolution: {integrity: sha1-/yAOPnzyQp4tyvwRQIKOjMY48Ik=}
|
||||
dev: false
|
||||
|
||||
/@protobufjs/path/1.1.2:
|
||||
resolution: {integrity: sha1-bMKyDFya1q0NzP0hynZz2Nf79o0=}
|
||||
dev: false
|
||||
|
||||
/@protobufjs/pool/1.1.0:
|
||||
resolution: {integrity: sha1-Cf0V8tbTq/qbZbw2ZQbWrXhG/1Q=}
|
||||
dev: false
|
||||
|
||||
/@protobufjs/utf8/1.1.0:
|
||||
resolution: {integrity: sha1-p3c2C1s5oaLlEG+OhY8v0tBgxXA=}
|
||||
dev: false
|
||||
|
||||
/@sinonjs/commons/1.8.3:
|
||||
resolution: {integrity: sha512-xkNcLAn/wZaX14RPlwizcKicDk9G3F8m2nU3L7Ukm5zBgTwiT0wsoFAHx9Jq56fJA1z/7uKGtCRu16sOUCLIHQ==}
|
||||
dependencies:
|
||||
@@ -2032,10 +1795,6 @@ packages:
|
||||
resolution: {integrity: sha512-0d5Wd09ItQWH1qFbEyQ7oTQ3GZrMfth5JkbN3EvTKLXcHLRDSXeLnlvlOn0wvxVIwK5o2M8JzP/OWz7T3NRsbw==}
|
||||
dev: true
|
||||
|
||||
/@types/long/4.0.1:
|
||||
resolution: {integrity: sha512-5tXH6Bx/kNGd3MgffdmP4dy2Z+G4eaXw0SE81Tq3BNadtnMR5/ySMzX4SLEzHJzSmPNn4HIdpQsBvXMUykr58w==}
|
||||
dev: false
|
||||
|
||||
/@types/marked/4.0.2:
|
||||
resolution: {integrity: sha512-auNrZ/c0w6wsM9DccwVxWHssrMDezHUAXNesdp2RQrCVCyrQbOiSq7yqdJKrUQQpw9VTm7CGYJH2A/YG7jjrjQ==}
|
||||
dev: true
|
||||
@@ -2063,10 +1822,6 @@ packages:
|
||||
form-data: 3.0.1
|
||||
dev: false
|
||||
|
||||
/@types/node/10.17.60:
|
||||
resolution: {integrity: sha512-F0KIgDJfy2nA3zMLmWGKxcH2ZVEtCZXHHdOQs2gSaQ27+lNeEfGxzkIw90aXswATX7AZ33tahPbzy6KAfUreVw==}
|
||||
dev: false
|
||||
|
||||
/@types/node/14.17.33:
|
||||
resolution: {integrity: sha512-noEeJ06zbn3lOh4gqe2v7NMGS33jrulfNqYFDjjEbhpDEHR5VTxgYNQSBqBlJIsBJW3uEYDgD6kvMnrrhGzq8g==}
|
||||
dev: false
|
||||
@@ -2682,120 +2437,7 @@ packages:
|
||||
dependencies:
|
||||
normalize-path: 3.0.0
|
||||
picomatch: 2.3.1
|
||||
|
||||
/apollo-datasource/3.3.1:
|
||||
resolution: {integrity: sha512-Z3a8rEUXVPIZ1p8xrFL8bcNhWmhOmovgDArvwIwmJOBnh093ZpRfO+ESJEDAN4KswmyzCLDAwjsW4zQOONdRUw==}
|
||||
engines: {node: '>=12.0'}
|
||||
dependencies:
|
||||
apollo-server-caching: 3.3.0
|
||||
apollo-server-env: 4.2.1
|
||||
transitivePeerDependencies:
|
||||
- encoding
|
||||
dev: false
|
||||
|
||||
/apollo-reporting-protobuf/3.3.0:
|
||||
resolution: {integrity: sha512-51Jwrg0NvHJfKz7TIGU8+Os3rUAqWtXeKRsRtKYtTeMSBPNhzz8UoGjAB3XyVmUXRE3IRmLtDPDRFL7qbxMI/w==}
|
||||
dependencies:
|
||||
'@apollo/protobufjs': 1.2.2
|
||||
dev: false
|
||||
|
||||
/apollo-server-caching/3.3.0:
|
||||
resolution: {integrity: sha512-Wgcb0ArjZ5DjQ7ID+tvxUcZ7Yxdbk5l1MxZL8D8gkyjooOkhPNzjRVQ7ubPoXqO54PrOMOTm1ejVhsF+AfIirQ==}
|
||||
engines: {node: '>=12.0'}
|
||||
dependencies:
|
||||
lru-cache: 6.0.0
|
||||
dev: false
|
||||
|
||||
/apollo-server-core/3.6.3_graphql@15.8.0:
|
||||
resolution: {integrity: sha512-TFJmAlI6vPp1MHOSXqYkE6leAyMekWv/D/3ma11uETkcd3EPjERGmxtTXPJElMVEkOK9BEElYKthCrH7bjYLuw==}
|
||||
engines: {node: '>=12.0'}
|
||||
peerDependencies:
|
||||
graphql: ^15.3.0 || ^16.0.0
|
||||
dependencies:
|
||||
'@apollographql/apollo-tools': 0.5.2
|
||||
'@apollographql/graphql-playground-html': 1.6.29
|
||||
'@graphql-tools/mock': 8.5.1_graphql@15.8.0
|
||||
'@graphql-tools/schema': 8.3.1_graphql@15.8.0
|
||||
'@josephg/resolvable': 1.0.1
|
||||
apollo-datasource: 3.3.1
|
||||
apollo-reporting-protobuf: 3.3.0
|
||||
apollo-server-caching: 3.3.0
|
||||
apollo-server-env: 4.2.1
|
||||
apollo-server-errors: 3.3.1_graphql@15.8.0
|
||||
apollo-server-plugin-base: 3.5.1_graphql@15.8.0
|
||||
apollo-server-types: 3.5.1_graphql@15.8.0
|
||||
async-retry: 1.3.3
|
||||
fast-json-stable-stringify: 2.1.0
|
||||
graphql: 15.8.0
|
||||
graphql-tag: 2.12.6_graphql@15.8.0
|
||||
lodash.sortby: 4.7.0
|
||||
loglevel: 1.8.0
|
||||
lru-cache: 6.0.0
|
||||
sha.js: 2.4.11
|
||||
uuid: 8.3.2
|
||||
transitivePeerDependencies:
|
||||
- encoding
|
||||
dev: false
|
||||
|
||||
/apollo-server-env/4.2.1:
|
||||
resolution: {integrity: sha512-vm/7c7ld+zFMxibzqZ7SSa5tBENc4B0uye9LTfjJwGoQFY5xsUPH5FpO5j0bMUDZ8YYNbrF9SNtzc5Cngcr90g==}
|
||||
engines: {node: '>=12.0'}
|
||||
dependencies:
|
||||
node-fetch: 2.6.7
|
||||
transitivePeerDependencies:
|
||||
- encoding
|
||||
dev: false
|
||||
|
||||
/apollo-server-errors/3.3.1_graphql@15.8.0:
|
||||
resolution: {integrity: sha512-xnZJ5QWs6FixHICXHxUfm+ZWqqxrNuPlQ+kj5m6RtEgIpekOPssH/SD9gf2B4HuWV0QozorrygwZnux8POvyPA==}
|
||||
engines: {node: '>=12.0'}
|
||||
peerDependencies:
|
||||
graphql: ^15.3.0 || ^16.0.0
|
||||
dependencies:
|
||||
graphql: 15.8.0
|
||||
dev: false
|
||||
|
||||
/apollo-server-fastify/3.6.3_graphql@15.8.0:
|
||||
resolution: {integrity: sha512-UtmIcUbZyupsFHn0G+6AJ0de6P6bkidKAzMzEwS9r1zw+dGnp8H11A8pZBDqn8Csb9Xa3g2qj8z6pXlbyDQXKw==}
|
||||
engines: {node: '>=12.0'}
|
||||
peerDependencies:
|
||||
fastify: ^3.17.0
|
||||
graphql: ^15.3.0 || ^16.0.0
|
||||
dependencies:
|
||||
apollo-server-core: 3.6.3_graphql@15.8.0
|
||||
apollo-server-types: 3.5.1_graphql@15.8.0
|
||||
fastify-accepts: 2.1.0
|
||||
fastify-cors: 6.0.2
|
||||
graphql: 15.8.0
|
||||
transitivePeerDependencies:
|
||||
- encoding
|
||||
dev: false
|
||||
|
||||
/apollo-server-plugin-base/3.5.1_graphql@15.8.0:
|
||||
resolution: {integrity: sha512-wgDHz3lLrCqpecDky3z6AOQ0vik0qs0Cya/Ti6n3ESYXJ9MdK3jE/QunATIrOYYJaa+NKl9V7YwU+/bojNfFuQ==}
|
||||
engines: {node: '>=12.0'}
|
||||
peerDependencies:
|
||||
graphql: ^15.3.0 || ^16.0.0
|
||||
dependencies:
|
||||
apollo-server-types: 3.5.1_graphql@15.8.0
|
||||
graphql: 15.8.0
|
||||
transitivePeerDependencies:
|
||||
- encoding
|
||||
dev: false
|
||||
|
||||
/apollo-server-types/3.5.1_graphql@15.8.0:
|
||||
resolution: {integrity: sha512-zG7xLl4mmHuZMAYOfjWKHY/IC/GgIkJ3HnYuR7FRrnPpRA9Yt5Kf1M1rjm1Esuqzpb/dt8pM7cX40QaIQObCYQ==}
|
||||
engines: {node: '>=12.0'}
|
||||
peerDependencies:
|
||||
graphql: ^15.3.0 || ^16.0.0
|
||||
dependencies:
|
||||
apollo-reporting-protobuf: 3.3.0
|
||||
apollo-server-caching: 3.3.0
|
||||
apollo-server-env: 4.2.1
|
||||
graphql: 15.8.0
|
||||
transitivePeerDependencies:
|
||||
- encoding
|
||||
dev: false
|
||||
dev: true
|
||||
|
||||
/aproba/1.2.0:
|
||||
resolution: {integrity: sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==}
|
||||
@@ -2886,12 +2528,6 @@ packages:
|
||||
dev: false
|
||||
optional: true
|
||||
|
||||
/async-retry/1.3.3:
|
||||
resolution: {integrity: sha512-wfr/jstw9xNi/0teMHrRW7dsz3Lt5ARhYNZ2ewpadnhaIp5mbALhOAP+EAdsC7t4Z6wqsDVv9+W6gm1Dk9mEyw==}
|
||||
dependencies:
|
||||
retry: 0.13.1
|
||||
dev: false
|
||||
|
||||
/async/0.9.2:
|
||||
resolution: {integrity: sha1-rqdNXmHB+JlhO/ZL2mbUx48v0X0=}
|
||||
dev: false
|
||||
@@ -3038,10 +2674,6 @@ packages:
|
||||
babel-preset-current-node-syntax: 1.0.1_@babel+core@7.17.0
|
||||
dev: true
|
||||
|
||||
/backo2/1.0.2:
|
||||
resolution: {integrity: sha1-MasayLEpNjRj41s+u2n038+6eUc=}
|
||||
dev: false
|
||||
|
||||
/balanced-match/1.0.2:
|
||||
resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==}
|
||||
|
||||
@@ -3077,6 +2709,7 @@ packages:
|
||||
/binary-extensions/2.2.0:
|
||||
resolution: {integrity: sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==}
|
||||
engines: {node: '>=8'}
|
||||
dev: true
|
||||
|
||||
/bl/4.1.0:
|
||||
resolution: {integrity: sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==}
|
||||
@@ -3190,13 +2823,6 @@ packages:
|
||||
upper-case: 1.1.3
|
||||
dev: false
|
||||
|
||||
/camel-case/4.1.2:
|
||||
resolution: {integrity: sha512-gxGWBrTT1JuMx6R+o5PTXMmUnhnVzLQ9SNutD4YqKtI6ap897t3tKECYla6gCWEkplXnlNybEkZg9GEGxKFCgw==}
|
||||
dependencies:
|
||||
pascal-case: 3.1.2
|
||||
tslib: 2.3.1
|
||||
dev: false
|
||||
|
||||
/camelcase-keys/7.0.2:
|
||||
resolution: {integrity: sha512-Rjs1H+A9R+Ig+4E/9oyB66UC5Mj9Xq3N//vcLf2WzgdTi/3gUu3Z9KoqmlrEG4VuuLK8wJHofxzdQXz/knhiYg==}
|
||||
engines: {node: '>=12'}
|
||||
@@ -3290,6 +2916,7 @@ packages:
|
||||
readdirp: 3.6.0
|
||||
optionalDependencies:
|
||||
fsevents: 2.3.2
|
||||
dev: true
|
||||
|
||||
/chownr/2.0.0:
|
||||
resolution: {integrity: sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==}
|
||||
@@ -4222,10 +3849,6 @@ packages:
|
||||
resolution: {integrity: sha512-HLU3NDY6wARrLCEwyGKRBvuWYyvW6mHYv72SJJAH3iJN3a6eVUvkjFkcxah1bcTgGVBBrFdIopBJPhCQFMLyXw==}
|
||||
dev: false
|
||||
|
||||
/eventemitter3/3.1.2:
|
||||
resolution: {integrity: sha512-tvtQIeLVHjDkJYnzf2dgVMxfuSGJeM/7UCG17TT4EumTfNtF+0nebF/4zWOIkCreAbtNqhGEboB6BWrwqNaw4Q==}
|
||||
dev: false
|
||||
|
||||
/events/3.3.0:
|
||||
resolution: {integrity: sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==}
|
||||
engines: {node: '>=0.8.x'}
|
||||
@@ -4325,17 +3948,6 @@ packages:
|
||||
merge2: 1.4.1
|
||||
micromatch: 4.0.4
|
||||
|
||||
/fast-glob/3.2.7:
|
||||
resolution: {integrity: sha512-rYGMRwip6lUMvYD3BTScMwT1HtAs2d71SMv66Vrxs0IekGZEjhM0pcMfjQPnknBt2zeCwQMEupiN02ZP4DiT1Q==}
|
||||
engines: {node: '>=8'}
|
||||
dependencies:
|
||||
'@nodelib/fs.stat': 2.0.5
|
||||
'@nodelib/fs.walk': 1.2.8
|
||||
glob-parent: 5.1.2
|
||||
merge2: 1.4.1
|
||||
micromatch: 4.0.4
|
||||
dev: false
|
||||
|
||||
/fast-json-stable-stringify/2.1.0:
|
||||
resolution: {integrity: sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==}
|
||||
|
||||
@@ -4369,14 +3981,6 @@ packages:
|
||||
strnum: 1.0.5
|
||||
dev: false
|
||||
|
||||
/fastify-accepts/2.1.0:
|
||||
resolution: {integrity: sha512-1nS8HfPcUsDvvGuuHDvfQBb2F1YJFfx26L77di7ypa0mUduFKZi1cpIpQCs8Kgu30v7yLMzLMH13FHfKk81SAw==}
|
||||
engines: {node: '>=10'}
|
||||
dependencies:
|
||||
accepts: 1.3.7
|
||||
fastify-plugin: 3.0.1
|
||||
dev: false
|
||||
|
||||
/fastify-cookie/5.5.0:
|
||||
resolution: {integrity: sha512-XhexnjmAR4CUh3Cz6Ko0is+pa8k1bS6+nkf/i3viv4p7R1fwGtGhAXuz+b4nEM0x7pvdi5ApKY73Bp5CELZP7g==}
|
||||
dependencies:
|
||||
@@ -4696,6 +4300,7 @@ packages:
|
||||
engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0}
|
||||
os: [darwin]
|
||||
requiresBuild: true
|
||||
dev: true
|
||||
optional: true
|
||||
|
||||
/function-bind/1.1.1:
|
||||
@@ -4888,30 +4493,6 @@ packages:
|
||||
/graceful-fs/4.2.9:
|
||||
resolution: {integrity: sha512-NtNxqUcXgpW2iMrfqSfR73Glt39K+BLwWsPs94yR63v45T0Wbej7eRmL5cWfwEgqXnmjQp3zaJTshdRW/qC2ZQ==}
|
||||
|
||||
/graphql-tag/2.12.6_graphql@15.8.0:
|
||||
resolution: {integrity: sha512-FdSNcu2QQcWnM2VNvSCCDCVS5PpPqpzgFT8+GXzqJuoDd0CBncxCY278u4mhRO7tMgo2JjgJA5aZ+nWSQ/Z+xg==}
|
||||
engines: {node: '>=10'}
|
||||
peerDependencies:
|
||||
graphql: ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0
|
||||
dependencies:
|
||||
graphql: 15.8.0
|
||||
tslib: 2.3.1
|
||||
dev: false
|
||||
|
||||
/graphql-ws/5.5.5_graphql@15.8.0:
|
||||
resolution: {integrity: sha512-hvyIS71vs4Tu/yUYHPvGXsTgo0t3arU820+lT5VjZS2go0ewp2LqyCgxEN56CzOG7Iys52eRhHBiD1gGRdiQtw==}
|
||||
engines: {node: '>=10'}
|
||||
peerDependencies:
|
||||
graphql: '>=0.11 <=16'
|
||||
dependencies:
|
||||
graphql: 15.8.0
|
||||
dev: false
|
||||
|
||||
/graphql/15.8.0:
|
||||
resolution: {integrity: sha512-5gghUc24tP9HRznNpV2+FIoq3xKkj5dTQqf4v0CpdPbFVwFkWoxOM+o+2OC9ZSvjEMTjfmG9QT+gcvggTwW1zw==}
|
||||
engines: {node: '>= 10.x'}
|
||||
dev: false
|
||||
|
||||
/har-schema/2.0.0:
|
||||
resolution: {integrity: sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=}
|
||||
engines: {node: '>=4'}
|
||||
@@ -5220,6 +4801,7 @@ packages:
|
||||
engines: {node: '>=8'}
|
||||
dependencies:
|
||||
binary-extensions: 2.2.0
|
||||
dev: true
|
||||
|
||||
/is-boolean-object/1.1.2:
|
||||
resolution: {integrity: sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA==}
|
||||
@@ -5418,10 +5000,6 @@ packages:
|
||||
istanbul-lib-report: 3.0.0
|
||||
dev: true
|
||||
|
||||
/iterall/1.3.0:
|
||||
resolution: {integrity: sha512-QZ9qOMdF+QLHxy1QIpUHUU1D5pS2CG2P69LF6L6CPjPYA/XMOmKV3PZpawHoAjHNyB0swdVTRxdYT4tbBbxqwg==}
|
||||
dev: false
|
||||
|
||||
/iterare/1.2.1:
|
||||
resolution: {integrity: sha512-RKYVTCjAnRthyJes037NX/IiqeidgN1xc3j1RjFfECFp28A1GVwK9nA+i0rJPaHqSZwygLzRnFlzUuHFoWWy+Q==}
|
||||
engines: {node: '>=6'}
|
||||
@@ -6347,10 +5925,6 @@ packages:
|
||||
resolution: {integrity: sha1-G7nzFO9ri63tE7VJFpsqlF62jk0=}
|
||||
dev: false
|
||||
|
||||
/lodash.sortby/4.7.0:
|
||||
resolution: {integrity: sha1-7dFMgk4sycHgsKG0K7UhBRakJDg=}
|
||||
dev: false
|
||||
|
||||
/lodash.uniq/4.5.0:
|
||||
resolution: {integrity: sha1-0CJTc662Uq3BvILklFM5qEJ1R3M=}
|
||||
dev: false
|
||||
@@ -6380,10 +5954,6 @@ packages:
|
||||
engines: {node: '>= 0.6.0'}
|
||||
dev: false
|
||||
|
||||
/long/4.0.0:
|
||||
resolution: {integrity: sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA==}
|
||||
dev: false
|
||||
|
||||
/lower-case/1.1.4:
|
||||
resolution: {integrity: sha1-miyr0bno4K6ZOkv31YdcOcQujqw=}
|
||||
dev: false
|
||||
@@ -6806,6 +6376,7 @@ packages:
|
||||
/normalize-path/3.0.0:
|
||||
resolution: {integrity: sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==}
|
||||
engines: {node: '>=0.10.0'}
|
||||
dev: true
|
||||
|
||||
/notepack.io/2.1.3:
|
||||
resolution: {integrity: sha512-AgSt+cP5XMooho1Ppn8NB3FFaVWefV+qZoZncYTUSch2GAEwlYLcIIbT5YVkMlFeNHnfwOvc4HDlbvrB5BRxXA==}
|
||||
@@ -7068,13 +6639,6 @@ packages:
|
||||
resolution: {integrity: sha512-Ofn/CTFzRGTTxwpNEs9PP93gXShHcTq255nzRYSKe8AkVpZY7e1fpmTfOyoIvjP5HG7Z2ZM7VS9PPhQGW2pOpw==}
|
||||
dev: true
|
||||
|
||||
/pascal-case/3.1.2:
|
||||
resolution: {integrity: sha512-uWlGT3YSnK9x3BQJaOdcZwrnV6hPpd8jFH1/ucpiLRPh/2zCVJKS19E4GvYHvaCcACn3foXZ0cLB9Wrx1KGe5g==}
|
||||
dependencies:
|
||||
no-case: 3.0.4
|
||||
tslib: 2.3.1
|
||||
dev: false
|
||||
|
||||
/passport-jwt/4.0.0:
|
||||
resolution: {integrity: sha512-BwC0n2GP/1hMVjR4QpnvqA61TxenUMlmfNjYNgK0ZAs0HK4SOQkHcSv4L328blNTLtHq7DbmvyNJiH+bn6C5Mg==}
|
||||
dependencies:
|
||||
@@ -7375,6 +6939,7 @@ packages:
|
||||
engines: {node: '>=8.10.0'}
|
||||
dependencies:
|
||||
picomatch: 2.3.1
|
||||
dev: true
|
||||
|
||||
/rechoir/0.6.2:
|
||||
resolution: {integrity: sha1-hSBLVNuoLVdC4oyWdW70OvUOM4Q=}
|
||||
@@ -7522,11 +7087,6 @@ packages:
|
||||
engines: {node: '>=4'}
|
||||
dev: false
|
||||
|
||||
/retry/0.13.1:
|
||||
resolution: {integrity: sha512-XQBQ3I8W1Cge0Seh+6gjj03LbmRFWuoszgK9ooCpwYIrhhoO80pfq4cUkU5DkknwfOfFteRwlZ56PYOGYyFWdg==}
|
||||
engines: {node: '>= 4'}
|
||||
dev: false
|
||||
|
||||
/reusify/1.0.4:
|
||||
resolution: {integrity: sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==}
|
||||
engines: {iojs: '>=1.0.0', node: '>=0.10.0'}
|
||||
@@ -7684,14 +7244,6 @@ packages:
|
||||
resolution: {integrity: sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==}
|
||||
dev: false
|
||||
|
||||
/sha.js/2.4.11:
|
||||
resolution: {integrity: sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==}
|
||||
hasBin: true
|
||||
dependencies:
|
||||
inherits: 2.0.4
|
||||
safe-buffer: 5.2.1
|
||||
dev: false
|
||||
|
||||
/shebang-command/2.0.0:
|
||||
resolution: {integrity: sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==}
|
||||
engines: {node: '>=8'}
|
||||
@@ -8035,22 +7587,6 @@ packages:
|
||||
resolution: {integrity: sha512-J8bbNyKKXl5qYcR36TIO8W3mVGVHrmmxsd5PAItGkmyzwJvybiw2IVq5nqd0i4LSNSkB/sx9VHllbfFdr9k1JA==}
|
||||
dev: false
|
||||
|
||||
/subscriptions-transport-ws/0.11.0_graphql@15.8.0:
|
||||
resolution: {integrity: sha512-8D4C6DIH5tGiAIpp5I0wD/xRlNiZAPGHygzCe7VzyzUoxHtawzjNAY9SUTXU05/EY2NMY9/9GF0ycizkXr1CWQ==}
|
||||
peerDependencies:
|
||||
graphql: ^15.7.2 || ^16.0.0
|
||||
dependencies:
|
||||
backo2: 1.0.2
|
||||
eventemitter3: 3.1.2
|
||||
graphql: 15.8.0
|
||||
iterall: 1.3.0
|
||||
symbol-observable: 1.2.0
|
||||
ws: 7.5.6
|
||||
transitivePeerDependencies:
|
||||
- bufferutil
|
||||
- utf-8-validate
|
||||
dev: false
|
||||
|
||||
/supports-color/5.5.0:
|
||||
resolution: {integrity: sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==}
|
||||
engines: {node: '>=4'}
|
||||
@@ -8088,11 +7624,6 @@ packages:
|
||||
engines: {node: '>= 0.4'}
|
||||
dev: true
|
||||
|
||||
/symbol-observable/1.2.0:
|
||||
resolution: {integrity: sha512-e900nM8RRtGhlV36KGEU9k65K3mPb1WV70OdjfxlG2EAuM1noi/E/BaW/uMhL7bPEssK8QV57vN3esixjUvcXQ==}
|
||||
engines: {node: '>=0.10.0'}
|
||||
dev: false
|
||||
|
||||
/symbol-observable/4.0.0:
|
||||
resolution: {integrity: sha512-b19dMThMV4HVFynSAM1++gBHAbk2Tc/osgLIBZMKsyqh34jb2e8Os7T6ZW/Bt3pJFdBTd2JwAnAAEQV7rSNvcQ==}
|
||||
engines: {node: '>=0.10'}
|
||||
@@ -8389,14 +7920,6 @@ packages:
|
||||
resolution: {integrity: sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==}
|
||||
dev: true
|
||||
|
||||
/tslib/2.0.3:
|
||||
resolution: {integrity: sha512-uZtkfKblCEQtZKBF6EBXVZeQNl82yqtDQdv+eck8u7tdPxjLu2/lp5/uPW+um2tpuxINHWy3GhiccY7QgEaVHQ==}
|
||||
dev: false
|
||||
|
||||
/tslib/2.2.0:
|
||||
resolution: {integrity: sha512-gS9GVHRU+RGn5KQM2rllAlR3dU6m7AcpJKdtH8gFvQiC4Otgk98XnmMU+nZenHt/+VhnBPWwgrJsyrdcw6i23w==}
|
||||
dev: false
|
||||
|
||||
/tslib/2.3.1:
|
||||
resolution: {integrity: sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw==}
|
||||
|
||||
@@ -8556,16 +8079,6 @@ packages:
|
||||
engines: {node: '>= 0.10'}
|
||||
dev: false
|
||||
|
||||
/value-or-promise/1.0.11:
|
||||
resolution: {integrity: sha512-41BrgH+dIbCFXClcSapVs5M6GkENd3gQOJpEfPDNa71LsUGMXDL0jMWpI/Rh7WhX+Aalfz2TTS3Zt5pUsbnhLg==}
|
||||
engines: {node: '>=12'}
|
||||
dev: false
|
||||
|
||||
/value-or-promise/1.0.6:
|
||||
resolution: {integrity: sha512-9r0wQsWD8z/BxPOvnwbPf05ZvFngXyouE9EKB+5GbYix+BYnAwrIChCUyFIinfbf2FL/U71z+CPpbnmTdxrwBg==}
|
||||
engines: {node: '>=12'}
|
||||
dev: false
|
||||
|
||||
/vary/1.1.2:
|
||||
resolution: {integrity: sha1-IpnwLG3tMNSllhsLn3RSShj2NPw=}
|
||||
engines: {node: '>= 0.8'}
|
||||
@@ -8787,6 +8300,7 @@ packages:
|
||||
optional: true
|
||||
utf-8-validate:
|
||||
optional: true
|
||||
dev: true
|
||||
|
||||
/ws/8.2.3:
|
||||
resolution: {integrity: sha512-wBuoj1BDpC6ZQ1B7DWQBYVLphPWkm8i9Y0/3YdHjHKHiohOJ1ws+3OccDWtH+PoC9DZD5WOTrJvNbWvjS6JWaA==}
|
||||
@@ -8800,19 +8314,6 @@ packages:
|
||||
utf-8-validate:
|
||||
optional: true
|
||||
|
||||
/ws/8.3.0:
|
||||
resolution: {integrity: sha512-Gs5EZtpqZzLvmIM59w4igITU57lrtYVFneaa434VROv4thzJyV6UjIL3D42lslWlI+D4KzLYnxSwtfuiO79sNw==}
|
||||
engines: {node: '>=10.0.0'}
|
||||
peerDependencies:
|
||||
bufferutil: ^4.0.1
|
||||
utf-8-validate: ^5.0.2
|
||||
peerDependenciesMeta:
|
||||
bufferutil:
|
||||
optional: true
|
||||
utf-8-validate:
|
||||
optional: true
|
||||
dev: false
|
||||
|
||||
/xml-name-validator/3.0.0:
|
||||
resolution: {integrity: sha512-A5CUptxDsvxKJEU3yO6DuWBSJz/qizqzJKOMIfUJHETbBw/sFaDxgd6fxm1ewUaM0jZ444Fc5vC5ROYurg/4Pw==}
|
||||
dev: true
|
||||
|
||||
@@ -1,12 +1,9 @@
|
||||
import { Logger, MiddlewareConsumer, Module, NestModule } from '@nestjs/common'
|
||||
import { APP_FILTER, APP_GUARD, APP_INTERCEPTOR } from '@nestjs/core'
|
||||
import { GraphQLModule } from '@nestjs/graphql'
|
||||
import cluster from 'cluster'
|
||||
import { mkdirSync } from 'fs'
|
||||
import { join } from 'path'
|
||||
import { CLUSTER } from './app.config'
|
||||
import { AppController } from './app.controller'
|
||||
import { AppResolver } from './app.resolver'
|
||||
import { AllExceptionsFilter } from './common/filters/any-exception.filter'
|
||||
import { RolesGuard } from './common/guard/roles.guard'
|
||||
import { AnalyzeInterceptor } from './common/interceptors/analyze.interceptor'
|
||||
@@ -52,6 +49,7 @@ import { DatabaseModule } from './processors/database/database.module'
|
||||
import { GatewayModule } from './processors/gateway/gateway.module'
|
||||
import { HelperModule } from './processors/helper/helper.module'
|
||||
import { LoggerModule } from './processors/logger/logger.module'
|
||||
|
||||
// FIXME
|
||||
function mkdirs() {
|
||||
mkdirSync(DATA_DIR, { recursive: true })
|
||||
@@ -73,14 +71,6 @@ if (!CLUSTER.enable || cluster.isPrimary) {
|
||||
DatabaseModule,
|
||||
CacheModule,
|
||||
|
||||
GraphQLModule.forRoot({
|
||||
debug: isDev,
|
||||
playground: isDev,
|
||||
autoSchemaFile: join(process.cwd(), 'schema.gql'),
|
||||
context: ({ req }) => ({ req }),
|
||||
cors: false,
|
||||
}),
|
||||
|
||||
AggregateModule,
|
||||
AnalyzeModule,
|
||||
AuthModule,
|
||||
@@ -116,8 +106,6 @@ if (!CLUSTER.enable || cluster.isPrimary) {
|
||||
].filter(Boolean),
|
||||
controllers: [AppController],
|
||||
providers: [
|
||||
AppResolver,
|
||||
|
||||
{
|
||||
provide: APP_INTERCEPTOR,
|
||||
useClass: HttpCacheInterceptor,
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
import { Query, Resolver } from '@nestjs/graphql'
|
||||
|
||||
@Resolver()
|
||||
export class AppResolver {
|
||||
@Query(() => String)
|
||||
sayHello(): string {
|
||||
return 'Hello World!'
|
||||
}
|
||||
}
|
||||
@@ -87,7 +87,6 @@ async function bootstrap() {
|
||||
const prefix = env ? 'P' : 'W'
|
||||
if (isDev) {
|
||||
consola.debug(`[${prefix + pid}] OpenApi: ${url}/api-docs`)
|
||||
consola.debug(`[${prefix + pid}] GraphQL playground: ${url}/graphql`)
|
||||
}
|
||||
consola.success(`[${prefix + pid}] Server listen on: ${url}`)
|
||||
consola.success(`[${prefix + pid}] Admin Dashboard: ${url}/qaqdmin`)
|
||||
|
||||
@@ -8,7 +8,6 @@ import {
|
||||
Logger,
|
||||
} from '@nestjs/common'
|
||||
import { Reflector } from '@nestjs/core'
|
||||
import { GqlArgumentsHost } from '@nestjs/graphql'
|
||||
import { FastifyReply, FastifyRequest } from 'fastify'
|
||||
import { WriteStream } from 'fs'
|
||||
import { resolve } from 'path'
|
||||
@@ -18,6 +17,7 @@ import { REFLECTOR } from '~/constants/system.constant'
|
||||
import { isDev } from '~/utils'
|
||||
import { getIp } from '../../utils/ip.util'
|
||||
import { LoggingInterceptor } from '../interceptors/logging.interceptor'
|
||||
|
||||
type myError = {
|
||||
readonly status: number
|
||||
readonly statusCode?: number
|
||||
@@ -31,7 +31,7 @@ export class AllExceptionsFilter implements ExceptionFilter {
|
||||
private errorLogPipe: WriteStream
|
||||
constructor(@Inject(REFLECTOR) private reflector: Reflector) {}
|
||||
catch(exception: unknown, host: ArgumentsHost) {
|
||||
const ctx = GqlArgumentsHost.create(host).switchToHttp()
|
||||
const ctx = host.switchToHttp()
|
||||
const response = ctx.getResponse<FastifyReply>()
|
||||
const request = ctx.getRequest<FastifyRequest>()
|
||||
|
||||
|
||||
@@ -14,10 +14,10 @@ import {
|
||||
NestInterceptor,
|
||||
SetMetadata,
|
||||
} from '@nestjs/common'
|
||||
import { GqlExecutionContext } from '@nestjs/graphql'
|
||||
import { Observable } from 'rxjs'
|
||||
import { tap } from 'rxjs/operators'
|
||||
import { HTTP_REQUEST_TIME } from '~/constants/meta.constant'
|
||||
import { getNestExecutionContextRequest } from '~/utils'
|
||||
|
||||
@Injectable()
|
||||
export class LoggingInterceptor implements NestInterceptor {
|
||||
@@ -34,7 +34,7 @@ export class LoggingInterceptor implements NestInterceptor {
|
||||
const content = request.method + ' -> ' + request.url
|
||||
this.logger.debug('+++ 收到请求:' + content)
|
||||
const now = +new Date()
|
||||
SetMetadata(HTTP_REQUEST_TIME, now)(this.getRequest(context))
|
||||
SetMetadata(HTTP_REQUEST_TIME, now)(this.getRequest(context) as any)
|
||||
|
||||
return call$.pipe(
|
||||
tap(() =>
|
||||
@@ -46,11 +46,6 @@ export class LoggingInterceptor implements NestInterceptor {
|
||||
}
|
||||
|
||||
getRequest(context: ExecutionContext) {
|
||||
const req = context.switchToHttp().getRequest<KV>()
|
||||
if (req) {
|
||||
return req
|
||||
}
|
||||
const ctx = GqlExecutionContext.create(context)
|
||||
return ctx.getContext().req
|
||||
return getNestExecutionContextRequest(context)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import { ObjectType, registerEnumType } from '@nestjs/graphql'
|
||||
import { PartialType } from '@nestjs/mapped-types'
|
||||
import { DocumentType, index, modelOptions, prop } from '@typegoose/typegoose'
|
||||
import { IsEnum, IsNotEmpty, IsOptional, IsString } from 'class-validator'
|
||||
@@ -11,13 +10,8 @@ export enum CategoryType {
|
||||
Tag,
|
||||
}
|
||||
|
||||
registerEnumType(CategoryType, {
|
||||
name: 'CategoryType',
|
||||
})
|
||||
|
||||
@index({ slug: -1 })
|
||||
@modelOptions({ options: { customName: 'Category' } })
|
||||
@ObjectType()
|
||||
export class CategoryModel extends BaseModel {
|
||||
@prop({ unique: true, trim: true, required: true })
|
||||
@IsString()
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import { ArgsType, Field, Int } from '@nestjs/graphql'
|
||||
import { Transform } from 'class-transformer'
|
||||
import {
|
||||
IsDefined,
|
||||
@@ -14,7 +13,6 @@ import {
|
||||
} from 'class-validator'
|
||||
import { PagerDto } from '~/shared/dto/pager.dto'
|
||||
|
||||
@ArgsType()
|
||||
export class NoteQueryDto extends PagerDto {
|
||||
@IsOptional()
|
||||
@IsIn(['title', 'created', 'modified', 'weather', 'mood'])
|
||||
@@ -24,7 +22,6 @@ export class NoteQueryDto extends PagerDto {
|
||||
@IsIn([1, -1])
|
||||
@ValidateIf((o) => o.sortBy)
|
||||
@Transform(({ value: v }) => v | 0)
|
||||
@Field(() => Int)
|
||||
sortOrder?: 1 | -1
|
||||
}
|
||||
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
import { ArgsType, Field, ID, Int } from '@nestjs/graphql'
|
||||
import { Transform } from 'class-transformer'
|
||||
import { IsInt, IsMongoId, IsOptional, IsString, Min } from 'class-validator'
|
||||
|
||||
@ArgsType()
|
||||
export class NidOrIdArgsDto {
|
||||
@IsInt()
|
||||
@Field(() => Int)
|
||||
@Min(1)
|
||||
@IsOptional()
|
||||
@Transform(({ value: v }) => v | 0)
|
||||
nid?: number
|
||||
|
||||
@Field(() => ID)
|
||||
@IsMongoId()
|
||||
@IsOptional()
|
||||
id?: string
|
||||
}
|
||||
|
||||
@ArgsType()
|
||||
export class PasswordArgsDto {
|
||||
@IsString()
|
||||
@IsOptional()
|
||||
password?: string
|
||||
}
|
||||
@@ -1,12 +1,3 @@
|
||||
/*
|
||||
* @Author: Innei
|
||||
* @Date: 2021-01-01 13:25:04
|
||||
* @LastEditTime: 2021-03-12 11:13:52
|
||||
* @LastEditors: Innei
|
||||
* @FilePath: /server/libs/db/src/models/note.model.ts
|
||||
* Mark: Coding with Love
|
||||
*/
|
||||
import { Field, ObjectType } from '@nestjs/graphql'
|
||||
import { PartialType } from '@nestjs/mapped-types'
|
||||
import { AutoIncrementID } from '@typegoose/auto-increment'
|
||||
import { index, modelOptions, plugin, prop } from '@typegoose/typegoose'
|
||||
@@ -27,7 +18,6 @@ import {
|
||||
} from '~/shared/model/base.model'
|
||||
|
||||
@modelOptions({ schemaOptions: { id: false, _id: false } })
|
||||
@ObjectType()
|
||||
export class Coordinate {
|
||||
@IsNumber()
|
||||
@prop()
|
||||
@@ -43,7 +33,6 @@ export class Coordinate {
|
||||
_id: false,
|
||||
},
|
||||
})
|
||||
@ObjectType()
|
||||
export class NoteMusic {
|
||||
@IsString()
|
||||
@IsNotEmpty()
|
||||
@@ -68,7 +57,6 @@ export class NoteMusic {
|
||||
@index({ text: 'text' })
|
||||
@index({ modified: -1 })
|
||||
@index({ nid: -1 })
|
||||
@ObjectType()
|
||||
export class NoteModel extends WriteBaseModel {
|
||||
@prop()
|
||||
@IsString()
|
||||
@@ -117,7 +105,6 @@ export class NoteModel extends WriteBaseModel {
|
||||
@ValidateNested()
|
||||
@Type(() => Coordinate)
|
||||
@IsOptional()
|
||||
@Field(() => Coordinate, { nullable: true })
|
||||
coordinates?: Coordinate
|
||||
|
||||
@prop({ select: false })
|
||||
@@ -126,14 +113,12 @@ export class NoteModel extends WriteBaseModel {
|
||||
location?: string
|
||||
|
||||
@prop({ type: CountMixed, default: { read: 0, like: 0 }, _id: false })
|
||||
@Field(() => CountMixed, { nullable: true })
|
||||
count?: CountMixed
|
||||
|
||||
@prop({ type: [NoteMusic] })
|
||||
@ValidateNested({ each: true })
|
||||
@IsOptional()
|
||||
@Type(() => NoteMusic)
|
||||
@Field(() => [NoteMusic], { nullable: true })
|
||||
music?: NoteMusic[]
|
||||
|
||||
static get protectedKeys() {
|
||||
@@ -143,17 +128,14 @@ export class NoteModel extends WriteBaseModel {
|
||||
|
||||
export class PartialNoteModel extends PartialType(NoteModel) {}
|
||||
|
||||
@ObjectType()
|
||||
export class NoteItemAggregateModel {
|
||||
@Field(() => NoteModel)
|
||||
data: NoteModel
|
||||
@Field(() => NoteModel, { nullable: true })
|
||||
|
||||
prev?: NoteModel
|
||||
@Field(() => NoteModel, { nullable: true })
|
||||
|
||||
next?: NoteModel
|
||||
}
|
||||
|
||||
@ObjectType()
|
||||
export class NotePaginatorModel {
|
||||
data: NoteModel[]
|
||||
pagination: Paginator
|
||||
|
||||
@@ -1,12 +1,11 @@
|
||||
import { Module } from '@nestjs/common'
|
||||
import { GatewayModule } from '~/processors/gateway/gateway.module'
|
||||
import { NoteController } from './note.controller'
|
||||
import { NoteResolver } from './note.resolver'
|
||||
import { NoteService } from './note.service'
|
||||
|
||||
@Module({
|
||||
controllers: [NoteController],
|
||||
providers: [NoteService, NoteResolver],
|
||||
providers: [NoteService],
|
||||
exports: [NoteService],
|
||||
imports: [GatewayModule],
|
||||
})
|
||||
|
||||
@@ -1,106 +0,0 @@
|
||||
import {
|
||||
ForbiddenException,
|
||||
UnprocessableEntityException,
|
||||
} from '@nestjs/common'
|
||||
import { Args, Query, Resolver } from '@nestjs/graphql'
|
||||
import { DocumentType } from '@typegoose/typegoose'
|
||||
import { IsMaster } from '~/common/decorator/role.decorator'
|
||||
import { VisitDocument } from '~/common/decorator/update-count.decorator'
|
||||
import { CannotFindException } from '~/common/exceptions/cant-find.exception'
|
||||
import {
|
||||
addConditionToSeeHideContent,
|
||||
addYearCondition,
|
||||
} from '~/utils/query.util'
|
||||
import { transformDataToPaginate } from '~/utils/transfrom.util'
|
||||
import { NoteQueryDto } from './note.dto'
|
||||
import { NidOrIdArgsDto, PasswordArgsDto } from './note.input'
|
||||
import {
|
||||
NoteItemAggregateModel,
|
||||
NoteModel,
|
||||
NotePaginatorModel,
|
||||
} from './note.model'
|
||||
import { NoteService } from './note.service'
|
||||
|
||||
@Resolver()
|
||||
export class NoteResolver {
|
||||
constructor(private readonly service: NoteService) {}
|
||||
|
||||
@Query(() => NoteItemAggregateModel)
|
||||
@VisitDocument('Note')
|
||||
async getNoteById(
|
||||
@Args() args: NidOrIdArgsDto,
|
||||
@IsMaster() isMaster: boolean,
|
||||
@Args() { password }: PasswordArgsDto,
|
||||
) {
|
||||
const { id, nid } = args
|
||||
if (!id && !nid) {
|
||||
throw new UnprocessableEntityException('id or nid must choice one')
|
||||
}
|
||||
const currentNote = (await this.service.findOneByIdOrNid(
|
||||
id ?? nid,
|
||||
)) as DocumentType<NoteModel>
|
||||
|
||||
if (!currentNote) {
|
||||
throw new CannotFindException()
|
||||
}
|
||||
if (
|
||||
(!this.service.checkPasswordToAccess(currentNote, password) ||
|
||||
currentNote.hide) &&
|
||||
!isMaster
|
||||
) {
|
||||
throw new ForbiddenException('不要偷看人家的小心思啦~')
|
||||
}
|
||||
const condition = addConditionToSeeHideContent(isMaster)
|
||||
const prev = await this.service.model
|
||||
.findOne({
|
||||
...condition,
|
||||
created: {
|
||||
$gt: currentNote.created,
|
||||
},
|
||||
})
|
||||
.sort({ created: 1 })
|
||||
|
||||
const next = await this.service.model
|
||||
.findOne({
|
||||
...condition,
|
||||
created: {
|
||||
$lt: currentNote.created,
|
||||
},
|
||||
})
|
||||
.sort({ created: -1 })
|
||||
|
||||
return { data: currentNote, next, prev }
|
||||
}
|
||||
|
||||
@Query(() => NoteItemAggregateModel)
|
||||
@VisitDocument('Note')
|
||||
async getLastestNote(@IsMaster() isMaster: boolean) {
|
||||
const doc = (await this.service.model
|
||||
.findOne({ ...addConditionToSeeHideContent(isMaster) })
|
||||
.sort({ created: -1 })) as DocumentType<NoteModel>
|
||||
if (!doc) {
|
||||
throw new CannotFindException()
|
||||
}
|
||||
const id = doc._id.toString()
|
||||
return await this.getNoteById({ id }, isMaster, {})
|
||||
}
|
||||
|
||||
@Query(() => NotePaginatorModel)
|
||||
async getNotesWithPager(
|
||||
@Args() args: NoteQueryDto,
|
||||
@IsMaster() isMaster: boolean,
|
||||
) {
|
||||
const { page, size, sortBy, sortOrder, year } = args
|
||||
const condition = {
|
||||
...addConditionToSeeHideContent(isMaster),
|
||||
...addYearCondition(year),
|
||||
}
|
||||
return transformDataToPaginate(
|
||||
await this.service.model.paginate(condition, {
|
||||
limit: size,
|
||||
page,
|
||||
sort: sortBy ? { [sortBy]: sortOrder || -1 } : { created: -1 },
|
||||
}),
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -1,9 +1,7 @@
|
||||
import { ArgsType, Field, Int } from '@nestjs/graphql'
|
||||
import { Transform } from 'class-transformer'
|
||||
import { IsEnum, IsOptional, IsString, ValidateIf } from 'class-validator'
|
||||
import { PagerDto } from '~/shared/dto/pager.dto'
|
||||
|
||||
@ArgsType()
|
||||
export class PostQueryDto extends PagerDto {
|
||||
@IsOptional()
|
||||
@IsEnum(['categoryId', 'title', 'created', 'modified'])
|
||||
@@ -14,11 +12,9 @@ export class PostQueryDto extends PagerDto {
|
||||
@IsEnum([1, -1])
|
||||
@ValidateIf((o) => o.sortBy)
|
||||
@Transform(({ value: v }) => v | 0)
|
||||
@Field(() => Int)
|
||||
readonly sortOrder?: 1 | -1
|
||||
}
|
||||
|
||||
@ArgsType()
|
||||
export class CategoryAndSlugDto {
|
||||
@IsString()
|
||||
readonly category: string
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import { Field, ObjectType } from '@nestjs/graphql'
|
||||
import { PartialType } from '@nestjs/mapped-types'
|
||||
import { ApiHideProperty, ApiProperty } from '@nestjs/swagger'
|
||||
import {
|
||||
@@ -25,10 +24,7 @@ import {
|
||||
Paginator,
|
||||
WriteBaseModel,
|
||||
} from '~/shared/model/base.model'
|
||||
import {
|
||||
CategoryModel as Category,
|
||||
CategoryModel,
|
||||
} from '../category/category.model'
|
||||
import { CategoryModel as Category } from '../category/category.model'
|
||||
|
||||
function autoPopulateCategory(
|
||||
this: Query<
|
||||
@@ -49,7 +45,6 @@ function autoPopulateCategory(
|
||||
@index({ modified: -1 })
|
||||
@index({ text: 'text' })
|
||||
@modelOptions({ options: { customName: 'Post', allowMixed: Severity.ALLOW } })
|
||||
@ObjectType()
|
||||
export class PostModel extends WriteBaseModel {
|
||||
@prop({ trim: true, unique: true, required: true })
|
||||
@IsString()
|
||||
@@ -65,7 +60,6 @@ export class PostModel extends WriteBaseModel {
|
||||
@prop({ ref: () => Category, required: true })
|
||||
@IsMongoId()
|
||||
@ApiProperty({ example: '5eb2c62a613a5ab0642f1f7a' })
|
||||
@Field(() => String)
|
||||
categoryId: Ref<Category>
|
||||
|
||||
@prop({
|
||||
@@ -75,7 +69,6 @@ export class PostModel extends WriteBaseModel {
|
||||
justOne: true,
|
||||
})
|
||||
@ApiHideProperty()
|
||||
@Field(() => CategoryModel, { nullable: true })
|
||||
public category: Ref<Category>
|
||||
|
||||
@prop({ default: false })
|
||||
@@ -98,7 +91,6 @@ export class PostModel extends WriteBaseModel {
|
||||
tags?: string[]
|
||||
@prop({ type: Count, default: { read: 0, like: 0 }, _id: false })
|
||||
@ApiHideProperty()
|
||||
@Field(() => Count, { nullable: true })
|
||||
count?: Count
|
||||
|
||||
static get protectedKeys() {
|
||||
@@ -108,7 +100,6 @@ export class PostModel extends WriteBaseModel {
|
||||
|
||||
export class PartialPostModel extends PartialType(PostModel) {}
|
||||
|
||||
@ObjectType()
|
||||
export class PostPaginatorModel {
|
||||
data: PostModel[]
|
||||
pagination: Paginator
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
import { forwardRef, Module } from '@nestjs/common'
|
||||
import { CategoryModule } from '../category/category.module'
|
||||
import { PostController } from './post.controller'
|
||||
import { PostResolver } from './post.resolver'
|
||||
import { PostService } from './post.service'
|
||||
|
||||
@Module({
|
||||
imports: [forwardRef(() => CategoryModule)],
|
||||
controllers: [PostController],
|
||||
providers: [PostService, PostResolver],
|
||||
providers: [PostService],
|
||||
exports: [PostService],
|
||||
})
|
||||
export class PostModule {}
|
||||
|
||||
@@ -1,79 +0,0 @@
|
||||
import { NotFoundException } from '@nestjs/common'
|
||||
import { Args, Query, Resolver } from '@nestjs/graphql'
|
||||
import { IsMaster } from '~/common/decorator/role.decorator'
|
||||
import { VisitDocument } from '~/common/decorator/update-count.decorator'
|
||||
import { CannotFindException } from '~/common/exceptions/cant-find.exception'
|
||||
import { MongoIdDto } from '~/shared/dto/id.dto'
|
||||
import {
|
||||
addConditionToSeeHideContent,
|
||||
addYearCondition,
|
||||
} from '~/utils/query.util'
|
||||
import { transformDataToPaginate } from '~/utils/transfrom.util'
|
||||
import { CategoryAndSlugDto, PostQueryDto } from './post.dto'
|
||||
import { PostModel, PostPaginatorModel } from './post.model'
|
||||
import { PostService } from './post.service'
|
||||
|
||||
@Resolver()
|
||||
export class PostResolver {
|
||||
constructor(private readonly postService: PostService) {}
|
||||
|
||||
@Query(() => PostModel)
|
||||
@VisitDocument('Post')
|
||||
public async getPostById(
|
||||
@Args() { id }: MongoIdDto,
|
||||
@IsMaster() isMaster: boolean,
|
||||
) {
|
||||
return this.postService.model
|
||||
.findOne({ _id: id, ...addConditionToSeeHideContent(isMaster) })
|
||||
.populate('category')
|
||||
}
|
||||
|
||||
@Query(() => PostPaginatorModel)
|
||||
public async getPostList(
|
||||
@IsMaster() isMaster: boolean,
|
||||
@Args() args: PostQueryDto,
|
||||
) {
|
||||
const { size, select, page, year, sortBy, sortOrder } = args
|
||||
|
||||
const res = await this.postService.findWithPaginator(
|
||||
{
|
||||
...addYearCondition(year),
|
||||
...addConditionToSeeHideContent(isMaster),
|
||||
},
|
||||
{
|
||||
limit: size,
|
||||
page,
|
||||
select,
|
||||
sort: sortBy ? { [sortBy]: sortOrder || -1 } : { created: -1 },
|
||||
},
|
||||
)
|
||||
|
||||
return transformDataToPaginate(res)
|
||||
}
|
||||
|
||||
@Query(() => PostModel)
|
||||
@VisitDocument('Post')
|
||||
async getByCateAndSlug(
|
||||
@Args() args: CategoryAndSlugDto,
|
||||
@IsMaster() isMaster: boolean,
|
||||
) {
|
||||
const { category, slug } = args
|
||||
|
||||
const categoryDocument = await this.postService.getCategoryBySlug(category)
|
||||
if (!categoryDocument) {
|
||||
throw new NotFoundException('该分类未找到 (。•́︿•̀。)')
|
||||
}
|
||||
|
||||
const postDocument = await this.postService.model
|
||||
.findOne({
|
||||
slug,
|
||||
categoryId: categoryDocument._id,
|
||||
})
|
||||
.populate('category')
|
||||
|
||||
if (!postDocument || (postDocument.hide && !isMaster)) {
|
||||
throw new CannotFindException()
|
||||
}
|
||||
return postDocument
|
||||
}
|
||||
}
|
||||
@@ -1,9 +1,7 @@
|
||||
import { ObjectType } from '@nestjs/graphql'
|
||||
import { modelOptions, prop } from '@typegoose/typegoose'
|
||||
import { IsOptional, IsString } from 'class-validator'
|
||||
import { BaseModel } from '~/shared/model/base.model'
|
||||
|
||||
@ObjectType()
|
||||
@modelOptions({
|
||||
options: {
|
||||
customName: 'Recently',
|
||||
|
||||
@@ -1,14 +1,11 @@
|
||||
import { UnprocessableEntityException } from '@nestjs/common'
|
||||
import { ArgsType, Field, ID } from '@nestjs/graphql'
|
||||
import { ApiProperty } from '@nestjs/swagger'
|
||||
import { Transform } from 'class-transformer'
|
||||
import { IsDefined, isMongoId, IsMongoId } from 'class-validator'
|
||||
|
||||
@ArgsType()
|
||||
export class MongoIdDto {
|
||||
@IsMongoId()
|
||||
@ApiProperty({ example: '5e6f67e75b303781d2807278' })
|
||||
@Field(() => ID)
|
||||
id: string
|
||||
}
|
||||
|
||||
|
||||
@@ -1,13 +1,3 @@
|
||||
/*
|
||||
* @Author: Innei
|
||||
* @Date: 2020-06-06 18:28:53
|
||||
* @LastEditTime: 2020-07-12 11:06:06
|
||||
* @LastEditors: Innei
|
||||
* @FilePath: /mx-server/src/shared/base/dto/pager.dto.ts
|
||||
* @Coding with Love
|
||||
*/
|
||||
|
||||
import { ArgsType, Field, Int } from '@nestjs/graphql'
|
||||
import { ApiProperty } from '@nestjs/swagger'
|
||||
import { Expose, Transform } from 'class-transformer'
|
||||
import {
|
||||
@@ -21,7 +11,6 @@ import {
|
||||
ValidateIf,
|
||||
} from 'class-validator'
|
||||
|
||||
@ArgsType()
|
||||
export class PagerDto {
|
||||
@Min(1)
|
||||
@Max(50)
|
||||
@@ -31,7 +20,6 @@ export class PagerDto {
|
||||
toClassOnly: true,
|
||||
})
|
||||
@ApiProperty({ example: 10 })
|
||||
@Field(() => Int)
|
||||
size?: number
|
||||
|
||||
@Transform(({ value: val }) => (val ? parseInt(val) : 1), {
|
||||
@@ -41,7 +29,6 @@ export class PagerDto {
|
||||
@IsInt()
|
||||
@Expose()
|
||||
@ApiProperty({ example: 1 })
|
||||
@Field(() => Int)
|
||||
page?: number
|
||||
|
||||
@IsOptional()
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import { Field, ID, ObjectType } from '@nestjs/graphql'
|
||||
import { ApiHideProperty } from '@nestjs/swagger'
|
||||
import { modelOptions, plugin, prop } from '@typegoose/typegoose'
|
||||
import { Type } from 'class-transformer'
|
||||
@@ -29,12 +28,10 @@ import Paginate from 'mongoose-paginate-v2'
|
||||
},
|
||||
},
|
||||
})
|
||||
@ObjectType()
|
||||
export class BaseModel {
|
||||
@ApiHideProperty()
|
||||
@Field(() => Date)
|
||||
created?: Date
|
||||
@Field(() => ID)
|
||||
|
||||
@ApiHideProperty()
|
||||
id?: string
|
||||
|
||||
@@ -43,7 +40,6 @@ export class BaseModel {
|
||||
}
|
||||
}
|
||||
|
||||
@ObjectType()
|
||||
export class Paginator {
|
||||
/**
|
||||
* 总条数
|
||||
@@ -68,7 +64,6 @@ export class Paginator {
|
||||
@modelOptions({
|
||||
schemaOptions: { _id: false },
|
||||
})
|
||||
@ObjectType()
|
||||
abstract class ImageModel {
|
||||
@prop()
|
||||
@IsOptional()
|
||||
@@ -96,7 +91,6 @@ abstract class ImageModel {
|
||||
src: string
|
||||
}
|
||||
|
||||
@ObjectType()
|
||||
export abstract class BaseCommentIndexModel extends BaseModel {
|
||||
@prop({ default: 0 })
|
||||
@ApiHideProperty()
|
||||
@@ -112,7 +106,6 @@ export abstract class BaseCommentIndexModel extends BaseModel {
|
||||
}
|
||||
}
|
||||
|
||||
@ObjectType()
|
||||
export class WriteBaseModel extends BaseCommentIndexModel {
|
||||
@prop({ trim: true, index: true, required: true })
|
||||
@IsString()
|
||||
@@ -125,7 +118,6 @@ export class WriteBaseModel extends BaseCommentIndexModel {
|
||||
|
||||
@prop({ type: ImageModel })
|
||||
@ApiHideProperty()
|
||||
@Field(() => ImageModel, { nullable: true })
|
||||
@IsOptional()
|
||||
@ValidateNested()
|
||||
@Type(() => ImageModel)
|
||||
@@ -133,7 +125,6 @@ export class WriteBaseModel extends BaseCommentIndexModel {
|
||||
|
||||
@prop({ default: null })
|
||||
@ApiHideProperty()
|
||||
@Field(() => Date, { nullable: true })
|
||||
modified: Date | null
|
||||
|
||||
static get protectedKeys() {
|
||||
@@ -145,7 +136,6 @@ export class WriteBaseModel extends BaseCommentIndexModel {
|
||||
schemaOptions: { id: false, _id: false },
|
||||
options: { customName: 'count' },
|
||||
})
|
||||
@ObjectType()
|
||||
export class CountMixed {
|
||||
@prop({ default: 0 })
|
||||
read?: number
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
import { ExecutionContext } from '@nestjs/common'
|
||||
import { GqlExecutionContext } from '@nestjs/graphql'
|
||||
|
||||
export function getNestExecutionContextRequest(context: ExecutionContext) {
|
||||
const req = context.switchToHttp().getRequest<KV>()
|
||||
if (req) {
|
||||
return req
|
||||
}
|
||||
const ctx = GqlExecutionContext.create(context)
|
||||
return ctx.getContext().req
|
||||
import type { FastifyRequest } from 'fastify'
|
||||
export function getNestExecutionContextRequest(
|
||||
context: ExecutionContext,
|
||||
): FastifyRequest & KV {
|
||||
return context.switchToHttp().getRequest<FastifyRequest>()
|
||||
// if (req) {
|
||||
// return req
|
||||
// }
|
||||
// const ctx = GqlExecutionContext.create(context)
|
||||
// return ctx.getContext().req
|
||||
}
|
||||
|
||||
@@ -1,52 +0,0 @@
|
||||
import { GraphQLModule } from '@nestjs/graphql'
|
||||
import { NestFastifyApplication } from '@nestjs/platform-fastify'
|
||||
import { Test } from '@nestjs/testing'
|
||||
import { join } from 'path'
|
||||
import { AppResolver } from '~/app.resolver'
|
||||
import { fastifyApp } from '~/common/adapters/fastify.adapter'
|
||||
|
||||
describe('GQL test (e2e)', () => {
|
||||
let app: NestFastifyApplication
|
||||
|
||||
beforeAll(async () => {
|
||||
const moduleRef = await Test.createTestingModule({
|
||||
imports: [
|
||||
GraphQLModule.forRoot({
|
||||
autoSchemaFile: join(process.cwd(), 'schema.gql'),
|
||||
context: ({ req }) => ({ req }),
|
||||
}),
|
||||
AppResolver,
|
||||
],
|
||||
}).compile()
|
||||
app = moduleRef.createNestApplication<NestFastifyApplication>(fastifyApp)
|
||||
await app.init()
|
||||
await app.getHttpAdapter().getInstance().ready()
|
||||
})
|
||||
|
||||
it('GET /graphql', () => {
|
||||
return app
|
||||
.inject({
|
||||
method: 'post',
|
||||
url: '/graphql',
|
||||
payload: {
|
||||
operationName: null,
|
||||
variables: {},
|
||||
query: ` {
|
||||
sayHello
|
||||
}`,
|
||||
},
|
||||
})
|
||||
.then((res) => {
|
||||
expect(res.statusCode).toBe(200)
|
||||
expect(res.json()).toStrictEqual({
|
||||
data: {
|
||||
sayHello: 'Hello World!',
|
||||
},
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
afterAll(async () => {
|
||||
await app.close()
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user