monorepo 버전 준비
## @strpc 기존 RPC를 package화 ### @strpc/express express의 middleware + router 결함 ## @sammo 게임 전체 - server, client - gateway_server, gateway_client
This commit is contained in:
@@ -0,0 +1 @@
|
||||
export const hello = "hello";
|
||||
@@ -0,0 +1,71 @@
|
||||
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>(),
|
||||
},
|
||||
GetGameLoginToken: GET<{
|
||||
result: true,
|
||||
gameLoginToken: string,
|
||||
userID: number,
|
||||
}>(),
|
||||
|
||||
} satisfies DefAPINamespace;
|
||||
@@ -0,0 +1,33 @@
|
||||
import 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";
|
||||
import { GET, POST } from '@strpc/def';
|
||||
|
||||
export type {
|
||||
InferResponse,
|
||||
InferError,
|
||||
InferQuery,
|
||||
} from "@strpc/def";
|
||||
export type * as def from './def/index.js';
|
||||
|
||||
export const structure = {
|
||||
} satisfies DefAPINamespace;
|
||||
Reference in New Issue
Block a user