gamelogintoken
This commit is contained in:
@@ -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<BaseAPI>;
|
||||||
|
type EType = ExtractError<BaseAPI>;
|
||||||
|
type QType = ExtractQuery<BaseAPI>;
|
||||||
|
|
||||||
|
export const GameLoginTokenSessionKey = "GameLoginToken";
|
||||||
|
|
||||||
|
export const GetGameLoginToken = GET<RType, EType, QType>(undefined)(declProcDecorators(
|
||||||
|
StartSession,
|
||||||
|
ReqLogin,
|
||||||
|
))(
|
||||||
|
async (query, ctx) => {
|
||||||
|
return {
|
||||||
|
result: false,
|
||||||
|
reason: 'NotYetImplemented',
|
||||||
|
};
|
||||||
|
}
|
||||||
|
);
|
||||||
@@ -1,7 +1,9 @@
|
|||||||
import type { structure } from "../apiStructure/sammoRootAPI.js";
|
import type { structure } from "../apiStructure/sammoRootAPI.js";
|
||||||
import type { APINamespaceType } from "./defs.js";
|
import type { APINamespaceType } from "./defs.js";
|
||||||
|
import { GetGameLoginToken } from "./RootAPI/GetGameLoginToken.js";
|
||||||
import { Login } from "./RootAPI/Login/index.js";
|
import { Login } from "./RootAPI/Login/index.js";
|
||||||
|
|
||||||
export const sammoRootAPI = {
|
export const sammoRootAPI = {
|
||||||
Login,
|
Login,
|
||||||
|
GetGameLoginToken
|
||||||
} satisfies APINamespaceType<typeof structure>;
|
} satisfies APINamespaceType<typeof structure>;
|
||||||
@@ -43,4 +43,10 @@ export const structure = {
|
|||||||
ReqNonce: GET<AutoLoginNonceResponse, AutoLoginFailed>(),
|
ReqNonce: GET<AutoLoginNonceResponse, AutoLoginFailed>(),
|
||||||
test: GET<{result: true, hello:'world'}>(),
|
test: GET<{result: true, hello:'world'}>(),
|
||||||
},
|
},
|
||||||
|
GetGameLoginToken: GET<{
|
||||||
|
result: true,
|
||||||
|
gameLoginToken: string,
|
||||||
|
userID: number,
|
||||||
|
}>(),
|
||||||
|
|
||||||
} satisfies DefAPINamespace;
|
} satisfies DefAPINamespace;
|
||||||
Reference in New Issue
Block a user