From 87c239610ac5eef11a4ea6d8788fc624607984c5 Mon Sep 17 00:00:00 2001 From: Hide_D Date: Fri, 18 Aug 2023 15:52:27 +0000 Subject: [PATCH] gamelogintoken --- server/api/RootAPI/GetGameLoginToken.ts | 25 +++++++++++++++++++++++++ server/api/root.ts | 2 ++ server/apiStructure/sammoRootAPI.ts | 6 ++++++ 3 files changed, 33 insertions(+) create mode 100644 server/api/RootAPI/GetGameLoginToken.ts diff --git a/server/api/RootAPI/GetGameLoginToken.ts b/server/api/RootAPI/GetGameLoginToken.ts new file mode 100644 index 0000000..9eaaa26 --- /dev/null +++ b/server/api/RootAPI/GetGameLoginToken.ts @@ -0,0 +1,25 @@ +import { GET } from "../defs.js"; +import type { structure } from "../../apiStructure/sammoRootAPI.js"; +import type { ExtractError, ExtractQuery, ExtractResponse } from "../../apiStructure/defs.js"; +import { StartSession } from "../../ProcDecorator/StartSession.js"; +import { declProcDecorators } from "../../ProcDecorator/base.js"; +import { ReqLogin } from "../../ProcDecorator/ReqLogin.js"; + +type BaseAPI = typeof structure.GetGameLoginToken; +type RType = ExtractResponse; +type EType = ExtractError; +type QType = ExtractQuery; + +export const GameLoginTokenSessionKey = "GameLoginToken"; + +export const GetGameLoginToken = GET(undefined)(declProcDecorators( + StartSession, + ReqLogin, +))( + async (query, ctx) => { + return { + result: false, + reason: 'NotYetImplemented', + }; + } +); \ No newline at end of file diff --git a/server/api/root.ts b/server/api/root.ts index 26e6333..83c275f 100644 --- a/server/api/root.ts +++ b/server/api/root.ts @@ -1,7 +1,9 @@ import type { structure } from "../apiStructure/sammoRootAPI.js"; import type { APINamespaceType } from "./defs.js"; +import { GetGameLoginToken } from "./RootAPI/GetGameLoginToken.js"; import { Login } from "./RootAPI/Login/index.js"; export const sammoRootAPI = { Login, + GetGameLoginToken } satisfies APINamespaceType; \ No newline at end of file diff --git a/server/apiStructure/sammoRootAPI.ts b/server/apiStructure/sammoRootAPI.ts index 24a3508..db37951 100644 --- a/server/apiStructure/sammoRootAPI.ts +++ b/server/apiStructure/sammoRootAPI.ts @@ -43,4 +43,10 @@ export const structure = { ReqNonce: GET(), test: GET<{result: true, hello:'world'}>(), }, + GetGameLoginToken: GET<{ + result: true, + gameLoginToken: string, + userID: number, + }>(), + } satisfies DefAPINamespace; \ No newline at end of file