This commit is contained in:
2023-09-23 16:24:32 +00:00
parent ffd3ab681e
commit bfbc0134de
31 changed files with 304 additions and 181 deletions
-1
View File
@@ -61,7 +61,6 @@ export const structure = {
token_id: number, token_id: number,
}, AutoLoginResponse, AutoLoginFailed>(), }, AutoLoginResponse, AutoLoginFailed>(),
ReqNonce: GET<AutoLoginNonceResponse, AutoLoginFailed>(), ReqNonce: GET<AutoLoginNonceResponse, AutoLoginFailed>(),
test: GET<{result: true, hello:'world'}>(),
}, },
GetGameLoginToken: GET<{ GetGameLoginToken: GET<{
result: true, result: true,
+2
View File
@@ -17,6 +17,7 @@
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@popperjs/core": "^2.11.8", "@popperjs/core": "^2.11.8",
"@sammo/game_logic": "workspace:^",
"@sammo/util": "workspace:^", "@sammo/util": "workspace:^",
"@strpc/def": "workspace:^", "@strpc/def": "workspace:^",
"bootstrap": "^5.3.1", "bootstrap": "^5.3.1",
@@ -30,6 +31,7 @@
"vue-router": "^4.2.4" "vue-router": "^4.2.4"
}, },
"devDependencies": { "devDependencies": {
"@tsconfig/node20": "^20.1.2",
"@types/lodash-es": "^4.17.9", "@types/lodash-es": "^4.17.9",
"@types/node": "^20.6.3", "@types/node": "^20.6.3",
"@vue/eslint-config-prettier": "^8.0.0", "@vue/eslint-config-prettier": "^8.0.0",
+1 -1
View File
@@ -1,5 +1,5 @@
{ {
"extends": "@tsconfig/node18/tsconfig.json", "extends": "@tsconfig/node20/tsconfig.json",
"include": [ "include": [
"vite.config.*", "vite.config.*",
"vitest.config.*", "vitest.config.*",
+1
View File
@@ -30,6 +30,7 @@
"vue-router": "^4.2.4" "vue-router": "^4.2.4"
}, },
"devDependencies": { "devDependencies": {
"@tsconfig/node20": "^20.1.2",
"@types/lodash-es": "^4.17.9", "@types/lodash-es": "^4.17.9",
"@types/node": "^20.6.3", "@types/node": "^20.6.3",
"@vue/eslint-config-prettier": "^8.0.0", "@vue/eslint-config-prettier": "^8.0.0",
+1 -1
View File
@@ -1,5 +1,5 @@
{ {
"extends": "@tsconfig/node18/tsconfig.json", "extends": "@tsconfig/node20/tsconfig.json",
"include": [ "include": [
"vite.config.*", "vite.config.*",
"vitest.config.*", "vitest.config.*",
+11 -1
View File
@@ -15,13 +15,23 @@
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@sammo/api_def": "workspace:^", "@sammo/api_def": "workspace:^",
"@sammo/crypto": "workspace:^",
"@sammo/server_util": "workspace:^", "@sammo/server_util": "workspace:^",
"@sammo/util": "workspace:^", "@sammo/util": "workspace:^",
"@strpc/express": "workspace:^", "@strpc/express": "workspace:^",
"date-fns": "^2.30.0",
"dotenv": "^16.3.1", "dotenv": "^16.3.1",
"mongoose": "^7.4.3" "express": "^4.18.2",
"express-session": "^1.17.3",
"lodash-es": "^4.17.21",
"mongoose": "^7.4.3",
"reflect-metadata": "^0.1.13",
"tslib": "^2.6.2",
"zod": "^3.22.2"
}, },
"devDependencies": { "devDependencies": {
"@types/express": "^4.17.17",
"@types/express-session": "^1.17.7",
"@types/node": "^20.6.3" "@types/node": "^20.6.3"
} }
} }
@@ -47,7 +47,8 @@ export const LoginByID = POST<BaseAPI>(LoginByIDReq)(declProcDecorators(
userID, userID,
userName, userName,
userLevel, userLevel,
allowServerAction: new Set(), allowServerAction: new Map(),
allowGatewayAction: new Set(),
loginDate: new Date(), loginDate: new Date(),
} }
@@ -3,7 +3,8 @@ import { StartSession } from "@sammo/server_util";
import { POST, type APIReturnType } from "@strpc/express"; import { POST, type APIReturnType } from "@strpc/express";
import { declProcDecorators } from "@strpc/express/proc_decorator"; import { declProcDecorators } from "@strpc/express/proc_decorator";
import { z } from "zod"; import { z } from "zod";
import { loginCtxSessionKey, type GatewayLoginCtx } from "../../procDecorator/ReqGatewayLogin.js"; import { loginCtxSessionKey, type GatewayLoginCtx } from "@/procDecorator/ReqGatewayLogin.js";
import { delay } from "@sammo/util";
type BaseAPI = typeof structure.Login.LoginByToken; type BaseAPI = typeof structure.Login.LoginByToken;
type RType = APIReturnType<BaseAPI>; type RType = APIReturnType<BaseAPI>;
@@ -16,7 +17,7 @@ const LoginByTokenReq = z.object({
export const LoginByToken = POST<BaseAPI>(LoginByTokenReq)(declProcDecorators( export const LoginByToken = POST<BaseAPI>(LoginByTokenReq)(declProcDecorators(
StartSession, StartSession,
)) ))
(async (query, ctx) => { (async (query, ctx): RType => {
query.hashedToken; query.hashedToken;
ctx.session.clear(); ctx.session.clear();
@@ -33,6 +34,7 @@ export const LoginByToken = POST<BaseAPI>(LoginByTokenReq)(declProcDecorators(
userName, userName,
userLevel, userLevel,
allowServerAction: new Map(), allowServerAction: new Map(),
allowGatewayAction: new Set(),
loginDate: new Date(), loginDate: new Date(),
} }
@@ -3,11 +3,9 @@ import type { APINamespaceType } from "@strpc/express";
import { LoginByID } from "./LoginByID.js"; import { LoginByID } from "./LoginByID.js";
import { LoginByToken } from "./LoginByToken.js"; import { LoginByToken } from "./LoginByToken.js";
import { ReqNonce } from "./ReqNonce.js"; import { ReqNonce } from "./ReqNonce.js";
import { test } from "./test.js";
export const Login = { export const Login = {
LoginByID, LoginByID,
LoginByToken, LoginByToken,
ReqNonce, ReqNonce,
test,
} satisfies APINamespaceType<typeof structure.Login>; } satisfies APINamespaceType<typeof structure.Login>;
+1 -1
View File
@@ -31,7 +31,7 @@ function generateConfig() {
return { return {
port: parseInt(process.env['SERVER_PORT'] ?? "3001"), port: parseInt(process.env['SERVER_PORT'] ?? "3001"),
sessionSecret: unwrap(process.env['SESSION_SECRET']), sessionSecret: unwrap(process.env['SESSION_SECRET']),
apiRootPath: process.env['API_ROOT_PATH'] ?? '/api/gateway', apiRootPath: process.env['API_ROOT_PATH'] ?? '/api',
} as const; } as const;
} }
+2 -2
View File
@@ -2,8 +2,8 @@ export type {
ServerActionType, ServerActionType,
UserIDType, UserIDType,
IUser, IUser,
} from "./schema/User.ts"; } from "./schema/User.js";
export type { export type {
ILoginToken ILoginToken
} from "./schema/LoginToken.ts"; } from "./schema/LoginToken.js";
@@ -1,7 +0,0 @@
import 'dotenv/config';
import { unwrap } from "@sammo/util";
export const gatewayConfig = {
sessionSecret: unwrap(process.env.GATEWAY_SESSION_SECRET),
port: Number(unwrap(process.env.GATEWAY_PORT)),
};
+5 -5
View File
@@ -1,15 +1,15 @@
import './dotenv.js' import './dotenv.js'
import { ownConfig } from './dotenv.js';
import 'reflect-metadata'; import 'reflect-metadata';
import gatewayDB from './connectDB.js'; import gatewayDB from './connectDB.js';
import express, { type Request, type Response } from "express" import express, { type Request, type Response } from "express"
import session from "express-session"; import session from "express-session";
import { buildAPISystem } from '@strpc/express/generator'; import { buildAPISystem } from '@strpc/express/generator';
//import { sammoGatewayAPI } from './api/index.js'; import { sammoGatewayAPI } from './api/index.js';
import { unwrap } from '@sammo/util';; import { unwrap } from '@sammo/util';
import { gatewayConfig } from './gatewayConfig.js';
const gatewayConfig = ownConfig();
gatewayDB.then(async (gatewayDB) => { gatewayDB.then(async (gatewayDB) => {
// create express app // create express app
@@ -22,7 +22,7 @@ gatewayDB.then(async (gatewayDB) => {
})) }))
//app.set('etag', false); //app.set('etag', false);
//app.use('/gateway_api', buildAPISystem(sammoGatewayAPI)); app.use('/gateway_api', buildAPISystem(sammoGatewayAPI));
// start express server // start express server
app.listen(gatewayConfig.port) app.listen(gatewayConfig.port)
+6
View File
@@ -3,11 +3,17 @@
"compilerOptions": { "compilerOptions": {
"rootDir": "./src", "rootDir": "./src",
"outDir": "./dist", "outDir": "./dist",
"paths": {
"@/*": ["./src/*"]
}
}, },
"references": [ "references": [
{ {
"path": "../../@strpc/express" "path": "../../@strpc/express"
}, },
{
"path": "../api_def"
},
{ {
"path": "../util" "path": "../util"
}, },
+3 -1
View File
@@ -29,7 +29,9 @@
"zod": "^3.22.2" "zod": "^3.22.2"
}, },
"devDependencies": { "devDependencies": {
"@sammo/gateway": "workspace:^", "@types/express": "^4.17.17",
"@types/express-session": "^1.17.7",
"@sammo/gateway_server": "workspace:^",
"@types/node": "^20.6.3" "@types/node": "^20.6.3"
} }
} }
+25
View File
@@ -0,0 +1,25 @@
import type { StateIncrementer } from '@sammo/server_util';
import SchemaSequence from './schema/SchemaSequence.js';
import { InvalidArgument } from '@sammo/util';
export function MongoSequenceFactory(collectionName: string): StateIncrementer{
return async (increase: number) => {
if(increase <= 0){
throw new InvalidArgument('increase must be > 0');
}
increase = Math.ceil(increase);
const result = await SchemaSequence.findOneAndUpdate({
collectionName,
}, {
$inc: {
nextSeq: increase,
},
}, {
upsert: true,
new: true,
});
return result.nextSeq;
}
}
+1 -1
View File
@@ -1,6 +1,6 @@
import 'dotenv/config'; import 'dotenv/config';
import { connect, Mongoose } from "mongoose"; import { connect, Mongoose } from "mongoose";
import { unwrap } from './util/unwrap.js'; import { unwrap } from '@sammo/util';
const dbConfig = { const dbConfig = {
host: unwrap(process.env.GAME_DB_HOST), host: unwrap(process.env.GAME_DB_HOST),
+3
View File
@@ -0,0 +1,3 @@
import { resolve } from "node:path";
export const rootPath = resolve(resolve(), '../..');
+49
View File
@@ -0,0 +1,49 @@
import dotenv from 'dotenv';
import { rootPath } from './constPath.js';
import { unwrap } from '@sammo/util';
let init = false;
const dirPath = rootPath
console.log(rootPath);
function initDotEnv() {
if (process.env['NODE_ENV'] == 'production') {
dotenv.config({ path: `${dirPath}/.env.production.local` });
dotenv.config({ path: `${dirPath}/.env.local` });
dotenv.config({ path: `${dirPath}/.env.production` });
}
else {
dotenv.config({ path: `${dirPath}/.env.development.local` });
dotenv.config({ path: `${dirPath}/.env.local` });
dotenv.config({ path: `${dirPath}/.env.development` });
}
dotenv.config();
init = true;
}
if (!init) {
initDotEnv();
}
let _ownConfig: ReturnType<typeof generateConfig>|undefined = undefined;
function generateConfig() {
return {
port: parseInt(process.env['SERVER_PORT'] ?? "3001"),
sessionSecret: unwrap(process.env['SESSION_SECRET']),
gatewayHost: unwrap(process.env.GATEWAY_HOST),
gatewayPort: Number(unwrap(process.env.GATEWAY_PORT)),
apiRootPath: process.env['API_ROOT_PATH'] ?? '/api',
} as const;
}
export function serverConfig() {
if(_ownConfig !== undefined){
return _ownConfig;
}
if(!init){
initDotEnv();
}
_ownConfig = generateConfig();
return _ownConfig;
}
@@ -1,6 +1,6 @@
import type { SessionCtx } from "@sammo/server_util";
import type { LoginCtx } from "./ReqLogin.js"; import type { LoginCtx } from "./ReqLogin.js";
import type { SessionCtx } from "./StartSession.js"; import type { ProcDecoratorGenerator } from "@strpc/express/proc_decorator";
import type { ProcDecoratorGenerator } from "./base.js";
export type GameLoginCtx = { export type GameLoginCtx = {
generalID: number; generalID: number;
@@ -12,11 +12,11 @@ export function ReqGameLogin<Q extends LoginCtx & SessionCtx>(): ProcDecoratorGe
return async (ctx) => { return async (ctx) => {
//NOTE: 게임 서버별로 gameLoginCtx를 따로 가져야 하는가? //NOTE: 게임 서버별로 gameLoginCtx를 따로 가져야 하는가?
let gameLoginCtx = ctx.session.getItem<GameLoginCtx>(`gameLoginCtx`); let gameLoginCtx = ctx.session.getItem<GameLoginCtx>(`gameLoginCtx`);
if(gameLoginCtx){ if (gameLoginCtx) {
if(gameLoginCtx.gameLoginDate >= ctx.loginDate){ if (gameLoginCtx.gameLoginDate >= ctx.loginDate) {
return [{ return [{
result: true, result: true,
},{ }, {
...gameLoginCtx, ...gameLoginCtx,
...ctx, ...ctx,
}]; }];
@@ -25,11 +25,12 @@ export function ReqGameLogin<Q extends LoginCtx & SessionCtx>(): ProcDecoratorGe
} }
//TODO: DB에서 generalID를 가져오는 로직 //TODO: DB에서 generalID를 가져오는 로직
return [{ return [{
result: false, result: false,
type: 'Required GameLogin', type: 'Required GameLogin',
info: 'NotYetImplemented' info: 'NotYetImplemented'
}, ctx]; }, {
...ctx
}];
} }
} }
+3 -3
View File
@@ -1,6 +1,6 @@
import type { ServerActionType } from "../schema/gateway/User.js"; import type { SessionCtx } from "@sammo/server_util";
import type { SessionCtx } from "./StartSession.js"; import type { ProcDecorator } from "@strpc/express/proc_decorator";
import type { ProcDecorator } from "./base.js"; import type { ServerActionType } from "@sammo/gateway_server/exports"
export type LoginCtx = { export type LoginCtx = {
userID: number; userID: number;
@@ -0,0 +1,23 @@
import { Schema, model, Types } from 'mongoose';
interface ISchemaSequence {
_id: Types.ObjectId;
collectionName: string;
nextSeq: number;
}
export const SchemaSequence = new Schema<ISchemaSequence>({
collectionName: { type: String, required: true },
nextSeq: {
type: Number, required: true,
get: (v: number) => Math.ceil(v),
set: (v: number) => Math.ceil(v),
default: 0,
},
}, { autoIndex: true, autoCreate: true })
.index({ collectionName: 1 }, { unique: true })
;
export default model<ISchemaSequence>('SchemaSequence', SchemaSequence);
+9
View File
@@ -3,6 +3,9 @@
"compilerOptions": { "compilerOptions": {
"rootDir": "./src", "rootDir": "./src",
"outDir": "./dist", "outDir": "./dist",
"paths": {
"@/*": ["./src/*"]
}
}, },
"references": [ "references": [
{ {
@@ -17,5 +20,11 @@
{ {
"path": "../server_util" "path": "../server_util"
}, },
{
"path": "../api_def"
},
{
"path": "../gateway_server"
}
] ]
} }
+1
View File
@@ -16,6 +16,7 @@
"@strpc/express": "workspace:^" "@strpc/express": "workspace:^"
}, },
"devDependencies": { "devDependencies": {
"@types/express-session": "^1.17.7",
"lodash-es": "^4.17.21" "lodash-es": "^4.17.21"
}, },
"peerDependencies": { "peerDependencies": {
+1 -1
View File
@@ -1,5 +1,5 @@
import type { Empty, ProcDecoratorGenerator } from "@strpc/express/proc_decorator"; import type { Empty, ProcDecoratorGenerator } from "@strpc/express/proc_decorator";
import { type Session, type SessionData } from "express-session"; import type { Session, SessionData } from "express-session";
export type SessionCtx = { export type SessionCtx = {
session: { session: {
+1
View File
@@ -18,6 +18,7 @@
"@strpc/def": "workspace:^" "@strpc/def": "workspace:^"
}, },
"devDependencies": { "devDependencies": {
"@types/express": "^4.17.17",
"express": "^4.18.2", "express": "^4.18.2",
"express-session": "^1.17.3", "express-session": "^1.17.3",
"lodash-es": "^4.17.21", "lodash-es": "^4.17.21",
+3 -3
View File
@@ -1,7 +1,7 @@
import { Router, type Request, type Response } from 'express'; import { Router, type Request, type Response } from 'express';
import type { AnyAPIExecuter, APINamespace } from './defs.js'; import type { AnyAPIExecuter, APINamespace } from './defs.js';
import type { RawArgType } from '@strpc/def'; import type { RawArgType } from '@strpc/def';
import type { SafeParseReturnType, ZodType, z } from 'zod'; import type { SafeParseReturnType, ZodType } from 'zod';
import { flatten } from 'lodash-es'; import { flatten } from 'lodash-es';
const PRINT_API_CALL = true; const PRINT_API_CALL = true;
@@ -107,14 +107,14 @@ async function apiRun<Q extends RawArgType>(query: Q, req: Request, res: Respons
let tmp_result = true; let tmp_result = true;
let tmp_reason = undefined; let tmp_reason = undefined;
if('result' in result){ if('result' in result){
tmp_result = result.result; tmp_result = result.result;
} }
if('reason' in result){ if('reason' in result){
tmp_reason = result.reason; tmp_reason = result.reason;
} }
console.log(JSON.stringify([(new Date).toISOString(), req.ip, req.path, tmp_result, tmp_reason])); console.log(JSON.stringify([(new Date).toISOString(), req.ip, req.path, tmp_result, tmp_reason]));
} }
} }
if (result !== true) { if (result !== true) {
+1 -2
View File
@@ -21,8 +21,7 @@ export type DecoratorStack = DecoratorResult[];
export interface ProcDecorator<Out extends object, In extends object = Empty> { export interface ProcDecorator<Out extends object, In extends object = Empty> {
(inCtx: In & Partial<Out>, req: Request, res: Response) (inCtx: In & Partial<Out>, req: Request, res: Response)
: MayBePromise<[DecoratorResultTrue, Out]> : MayBePromise<[DecoratorResultTrue, Out] | [DecoratorResultFalse, In & Partial<Out>]>;
| MayBePromise<[DecoratorResultFalse, In & Partial<Out>]>;
} }
export interface PostProcDecorator<T extends object> { export interface PostProcDecorator<T extends object> {
+128 -1
View File
@@ -75,6 +75,9 @@ importers:
'@popperjs/core': '@popperjs/core':
specifier: ^2.11.8 specifier: ^2.11.8
version: 2.11.8 version: 2.11.8
'@sammo/game_logic':
specifier: workspace:^
version: link:../game_logic
'@sammo/util': '@sammo/util':
specifier: workspace:^ specifier: workspace:^
version: link:../util version: link:../util
@@ -109,6 +112,9 @@ importers:
specifier: ^4.2.4 specifier: ^4.2.4
version: 4.2.4(vue@3.3.4) version: 4.2.4(vue@3.3.4)
devDependencies: devDependencies:
'@tsconfig/node20':
specifier: ^20.1.2
version: 20.1.2
'@types/lodash-es': '@types/lodash-es':
specifier: ^4.17.9 specifier: ^4.17.9
version: 4.17.9 version: 4.17.9
@@ -262,6 +268,9 @@ importers:
specifier: ^4.2.4 specifier: ^4.2.4
version: 4.2.4(vue@3.3.4) version: 4.2.4(vue@3.3.4)
devDependencies: devDependencies:
'@tsconfig/node20':
specifier: ^20.1.2
version: 20.1.2
'@types/lodash-es': '@types/lodash-es':
specifier: ^4.17.9 specifier: ^4.17.9
version: 4.17.9 version: 4.17.9
@@ -307,6 +316,9 @@ importers:
'@sammo/api_def': '@sammo/api_def':
specifier: workspace:^ specifier: workspace:^
version: link:../api_def version: link:../api_def
'@sammo/crypto':
specifier: workspace:^
version: link:../crypto
'@sammo/server_util': '@sammo/server_util':
specifier: workspace:^ specifier: workspace:^
version: link:../server_util version: link:../server_util
@@ -316,13 +328,40 @@ importers:
'@strpc/express': '@strpc/express':
specifier: workspace:^ specifier: workspace:^
version: link:../../@strpc/express version: link:../../@strpc/express
date-fns:
specifier: ^2.30.0
version: 2.30.0
dotenv: dotenv:
specifier: ^16.3.1 specifier: ^16.3.1
version: 16.3.1 version: 16.3.1
express:
specifier: ^4.18.2
version: 4.18.2
express-session:
specifier: ^1.17.3
version: 1.17.3
lodash-es:
specifier: ^4.17.21
version: 4.17.21
mongoose: mongoose:
specifier: ^7.4.3 specifier: ^7.4.3
version: 7.4.3 version: 7.4.3
reflect-metadata:
specifier: ^0.1.13
version: 0.1.13
tslib:
specifier: ^2.6.2
version: 2.6.2
zod:
specifier: ^3.22.2
version: 3.22.2
devDependencies: devDependencies:
'@types/express':
specifier: ^4.17.17
version: 4.17.17
'@types/express-session':
specifier: ^1.17.7
version: 1.17.7
'@types/node': '@types/node':
specifier: ^20.6.3 specifier: ^20.6.3
version: 20.6.3 version: 20.6.3
@@ -400,9 +439,15 @@ importers:
specifier: ^3.22.2 specifier: ^3.22.2
version: 3.22.2 version: 3.22.2
devDependencies: devDependencies:
'@sammo/gateway': '@sammo/gateway_server':
specifier: workspace:^ specifier: workspace:^
version: link:../gateway_server version: link:../gateway_server
'@types/express':
specifier: ^4.17.17
version: 4.17.17
'@types/express-session':
specifier: ^1.17.7
version: 1.17.7
'@types/node': '@types/node':
specifier: ^20.6.3 specifier: ^20.6.3
version: 20.6.3 version: 20.6.3
@@ -419,6 +464,9 @@ importers:
specifier: workspace:^ specifier: workspace:^
version: link:../../@strpc/express version: link:../../@strpc/express
devDependencies: devDependencies:
'@types/express-session':
specifier: ^1.17.7
version: 1.17.7
lodash-es: lodash-es:
specifier: ^4.17.21 specifier: ^4.17.21
version: 4.17.21 version: 4.17.21
@@ -453,6 +501,9 @@ importers:
specifier: workspace:^ specifier: workspace:^
version: link:../def version: link:../def
devDependencies: devDependencies:
'@types/express':
specifier: ^4.17.17
version: 4.17.17
express: express:
specifier: ^4.18.2 specifier: ^4.18.2
version: 4.18.2 version: 4.18.2
@@ -1553,6 +1604,10 @@ packages:
resolution: {integrity: sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA==} resolution: {integrity: sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA==}
dev: true dev: true
/@tsconfig/node20@20.1.2:
resolution: {integrity: sha512-madaWq2k+LYMEhmcp0fs+OGaLFk0OenpHa4gmI4VEmCKX4PJntQ6fnnGADVFrVkBj0wIdAlQnK/MrlYTHsa1gQ==}
dev: true
/@types/babel__core@7.20.2: /@types/babel__core@7.20.2:
resolution: {integrity: sha512-pNpr1T1xLUc2l3xJKuPtsEky3ybxN3m4fJkknfIpTCTfIZCDW57oAg+EfCgIIp2rvCe0Wn++/FfodDS4YXxBwA==} resolution: {integrity: sha512-pNpr1T1xLUc2l3xJKuPtsEky3ybxN3m4fJkknfIpTCTfIZCDW57oAg+EfCgIIp2rvCe0Wn++/FfodDS4YXxBwA==}
dependencies: dependencies:
@@ -1582,12 +1637,53 @@ packages:
'@babel/types': 7.22.5 '@babel/types': 7.22.5
dev: true dev: true
/@types/body-parser@1.19.3:
resolution: {integrity: sha512-oyl4jvAfTGX9Bt6Or4H9ni1Z447/tQuxnZsytsCaExKlmJiU8sFgnIBRzJUpKwB5eWn9HuBYlUlVA74q/yN0eQ==}
dependencies:
'@types/connect': 3.4.36
'@types/node': 20.6.3
dev: true
/@types/connect@3.4.36:
resolution: {integrity: sha512-P63Zd/JUGq+PdrM1lv0Wv5SBYeA2+CORvbrXbngriYY0jzLUWfQMQQxOhjONEz/wlHOAxOdY7CY65rgQdTjq2w==}
dependencies:
'@types/node': 20.6.3
dev: true
/@types/express-serve-static-core@4.17.36:
resolution: {integrity: sha512-zbivROJ0ZqLAtMzgzIUC4oNqDG9iF0lSsAqpOD9kbs5xcIM3dTiyuHvBc7R8MtWBp3AAWGaovJa+wzWPjLYW7Q==}
dependencies:
'@types/node': 20.6.3
'@types/qs': 6.9.8
'@types/range-parser': 1.2.4
'@types/send': 0.17.1
dev: true
/@types/express-session@1.17.7:
resolution: {integrity: sha512-L25080PBYoRLu472HY/HNCxaXY8AaGgqGC8/p/8+BYMhG0RDOLQ1wpXOpAzr4Gi5TGozTKyJv5BVODM5UNyVMw==}
dependencies:
'@types/express': 4.17.17
dev: true
/@types/express@4.17.17:
resolution: {integrity: sha512-Q4FmmuLGBG58btUnfS1c1r/NQdlp3DMfGDGig8WhfpA2YRUtEkxAjkZb0yvplJGYdF1fsQ81iMDcH24sSCNC/Q==}
dependencies:
'@types/body-parser': 1.19.3
'@types/express-serve-static-core': 4.17.36
'@types/qs': 6.9.8
'@types/serve-static': 1.15.2
dev: true
/@types/graceful-fs@4.1.7: /@types/graceful-fs@4.1.7:
resolution: {integrity: sha512-MhzcwU8aUygZroVwL2jeYk6JisJrPl/oov/gsgGCue9mkgl9wjGbzReYQClxiUgFDnib9FuHqTndccKeZKxTRw==} resolution: {integrity: sha512-MhzcwU8aUygZroVwL2jeYk6JisJrPl/oov/gsgGCue9mkgl9wjGbzReYQClxiUgFDnib9FuHqTndccKeZKxTRw==}
dependencies: dependencies:
'@types/node': 20.6.3 '@types/node': 20.6.3
dev: true dev: true
/@types/http-errors@2.0.2:
resolution: {integrity: sha512-lPG6KlZs88gef6aD85z3HNkztpj7w2R7HmR3gygjfXCQmsLloWNARFkMuzKiiY8FGdh1XDpgBdrSf4aKDiA7Kg==}
dev: true
/@types/istanbul-lib-coverage@2.0.4: /@types/istanbul-lib-coverage@2.0.4:
resolution: {integrity: sha512-z/QT1XN4K4KYuslS23k62yDIDLwLFkzxOuMplDtObz0+y7VqJCaO2o+SPwHCvLFZh7xazvvoor2tA/hPz9ee7g==} resolution: {integrity: sha512-z/QT1XN4K4KYuslS23k62yDIDLwLFkzxOuMplDtObz0+y7VqJCaO2o+SPwHCvLFZh7xazvvoor2tA/hPz9ee7g==}
dev: true dev: true
@@ -1635,6 +1731,14 @@ packages:
resolution: {integrity: sha512-trNJ/vtMZYMLhfN45uLq4ShQSw0/S7xCTLLVM+WM1rmFpba/VS42jVUgaO3w/NOLiWR/09lnYk0yMaA/atdIsg==} resolution: {integrity: sha512-trNJ/vtMZYMLhfN45uLq4ShQSw0/S7xCTLLVM+WM1rmFpba/VS42jVUgaO3w/NOLiWR/09lnYk0yMaA/atdIsg==}
dev: true dev: true
/@types/mime@1.3.2:
resolution: {integrity: sha512-YATxVxgRqNH6nHEIsvg6k2Boc1JHI9ZbH5iWFFv/MTkchz3b1ieGDa5T0a9RznNdI0KhVbdbWSN+KWWrQZRxTw==}
dev: true
/@types/mime@3.0.1:
resolution: {integrity: sha512-Y4XFY5VJAuw0FgAqPNd6NNoV44jbq9Bz2L7Rh/J6jLTiHBSBJa9fxqQIvkIld4GsoDOcCbvzOUAbLPsSKKg+uA==}
dev: true
/@types/node@18.17.0: /@types/node@18.17.0:
resolution: {integrity: sha512-GXZxEtOxYGFchyUzxvKI14iff9KZ2DI+A6a37o6EQevtg6uO9t+aUZKcaC1Te5Ng1OnLM7K9NVVj+FbecD9cJg==} resolution: {integrity: sha512-GXZxEtOxYGFchyUzxvKI14iff9KZ2DI+A6a37o6EQevtg6uO9t+aUZKcaC1Te5Ng1OnLM7K9NVVj+FbecD9cJg==}
dev: true dev: true
@@ -1642,10 +1746,33 @@ packages:
/@types/node@20.6.3: /@types/node@20.6.3:
resolution: {integrity: sha512-HksnYH4Ljr4VQgEy2lTStbCKv/P590tmPe5HqOnv9Gprffgv5WXAY+Y5Gqniu0GGqeTCUdBnzC3QSrzPkBkAMA==} resolution: {integrity: sha512-HksnYH4Ljr4VQgEy2lTStbCKv/P590tmPe5HqOnv9Gprffgv5WXAY+Y5Gqniu0GGqeTCUdBnzC3QSrzPkBkAMA==}
/@types/qs@6.9.8:
resolution: {integrity: sha512-u95svzDlTysU5xecFNTgfFG5RUWu1A9P0VzgpcIiGZA9iraHOdSzcxMxQ55DyeRaGCSxQi7LxXDI4rzq/MYfdg==}
dev: true
/@types/range-parser@1.2.4:
resolution: {integrity: sha512-EEhsLsD6UsDM1yFhAvy0Cjr6VwmpMWqFBCb9w07wVugF7w9nfajxLuVmngTIpgS6svCnm6Vaw+MZhoDCKnOfsw==}
dev: true
/@types/semver@7.5.0: /@types/semver@7.5.0:
resolution: {integrity: sha512-G8hZ6XJiHnuhQKR7ZmysCeJWE08o8T0AXtk5darsCaTVsYZhhgUrq53jizaR2FvsoeCwJhlmwTjkXBY5Pn/ZHw==} resolution: {integrity: sha512-G8hZ6XJiHnuhQKR7ZmysCeJWE08o8T0AXtk5darsCaTVsYZhhgUrq53jizaR2FvsoeCwJhlmwTjkXBY5Pn/ZHw==}
dev: true dev: true
/@types/send@0.17.1:
resolution: {integrity: sha512-Cwo8LE/0rnvX7kIIa3QHCkcuF21c05Ayb0ZfxPiv0W8VRiZiNW/WuRupHKpqqGVGf7SUA44QSOUKaEd9lIrd/Q==}
dependencies:
'@types/mime': 1.3.2
'@types/node': 20.6.3
dev: true
/@types/serve-static@1.15.2:
resolution: {integrity: sha512-J2LqtvFYCzaj8pVYKw8klQXrLLk7TBZmQ4ShlcdkELFKGwGMfevMLneMMRkMgZxotOD9wg497LpC7O8PcvAmfw==}
dependencies:
'@types/http-errors': 2.0.2
'@types/mime': 3.0.1
'@types/node': 20.6.3
dev: true
/@types/stack-utils@2.0.1: /@types/stack-utils@2.0.1:
resolution: {integrity: sha512-Hl219/BT5fLAaz6NDkSuhzasy49dwQS/DSdu4MdggFB8zcXv7vflBI3xp7FEmkmdDkBUI2bPUNeMttp2knYdxw==} resolution: {integrity: sha512-Hl219/BT5fLAaz6NDkSuhzasy49dwQS/DSdu4MdggFB8zcXv7vflBI3xp7FEmkmdDkBUI2bPUNeMttp2knYdxw==}
dev: true dev: true
+9 -24
View File
@@ -1,32 +1,17 @@
{ {
"files": [], "extends": "./tsconfig.base.json",
"references": [ "references": [
{ {
"path": "./tsconfig.node.json" "path": "./@sammo/gateway_client"
}, },
{ {
"path": "./tsconfig.app.json" "path": "./@sammo/gateway_server"
},
{
"path": "./@sammo/server"
},
{
"path": "./@sammo/client"
}, },
], ],
"compilerOptions": {
"experimentalDecorators": true,
"emitDecoratorMetadata": true,
"module": "ESNext",
"moduleResolution": "node",
"resolveJsonModule": true,
"importHelpers": true,
"isolatedModules": true,
"verbatimModuleSyntax": true,
"allowSyntheticDefaultImports": true,
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"strict": true,
"noImplicitOverride": true,
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": true,
"paths": {
"@util/*": ["./server/util/*"],
"@server/*": ["./server/*"],
}
}
} }
-114
View File
@@ -1,114 +0,0 @@
{
"compilerOptions": {
/* Visit https://aka.ms/tsconfig to read more about this file */
/* Projects */
// "incremental": true, /* Save .tsbuildinfo files to allow for incremental compilation of projects. */
// "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */
// "tsBuildInfoFile": "./.tsbuildinfo", /* Specify the path to .tsbuildinfo incremental compilation file. */
// "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects. */
// "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */
// "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */
/* Language and Environment */
"target": "ESNext", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */
"lib": [
"ESNext"
], /* Specify a set of bundled library declaration files that describe the target runtime environment. */
// "jsx": "preserve", /* Specify what JSX code is generated. */
"experimentalDecorators": true, /* Enable experimental support for legacy experimental decorators. */
"emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */
// "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'. */
// "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */
// "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using 'jsx: react-jsx*'. */
// "reactNamespace": "", /* Specify the object invoked for 'createElement'. This only applies when targeting 'react' JSX emit. */
// "noLib": true, /* Disable including any library files, including the default lib.d.ts. */
// "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */
// "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */
/* Modules */
"module": "ESNext", /* Specify what module code is generated. */
"rootDir": "./server", /* Specify the root folder within your source files. */
"moduleResolution": "node", /* Specify how TypeScript looks up a file from a given module specifier. */
// "baseUrl": ".", /* Specify the base directory to resolve non-relative module names. */
// "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */
// "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */
// "typeRoots": [], /* Specify multiple folders that act like './node_modules/@types'. */
// "types": [], /* Specify type package names to be included without being referenced in a source file. */
// "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */
// "moduleSuffixes": [], /* List of file name suffixes to search when resolving a module. */
// "allowImportingTsExtensions": true, /* Allow imports to include TypeScript file extensions. Requires '--moduleResolution bundler' and either '--noEmit' or '--emitDeclarationOnly' to be set. */
// "resolvePackageJsonExports": true, /* Use the package.json 'exports' field when resolving package imports. */
// "resolvePackageJsonImports": true, /* Use the package.json 'imports' field when resolving imports. */
// "customConditions": [], /* Conditions to set in addition to the resolver-specific defaults when resolving imports. */
"resolveJsonModule": true, /* Enable importing .json files. */
// "allowArbitraryExtensions": true, /* Enable importing files with any extension, provided a declaration file is present. */
// "noResolve": true, /* Disallow 'import's, 'require's or '<reference>'s from expanding the number of files TypeScript should add to a project. */
/* JavaScript Support */
// "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */
// "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */
// "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */
/* Emit */
"declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */
"declarationMap": true, /* Create sourcemaps for d.ts files. */
// "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */
// "sourceMap": true, /* Create source map files for emitted JavaScript files. */
// "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */
// "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */
"outDir": "./dist_server/", /* Specify an output folder for all emitted files. */
// "removeComments": true, /* Disable emitting comments. */
// "noEmit": true, /* Disable emitting files from a compilation. */
"importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */
// "importsNotUsedAsValues": "error", /* Specify emit/checking behavior for imports that are only used for types. */
// "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */
// "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */
// "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */
// "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */
// "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */
// "newLine": "crlf", /* Set the newline character for emitting files. */
// "stripInternal": true, /* Disable emitting declarations that have '@internal' in their JSDoc comments. */
// "noEmitHelpers": true, /* Disable generating custom helper functions like '__extends' in compiled output. */
// "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */
// "preserveConstEnums": true, /* Disable erasing 'const enum' declarations in generated code. */
// "declarationDir": "./", /* Specify the output directory for generated declaration files. */
// "preserveValueImports": true, /* Preserve unused imported values in the JavaScript output that would otherwise be removed. */
/* Interop Constraints */
"isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */
"verbatimModuleSyntax": true, /* Do not transform or elide any imports or exports not marked as type-only, ensuring they are written in the output file's format based on the 'module' setting. */
"allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */
"esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */
// "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */
"forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */
/* Type Checking */
"strict": true, /* Enable all strict type-checking options. */
// "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied 'any' type. */
// "strictNullChecks": true, /* When type checking, take into account 'null' and 'undefined'. */
// "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */
// "strictBindCallApply": true, /* Check that the arguments for 'bind', 'call', and 'apply' methods match the original function. */
// "strictPropertyInitialization": true, /* Check for class properties that are declared but not set in the constructor. */
// "noImplicitThis": true, /* Enable error reporting when 'this' is given the type 'any'. */
// "useUnknownInCatchVariables": true, /* Default catch clause variables as 'unknown' instead of 'any'. */
// "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */
// "noUnusedLocals": true, /* Enable error reporting when local variables aren't read. */
// "noUnusedParameters": true, /* Raise an error when a function parameter isn't read. */
// "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */
"noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */
"noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */
// "noUncheckedIndexedAccess": true, /* Add 'undefined' to a type when accessed using an index. */
"noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */
// "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type. */
// "allowUnusedLabels": true, /* Disable error reporting for unused labels. */
// "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */
/* Completeness */
// "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */
"skipLibCheck": true, /* Skip type checking all .d.ts files. */
"paths": {
"@util/*": ["./util/*"],
"@server/*": ["./*"],
}
},
"include": [
"./server/**/*"
],
"ts-node": {
"esm": true,
"experimentalSpecifierResolution": "node"
}
}