mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-17 08:14:25 +08:00
code refactor
This commit is contained in:
+5
-5
@@ -130,11 +130,11 @@ import { getTimezoneOffsetMinutes } from './datetime.ts';
|
||||
import { generateRandomUUID } from './misc.ts';
|
||||
|
||||
interface ApiRequestConfig extends AxiosRequestConfig {
|
||||
headers: AxiosRequestHeaders;
|
||||
noAuth?: boolean;
|
||||
ignoreBlocked?: boolean;
|
||||
ignoreError?: boolean;
|
||||
timeout?: number;
|
||||
readonly headers: AxiosRequestHeaders;
|
||||
readonly noAuth?: boolean;
|
||||
readonly ignoreBlocked?: boolean;
|
||||
readonly ignoreError?: boolean;
|
||||
readonly timeout?: number;
|
||||
}
|
||||
|
||||
export type ApiResponsePromise<T> = Promise<AxiosResponse<ApiResponse<T>>>;
|
||||
|
||||
+10
-10
@@ -3,18 +3,18 @@ import uaParser from 'ua-parser-js';
|
||||
import { TOKEN_CLI_USER_AGENT, type TokenInfoResponse, SessionInfo } from '@/models/token.ts';
|
||||
|
||||
interface UserAgentInfo {
|
||||
device: {
|
||||
vendor?: string;
|
||||
model?: string;
|
||||
type?: string;
|
||||
readonly device: {
|
||||
readonly vendor?: string;
|
||||
readonly model?: string;
|
||||
readonly type?: string;
|
||||
};
|
||||
os: {
|
||||
name?: string;
|
||||
version?: string;
|
||||
readonly os: {
|
||||
readonly name?: string;
|
||||
readonly version?: string;
|
||||
};
|
||||
browser: {
|
||||
name?: string;
|
||||
version?: string;
|
||||
readonly browser: {
|
||||
readonly name?: string;
|
||||
readonly version?: string;
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
+15
-15
@@ -16,30 +16,30 @@ import {
|
||||
import logger from './logger.ts';
|
||||
|
||||
interface ClientData {
|
||||
challenge: string;
|
||||
crossOrigin: boolean;
|
||||
origin: string;
|
||||
type: string;
|
||||
readonly challenge: string;
|
||||
readonly crossOrigin: boolean;
|
||||
readonly origin: string;
|
||||
readonly type: string;
|
||||
}
|
||||
|
||||
interface AttestationData {
|
||||
authData: Uint8Array;
|
||||
fmt: string;
|
||||
readonly authData: Uint8Array;
|
||||
readonly fmt: string;
|
||||
}
|
||||
|
||||
interface WebAuthnRegisterResponse {
|
||||
id: string | null;
|
||||
clientData: ClientData;
|
||||
publicKey: Uint8Array | null;
|
||||
rawCredential: Credential;
|
||||
readonly id: string | null;
|
||||
readonly clientData: ClientData;
|
||||
readonly publicKey: Uint8Array | null;
|
||||
readonly rawCredential: Credential;
|
||||
}
|
||||
|
||||
interface WebAuthnVerifyResponse {
|
||||
id: string | null;
|
||||
userName: string;
|
||||
userSecret: string;
|
||||
clientData: ClientData;
|
||||
rawCredential: Credential;
|
||||
readonly id: string | null;
|
||||
readonly userName: string;
|
||||
readonly userSecret: string;
|
||||
readonly clientData: ClientData;
|
||||
readonly rawCredential: Credential;
|
||||
}
|
||||
|
||||
const PUBLIC_KEY_CREDENTIAL_CREATION_OPTIONS_BASE_TEMPLATE = {
|
||||
|
||||
Reference in New Issue
Block a user