rootAPI to gatewayAPI
This commit is contained in:
@@ -0,0 +1,52 @@
|
||||
import { type DefAPINamespace, GET, POST } from "./defs.js";
|
||||
|
||||
export type LoginResponse = {
|
||||
result: true,
|
||||
nextToken: [number, string] | undefined,
|
||||
}
|
||||
|
||||
export type LoginFailed = {
|
||||
result: false,
|
||||
reqOTP: boolean,
|
||||
reason: string,
|
||||
}
|
||||
|
||||
|
||||
export type AutoLoginNonceResponse = {
|
||||
result: true,
|
||||
loginNonce: string,
|
||||
};
|
||||
|
||||
export type AutoLoginResponse = {
|
||||
result: true,
|
||||
nextToken: [number, string] | undefined,
|
||||
}
|
||||
|
||||
|
||||
export type AutoLoginFailed = {
|
||||
result: false,
|
||||
silent: boolean,
|
||||
reason: string,
|
||||
}
|
||||
|
||||
/** @internal */
|
||||
export const structure = {
|
||||
Login: {
|
||||
LoginByID: POST<{
|
||||
id: string,
|
||||
password: string,
|
||||
}, LoginResponse, LoginFailed>(),
|
||||
LoginByToken: POST<{
|
||||
hashedToken: string,
|
||||
token_id: number,
|
||||
}, AutoLoginResponse, AutoLoginFailed>(),
|
||||
ReqNonce: GET<AutoLoginNonceResponse, AutoLoginFailed>(),
|
||||
test: GET<{result: true, hello:'world'}>(),
|
||||
},
|
||||
GetGameLoginToken: GET<{
|
||||
result: true,
|
||||
gameLoginToken: string,
|
||||
userID: number,
|
||||
}>(),
|
||||
|
||||
} satisfies DefAPINamespace;
|
||||
Reference in New Issue
Block a user