This commit is contained in:
2023-09-22 20:51:08 +09:00
parent b8d57a014a
commit 295d39327b
5 changed files with 78 additions and 5 deletions
+1
View File
@@ -5,6 +5,7 @@
"main": "dist/index.js",
"exports": {
".": "./dist/index.js",
"./gateway": "./dist/gateway.js",
"./def": "./dist/def/index.js"
},
"scripts": {
+72
View File
@@ -0,0 +1,72 @@
import { GET, POST, type DefAPINamespace } from "@strpc/def";
//굳이 할 필요는 없지만, d.ts가 깔끔해짐
import type {
InvalidResponse, ValidResponse
} from "@strpc/def";
import type {
ArgDeleteAPI,
ArgGetAPI,
ArgHeadAPI,
ArgPatchAPI,
ArgPostAPI,
ArgPutAPI,
EmptyDeleteAPI,
EmptyGetAPI,
EmptyHeadAPI,
EmptyPatchAPI,
EmptyPostAPI,
EmptyPutAPI,
} from "@strpc/def/types";
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;
-4
View File
@@ -22,10 +22,6 @@ import type {
} from "@strpc/def/types";
import { GET, POST } from '@strpc/def';
import type { Base64String, WrappedBuffer } from "@sammo/util";
import type { ECDSASignatureBSON, ECDSASignatureJSON, ECDSASignatureRaw, ECDSA_P384_VerifyKey, ECDSA_PKCS8_P384_SignKey } from "@sammo/crypto/RawTypes";
import type { PEMString } from "@sammo/crypto";
export type {
InferResponse,
InferError,