fix: restore full typecheck stability
This commit is contained in:
30
src/main/types/auth-ipc.types.ts
Normal file
30
src/main/types/auth-ipc.types.ts
Normal file
@@ -0,0 +1,30 @@
|
||||
import type { UserInfo } from './user.types'
|
||||
|
||||
export interface LoginRequest {
|
||||
username: string
|
||||
password: string
|
||||
}
|
||||
|
||||
export interface LoginResponse {
|
||||
success: boolean
|
||||
userInfo?: UserInfo
|
||||
error?: string
|
||||
}
|
||||
|
||||
export interface SilentLoginResponse {
|
||||
success: boolean
|
||||
userInfo?: UserInfo
|
||||
requiresUserSelection?: boolean
|
||||
error?: string
|
||||
}
|
||||
|
||||
export interface UserSelectionResponse {
|
||||
success: boolean
|
||||
userInfo?: UserInfo
|
||||
error?: string
|
||||
}
|
||||
|
||||
export interface CurrentUserResponse {
|
||||
isAuthenticated: boolean
|
||||
userInfo?: UserInfo
|
||||
}
|
||||
@@ -11,7 +11,7 @@ import type {
|
||||
ExportResultItem,
|
||||
ExportResultResponse
|
||||
} from './cleaner.types'
|
||||
import type { IpcResult } from '../ipc'
|
||||
import type { IpcResult } from './ipc.types'
|
||||
|
||||
/**
|
||||
* MySQL connection configuration
|
||||
@@ -176,13 +176,23 @@ export interface ReportAPI {
|
||||
/**
|
||||
* List all reports across all users (Admin only typically)
|
||||
*/
|
||||
listAll: () => Promise<IpcResult<{ key: string; filename: string; username: string; lastModified?: Date; size?: number }[]>>
|
||||
listAll: () => Promise<
|
||||
IpcResult<
|
||||
{ key: string; filename: string; username: string; lastModified?: Date; size?: number }[]
|
||||
>
|
||||
>
|
||||
|
||||
/**
|
||||
* List reports for a specific user
|
||||
* @param username - Username to list reports for
|
||||
*/
|
||||
listByUser: (username: string) => Promise<IpcResult<{ key: string; filename: string; username: string; lastModified?: Date; size?: number }[]>>
|
||||
listByUser: (
|
||||
username: string
|
||||
) => Promise<
|
||||
IpcResult<
|
||||
{ key: string; filename: string; username: string; lastModified?: Date; size?: number }[]
|
||||
>
|
||||
>
|
||||
|
||||
/**
|
||||
* Download a specific report by key
|
||||
|
||||
6
src/main/types/ipc.types.ts
Normal file
6
src/main/types/ipc.types.ts
Normal file
@@ -0,0 +1,6 @@
|
||||
export interface IpcResult<T = unknown> {
|
||||
success: boolean
|
||||
data?: T
|
||||
error?: string
|
||||
code?: string
|
||||
}
|
||||
18
src/main/types/order-resolver.types.ts
Normal file
18
src/main/types/order-resolver.types.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
export interface OrderMapping {
|
||||
input: string
|
||||
productionId?: string
|
||||
orderNumber?: string
|
||||
resolved: boolean
|
||||
error?: string
|
||||
}
|
||||
|
||||
export type OrderNumberType = 'productionId' | 'orderNumber' | 'unknown'
|
||||
|
||||
export interface ResolutionStats {
|
||||
totalInputs: number
|
||||
validOrderNumbers: number
|
||||
validProductionIds: number
|
||||
resolvedCount: number
|
||||
failedCount: number
|
||||
unknownFormat: number
|
||||
}
|
||||
14
src/main/types/resolver-ipc.types.ts
Normal file
14
src/main/types/resolver-ipc.types.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
import type { OrderMapping, ResolutionStats } from './order-resolver.types'
|
||||
|
||||
export interface ResolverInput {
|
||||
inputs: string[]
|
||||
}
|
||||
|
||||
export interface ResolverResponse {
|
||||
success: boolean
|
||||
mappings?: OrderMapping[]
|
||||
validOrderNumbers?: string[]
|
||||
warnings?: string[]
|
||||
stats?: ResolutionStats
|
||||
error?: string
|
||||
}
|
||||
Reference in New Issue
Block a user