API Structure 재정비

This commit is contained in:
2023-08-06 12:31:51 +00:00
parent 19a19d8a2f
commit 5e216e5f67
4 changed files with 275 additions and 146 deletions
+8 -7
View File
@@ -1,4 +1,4 @@
import { type APICallT, GET, POST } from "./defs";
import { DefAPINamespace, GET, POST } from "./defs";
export type LoginResponse = {
result: true,
@@ -32,14 +32,15 @@ export type AutoLoginFailed = {
/** @internal */
export const structure = {
Login: {
LoginByID: POST as APICallT<{
LoginByID: POST<{
username: string,
password: string,
}, LoginResponse, LoginFailed>,
LoginByToken: POST as APICallT<{
}, LoginResponse, LoginFailed>(),
LoginByToken: POST<{
hashedToken: string,
token_id: number,
}, AutoLoginResponse, AutoLoginFailed>,
ReqNonce: GET as APICallT<undefined, AutoLoginNonceResponse, AutoLoginFailed>
}, AutoLoginResponse, AutoLoginFailed>(),
Test: POST<AutoLoginResponse, AutoLoginFailed>(),
ReqNonce: GET<AutoLoginNonceResponse, AutoLoginFailed>()
},
} as const;
} satisfies DefAPINamespace;