refactored to make use of the ServiceType enum throughout backend and frontend for typesafety
This commit is contained in:
@@ -1,20 +1,26 @@
|
||||
export const ServiceType = {
|
||||
HOMEBOX: "HOMEBOX",
|
||||
} as const;
|
||||
|
||||
export type ServiceType = (typeof ServiceType)[keyof typeof ServiceType];
|
||||
|
||||
export interface LoginRequest {
|
||||
appUrl: string
|
||||
serviceType: string
|
||||
username: string
|
||||
password: string
|
||||
stayLoggedIn: boolean
|
||||
appUrl: string;
|
||||
serviceType: ServiceType;
|
||||
username: string;
|
||||
password: string;
|
||||
stayLoggedIn: boolean;
|
||||
}
|
||||
|
||||
export interface AuthResponse {
|
||||
serviceType: string
|
||||
expiresAt: string
|
||||
serviceType: ServiceType;
|
||||
expiresAt: string;
|
||||
}
|
||||
|
||||
export interface ConnectionStatus {
|
||||
serviceType: string
|
||||
appUrl: string
|
||||
username: string
|
||||
expiresAt: string | null
|
||||
connected: boolean
|
||||
serviceType: ServiceType;
|
||||
appUrl: string;
|
||||
username: string;
|
||||
expiresAt: string | null;
|
||||
connected: boolean;
|
||||
}
|
||||
|
||||
@@ -1,23 +1,25 @@
|
||||
import type { ServiceType } from "./connection";
|
||||
|
||||
export interface SearchRequest {
|
||||
appUrl: string;
|
||||
serviceType: string;
|
||||
username: string;
|
||||
query: string | null;
|
||||
appUrl: string
|
||||
serviceType: ServiceType
|
||||
username: string
|
||||
query: string | null
|
||||
}
|
||||
|
||||
export interface SearchResponse {
|
||||
id: string;
|
||||
title: string;
|
||||
description: string | null;
|
||||
extraData: Record<string, unknown>;
|
||||
id: string
|
||||
title: string
|
||||
description: string | null
|
||||
extraData: Record<string, unknown>
|
||||
}
|
||||
|
||||
export interface PagedSearchResponse<T> {
|
||||
content: T[];
|
||||
page: number;
|
||||
pageSize: number;
|
||||
totalElements: number;
|
||||
first: boolean;
|
||||
last: boolean;
|
||||
sort: string;
|
||||
content: T[]
|
||||
page: number
|
||||
pageSize: number
|
||||
totalElements: number
|
||||
first: boolean
|
||||
last: boolean
|
||||
sort: string
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user