diff --git a/packages/nocodb-sdk/src/lib/Api.ts b/packages/nocodb-sdk/src/lib/Api.ts index dcb115ca87..244b9760b7 100644 --- a/packages/nocodb-sdk/src/lib/Api.ts +++ b/packages/nocodb-sdk/src/lib/Api.ts @@ -2258,6 +2258,30 @@ export class Api< ...params, }), + /** + * @description check if table row with conditions exists or not + * + * @tags DB table row + * @name Exist + * @summary Table row Exist + * @request GET:/api/v1/db/data/{orgs}/{projectName}/{tableName}/exist + * @response `200` `any` OK + */ + exist: ( + orgs: string, + projectName: string, + tableName: string, + query?: { fields?: any[]; sort?: any[]; where?: string }, + params: RequestParams = {} + ) => + this.request({ + path: `/api/v1/db/data/${orgs}/${projectName}/${tableName}/exist`, + method: 'GET', + query: query, + format: 'json', + ...params, + }), + /** * No description * @@ -2686,6 +2710,31 @@ export class Api< ...params, }), + /** + * @description check if table row with conditions exists or not + * + * @tags DB view row + * @name Exist + * @summary Table view row Exist + * @request GET:/api/v1/db/data/{orgs}/{projectName}/{tableName}/views/{viewName}/exist + * @response `200` `any` OK + */ + exist: ( + orgs: string, + projectName: string, + tableName: string, + viewName: string, + query?: { fields?: any[]; sort?: any[]; where?: string; nested?: any }, + params: RequestParams = {} + ) => + this.request({ + path: `/api/v1/db/data/${orgs}/${projectName}/${tableName}/views/${viewName}/exist`, + method: 'GET', + query: query, + format: 'json', + ...params, + }), + /** * No description * diff --git a/scripts/sdk/swagger.json b/scripts/sdk/swagger.json index 064de341de..ebfdc32c65 100644 --- a/scripts/sdk/swagger.json +++ b/scripts/sdk/swagger.json @@ -2600,6 +2600,75 @@ } } }, + "/api/v1/db/data/{orgs}/{projectName}/{tableName}/exist": { + "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": "Table row Exist", + "operationId": "db-table-row-exist", + "description": "check if table row with conditions exists or not", + "tags": [ + "DB table row" + ], + "parameters": [ + { + "schema": { + "type": "array" + }, + "in": "query", + "name": "fields" + }, + { + "schema": { + "type": "array" + }, + "in": "query", + "name": "sort" + }, + { + "schema": { + "type": "string" + }, + "in": "query", + "name": "where" + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": {} + } + } + } + } + } + }, "/api/v1/db/data/{orgs}/{projectName}/{tableName}/count": { "parameters": [ { @@ -2851,6 +2920,89 @@ } } }, + "/api/v1/db/data/{orgs}/{projectName}/{tableName}/views/{viewName}/exist": { + "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 + } + ], + "get": { + "summary": "Table view row Exist", + "operationId": "db-view-row-exist", + "description": "check if table row with conditions exists or not", + "tags": [ + "DB view row" + ], + "parameters": [ + { + "schema": { + "type": "array" + }, + "in": "query", + "name": "fields" + }, + { + "schema": { + "type": "array" + }, + "in": "query", + "name": "sort" + }, + { + "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}/count": { "parameters": [ { @@ -7958,4 +8110,4 @@ } } } -} +} \ No newline at end of file