From db7396f2251b741ea51acf0cfb135533c79bd6fe Mon Sep 17 00:00:00 2001 From: Akilan Date: Wed, 28 Jun 2023 00:36:22 +0100 Subject: [PATCH] updated webapi docs --- webapi/readme.md | 54 +++++++++++++++++++++++++++--------------------- 1 file changed, 30 insertions(+), 24 deletions(-) diff --git a/webapi/readme.md b/webapi/readme.md index c2d0554..a77d89a 100644 --- a/webapi/readme.md +++ b/webapi/readme.md @@ -75,6 +75,11 @@ These are the functions provided by the API: /merge/directory List all recent files shared by peers based on the similar file shared +/warehouse/create/uploadID Generates a UUID to track upload status +/warehouse/create/track/uploadID Tracks upload status when a upload is + ongoing to the warehaouse (Triggers after + the route "/warehouse/create" is called). + ``` # API Documentation @@ -277,29 +282,30 @@ The file type is an indication what type of content the file's data is: The file format is a more granular indicator about the content of a file: -| Type | Constant | Info | -| ---- | ---------------- | --------------------------------------------------- | -| 0 | FormatBinary | Binary/unspecified | -| 1 | FormatPDF | PDF document | -| 2 | FormatWord | Word document | -| 3 | FormatExcel | Excel | -| 4 | FormatPowerpoint | Powerpoint | -| 5 | FormatPicture | Pictures (including GIF, excluding icons) | -| 6 | FormatAudio | Audio files | -| 7 | FormatVideo | Video files | +| Type | Constant | Info | +|------| ---------------- |----------------------------------------------------| +| 0 | FormatBinary | Binary/unspecified | +| 1 | FormatPDF | PDF document | +| 2 | FormatWord | Word document | +| 3 | FormatExcel | Excel | +| 4 | FormatPowerpoint | Powerpoint | +| 5 | FormatPicture | Pictures (including GIF, excluding icons) | +| 6 | FormatAudio | Audio files | +| 7 | FormatVideo | Video files | | 8 | FormatContainer | Compressed files including ZIP, RAR, TAR and others | -| 9 | FormatHTML | HTML file | -| 10 | FormatText | Text file | -| 11 | FormatEbook | Ebook file | -| 12 | FormatCompressed | Compressed file | -| 13 | FormatDatabase | Database file | -| 14 | FormatEmail | Single email | -| 15 | FormatCSV | CSV file | -| 16 | FormatFolder | Virtual folder | -| 17 | FormatExecutable | Executable file | -| 18 | FormatInstaller | Installer | -| 19 | FormatAPK | APK | -| 20 | FormatISO | ISO | +| 9 | FormatHTML | HTML file | +| 10 | FormatText | Text file | +| 11 | FormatEbook | Ebook file | +| 12 | FormatCompressed | Compressed file | +| 13 | FormatDatabase | Database file | +| 14 | FormatEmail | Single email | +| 15 | FormatCSV | CSV file | +| 16 | FormatFolder | Virtual folder | +| 17 | FormatExecutable | Executable file | +| 18 | FormatInstaller | Installer | +| 19 | FormatAPK | APK | +| 20 | FormatISO | ISO | +| 21 | FormatPeernetSearch | File type to store peernet search history | ### Add File @@ -629,7 +635,6 @@ These are the available sort options: | 8 | SortSizeDesc | File size descending. Largest files first. | | 9 | SortSharedByCountAsc | Shared by count ascending. Files that are shared by the least count of peers first. | | 10 | SortSharedByCountDesc | Shared by count descending. Files that are shared by the most count of peers first. | -| 11 | Node | Only provide files of a search term based on the NodeID provided | The following filters are supported: @@ -1031,7 +1036,8 @@ type WarehouseResult struct { Example POST request to `http://127.0.0.1:112/warehouse/create`: ``` -Test file. +--form 'id=""' \ +--form 'File=@""' ``` Example response: