From 536f718465edbc2d456d535499d0d162a1e67d56 Mon Sep 17 00:00:00 2001 From: Anastasiia Date: Wed, 24 Apr 2024 13:00:20 +0300 Subject: [PATCH] MSP-3204 add type for ModulesPage --- src/pages/ModulesPage/module.type.ts | 89 ++++++++++++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 src/pages/ModulesPage/module.type.ts diff --git a/src/pages/ModulesPage/module.type.ts b/src/pages/ModulesPage/module.type.ts new file mode 100644 index 0000000..cdb7d1d --- /dev/null +++ b/src/pages/ModulesPage/module.type.ts @@ -0,0 +1,89 @@ +export interface RequiredModuleType { + id: string + name: string + required: boolean +} + +export interface AddressType { + ip: string + port: string +} + +export interface EndpointType { + extra: Record + inner: boolean + path: string + userAuthRequired: boolean +} + +export interface ModuleStatusType { + establishedAt: string + libVersion: string + version: string + address: AddressType + endpoints: EndpointType[] +} + +export interface ConfigType { + active: boolean + commonConfigs: string[] + createdAt: string + data: Record + description: string + id: string + moduleId: string + name: string + updatedAt: string + valid: boolean + version: number +} + +export interface JSONSchema { + $ref?: string + $schema?: string + additionalItems?: boolean | JSONSchema + additionalProperties?: boolean | JSONSchema + allOf?: JSONSchema[] + anyOf?: JSONSchema[] + default?: any + definitions?: Record + dependencies?: Record + description?: string + enum?: any[] + exclusiveMaximum?: boolean + exclusiveMinimum?: boolean + format?: string + items?: JSONSchema | JSONSchema[] + maxItems?: number + maxLength?: number + maxProperties?: number + maximum?: number + media?: JSONSchema + minItems?: number + minLength?: number + minProperties?: number + minimum?: number + multipleOf?: number + not?: JSONSchema + oneOf?: JSONSchema[] + pattern?: string + patternProperties?: Record + properties?: Record + required?: string[] + title?: string + type?: string | string[] + uniqueItems?: boolean +} + +export interface ModuleType { + active: boolean + configs: ConfigType[] + createdAt: string + id: string + lastConnectedAt: string + lastDisconnectedAt: string + name: string + requiredModules: RequiredModuleType[] + status: ModuleStatusType[] + configSchema: JSONSchema +}