diff options
author | Julien Dessaux | 2024-04-05 00:42:30 +0200 |
---|---|---|
committer | Julien Dessaux | 2024-04-07 23:01:52 +0200 |
commit | 234770b611df32178382b557df396db220070a7f (patch) | |
tree | 8c768846716eaf892ff75abe84d0f5c00e8519ff /nodejs/model/api.ts | |
parent | [node] Fixed basic procurement trading loop (diff) | |
download | spacetraders-234770b611df32178382b557df396db220070a7f.tar.gz spacetraders-234770b611df32178382b557df396db220070a7f.tar.bz2 spacetraders-234770b611df32178382b557df396db220070a7f.zip |
[node] Big Ships lib refactoring
Diffstat (limited to 'nodejs/model/api.ts')
-rw-r--r-- | nodejs/model/api.ts | 31 |
1 files changed, 0 insertions, 31 deletions
diff --git a/nodejs/model/api.ts b/nodejs/model/api.ts deleted file mode 100644 index 69c7ee1..0000000 --- a/nodejs/model/api.ts +++ /dev/null @@ -1,31 +0,0 @@ -export type APIError = { - error: string; - code: number; - data: unknown; -}; - -export type Meta = { - limit: number; - page: number; - total: number; -} - -export type Request = { - endpoint: string; // the path part of the url to call - method?: string; // HTTP method for `fetch` call, defaults to 'GET' - page?: number; // run a paginated request starting from this page until all the following pages are fetched - payload?: { [key:string]: any}; // optional json object that will be sent along the request - priority?: number; // optional priority value, defaults to 10. lower than 10 means the message will be sent faster -}; - -export type RequestPromise<T> = { - reject: (reason?: any) => void; - request: Request; - resolve: (value: Response<T> | PromiseLike<Response<T>>) => void; -}; - -export type Response<T> = { - data: T; - error?: APIError; - meta?: Meta; -} |