From 9c74e5285cd2cca288b097d2c1d14bb990c9911c Mon Sep 17 00:00:00 2001 From: Pranav C Date: Wed, 17 Aug 2022 13:17:22 +0530 Subject: [PATCH] chore(swagger): type correction Signed-off-by: Pranav C --- packages/nocodb-sdk/src/lib/Api.ts | 36 ++++++---- scripts/sdk/swagger.json | 104 +++++++++++++++++++++-------- 2 files changed, 97 insertions(+), 43 deletions(-) diff --git a/packages/nocodb-sdk/src/lib/Api.ts b/packages/nocodb-sdk/src/lib/Api.ts index d916b3839b..535f255ea0 100644 --- a/packages/nocodb-sdk/src/lib/Api.ts +++ b/packages/nocodb-sdk/src/lib/Api.ts @@ -3062,32 +3062,40 @@ export class Api< }), /** - * No description + * @description Read project details * * @tags Public - * @name SharedViewMetaGet - * @request GET:/api/v1/db/public/shared-view/{sharedViewUuid}/meta - * @response `200` `object` OK + * @name SharedBaseGet + * @request GET:/api/v1/db/public/shared-base/{sharedBaseUuid}/meta + * @response `200` `{ project_id?: string }` OK */ - sharedViewMetaGet: (sharedViewUuid: string, params: RequestParams = {}) => - this.request({ - path: `/api/v1/db/public/shared-view/${sharedViewUuid}/meta`, + sharedBaseGet: (sharedBaseUuid: string, params: RequestParams = {}) => + this.request<{ project_id?: string }, any>({ + path: `/api/v1/db/public/shared-base/${sharedBaseUuid}/meta`, method: 'GET', format: 'json', ...params, }), /** - * @description Read project details + * No description * * @tags Public - * @name SharedBaseGet - * @request GET:/api/v1/db/public/shared-base/{sharedBaseUuid}/meta - * @response `200` `{ project_id?: string }` OK + * @name SharedViewMetaGet + * @request GET:/api/v1/db/public/shared-view/{sharedViewUuid}/meta + * @response `200` `(ViewType & { relatedMetas?: any, client?: string, columns?: (GridColumnType | FormColumnType | GalleryColumnType), model?: TableType } & { view?: (FormType | GridType | GalleryType) })` OK */ - sharedBaseGet: (sharedBaseUuid: string, params: RequestParams = {}) => - this.request<{ project_id?: string }, any>({ - path: `/api/v1/db/public/shared-base/${sharedBaseUuid}/meta`, + sharedViewMetaGet: (sharedViewUuid: string, params: RequestParams = {}) => + this.request< + ViewType & { + relatedMetas?: any; + client?: string; + columns?: GridColumnType | FormColumnType | GalleryColumnType; + model?: TableType; + } & { view?: FormType | GridType | GalleryType }, + any + >({ + path: `/api/v1/db/public/shared-view/${sharedViewUuid}/meta`, method: 'GET', format: 'json', ...params, diff --git a/scripts/sdk/swagger.json b/scripts/sdk/swagger.json index b3e60d58f3..6df846ef2d 100644 --- a/scripts/sdk/swagger.json +++ b/scripts/sdk/swagger.json @@ -4363,28 +4363,22 @@ "description": "" } }, - "/api/v1/db/public/shared-view/{sharedViewUuid}/meta": { + "/api/v1/db/public/shared-base/{sharedBaseUuid}/meta": { "parameters": [ { "schema": { "type": "string" }, - "name": "sharedViewUuid", + "name": "sharedBaseUuid", "in": "path", "required": true - }, - { - "schema": { - "type": "string" - }, - "in": "header", - "name": "xc-password", - "description": "Shared view password" } ], "get": { "summary": "", - "operationId": "public-shared-view-meta-get", + "operationId": "public-shared-base-get", + "description": "Read project details", + "parameters": [], "responses": { "200": { "description": "OK", @@ -4392,58 +4386,110 @@ "application/json": { "schema": { "type": "object", - "properties": {} + "properties": { + "project_id": { + "type": "string" + } + } } - }, - "application/xml": { - "schema": {} } } } }, "tags": [ "Public" - ], - "description": "", - "parameters": [] + ] } }, - "/api/v1/db/public/shared-base/{sharedBaseUuid}/meta": { + "/api/v1/db/public/shared-view/{sharedViewUuid}/meta": { "parameters": [ { "schema": { "type": "string" }, - "name": "sharedBaseUuid", + "name": "sharedViewUuid", "in": "path", "required": true + }, + { + "schema": { + "type": "string" + }, + "in": "header", + "name": "xc-password", + "description": "Shared view password" } ], "get": { "summary": "", - "operationId": "public-shared-base-get", - "description": "Read project details", - "parameters": [], + "operationId": "public-shared-view-meta-get", "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { - "type": "object", - "properties": { - "project_id": { - "type": "string" + "allOf": [ + { + "$ref": "#/components/schemas/View" + }, + { + "type": "object", + "properties": { + "relatedMetas": {}, + "client": { + "type": "string" + }, + "columns": { + "oneOf": [ + { + "$ref": "#/components/schemas/GridColumn" + }, + { + "$ref": "#/components/schemas/FormColumn" + }, + { + "$ref": "#/components/schemas/GalleryColumn" + } + ] + }, + "model": { + "$ref": "#/components/schemas/Table" + } + } + }, + { + "properties": { + "view": { + "oneOf": [ + { + "$ref": "#/components/schemas/Form" + }, + { + "$ref": "#/components/schemas/Grid" + }, + { + "$ref": "#/components/schemas/Gallery" + } + ] + } + }, + "type": "object" } - } + ] } + }, + "application/xml": { + "schema": {} } } } }, "tags": [ "Public" - ] + ], + "description": "", + "parameters": [] } }, "/api/v1/db/meta/audits/comments": {