Browse Source

feat: add exist to dbTableRow & dbViewRow

pull/2070/head
Wing-Kam Wong 2 years ago
parent
commit
dff3ab6182
  1. 49
      packages/nocodb-sdk/src/lib/Api.ts
  2. 154
      scripts/sdk/swagger.json

49
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<any, any>({
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<any, any>({
path: `/api/v1/db/data/${orgs}/${projectName}/${tableName}/views/${viewName}/exist`,
method: 'GET',
query: query,
format: 'json',
...params,
}),
/**
* No description
*

154
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 @@
}
}
}
}
}
Loading…
Cancel
Save