feat(server): add compatibility field (#4022)

This commit is contained in:
Alex Yang
2023-08-29 16:30:59 -05:00
committed by GitHub
parent e3b105f1cd
commit 71b195d9a9
4 changed files with 74 additions and 62 deletions

View File

@@ -1,13 +1,13 @@
import { Controller, Get } from '@nestjs/common';
import pkg from '../package.json' assert { type: 'json' };
@Controller('/')
export class AppController {
@Get()
hello() {
info() {
const version = AFFiNE.version;
return {
message: `AFFiNE GraphQL server: ${pkg.version}`,
compatibility: version,
message: `AFFiNE ${version} Server`,
};
}
}

View File

@@ -1,4 +1,4 @@
import type { INestApplication, LoggerService } from '@nestjs/common';
import type { INestApplication } from '@nestjs/common';
import { Test } from '@nestjs/testing';
import { PrismaClient } from '@prisma/client';
// @ts-expect-error graphql-upload is not typed
@@ -10,28 +10,6 @@ import type { TokenType } from '../modules/auth';
import type { UserType } from '../modules/users';
import type { InvitationType, WorkspaceType } from '../modules/workspaces';
export class NestDebugLogger implements LoggerService {
log(message: string): any {
console.log(message);
}
error(message: string, trace: string): any {
console.error(message, trace);
}
warn(message: string): any {
console.warn(message);
}
debug(message: string): any {
console.debug(message);
}
verbose(message: string): any {
console.log(message);
}
}
const gql = '/graphql';
async function signUp(