From 27d033bfdf07518c126b0d9caa3a8702faee24a6 Mon Sep 17 00:00:00 2001 From: Pranav C Date: Sat, 16 Apr 2022 20:44:55 +0530 Subject: [PATCH 1/7] refactor: swagger apis tag corrections Signed-off-by: Pranav C --- scripts/sdk/swagger.json | 134 +++++++++++++++++++-------------------- 1 file changed, 67 insertions(+), 67 deletions(-) diff --git a/scripts/sdk/swagger.json b/scripts/sdk/swagger.json index fb8532e655..906f6b38bf 100644 --- a/scripts/sdk/swagger.json +++ b/scripts/sdk/swagger.json @@ -1018,7 +1018,7 @@ } }, "tags": [ - "DB Table" + "DB table" ] }, "get": { @@ -1067,7 +1067,7 @@ } ], "tags": [ - "DB Table" + "DB table" ] } }, @@ -1188,7 +1188,7 @@ } }, "tags": [ - "DB Table" + "DB table" ] }, "patch": { @@ -1205,7 +1205,7 @@ } }, "tags": [ - "DB Table" + "DB table" ], "requestBody": { "content": { @@ -1231,7 +1231,7 @@ } }, "tags": [ - "DB Table" + "DB table" ], "description": "" } @@ -1270,7 +1270,7 @@ } }, "tags": [ - "DB Table" + "DB table" ] } }, @@ -1303,7 +1303,7 @@ } }, "tags": [ - "DB Table column" + "DB table column" ] } }, @@ -1343,7 +1343,7 @@ } }, "tags": [ - "DB Table column" + "DB table column" ] }, "delete": { @@ -1355,7 +1355,7 @@ } }, "tags": [ - "DB Table column" + "DB table column" ] } }, @@ -1379,7 +1379,7 @@ } }, "tags": [ - "DB Table column" + "DB table column" ] } }, @@ -1403,7 +1403,7 @@ } }, "tags": [ - "DB View" + "DB view" ], "description": "" } @@ -1456,7 +1456,7 @@ } }, "tags": [ - "DB View" + "DB view" ] }, "delete": { @@ -1468,7 +1468,7 @@ } }, "tags": [ - "DB View" + "DB view" ] } }, @@ -1492,7 +1492,7 @@ } }, "tags": [ - "DB View" + "DB view" ], "description": "", "parameters": [ @@ -1526,7 +1526,7 @@ } }, "tags": [ - "DB View" + "DB view" ], "parameters": [ { @@ -1569,7 +1569,7 @@ }, "description": "", "tags": [ - "DB View Share" + "DB view share" ] } }, @@ -1605,7 +1605,7 @@ } }, "tags": [ - "DB View Share" + "DB view share" ] }, "patch": { @@ -1639,7 +1639,7 @@ "description": "" }, "tags": [ - "DB View Share" + "DB view share" ] }, "delete": { @@ -1652,7 +1652,7 @@ }, "description": "", "tags": [ - "DB View Share" + "DB view share" ] } }, @@ -1672,7 +1672,7 @@ "operationId": "db-view-column-list", "responses": {}, "tags": [ - "DB View Column" + "DB view column" ] }, "post": { @@ -1684,7 +1684,7 @@ } }, "tags": [ - "DB View Column" + "DB view column" ], "requestBody": { "content": { @@ -1723,7 +1723,7 @@ } }, "tags": [ - "DB View Column" + "DB view column" ], "requestBody": { "content": { @@ -1769,7 +1769,7 @@ } }, "tags": [ - "DB Table Sort" + "DB table sort" ] }, "post": { @@ -1781,7 +1781,7 @@ } }, "tags": [ - "DB Table Sort" + "DB table sort" ], "requestBody": { "content": { @@ -1821,7 +1821,7 @@ } }, "tags": [ - "DB Table Sort" + "DB table sort" ] }, "patch": { @@ -1833,7 +1833,7 @@ } }, "tags": [ - "DB Table Sort" + "DB table sort" ], "requestBody": { "content": { @@ -1854,7 +1854,7 @@ } }, "tags": [ - "DB Table Sort" + "DB table sort" ] } }, @@ -1878,7 +1878,7 @@ } }, "tags": [ - "DB Table Filter" + "DB table filter" ] }, "post": { @@ -1890,7 +1890,7 @@ } }, "tags": [ - "DB Table Filter" + "DB table filter" ], "requestBody": { "content": { @@ -1923,7 +1923,7 @@ } }, "tags": [ - "DB Table Webhook Filter" + "DB table webhook filter" ] }, "post": { @@ -1935,7 +1935,7 @@ } }, "tags": [ - "DB Table Webhook Filter" + "DB table webhook filter" ], "requestBody": { "content": { @@ -1975,7 +1975,7 @@ } }, "tags": [ - "DB Table Filter" + "DB table filter" ] }, "patch": { @@ -1987,7 +1987,7 @@ } }, "tags": [ - "DB Table Filter" + "DB table filter" ], "requestBody": { "content": { @@ -2008,7 +2008,7 @@ } }, "tags": [ - "DB Table Filter" + "DB table filter" ] } }, @@ -2039,7 +2039,7 @@ } }, "tags": [ - "DB Table Filter" + "DB table filter" ] } }, @@ -2070,7 +2070,7 @@ } }, "tags": [ - "DB View" + "DB view" ], "requestBody": { "content": { @@ -2111,7 +2111,7 @@ }, "description": "", "tags": [ - "DB View" + "DB view" ], "requestBody": { "content": { @@ -2144,7 +2144,7 @@ } }, "tags": [ - "DB View" + "DB view" ], "requestBody": { "content": { @@ -2172,7 +2172,7 @@ } }, "tags": [ - "DB View" + "DB view" ] } }, @@ -2203,7 +2203,7 @@ } }, "tags": [ - "DB View" + "DB view" ], "requestBody": { "content": { @@ -2246,7 +2246,7 @@ } }, "tags": [ - "DB View" + "DB view" ] } }, @@ -2275,7 +2275,7 @@ } }, "tags": [ - "DB View" + "DB view" ], "requestBody": { "content": { @@ -2316,7 +2316,7 @@ } }, "tags": [ - "DB View" + "DB view" ], "requestBody": { "content": { @@ -2349,7 +2349,7 @@ } }, "tags": [ - "DB View" + "DB view" ], "requestBody": { "content": { @@ -2377,7 +2377,7 @@ } }, "tags": [ - "DB View" + "DB view" ] } }, @@ -2460,7 +2460,7 @@ "operationId": "db-table-row-list", "description": "", "tags": [ - "DB Table Row" + "DB table row" ], "parameters": [ { @@ -2510,7 +2510,7 @@ } }, "tags": [ - "DB Table Row" + "DB table row" ], "requestBody": { "content": { @@ -2561,7 +2561,7 @@ "operationId": "db-view-row-list", "description": "", "tags": [ - "DB View Row" + "DB view row" ], "parameters": [ { @@ -2617,7 +2617,7 @@ } }, "tags": [ - "DB View Row" + "DB view row" ], "requestBody": { "content": { @@ -2668,7 +2668,7 @@ "operationId": "db-view-row-count", "description": "", "tags": [ - "DB View Row" + "DB view row" ], "parameters": [ { @@ -2755,7 +2755,7 @@ }, "description": "", "tags": [ - "DB View Row" + "DB view row" ] }, "patch": { @@ -2772,7 +2772,7 @@ } }, "tags": [ - "DB View Row" + "DB view row" ], "requestBody": { "content": { @@ -2791,7 +2791,7 @@ } }, "tags": [ - "DB View Row" + "DB view row" ], "description": "" } @@ -2846,7 +2846,7 @@ }, "description": "", "tags": [ - "DB Table Row" + "DB table row" ] }, "patch": { @@ -2863,7 +2863,7 @@ } }, "tags": [ - "DB Table Row" + "DB table row" ], "requestBody": { "content": { @@ -2882,7 +2882,7 @@ } }, "tags": [ - "DB Table Row" + "DB table row" ], "description": "" } @@ -2928,7 +2928,7 @@ } }, "tags": [ - "DB Table Row" + "DB table row" ], "requestBody": { "content": { @@ -2952,7 +2952,7 @@ } }, "tags": [ - "DB Table Row" + "DB table row" ], "requestBody": { "content": { @@ -2976,7 +2976,7 @@ } }, "tags": [ - "DB Table Row" + "DB table row" ], "requestBody": { "content": { @@ -3028,7 +3028,7 @@ } }, "tags": [ - "DB Table Row" + "DB table row" ], "requestBody": { "content": { @@ -3052,7 +3052,7 @@ } }, "tags": [ - "DB Table Row" + "DB table row" ], "requestBody": { "content": { @@ -4136,7 +4136,7 @@ "description": "", "parameters": [], "tags": [ - "DB Table Webhook" + "DB table webhook" ] }, "post": { @@ -4165,7 +4165,7 @@ } }, "tags": [ - "DB Table Webhook" + "DB table webhook" ] } }, @@ -4194,7 +4194,7 @@ } }, "tags": [ - "DB Table Webhook" + "DB table webhook" ], "requestBody": { "content": { @@ -4283,7 +4283,7 @@ "description": "", "parameters": [], "tags": [ - "DB Table Webhook" + "DB table webhook" ] } }, @@ -4314,7 +4314,7 @@ } }, "tags": [ - "DB Table Webhook" + "DB table webhook" ], "requestBody": { "content": { @@ -4335,7 +4335,7 @@ } }, "tags": [ - "DB Table Webhook" + "DB table webhook" ] } }, From 8f176379edff0720dad7112bc6d6d3d25601ad0f Mon Sep 17 00:00:00 2001 From: Pranav C Date: Sat, 16 Apr 2022 23:07:37 +0530 Subject: [PATCH 2/7] refactor: swagger api id update Signed-off-by: Pranav C --- scripts/sdk/swagger.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/sdk/swagger.json b/scripts/sdk/swagger.json index 906f6b38bf..0a678815d2 100644 --- a/scripts/sdk/swagger.json +++ b/scripts/sdk/swagger.json @@ -2875,7 +2875,7 @@ }, "delete": { "summary": "", - "operationId": "db-table-row-model-delete", + "operationId": "db-table-row-delete", "responses": { "200": { "description": "OK" From 602439254c5c4c17905dce21a5a54293067626a9 Mon Sep 17 00:00:00 2001 From: Pranav C Date: Sat, 16 Apr 2022 23:14:20 +0530 Subject: [PATCH 3/7] feat: add table row count api Signed-off-by: Pranav C --- .../noco/meta/api/dataApis/dataAliasApis.ts | 14 +++-- scripts/sdk/swagger.json | 61 +++++++++++++++++++ 2 files changed, 71 insertions(+), 4 deletions(-) diff --git a/packages/nocodb/src/lib/noco/meta/api/dataApis/dataAliasApis.ts b/packages/nocodb/src/lib/noco/meta/api/dataApis/dataAliasApis.ts index 7f1c74438b..00a29f3b84 100644 --- a/packages/nocodb/src/lib/noco/meta/api/dataApis/dataAliasApis.ts +++ b/packages/nocodb/src/lib/noco/meta/api/dataApis/dataAliasApis.ts @@ -134,6 +134,16 @@ router.get( '/api/v1/db/data/:orgs/:projectName/:tableName', ncMetaAclMw(dataList, 'dataList') ); + +router.get( + '/api/v1/db/data/:orgs/:projectName/:tableName/count', + ncMetaAclMw(dataCount, 'dataCount') +); +router.get( + '/api/v1/db/data/:orgs/:projectName/:tableName/views/:viewName/count', + ncMetaAclMw(dataCount, 'dataCount') +); + router.get( '/api/v1/db/data/:orgs/:projectName/:tableName/:rowId', ncMetaAclMw(dataRead, 'dataRead') @@ -157,10 +167,6 @@ router.get( '/api/v1/db/data/:orgs/:projectName/:tableName/views/:viewName', ncMetaAclMw(dataList, 'dataList') ); -router.get( - '/api/v1/db/data/:orgs/:projectName/:tableName/views/:viewName/count', - ncMetaAclMw(dataCount, 'dataCount') -); router.post( '/api/v1/db/data/:orgs/:projectName/:tableName', diff --git a/scripts/sdk/swagger.json b/scripts/sdk/swagger.json index 0a678815d2..3177cf7c12 100644 --- a/scripts/sdk/swagger.json +++ b/scripts/sdk/swagger.json @@ -2521,6 +2521,67 @@ } } }, + "/api/v1/db/data/{orgs}/{projectName}/{tableName}/count": { + "parameters": [ + { + "schema": { + "type": "string" + }, + "name": "orgs", + "in": "path", + "required": true + }, + { + "schema": { + "type": "string" + }, + "name": "projectName", + "in": "path", + "required": true + }, + { + "schema": { + "type": "string" + }, + "name": "tableName", + "in": "path", + "required": true + } + ], + "get": { + "summary": "", + "operationId": "db-table-row-count", + "description": "", + "tags": [ + "DB table row" + ], + "parameters": [ + { + "schema": { + "type": "string" + }, + "in": "query", + "name": "where" + }, + { + "schema": {}, + "in": "query", + "name": "nested", + "description": "Query params for nested data" + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": {} + } + } + } + } + } + }, "/api/v1/db/data/{orgs}/{projectName}/{tableName}/views/{viewName}": { "parameters": [ { From e911948641b1df0485bfa30a7e06cbd4032a2dd2 Mon Sep 17 00:00:00 2001 From: Pranav C Date: Sat, 16 Apr 2022 23:27:31 +0530 Subject: [PATCH 4/7] docs: add summary to docker apis Signed-off-by: Pranav C --- scripts/sdk/swagger.json | 67 ++++++++++++++++++++-------------------- 1 file changed, 34 insertions(+), 33 deletions(-) diff --git a/scripts/sdk/swagger.json b/scripts/sdk/swagger.json index 3177cf7c12..f32e247509 100644 --- a/scripts/sdk/swagger.json +++ b/scripts/sdk/swagger.json @@ -170,7 +170,7 @@ "/api/v1/db/auth/user/me": { "parameters": [], "get": { - "summary": "User Info", + "summary": "User info", "operationId": "auth-me", "responses": { "200": { @@ -216,7 +216,7 @@ }, "/api/v1/db/auth/password/forgot": { "post": { - "summary": "Password Forgot", + "summary": "Password forgot", "operationId": "auth-password-forgot", "responses": { "200": { @@ -250,7 +250,7 @@ }, "/api/v1/db/auth/password/change": { "post": { - "summary": "Password Change", + "summary": "Password change", "operationId": "auth-password-change", "responses": { "200": { @@ -338,7 +338,7 @@ }, "/api/v1/db/auth/token/validate/{token}": { "post": { - "summary": "Reset Token Verify", + "summary": "Reset token verify", "operationId": "auth-password-reset-token-validate", "responses": { "200": { @@ -363,7 +363,7 @@ }, "/api/v1/db/auth/email/validate/{token}": { "post": { - "summary": "Verify Email", + "summary": "Verify email", "operationId": "auth-email-validate", "responses": { "200": { @@ -388,7 +388,7 @@ }, "/api/v1/db/auth/password/reset/{token}": { "post": { - "summary": "Password Reset", + "summary": "Password reset", "operationId": "auth-password-reset", "responses": { "200": { @@ -427,7 +427,7 @@ }, "/api/v1/db/auth/token/refresh": { "post": { - "summary": "Refresh Token", + "summary": "Refresh token", "operationId": "auth-token-refresh", "responses": { "200": { @@ -443,7 +443,7 @@ }, "/api/v1/db/meta/projects/{projectId}/users": { "get": { - "summary": "Project Users", + "summary": "Project users", "operationId": "auth-project-user-list", "responses": { "200": { @@ -531,7 +531,7 @@ } ], "get": { - "summary": "Project Info", + "summary": "Project info", "operationId": "project-meta-get", "responses": { "200": { @@ -596,7 +596,7 @@ } ], "patch": { - "summary": "Project User Update", + "summary": "Project user update", "operationId": "auth-project-user-update", "responses": { "200": { @@ -620,7 +620,7 @@ ] }, "delete": { - "summary": "Project User Remove", + "summary": "Project user remove", "operationId": "auth-project-user-remove", "responses": { "200": { @@ -706,7 +706,7 @@ "/api/v1/db/meta/projects/": { "parameters": [], "get": { - "summary": "", + "summary": "Project list", "operationId": "project-list", "responses": { "201": { @@ -750,7 +750,7 @@ ] }, "post": { - "summary": "", + "summary": "Project create", "operationId": "project-create", "responses": { "200": { @@ -803,7 +803,7 @@ } ], "get": { - "summary": "", + "summary": "Project read", "operationId": "project-read", "description": "Read project details", "parameters": [ @@ -834,7 +834,7 @@ } }, "delete": { - "summary": "", + "summary": "Project delete", "operationId": "project-delete", "responses": { "200": { @@ -2456,7 +2456,7 @@ } ], "get": { - "summary": "", + "summary": "Table row list", "operationId": "db-table-row-list", "description": "", "tags": [ @@ -2497,7 +2497,7 @@ } }, "post": { - "summary": "", + "summary": "Table row create", "operationId": "db-table-row-create", "responses": { "200": { @@ -2549,7 +2549,7 @@ } ], "get": { - "summary": "", + "summary": "table rows count", "operationId": "db-table-row-count", "description": "", "tags": [ @@ -2618,7 +2618,7 @@ } ], "get": { - "summary": "", + "summary": "Table view row list", "operationId": "db-view-row-list", "description": "", "tags": [ @@ -2665,7 +2665,7 @@ } }, "post": { - "summary": "", + "summary": "Table view row create", "operationId": "db-view-row-create", "responses": { "200": { @@ -2725,7 +2725,7 @@ } ], "get": { - "summary": "", + "summary": "Table view rows count", "operationId": "db-view-row-count", "description": "", "tags": [ @@ -2802,7 +2802,7 @@ } ], "get": { - "summary": "", + "summary": "Table view row read", "operationId": "db-view-row-read", "responses": { "201": { @@ -2820,7 +2820,7 @@ ] }, "patch": { - "summary": "", + "summary": "Table view row update", "operationId": "db-view-row-update", "responses": { "200": { @@ -2844,7 +2844,7 @@ } }, "delete": { - "summary": "", + "summary": "Table view row delete", "operationId": "db-view-row-delete", "responses": { "200": { @@ -2893,7 +2893,7 @@ } ], "get": { - "summary": "", + "summary": "Table row read", "operationId": "db-table-row-read", "responses": { "201": { @@ -2911,7 +2911,7 @@ ] }, "patch": { - "summary": "", + "summary": "Table row update", "operationId": "db-table-row-update", "responses": { "200": { @@ -3172,7 +3172,7 @@ } ], "get": { - "summary": "", + "summary": "Table view rows export", "operationId": "db-view-row-export", "description": "CSV or Excel export", "tags": [ @@ -3239,7 +3239,7 @@ } ], "get": { - "summary": "", + "summary": "Tablerows export", "operationId": "db-table-row-csv-export", "description": "CSV or Excel export", "tags": [ @@ -3322,7 +3322,7 @@ } ], "get": { - "summary": "", + "summary": "Nested relations row list", "operationId": "db-table-row-nested-list", "responses": { "200": { @@ -3419,7 +3419,7 @@ } ], "post": { - "summary": "", + "summary": "Nested relations row add", "operationId": "db-table-row-nested-add", "responses": { "200": { @@ -3449,10 +3449,11 @@ "in": "query", "name": "offset" } - ] + ], + "description": "" }, "delete": { - "summary": "", + "summary": "Nested relations row remove", "operationId": "db-table-row-nested-remove", "responses": { "200": { @@ -3525,7 +3526,7 @@ } ], "get": { - "summary": "", + "summary": "Referenced tables rows excluding current records children/parent", "operationId": "db-table-row-nested-children-excluded-list", "responses": { "200": { From e0f3579756811d3567ee8d3ac026fdf9ab38d61b Mon Sep 17 00:00:00 2001 From: Pranav C Date: Sat, 16 Apr 2022 23:33:38 +0530 Subject: [PATCH 5/7] docs: added summary for table-row-delete swagger api Signed-off-by: Pranav C --- scripts/sdk/swagger.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/sdk/swagger.json b/scripts/sdk/swagger.json index f32e247509..42971ea634 100644 --- a/scripts/sdk/swagger.json +++ b/scripts/sdk/swagger.json @@ -2935,7 +2935,7 @@ } }, "delete": { - "summary": "", + "summary": "Table row delete", "operationId": "db-table-row-delete", "responses": { "200": { From 713a03b022eb1745311b0f0dd1cc859f09ed65b5 Mon Sep 17 00:00:00 2001 From: Wing-Kam Wong Date: Sun, 17 Apr 2022 15:17:29 +0800 Subject: [PATCH 6/7] chore: run generate:sdk Signed-off-by: Wing-Kam Wong --- packages/nocodb-sdk/src/lib/Api.ts | 205 ++++++++++++++++++----------- 1 file changed, 125 insertions(+), 80 deletions(-) diff --git a/packages/nocodb-sdk/src/lib/Api.ts b/packages/nocodb-sdk/src/lib/Api.ts index a36717bc63..ebd9e89a0d 100644 --- a/packages/nocodb-sdk/src/lib/Api.ts +++ b/packages/nocodb-sdk/src/lib/Api.ts @@ -851,7 +851,7 @@ export class Api< * * @tags Auth * @name Me - * @summary User Info + * @summary User info * @request GET:/api/v1/db/auth/user/me * @response `200` `UserInfoType` OK */ @@ -869,7 +869,7 @@ export class Api< * * @tags Auth * @name PasswordForgot - * @summary Password Forgot + * @summary Password forgot * @request POST:/api/v1/db/auth/password/forgot * @response `200` `void` OK * @response `401` `void` Unauthorized @@ -888,7 +888,7 @@ export class Api< * * @tags Auth * @name PasswordChange - * @summary Password Change + * @summary Password change * @request POST:/api/v1/db/auth/password/change * @response `200` `{ msg?: string }` OK * @response `400` `{ msg?: string }` Bad request @@ -911,7 +911,7 @@ export class Api< * * @tags Auth * @name PasswordResetTokenValidate - * @summary Reset Token Verify + * @summary Reset token verify * @request POST:/api/v1/db/auth/token/validate/{token} * @response `200` `void` OK */ @@ -927,7 +927,7 @@ export class Api< * * @tags Auth * @name EmailValidate - * @summary Verify Email + * @summary Verify email * @request POST:/api/v1/db/auth/email/validate/{token} * @response `200` `void` OK */ @@ -943,7 +943,7 @@ export class Api< * * @tags Auth * @name PasswordReset - * @summary Password Reset + * @summary Password reset * @request POST:/api/v1/db/auth/password/reset/{token} * @response `200` `void` OK */ @@ -965,7 +965,7 @@ export class Api< * * @tags Auth * @name TokenRefresh - * @summary Refresh Token + * @summary Refresh token * @request POST:/api/v1/db/auth/token/refresh * @response `200` `void` OK */ @@ -981,7 +981,7 @@ export class Api< * * @tags Auth * @name ProjectUserList - * @summary Project Users + * @summary Project users * @request GET:/api/v1/db/meta/projects/{projectId}/users * @response `200` `{ users?: { list: (UserType)[], pageInfo: PaginatedType } }` OK */ @@ -1024,7 +1024,7 @@ export class Api< * * @tags Auth * @name ProjectUserUpdate - * @summary Project User Update + * @summary Project user update * @request PATCH:/api/v1/db/meta/projects/{projectId}/users/{userId} * @response `200` `any` OK */ @@ -1048,7 +1048,7 @@ export class Api< * * @tags Auth * @name ProjectUserRemove - * @summary Project User Remove + * @summary Project user remove * @request DELETE:/api/v1/db/meta/projects/{projectId}/users/{userId} * @response `200` `any` OK */ @@ -1070,7 +1070,7 @@ export class Api< * * @tags Project * @name MetaGet - * @summary Project Info + * @summary Project info * @request GET:/api/v1/db/meta/projects/{projectId}/info * @response `200` `{ Node?: string, Arch?: string, Platform?: string, Docker?: boolean, Database?: string, ProjectOnRootDB?: string, RootDB?: string, PackageVersion?: string }` OK */ @@ -1143,6 +1143,7 @@ export class Api< * * @tags Project * @name List + * @summary Project list * @request GET:/api/v1/db/meta/projects/ * @response `201` `ProjectListType` */ @@ -1162,6 +1163,7 @@ export class Api< * * @tags Project * @name Create + * @summary Project create * @request POST:/api/v1/db/meta/projects/ * @response `200` `ProjectType` OK */ @@ -1183,6 +1185,7 @@ export class Api< * * @tags Project * @name Read + * @summary Project read * @request GET:/api/v1/db/meta/projects/{projectId} * @response `200` `object` OK */ @@ -1199,6 +1202,7 @@ export class Api< * * @tags Project * @name Delete + * @summary Project delete * @request DELETE:/api/v1/db/meta/projects/{projectId} * @response `200` `void` OK */ @@ -1340,7 +1344,7 @@ export class Api< /** * No description * - * @tags DB Table + * @tags DB table * @name Create * @request POST:/api/v1/db/meta/projects/{projectId}/tables * @response `200` `TableType` OK @@ -1362,7 +1366,7 @@ export class Api< /** * No description * - * @tags DB Table + * @tags DB table * @name List * @request GET:/api/v1/db/meta/projects/{projectId}/tables * @response `200` `TableListType` @@ -1387,7 +1391,7 @@ export class Api< /** * No description * - * @tags DB Table + * @tags DB table * @name Read * @request GET:/api/v1/db/meta/tables/{tableId} * @response `200` `TableInfoType` OK @@ -1403,7 +1407,7 @@ export class Api< /** * No description * - * @tags DB Table + * @tags DB table * @name Update * @request PATCH:/api/v1/db/meta/tables/{tableId} * @response `200` `any` OK @@ -1425,7 +1429,7 @@ export class Api< /** * No description * - * @tags DB Table + * @tags DB table * @name Delete * @request DELETE:/api/v1/db/meta/tables/{tableId} * @response `200` `void` OK @@ -1440,7 +1444,7 @@ export class Api< /** * No description * - * @tags DB Table + * @tags DB table * @name Reorder * @request POST:/api/v1/db/meta/tables/{tableId}/reorder * @response `200` `void` OK @@ -1462,7 +1466,7 @@ export class Api< /** * No description * - * @tags DB Table column + * @tags DB table column * @name Create * @summary Column create * @request POST:/api/v1/db/meta/tables/{tableId}/columns @@ -1484,7 +1488,7 @@ export class Api< /** * No description * - * @tags DB Table column + * @tags DB table column * @name Update * @summary Column Update * @request PATCH:/api/v1/db/meta/columns/{columnId} @@ -1507,7 +1511,7 @@ export class Api< /** * No description * - * @tags DB Table column + * @tags DB table column * @name Delete * @request DELETE:/api/v1/db/meta/columns/{columnId} * @response `200` `void` OK @@ -1522,7 +1526,7 @@ export class Api< /** * No description * - * @tags DB Table column + * @tags DB table column * @name PrimaryColumnSet * @request POST:/api/v1/db/meta/columns/{columnId}/primary * @response `200` `void` OK @@ -1538,7 +1542,7 @@ export class Api< /** * No description * - * @tags DB View + * @tags DB view * @name List * @request GET:/api/v1/db/meta/tables/{tableId}/views * @response `200` `ViewListType` @@ -1553,7 +1557,7 @@ export class Api< /** * No description * - * @tags DB View + * @tags DB view * @name Update * @request PATCH:/api/v1/db/meta/views/{viewId} * @response `200` `void` OK @@ -1579,7 +1583,7 @@ export class Api< /** * No description * - * @tags DB View + * @tags DB view * @name Delete * @request DELETE:/api/v1/db/meta/views/{viewId} * @response `200` `void` OK @@ -1594,7 +1598,7 @@ export class Api< /** * No description * - * @tags DB View + * @tags DB view * @name ShowAllColumn * @request POST:/api/v1/db/meta/views/{viewId}/show-all * @response `200` `void` OK @@ -1614,7 +1618,7 @@ export class Api< /** * No description * - * @tags DB View + * @tags DB view * @name HideAllColumn * @request POST:/api/v1/db/meta/views/{viewId}/hide-all * @response `200` `void` OK @@ -1634,7 +1638,7 @@ export class Api< /** * No description * - * @tags DB View + * @tags DB view * @name GridCreate * @request POST:/api/v1/db/meta/tables/{tableId}/grids * @response `200` `GridType` OK @@ -1652,7 +1656,7 @@ export class Api< /** * No description * - * @tags DB View + * @tags DB view * @name FormCreate * @request POST:/api/v1/db/meta/tables/{tableId}/forms * @response `200` `FormType` OK @@ -1670,7 +1674,7 @@ export class Api< /** * No description * - * @tags DB View + * @tags DB view * @name FormUpdate * @request PATCH:/api/v1/db/meta/forms/{formId} * @response `200` `void` OK @@ -1687,7 +1691,7 @@ export class Api< /** * No description * - * @tags DB View + * @tags DB view * @name FormRead * @request GET:/api/v1/db/meta/forms/{formId} * @response `200` `FormType` OK @@ -1703,7 +1707,7 @@ export class Api< /** * No description * - * @tags DB View + * @tags DB view * @name FormColumnUpdate * @request PATCH:/api/v1/db/meta/form-columns/{formViewColumnId} * @response `200` `any` OK @@ -1725,7 +1729,7 @@ export class Api< /** * No description * - * @tags DB View + * @tags DB view * @name GridColumnsList * @request GET:/api/v1/db/meta/grids/{gridId}/grid-columns * @response `200` `(GridColumnType)[]` OK @@ -1741,7 +1745,7 @@ export class Api< /** * No description * - * @tags DB View + * @tags DB view * @name GridColumnUpdate * @request PATCH:/api/v1/db/meta/grid-columns/{columnId} * @response `200` `any` OK @@ -1763,7 +1767,7 @@ export class Api< /** * No description * - * @tags DB View + * @tags DB view * @name GalleryCreate * @request POST:/api/v1/db/meta/tables/{tableId}/galleries * @response `200` `object` OK @@ -1785,7 +1789,7 @@ export class Api< /** * No description * - * @tags DB View + * @tags DB view * @name GalleryUpdate * @request PATCH:/api/v1/db/meta/galleries/{galleryId} * @response `200` `void` OK @@ -1806,7 +1810,7 @@ export class Api< /** * No description * - * @tags DB View + * @tags DB view * @name GalleryRead * @request GET:/api/v1/db/meta/galleries/{galleryId} * @response `200` `GalleryType` OK @@ -1823,7 +1827,7 @@ export class Api< /** * No description * - * @tags DB View Share + * @tags DB view share * @name List * @summary Shared view list * @request GET:/api/v1/db/meta/tables/{tableId}/share @@ -1840,7 +1844,7 @@ export class Api< /** * No description * - * @tags DB View Share + * @tags DB view share * @name Create * @request POST:/api/v1/db/meta/views/{viewId}/share * @response `200` `{ uuid?: string }` OK @@ -1856,7 +1860,7 @@ export class Api< /** * No description * - * @tags DB View Share + * @tags DB view share * @name Update * @request PATCH:/api/v1/db/meta/views/{viewId}/share * @response `200` `SharedViewType` OK @@ -1878,7 +1882,7 @@ export class Api< /** * No description * - * @tags DB View Share + * @tags DB view share * @name Delete * @request DELETE:/api/v1/db/meta/views/{viewId}/share * @response `200` `void` OK @@ -1894,7 +1898,7 @@ export class Api< /** * No description * - * @tags DB View Column + * @tags DB view column * @name List * @request GET:/api/v1/db/meta/views/{viewId}/columns */ @@ -1908,7 +1912,7 @@ export class Api< /** * No description * - * @tags DB View Column + * @tags DB view column * @name Create * @request POST:/api/v1/db/meta/views/{viewId}/columns * @response `200` `void` OK @@ -1925,7 +1929,7 @@ export class Api< /** * No description * - * @tags DB View Column + * @tags DB view column * @name Update * @request PATCH:/api/v1/db/meta/views/{viewId}/columns/{columnId} * @response `200` `void` OK @@ -1948,7 +1952,7 @@ export class Api< /** * No description * - * @tags DB Table Sort + * @tags DB table sort * @name List * @request GET:/api/v1/db/meta/views/{viewId}/sorts * @response `200` `{ uuid?: string, url?: string }` OK @@ -1964,7 +1968,7 @@ export class Api< /** * No description * - * @tags DB Table Sort + * @tags DB table sort * @name Create * @request POST:/api/v1/db/meta/views/{viewId}/sorts * @response `200` `void` OK @@ -1981,7 +1985,7 @@ export class Api< /** * No description * - * @tags DB Table Sort + * @tags DB table sort * @name Get * @request GET:/api/v1/db/meta/sorts/{sortId} * @response `200` `SortType` OK @@ -1997,7 +2001,7 @@ export class Api< /** * No description * - * @tags DB Table Sort + * @tags DB table sort * @name Update * @request PATCH:/api/v1/db/meta/sorts/{sortId} * @response `200` `void` OK @@ -2014,7 +2018,7 @@ export class Api< /** * No description * - * @tags DB Table Sort + * @tags DB table sort * @name Delete * @request DELETE:/api/v1/db/meta/sorts/{sortId} * @response `200` `void` OK @@ -2030,7 +2034,7 @@ export class Api< /** * No description * - * @tags DB Table Filter + * @tags DB table filter * @name Read * @request GET:/api/v1/db/meta/views/{viewId}/filters * @response `200` `FilterListType` @@ -2045,7 +2049,7 @@ export class Api< /** * No description * - * @tags DB Table Filter + * @tags DB table filter * @name Create * @request POST:/api/v1/db/meta/views/{viewId}/filters * @response `200` `void` OK @@ -2062,7 +2066,7 @@ export class Api< /** * No description * - * @tags DB Table Filter + * @tags DB table filter * @name Get * @request GET:/api/v1/db/meta/filters/{filterId} * @response `200` `FilterType` OK @@ -2078,7 +2082,7 @@ export class Api< /** * No description * - * @tags DB Table Filter + * @tags DB table filter * @name Update * @request PATCH:/api/v1/db/meta/filters/{filterId} * @response `200` `void` OK @@ -2095,7 +2099,7 @@ export class Api< /** * No description * - * @tags DB Table Filter + * @tags DB table filter * @name Delete * @request DELETE:/api/v1/db/meta/filters/{filterId} * @response `200` `void` OK @@ -2110,7 +2114,7 @@ export class Api< /** * No description * - * @tags DB Table Filter + * @tags DB table filter * @name ChildrenRead * @request GET:/api/v1/db/meta/filters/{filterGroupId}/children * @response `200` `FilterType` OK @@ -2127,7 +2131,7 @@ export class Api< /** * No description * - * @tags DB Table Webhook Filter + * @tags DB table webhook filter * @name Read * @request GET:/api/v1/db/meta/hooks/{hookId}/filters * @response `200` `FilterListType` @@ -2142,7 +2146,7 @@ export class Api< /** * No description * - * @tags DB Table Webhook Filter + * @tags DB table webhook filter * @name Create * @request POST:/api/v1/db/meta/hooks/{hookId}/filters * @response `200` `void` OK @@ -2160,8 +2164,9 @@ export class Api< /** * No description * - * @tags DB Table Row + * @tags DB table row * @name List + * @summary Table row list * @request GET:/api/v1/db/data/{orgs}/{projectName}/{tableName} * @response `200` `any` OK */ @@ -2183,8 +2188,9 @@ export class Api< /** * No description * - * @tags DB Table Row + * @tags DB table row * @name Create + * @summary Table row create * @request POST:/api/v1/db/data/{orgs}/{projectName}/{tableName} * @response `200` `any` OK */ @@ -2207,8 +2213,33 @@ export class Api< /** * No description * - * @tags DB Table Row + * @tags DB table row + * @name Count + * @summary table rows count + * @request GET:/api/v1/db/data/{orgs}/{projectName}/{tableName}/count + * @response `200` `any` OK + */ + count: ( + orgs: string, + projectName: string, + tableName: string, + query?: { where?: string; nested?: any }, + params: RequestParams = {} + ) => + this.request({ + path: `/api/v1/db/data/${orgs}/${projectName}/${tableName}/count`, + method: 'GET', + query: query, + format: 'json', + ...params, + }), + + /** + * No description + * + * @tags DB table row * @name Read + * @summary Table row read * @request GET:/api/v1/db/data/{orgs}/{projectName}/{tableName}/{rowId} * @response `201` `any` Created */ @@ -2229,8 +2260,9 @@ export class Api< /** * No description * - * @tags DB Table Row + * @tags DB table row * @name Update + * @summary Table row update * @request PATCH:/api/v1/db/data/{orgs}/{projectName}/{tableName}/{rowId} * @response `200` `any` OK */ @@ -2254,12 +2286,13 @@ export class Api< /** * No description * - * @tags DB Table Row - * @name ModelDelete + * @tags DB table row + * @name Delete + * @summary Table row delete * @request DELETE:/api/v1/db/data/{orgs}/{projectName}/{tableName}/{rowId} * @response `200` `void` OK */ - modelDelete: ( + delete: ( orgs: string, projectName: string, tableName: string, @@ -2275,7 +2308,7 @@ export class Api< /** * No description * - * @tags DB Table Row + * @tags DB table row * @name BulkCreate * @summary Bulk insert table rows * @request POST:/api/v1/db/data/bulk/{orgs}/{projectName}/{tableName} @@ -2300,7 +2333,7 @@ export class Api< /** * No description * - * @tags DB Table Row + * @tags DB table row * @name BulkUpdate * @summary Bulk update all table rows by IDs * @request PATCH:/api/v1/db/data/bulk/{orgs}/{projectName}/{tableName} @@ -2325,7 +2358,7 @@ export class Api< /** * No description * - * @tags DB Table Row + * @tags DB table row * @name BulkDelete * @summary Bulk delete all table rows by IDs * @request DELETE:/api/v1/db/data/bulk/{orgs}/{projectName}/{tableName} @@ -2350,7 +2383,7 @@ export class Api< /** * No description * - * @tags DB Table Row + * @tags DB table row * @name BulkUpdateAll * @summary Bulk update all table rows with conditions * @request PATCH:/api/v1/db/data/bulk/{orgs}/{projectName}/{tableName}/all @@ -2375,7 +2408,7 @@ export class Api< /** * No description * - * @tags DB Table Row + * @tags DB table row * @name BulkDeleteAll * @summary Bulk delete all table rows with conditions * @request DELETE:/api/v1/db/data/bulk/{orgs}/{projectName}/{tableName}/all @@ -2402,6 +2435,7 @@ export class Api< * * @tags DB table row * @name CsvExport + * @summary Tablerows export * @request GET:/api/v1/db/data/{orgs}/{projectName}/{tableName}/export/{type} * @response `200` `any` OK */ @@ -2424,6 +2458,7 @@ export class Api< * * @tags DB table row * @name NestedList + * @summary Nested relations row list * @request GET:/api/v1/db/data/{orgs}/{projectName}/{tableName}/{rowId}/{relationType}/{columnName} * @response `200` `any` OK */ @@ -2450,6 +2485,7 @@ export class Api< * * @tags DB table row * @name NestedAdd + * @summary Nested relations row add * @request POST:/api/v1/db/data/{orgs}/{projectName}/{tableName}/{rowId}/{relationType}/{columnName}/{refRowId} * @response `200` `any` OK */ @@ -2477,6 +2513,7 @@ export class Api< * * @tags DB table row * @name NestedRemove + * @summary Nested relations row remove * @request DELETE:/api/v1/db/data/{orgs}/{projectName}/{tableName}/{rowId}/{relationType}/{columnName}/{refRowId} * @response `200` `any` OK */ @@ -2502,6 +2539,7 @@ export class Api< * * @tags DB table row * @name NestedChildrenExcludedList + * @summary Referenced tables rows excluding current records children/parent * @request GET:/api/v1/db/data/{orgs}/{projectName}/{tableName}/{rowId}/{relationType}/{columnName}/exclude * @response `200` `any` OK */ @@ -2527,8 +2565,9 @@ export class Api< /** * No description * - * @tags DB View Row + * @tags DB view row * @name List + * @summary Table view row list * @request GET:/api/v1/db/data/{orgs}/{projectName}/{tableName}/views/{viewName} * @response `200` `any` OK */ @@ -2551,8 +2590,9 @@ export class Api< /** * No description * - * @tags DB View Row + * @tags DB view row * @name Create + * @summary Table view row create * @request POST:/api/v1/db/data/{orgs}/{projectName}/{tableName}/views/{viewName} * @response `200` `any` OK */ @@ -2576,8 +2616,9 @@ export class Api< /** * No description * - * @tags DB View Row + * @tags DB view row * @name Count + * @summary Table view rows count * @request GET:/api/v1/db/data/{orgs}/{projectName}/{tableName}/views/{viewName}/count * @response `200` `any` OK */ @@ -2600,8 +2641,9 @@ export class Api< /** * No description * - * @tags DB View Row + * @tags DB view row * @name Read + * @summary Table view row read * @request GET:/api/v1/db/data/{orgs}/{projectName}/{tableName}/views/{viewName}/{rowId} * @response `201` `any` Created */ @@ -2623,8 +2665,9 @@ export class Api< /** * No description * - * @tags DB View Row + * @tags DB view row * @name Update + * @summary Table view row update * @request PATCH:/api/v1/db/data/{orgs}/{projectName}/{tableName}/views/{viewName}/{rowId} * @response `200` `any` OK */ @@ -2649,8 +2692,9 @@ export class Api< /** * No description * - * @tags DB View Row + * @tags DB view row * @name Delete + * @summary Table view row delete * @request DELETE:/api/v1/db/data/{orgs}/{projectName}/{tableName}/views/{viewName}/{rowId} * @response `200` `void` OK */ @@ -2673,6 +2717,7 @@ export class Api< * * @tags DB view row * @name Export + * @summary Table view rows export * @request GET:/api/v1/db/data/{orgs}/{projectName}/{tableName}/views/{viewName}/export/{type} * @response `200` `any` OK */ @@ -3005,7 +3050,7 @@ export class Api< /** * No description * - * @tags DB Table Webhook + * @tags DB table webhook * @name List * @request GET:/api/v1/db/meta/tables/{tableId}/hooks * @response `200` `{ list: (HookType)[], pageInfo: PaginatedType }` OK @@ -3021,7 +3066,7 @@ export class Api< /** * No description * - * @tags DB Table Webhook + * @tags DB table webhook * @name Create * @request POST:/api/v1/db/meta/tables/{tableId}/hooks * @response `200` `AuditType` OK @@ -3039,7 +3084,7 @@ export class Api< /** * No description * - * @tags DB Table Webhook + * @tags DB table webhook * @name Test * @request POST:/api/v1/db/meta/tables/{tableId}/hooks/test * @response `200` `any` OK @@ -3061,7 +3106,7 @@ export class Api< /** * No description * - * @tags DB Table Webhook + * @tags DB table webhook * @name SamplePayloadGet * @request GET:/api/v1/db/meta/tables/{tableId}/hooks/samplePayload/{operation} * @response `200` `{ plugins?: { list: (PluginType)[], pageInfo: PaginatedType } }` OK @@ -3084,7 +3129,7 @@ export class Api< /** * No description * - * @tags DB Table Webhook + * @tags DB table webhook * @name Update * @request PATCH:/api/v1/db/meta/hooks/{hookId} * @response `200` `HookType` OK @@ -3102,7 +3147,7 @@ export class Api< /** * No description * - * @tags DB Table Webhook + * @tags DB table webhook * @name Delete * @request DELETE:/api/v1/db/meta/hooks/{hookId} * @response `200` `void` OK From 8596fcc102cb6b271eae940d3d55060579e3736c Mon Sep 17 00:00:00 2001 From: Wing-Kam Wong Date: Sun, 17 Apr 2022 15:28:41 +0800 Subject: [PATCH 7/7] docs: add dbTableRow.count + fix typos Signed-off-by: Wing-Kam Wong --- packages/noco-docs/content/en/developer-resources/rest-apis.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 84ab57acb9..cb4b517364 100644 --- a/packages/noco-docs/content/en/developer-resources/rest-apis.md +++ b/packages/noco-docs/content/en/developer-resources/rest-apis.md @@ -51,12 +51,13 @@ Here's the overview of all APIs. For the details, please check out