fix
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
import { GET } from "../defs";
|
||||
import type { structure } from "../../apiStructure/sammoRootAPI";
|
||||
import type { ExtractError, ExtractQuery, ExtractResponse } from "../../apiStructure/defs";
|
||||
import { declProcDecorators } from "../ProcDecorator/base";
|
||||
import { GET } from "../defs.js";
|
||||
import type { structure } from "../../apiStructure/sammoRootAPI.js";
|
||||
import type { ExtractError, ExtractQuery, ExtractResponse } from "../../apiStructure/defs.js";
|
||||
import { declProcDecorators } from "../ProcDecorator/base.js";
|
||||
import { ReqLogin } from "../ProcDecorator/ReqLogin.js";
|
||||
import { StartSession } from "../ProcDecorator/StartSession.js";
|
||||
|
||||
type BaseAPI = typeof structure.Login.ReqNonce;
|
||||
type RType = ExtractResponse<BaseAPI>;
|
||||
@@ -11,7 +13,10 @@ const argValidator = undefined;
|
||||
|
||||
export const ReqNonce = GET<RType, EType, QType>
|
||||
(argValidator)
|
||||
(declProcDecorators([] as const))
|
||||
(() => {
|
||||
(declProcDecorators([
|
||||
StartSession,
|
||||
ReqLogin,
|
||||
] as const))
|
||||
((query, ctx) => {
|
||||
throw new Error("Method not implemented.");
|
||||
});
|
||||
@@ -1,10 +1,10 @@
|
||||
import { POST } from "../defs";
|
||||
import type { structure } from "../../apiStructure/sammoRootAPI";
|
||||
import type { ExtractError, ExtractQuery, ExtractResponse } from "../../apiStructure/defs";
|
||||
import { StartSession } from "../ProcDecorator/StartSession";
|
||||
import { POST } from "../defs.js";
|
||||
import type { structure } from "../../apiStructure/sammoRootAPI.js";
|
||||
import type { ExtractError, ExtractQuery, ExtractResponse } from "../../apiStructure/defs.js";
|
||||
import { StartSession } from "../ProcDecorator/StartSession.js";
|
||||
import { IsString } from "class-validator";
|
||||
import { delay } from "../../util/delay";
|
||||
import { declProcDecorators } from "../ProcDecorator/base";
|
||||
import { delay } from "../../util/delay.js";
|
||||
import { declProcDecorators } from "../ProcDecorator/base.js";
|
||||
|
||||
type BaseAPI = typeof structure.Login.LoginByID;
|
||||
type RType = ExtractResponse<BaseAPI>;
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import { POST } from "../defs";
|
||||
import type { structure } from "../../apiStructure/sammoRootAPI";
|
||||
import type { ExtractError, ExtractQuery, ExtractResponse } from "../../apiStructure/defs";
|
||||
import { StartSession } from "../ProcDecorator/StartSession";
|
||||
import { POST } from "../defs.js";
|
||||
import type { structure } from "../../apiStructure/sammoRootAPI.js";
|
||||
import type { ExtractError, ExtractQuery, ExtractResponse } from "../../apiStructure/defs.js";
|
||||
import { StartSession } from "../ProcDecorator/StartSession.js";
|
||||
import { IsNumber, IsString } from "class-validator";
|
||||
import { delay } from "../../util/delay";
|
||||
import { PackChain, ParseInType, ParseOutType, declProcDecorators } from "../ProcDecorator/base";
|
||||
import { delay } from "../../util/delay.js";
|
||||
import { declProcDecorators } from "../ProcDecorator/base.js";
|
||||
type BaseAPI = typeof structure.Login.LoginByToken;
|
||||
type RType = ExtractResponse<BaseAPI>;
|
||||
type EType = ExtractError<BaseAPI>;
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { GET } from "../defs";
|
||||
import type { structure } from "../../apiStructure/sammoRootAPI";
|
||||
import type { ExtractError, ExtractQuery, ExtractResponse } from "../../apiStructure/defs";
|
||||
import { StartSession } from "../ProcDecorator/StartSession";
|
||||
import { declProcDecorators } from "../ProcDecorator/base";
|
||||
import { GET } from "../defs.js";
|
||||
import type { structure } from "../../apiStructure/sammoRootAPI.js";
|
||||
import type { ExtractError, ExtractQuery, ExtractResponse } from "../../apiStructure/defs.js";
|
||||
import { StartSession } from "../ProcDecorator/StartSession.js";
|
||||
import { declProcDecorators } from "../ProcDecorator/base.js";
|
||||
|
||||
type BaseAPI = typeof structure.Login.ReqNonce;
|
||||
type RType = ExtractResponse<BaseAPI>;
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import type { structure } from "../../apiStructure/sammoRootAPI";
|
||||
import type { APINamespaceType } from "../defs";
|
||||
import { LoginByID } from "./LoginByID";
|
||||
import { LoginByToken } from "./LoginByToken";
|
||||
import { ReqNonce } from "./ReqNonce";
|
||||
import { test } from "./test";
|
||||
import type { structure } from "../../apiStructure/sammoRootAPI.js";
|
||||
import type { APINamespaceType } from "../defs.js";
|
||||
import { LoginByID } from "./LoginByID.js";
|
||||
import { LoginByToken } from "./LoginByToken.js";
|
||||
import { ReqNonce } from "./ReqNonce.js";
|
||||
import { test } from "./test.js";
|
||||
|
||||
export const Login = {
|
||||
LoginByID,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { GET } from "../defs";
|
||||
import type { structure } from "../../apiStructure/sammoRootAPI";
|
||||
import type { ExtractError, ExtractQuery, ExtractResponse } from "../../apiStructure/defs";
|
||||
import { declProcDecorators } from "../ProcDecorator/base";
|
||||
import { GET } from "../defs.js";
|
||||
import type { structure } from "../../apiStructure/sammoRootAPI.js";
|
||||
import type { ExtractError, ExtractQuery, ExtractResponse } from "../../apiStructure/defs.js";
|
||||
import { declProcDecorators } from "../ProcDecorator/base.js";
|
||||
|
||||
type BaseAPI = typeof structure.Login.test;
|
||||
type RType = ExtractResponse<BaseAPI>;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { LoginCtx } from "./ReqLogin";
|
||||
import type { SessionCtx } from "./StartSession";
|
||||
import type { ProcDecoratorGenerator } from "./base";
|
||||
import type { LoginCtx } from "./ReqLogin.js";
|
||||
import type { SessionCtx } from "./StartSession.js";
|
||||
import type { ProcDecoratorGenerator } from "./base.js";
|
||||
import type { Request, Response } from "express";
|
||||
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { LoginCtx } from "./ReqLogin";
|
||||
import type { SessionCtx } from "./StartSession";
|
||||
import type { ProcDecoratorGenerator } from "./base";
|
||||
import type { LoginCtx } from "./ReqLogin.js";
|
||||
import type { SessionCtx } from "./StartSession.js";
|
||||
import type { ProcDecoratorGenerator } from "./base.js";
|
||||
import type { Request, Response } from "express";
|
||||
import { delay } from "../../util/delay.js";
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { SessionCtx } from "./StartSession";
|
||||
import type { DecoratorResultFalse, DecoratorResultTrue, ProcDecorator, ProcDecoratorGenerator } from "./base";
|
||||
import type { SessionCtx } from "./StartSession.js";
|
||||
import type { DecoratorResultFalse, DecoratorResultTrue, ProcDecorator, ProcDecoratorGenerator } from "./base.js";
|
||||
|
||||
export type LoginCtx = {
|
||||
userID: number;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { Empty, ProcDecoratorGenerator } from "./base";
|
||||
import type { Empty, ProcDecoratorGenerator } from "./base.js";
|
||||
|
||||
export type SessionCtx = {
|
||||
clearSession: () => Promise<void>;
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
|
||||
import type { Request, Response } from 'express';
|
||||
import type { Callable, DefAPINamespace, DeleteAPICallT, GetAPICallT, HeadAPICallT, HttpMethod, InvalidResponse, PatchAPICallT, PostAPICallT, PutAPICallT, RawArgType, ValidResponse, recoveryMethod } from '../apiStructure/defs';
|
||||
import type { Callable, DefAPINamespace, DeleteAPICallT, GetAPICallT, HeadAPICallT, HttpMethod, InvalidResponse, PatchAPICallT, PostAPICallT, PutAPICallT, RawArgType, ValidResponse, recoveryMethod } from '../apiStructure/defs.js';
|
||||
import {
|
||||
validate,
|
||||
type ValidatorOptions,
|
||||
|
||||
+3
-3
@@ -1,6 +1,6 @@
|
||||
import type { structure } from "../apiStructure/sammoRootAPI";
|
||||
import type { APINamespaceType } from "./defs";
|
||||
import { Login } from "./Login";
|
||||
import type { structure } from "../apiStructure/sammoRootAPI.js";
|
||||
import type { APINamespaceType } from "./defs.js";
|
||||
import { Login } from "./Login/index.js";
|
||||
|
||||
export const sammoRootAPI = {
|
||||
Login,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { type DefAPINamespace, GET, POST } from "./defs";
|
||||
import { type DefAPINamespace, GET, POST } from "./defs.js";
|
||||
|
||||
export type LoginResponse = {
|
||||
result: true,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import isArray from "lodash-es/isArray";
|
||||
import isEmpty from "lodash-es/isEmpty";
|
||||
import ky from "ky";
|
||||
import type { HttpMethod, InvalidResponse, RawArgType, ValidResponse } from "../apiStructure/defs";
|
||||
import type { HttpMethod, InvalidResponse, RawArgType, ValidResponse } from "../apiStructure/defs.js";
|
||||
|
||||
export async function callClientAPI<ResultType extends ValidResponse>(
|
||||
method: HttpMethod,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { APIPathGen } from "./APIPathGen";
|
||||
import type { APITail, RawArgType } from "../apiStructure/defs";
|
||||
import { structure } from "../apiStructure/sammoRootAPI";
|
||||
import { callClientAPI } from "./generator";
|
||||
import { APIPathGen } from "./APIPathGen.js";
|
||||
import type { APITail, RawArgType } from "../apiStructure/defs.js";
|
||||
import { structure } from "../apiStructure/sammoRootAPI.js";
|
||||
import { callClientAPI } from "./generator.js";
|
||||
|
||||
const apiRoot = process.env.API_ROOT_PATH ?? process.env.VITE_API_ROOT_PATH ?? '/rootAPI';
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { RNG } from './RNG';
|
||||
import type { RNG } from './RNG.js';
|
||||
|
||||
export class RandUtil {
|
||||
constructor(protected rng: RNG) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { IDItem } from './defs';
|
||||
import type { IDItem } from './defs.js';
|
||||
|
||||
export function convertIDArray<T>(array: Iterable<T>): IDItem<T>[] {
|
||||
const result: IDItem<T>[] = [];
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { formatTime } from './/formatTime';
|
||||
import { formatTime } from './formatTime.js';
|
||||
export function getDateTimeNow(withFraction = false): string {
|
||||
return formatTime(new Date(), withFraction);
|
||||
}
|
||||
Reference in New Issue
Block a user