Browse Source

chore: update swagger and test

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/3962/head
Pranav C 2 years ago
parent
commit
4b0c844ce7
  1. 33
      packages/nocodb-sdk/src/lib/Api.ts
  2. 2
      packages/nocodb/tests/unit/rest/tests/project.test.ts
  3. 176
      scripts/sdk/swagger.json

33
packages/nocodb-sdk/src/lib/Api.ts

@ -3307,10 +3307,39 @@ export class Api<
* @tags Utils * @tags Utils
* @name AggregatedMetaInfo * @name AggregatedMetaInfo
* @request GET:/api/v1/aggregated-meta-info * @request GET:/api/v1/aggregated-meta-info
* @response `200` `any` OK * @response `200` `{ projectCount?: number, projects?: ({ tableCount?: { table?: number, view?: number }, external?: boolean, viewCount?: { formCount?: number, gridCount?: number, galleryCount?: number, kanbanCount?: number, total?: number, sharedFormCount?: number, sharedGridCount?: number, sharedGalleryCount?: number, sharedKanbanCount?: number, sharedTotal?: number, sharedLockedCount?: number }, webhookCount?: number, filterCount?: number, sortCount?: number, rowCount?: ({ TotalRecords?: string })[], userCount?: number })[], userCount?: number, sharedBaseCount?: number }` OK
*/ */
aggregatedMetaInfo: (params: RequestParams = {}) => aggregatedMetaInfo: (params: RequestParams = {}) =>
this.request<any, any>({ this.request<
{
projectCount?: number;
projects?: {
tableCount?: { table?: number; view?: number };
external?: boolean;
viewCount?: {
formCount?: number;
gridCount?: number;
galleryCount?: number;
kanbanCount?: number;
total?: number;
sharedFormCount?: number;
sharedGridCount?: number;
sharedGalleryCount?: number;
sharedKanbanCount?: number;
sharedTotal?: number;
sharedLockedCount?: number;
};
webhookCount?: number;
filterCount?: number;
sortCount?: number;
rowCount?: { TotalRecords?: string }[];
userCount?: number;
}[];
userCount?: number;
sharedBaseCount?: number;
},
any
>({
path: `/api/v1/aggregated-meta-info`, path: `/api/v1/aggregated-meta-info`,
method: 'GET', method: 'GET',
format: 'json', format: 'json',

2
packages/nocodb/tests/unit/rest/tests/project.test.ts

@ -301,6 +301,7 @@ function projectTest() {
'sharedTotal', 'sharedTotal',
'sharedLockedCount') 'sharedLockedCount')
expect(res.body.projects[0]).have.keys( expect(res.body.projects[0]).have.keys(
'external',
'webhookCount', 'webhookCount',
'filterCount', 'filterCount',
'sortCount', 'sortCount',
@ -310,6 +311,7 @@ function projectTest() {
'viewCount', 'viewCount',
) )
expect(res.body).to.have.nested.property('projects[0].rowCount').to.be.an('array') expect(res.body).to.have.nested.property('projects[0].rowCount').to.be.an('array')
expect(res.body).to.have.nested.property('projects[0].external').to.be.an('boolean')
}) })
}) })
} }

176
scripts/sdk/swagger.json

@ -5347,7 +5347,181 @@
"description": "OK", "description": "OK",
"content": { "content": {
"application/json": { "application/json": {
"schema": {} "schema": {
"type": "object",
"properties": {
"projectCount": {
"type": "integer"
},
"projects": {
"type": "array",
"items": {
"type": "object",
"properties": {
"tableCount": {
"type": "object",
"properties": {
"table": {
"type": "integer"
},
"view": {
"type": "integer"
}
}
},
"external": {
"type": "boolean"
},
"viewCount": {
"type": "object",
"properties": {
"formCount": {
"type": "integer"
},
"gridCount": {
"type": "integer"
},
"galleryCount": {
"type": "integer"
},
"kanbanCount": {
"type": "integer"
},
"total": {
"type": "integer"
},
"sharedFormCount": {
"type": "integer"
},
"sharedGridCount": {
"type": "integer"
},
"sharedGalleryCount": {
"type": "integer"
},
"sharedKanbanCount": {
"type": "integer"
},
"sharedTotal": {
"type": "integer"
},
"sharedLockedCount": {
"type": "integer"
}
}
},
"webhookCount": {
"type": "integer"
},
"filterCount": {
"type": "integer"
},
"sortCount": {
"type": "integer"
},
"rowCount": {
"type": "array",
"items": {
"type": "object",
"properties": {
"TotalRecords": {
"type": "string"
}
}
}
},
"userCount": {
"type": "integer"
}
}
}
},
"userCount": {
"type": "integer"
},
"sharedBaseCount": {
"type": "integer"
}
},
"x-examples": {
"Example 1": {
"projectCount": 1,
"projects": [
{
"tableCount": {
"table": 3,
"view": 0
},
"external": false,
"viewCount": {
"formCount": 0,
"gridCount": 3,
"galleryCount": 0,
"kanbanCount": 0,
"total": 3,
"sharedFormCount": 0,
"sharedGridCount": 0,
"sharedGalleryCount": 0,
"sharedKanbanCount": 0,
"sharedTotal": 0,
"sharedLockedCount": 0
},
"webhookCount": 0,
"filterCount": 0,
"sortCount": 0,
"rowCount": [
{
"TotalRecords": "76"
}
],
"userCount": 1
}
],
"userCount": 1,
"sharedBaseCount": 0
}
}
},
"examples": {
"example-1": {
"value": {
"projectCount": 1,
"projects": [
{
"tableCount": {
"table": 3,
"view": 0
},
"external": false,
"viewCount": {
"formCount": 0,
"gridCount": 3,
"galleryCount": 0,
"kanbanCount": 0,
"total": 3,
"sharedFormCount": 0,
"sharedGridCount": 0,
"sharedGalleryCount": 0,
"sharedKanbanCount": 0,
"sharedTotal": 0,
"sharedLockedCount": 0
},
"webhookCount": 0,
"filterCount": 0,
"sortCount": 0,
"rowCount": [
{
"TotalRecords": "76"
}
],
"userCount": 1
}
],
"userCount": 1,
"sharedBaseCount": 0
}
}
}
}, },
"application/xml": { "application/xml": {
"schema": { "schema": {

Loading…
Cancel
Save