updated react-openapi
This commit is contained in:
85
react-openapi/src/types.ts
Normal file
85
react-openapi/src/types.ts
Normal file
@@ -0,0 +1,85 @@
|
||||
export interface SpecConfiguration {
|
||||
specUrl: string;
|
||||
baseApiUrl?: string;
|
||||
title?: string;
|
||||
getToken?: () => string | null;
|
||||
}
|
||||
|
||||
export interface ValidationMessage {
|
||||
type: "error" | "warning" | "info";
|
||||
message: string;
|
||||
}
|
||||
|
||||
export interface ResourceRelationship {
|
||||
fieldName: string;
|
||||
config: FKFieldConfig;
|
||||
targetSchemaName: string;
|
||||
}
|
||||
|
||||
export interface ResourceConfig {
|
||||
name: string;
|
||||
schemaName: string;
|
||||
path: string;
|
||||
primaryKey: string;
|
||||
displayFormat: string;
|
||||
listColumns: string[];
|
||||
fields: FieldConfig[];
|
||||
orderedFields: FieldConfig[];
|
||||
operations: {
|
||||
list: boolean;
|
||||
get: boolean;
|
||||
create: boolean;
|
||||
update: boolean;
|
||||
delete: boolean;
|
||||
};
|
||||
pagination: {
|
||||
limitParam: string;
|
||||
offsetParam: string;
|
||||
defaultLimit: number;
|
||||
} | null;
|
||||
relationships: ResourceRelationship[];
|
||||
}
|
||||
|
||||
export interface FieldConfig {
|
||||
name: string;
|
||||
label: string;
|
||||
description: string;
|
||||
type: string;
|
||||
format?: string;
|
||||
order: number;
|
||||
hidden: { form?: boolean; list?: boolean; detail?: boolean };
|
||||
filterable: boolean;
|
||||
sortable: boolean;
|
||||
readOnly: boolean;
|
||||
required: boolean;
|
||||
enumValues?: string[];
|
||||
fk?: FKFieldConfig;
|
||||
uiType?: string;
|
||||
uploadUrl?: string;
|
||||
refSchema?: string;
|
||||
inlineDisplayFormat?: string;
|
||||
isArray: boolean;
|
||||
}
|
||||
|
||||
export interface FKFieldConfig {
|
||||
resource: string;
|
||||
prefetch: boolean;
|
||||
}
|
||||
|
||||
export interface OpenApiSpec {
|
||||
openapi: string;
|
||||
info: {
|
||||
title: string;
|
||||
version: string;
|
||||
};
|
||||
servers?: { url: string }[];
|
||||
components?: {
|
||||
schemas?: Record<string, any>;
|
||||
};
|
||||
paths?: Record<string, any>;
|
||||
}
|
||||
|
||||
export interface ParsedListResponse {
|
||||
total?: number;
|
||||
items?: any[];
|
||||
}
|
||||
Reference in New Issue
Block a user