Browse Source

geodata: add types and endpoints in swagger.json

* also regenerate ts types (sdk build)
pull/4140/head
flisowna 2 years ago
parent
commit
c374f00edb
  1. 71
      packages/nocodb-sdk/src/lib/Api.ts
  2. 145
      scripts/sdk/swagger.json

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

@ -136,7 +136,7 @@ export interface ViewType {
show_system_fields?: boolean;
lock_type?: 'collaborative' | 'locked' | 'personal';
type?: number;
view?: FormType | GridType | GalleryType | KanbanType;
view?: FormType | GridType | GalleryType | KanbanType | MapType;
}
export interface TableInfoType {
@ -387,6 +387,24 @@ export interface KanbanType {
meta?: string | object;
}
export interface GeoLocationType {
/** @format double */
latitude?: number;
/** @format double */
longitude?: number;
}
export interface MapType {
id?: string;
title?: string;
alias?: string;
initial_geo_position?: GeoLocationType;
fk_model_id?: string;
fk_geo_data_col_id?: string | null;
meta?: string | object;
}
export interface FormType {
id?: string;
title?: string;
@ -1958,6 +1976,57 @@ export class Api<
format: 'json',
...params,
}),
/**
* No description
*
* @tags DB view
* @name MapCreate
* @request POST:/api/v1/db/meta/tables/{tableId}/maps
* @response `200` `object` OK
*/
mapCreate: (tableId: string, data: MapType, params: RequestParams = {}) =>
this.request<object, any>({
path: `/api/v1/db/meta/tables/${tableId}/maps`,
method: 'POST',
body: data,
type: ContentType.Json,
format: 'json',
...params,
}),
/**
* No description
*
* @tags DB view
* @name MapUpdate
* @request PATCH:/api/v1/db/meta/maps/{mapId}
* @response `200` `void` OK
*/
mapUpdate: (mapId: string, data: MapType, params: RequestParams = {}) =>
this.request<void, any>({
path: `/api/v1/db/meta/maps/${mapId}`,
method: 'PATCH',
body: data,
type: ContentType.Json,
...params,
}),
/**
* No description
*
* @tags DB view
* @name MapRead
* @request GET:/api/v1/db/meta/maps/{mapId}
* @response `200` `MapType` OK
*/
mapRead: (mapId: string, params: RequestParams = {}) =>
this.request<MapType, any>({
path: `/api/v1/db/meta/maps/${mapId}`,
method: 'GET',
format: 'json',
...params,
}),
};
dbViewShare = {
/**

145
scripts/sdk/swagger.json

@ -2599,6 +2599,99 @@
]
}
},
"/api/v1/db/meta/tables/{tableId}/maps": {
"parameters": [
{
"schema": {
"type": "string"
},
"name": "tableId",
"in": "path",
"required": true
}
],
"post": {
"summary": "",
"operationId": "db-view-map-create",
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {}
}
}
}
}
},
"tags": [
"DB view"
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Map"
}
}
}
}
}
},
"/api/v1/db/meta/maps/{mapId}": {
"parameters": [
{
"schema": {
"type": "string"
},
"name": "mapId",
"in": "path",
"required": true
}
],
"patch": {
"summary": "",
"operationId": "db-view-map-update",
"responses": {
"200": {
"description": "OK"
}
},
"tags": [
"DB view"
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Map"
}
}
}
}
},
"get": {
"summary": "",
"operationId": "db-view-map-read",
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Map"
}
}
}
}
},
"tags": [
"DB view"
]
}
},
"/api/v1/db/meta/projects/{projectId}/meta-diff": {
"parameters": [
{
@ -6886,6 +6979,9 @@
},
{
"$ref": "#/components/schemas/Kanban"
},
{
"$ref": "#/components/schemas/Map"
}
]
}
@ -7934,6 +8030,55 @@
}
}
},
"GeoLocation": {
"title": "GeoLocation",
"type": "object",
"description": "",
"properties": {
"latitude": {
"type": "number",
"format": "double"
},
"longitude": {
"type": "number",
"format": "double"
}
}
},
"Map": {
"title": "Map",
"type": "object",
"description": "",
"properties": {
"id": {
"type": "string"
},
"title": {
"type": "string"
},
"alias": {
"type": "string"
},
"initial_geo_position": {
"$ref": "#/components/schemas/GeoLocation"
},
"fk_model_id": {
"type": "string"
},
"fk_geo_data_col_id": {
"type": [
"string",
"null"
]
},
"meta": {
"type": [
"string",
"object"
]
}
}
},
"Form": {
"title": "Form",
"type": "object",

Loading…
Cancel
Save