diff --git a/packages/nocodb-sdk/src/lib/Api.ts b/packages/nocodb-sdk/src/lib/Api.ts index ca52dbe62a..9c31847787 100644 --- a/packages/nocodb-sdk/src/lib/Api.ts +++ b/packages/nocodb-sdk/src/lib/Api.ts @@ -2258,6 +2258,36 @@ export class Api< ...params, }), + /** + * No description + * + * @tags DB table row + * @name GroupBy + * @summary Table row Group by + * @request GET:/api/v1/db/data/{orgs}/{projectName}/{tableName}/groupby + * @response `200` `any` OK + */ + groupBy: ( + orgs: string, + projectName: string, + tableName: string, + query?: { + column_name?: string; + sort?: any[]; + where?: string; + limit?: number; + offset?: number; + }, + params: RequestParams = {} + ) => + this.request({ + path: `/api/v1/db/data/${orgs}/${projectName}/${tableName}/groupby`, + method: 'GET', + query: query, + format: 'json', + ...params, + }), + /** * No description * @@ -2664,17 +2694,23 @@ export class Api< * No description * * @tags DB view row - * @name FindOne - * @summary Table view row FindOne + * @name GroupBy + * @summary Table view row Group by * @request GET:/api/v1/db/data/{orgs}/{projectName}/{tableName}/views/{viewName}/find-one * @response `200` `any` OK */ - findOne: ( + groupBy: ( orgs: string, projectName: string, tableName: string, viewName: string, - query?: { fields?: any[]; sort?: any[]; where?: string; nested?: any }, + query?: { + column_name?: string; + sort?: any[]; + where?: string; + limit?: number; + offset?: number; + }, params: RequestParams = {} ) => this.request({ diff --git a/scripts/sdk/swagger.json b/scripts/sdk/swagger.json index 6712504088..30959a10f7 100644 --- a/scripts/sdk/swagger.json +++ b/scripts/sdk/swagger.json @@ -2600,6 +2600,90 @@ } } }, + "/api/v1/db/data/{orgs}/{projectName}/{tableName}/groupby": { + "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 + },{ + "schema": { + "type": "string" + }, + "in": "query", + "name": "column_name", + "description": + "Column name of the column you want to group by, eg. `column_name=column1`" + } + ], + "get": { + "summary": "Table row Group by", + "operationId": "db-table-row-group-by", + "description": "", + "tags": [ + "DB table row" + ], + "parameters": [ + { + "schema": { + "type": "array" + }, + "in": "query", + "name": "sort" + }, + { + "schema": { + "type": "string" + }, + "in": "query", + "name": "where" + }, + { + "schema": { + "type": "number" + }, + "in": "query", + "name": "limit" + }, + { + "schema": { + "type": "number" + }, + "in": "query", + "name": "offset" + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": {} + } + } + } + } + } + }, "/api/v1/db/data/{orgs}/{projectName}/{tableName}/views/{viewName}": { "parameters": [ { @@ -2790,6 +2874,98 @@ } } }, + "/api/v1/db/data/{orgs}/{projectName}/{tableName}/views/{viewName}/find-one": { + "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 + }, + { + "schema": { + "type": "string" + }, + "name": "viewName", + "in": "path", + "required": true + },{ + "schema": { + "type": "string" + }, + "in": "query", + "name": "column_name", + "description": + "Column name of the column you want to group by, eg. `column_name=column1`" + } + ], + "get": { + "summary": "Table view row Group by", + "operationId": "db-view-row-group-by", + "description": "", + "tags": [ + "DB view row" + ], + "parameters": [ + { + "schema": { + "type": "array" + }, + "in": "query", + "name": "sort" + }, + { + "schema": { + "type": "string" + }, + "in": "query", + "name": "where" + }, + { + "schema": { + "type": "number" + }, + "in": "query", + "name": "limit" + }, + { + "schema": { + "type": "number" + }, + "in": "query", + "name": "offset" + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": {} + } + } + } + } + } + }, "/api/v1/db/data/{orgs}/{projectName}/{tableName}/views/{viewName}/count": { "parameters": [ { @@ -8013,4 +8189,4 @@ } } } -} \ No newline at end of file +}