api_def
This commit is contained in:
@@ -5,6 +5,7 @@
|
|||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
"exports": {
|
"exports": {
|
||||||
".": "./dist/index.js",
|
".": "./dist/index.js",
|
||||||
|
"./gateway": "./dist/gateway.js",
|
||||||
"./def": "./dist/def/index.js"
|
"./def": "./dist/def/index.js"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
@@ -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;
|
||||||
@@ -22,10 +22,6 @@ import type {
|
|||||||
} from "@strpc/def/types";
|
} from "@strpc/def/types";
|
||||||
import { GET, POST } from '@strpc/def';
|
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 {
|
export type {
|
||||||
InferResponse,
|
InferResponse,
|
||||||
InferError,
|
InferError,
|
||||||
|
|||||||
+2
-1
@@ -38,7 +38,8 @@
|
|||||||
"tslib": "^2.6.1",
|
"tslib": "^2.6.1",
|
||||||
"vue": "^3.3.4",
|
"vue": "^3.3.4",
|
||||||
"vue-router": "^4.2.4",
|
"vue-router": "^4.2.4",
|
||||||
"zod": "^3.22.1"
|
"zod": "^3.22.1",
|
||||||
|
"@sammo/api_def": "workspace:^"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@rushstack/eslint-patch": "^1.3.2",
|
"@rushstack/eslint-patch": "^1.3.2",
|
||||||
|
|||||||
Generated
+3
@@ -14,6 +14,9 @@ importers:
|
|||||||
'@popperjs/core':
|
'@popperjs/core':
|
||||||
specifier: ^2.11.8
|
specifier: ^2.11.8
|
||||||
version: 2.11.8
|
version: 2.11.8
|
||||||
|
'@sammo/api_def':
|
||||||
|
specifier: workspace:^
|
||||||
|
version: link:@sammo/api_def
|
||||||
async-lock:
|
async-lock:
|
||||||
specifier: ^1.4.0
|
specifier: ^1.4.0
|
||||||
version: 1.4.0
|
version: 1.4.0
|
||||||
|
|||||||
Reference in New Issue
Block a user