From 56d74d776f7c727d3002ce2ac77b6057b9b15ab5 Mon Sep 17 00:00:00 2001 From: Wing-Kam Wong Date: Mon, 19 Jul 2021 22:42:14 +0800 Subject: [PATCH] docs: fix broken structures Signed-off-by: Wing-Kam Wong --- .../en/developer-resources/rest-apis.md | 128 ++++++++++-------- 1 file changed, 74 insertions(+), 54 deletions(-) diff --git a/packages/noco-docs/content/en/developer-resources/rest-apis.md b/packages/noco-docs/content/en/developer-resources/rest-apis.md index 1e133ba7ef..242f235fde 100644 --- a/packages/noco-docs/content/en/developer-resources/rest-apis.md +++ b/packages/noco-docs/content/en/developer-resources/rest-apis.md @@ -2,39 +2,33 @@ title: 'REST APIs' position: 1 category: 'Developer Resources' -fullscreen: true menuTitle: 'REST APIs' --- -# Table of Content -* [Features](#features) -* [APIs overview](#api-overview) -* [Authentication](#authentication) -* [Access Control](#acess-control) -* [Migrations](#migrations) - -# Features + +## Features + * **Automatic REST APIs for any SQL database** - * Generates REST APIs for **ANY** MySql, Postgres, MSSQL, Sqlite database :fire: - * Serves APIs irrespective of naming conventions of primary keys, foreign keys, tables etc :fire: - * Support for composite primary keys :fire: - * REST APIs : - * CRUD, List, FindOne, Count, Exists, Distinct (Usual suspects) - * Pagination - * Sorting - * Column filtering - Fields :fire: - * Row filtering - Where :fire: - * Bulk insert, Bulk delete, Bulk read :fire: - * Relations - automatically detected - * Aggregate functions - * More - * Upload single file - * Upload multiple files - * Download file -* **Authentication** -* **Access Control** - - -# API Overview + * Generates REST APIs for **ANY** MySql, Postgres, MSSQL, Sqlite database + * Serves APIs irrespective of naming conventions of primary keys, foreign keys, tables etc + * Support for composite primary keys + * REST APIs : + * CRUD, List, FindOne, Count, Exists, Distinct (Usual suspects) + * Pagination + * Sorting + * Column filtering - Fields + * Row filtering - Where + * Bulk insert, Bulk delete, Bulk read + * Relations - automatically detected + * Aggregate functions + * More + * Upload single file + * Upload multiple files + * Download file + * Authentication + * Access Control + + +## API Overview | **Method** | **Path** | **Query Params** | **Description** | |---|---|---|---| @@ -62,7 +56,6 @@ menuTitle: 'REST APIs' - ### HasMany APIs | **Method** | **Path** | **Query Params** | **Description** | @@ -98,7 +91,7 @@ menuTitle: 'REST APIs' -## Query params +### Query params | **Name** | **Alias** | **Use case** | **Default value** |**Example value** | @@ -140,9 +133,9 @@ like - 'like' - (colName,like,%name) ``` -### Examples +## Examples -#### List +### List @@ -169,7 +162,7 @@ like - 'like' - (colName,like,%name) -#### List + where +### List + where @@ -240,7 +233,7 @@ GET /api/v1/country?where=(country,like,United%)&sort=-country -#### List + where + sort + offset +### List + where + sort + offset @@ -270,7 +263,7 @@ GET /api/v1/country?where=(country,like,United%)&sort=-country&offset=1 -#### List + limit +### List + limit @@ -389,7 +382,10 @@ POST /api/v1/country -```PUT /api/v1/country/1``` +``` +PUT /api/v1/country/1 +``` + ``` { "country": "Afghanistan1" @@ -397,7 +393,7 @@ POST /api/v1/country ``` - + ```json { @@ -429,6 +425,7 @@ true ``` + [⤴️](#api-overview) @@ -629,24 +626,29 @@ GET /api/v1/country/count "count": 161 } ``` -[⤴️](#api-overview) + + +[⤴️](#api-overview) ### Bulk Insert -```POST /api/v1/country/bulk``` +``` +POST /api/v1/country/bulk +``` + ```json - [ - { - "country": "test 1" - }, - { - "country": "test 2" - } - ] +[ + { + "country": "test 1" + }, + { + "country": "test 2" + } +] ``` @@ -659,6 +661,7 @@ GET /api/v1/country/count ``` + [⤴️](#api-overview) @@ -666,7 +669,10 @@ GET /api/v1/country/count -```PUT /api/v1/country/bulk``` +``` +PUT /api/v1/country/bulk +``` + ```json [ { @@ -690,6 +696,7 @@ GET /api/v1/country/count ``` + [⤴️](#api-overview) @@ -698,7 +705,10 @@ GET /api/v1/country/count -```DELETE /api/v1/country/bulk``` +``` +DELETE /api/v1/country/bulk +``` + ```json [ { @@ -720,6 +730,7 @@ GET /api/v1/country/count ``` + [⤴️](#api-overview) @@ -790,7 +801,10 @@ GET /api/v1/country/1/city -```POST /api/v1/country/1/city``` +``` +POST /api/v1/country/1/city +``` + ```json { "city": "test" @@ -817,7 +831,9 @@ GET /api/v1/country/1/city -```GET /api/v1/country/1/city/findOne?where=(city,like,ka%)``` +``` +GET /api/v1/country/1/city/findOne?where=(city,like,ka%) +``` @@ -891,7 +907,10 @@ GET /api/v1/country/1/city/251 -```POST /api/v1/country/1/city/251``` +``` +POST /api/v1/country/1/city/251 +``` + ``` { "city": "Kabul-1" @@ -943,6 +962,7 @@ GET /api/v1/country/has/city [⤴️](#belongsto-apis) + ### Get table and parent class within