Skip to content

Commit

Permalink
types: add basic types
Browse files Browse the repository at this point in the history
  • Loading branch information
twlite committed Jul 17, 2024
1 parent 74314c9 commit 6948d7f
Showing 1 changed file with 59 additions and 0 deletions.
59 changes: 59 additions & 0 deletions src/stores/application/workspace.store.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
export interface WorkspaceEntity<T> {
name: string;
data: T;
}

export enum EntityType {
Directory = 'directory',
File = 'file',
}

export interface BaseEntity {
id: string;
name: string;
description: string;
createdAt: string;
updatedAt: string;
}

export interface RestResponse {
status: number;
bytes: number;
headers: Record<string, string>;
body: string;
bodyType: string;
}

export interface RestProperties {
method: string;
url: string;
headers: Record<string, string>;
body: string;
bodyType: string;
response: RestResponse;
}

export interface RestEntity extends BaseEntity {
type: EntityType;
properties: RestProperties;
}

export interface GraphqlEntity extends BaseEntity {}
export interface WebsocketEntity extends BaseEntity {}
export interface SocketIoEntity extends BaseEntity {}
export interface MqttEntity extends BaseEntity {}
export interface SmtpEntity extends BaseEntity {}

export interface IWorkspaceEntities {
rest: WorkspaceEntity<RestEntity>;
graphql: WorkspaceEntity<GraphqlEntity>;
websocket: WorkspaceEntity<WebsocketEntity>;
socketio: WorkspaceEntity<SocketIoEntity>;
mqtt: WorkspaceEntity<MqttEntity>;
smtp: WorkspaceEntity<SmtpEntity>;
}

export interface IWorkspace {
name: string;
entities: IWorkspaceEntities;
}

0 comments on commit 6948d7f

Please sign in to comment.