Browse Source

chore(swagger): typo correction

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/3065/head
Pranav C 2 years ago
parent
commit
3fa129ea82
  1. 5
      packages/nc-gui-v2/components/smartsheet-toolbar/ShareView.vue
  2. 3
      packages/nc-gui-v2/composables/useColumnCreateStore.ts
  3. 3
      packages/nc-gui-v2/composables/useExpandedFormStore.ts
  4. 2
      packages/nc-gui-v2/composables/useGridViewColumnWidth.ts
  5. 6
      packages/nc-gui-v2/composables/useLTARStore.ts
  6. 8
      packages/nc-gui-v2/composables/useViewColumns.ts
  7. 6
      packages/nc-gui-v2/composables/useViewFilters.ts
  8. 3
      packages/nc-gui-v2/composables/useViewSorts.ts
  9. 23
      packages/nocodb-sdk/src/lib/Api.ts
  10. 94
      scripts/sdk/swagger.json

5
packages/nc-gui-v2/components/smartsheet-toolbar/ShareView.vue

@ -65,12 +65,11 @@ async function saveAllowCSVDownload() {
try { try {
const meta = shared.value.meta && typeof shared.value.meta === 'string' ? JSON.parse(shared.value.meta) : shared.value.meta const meta = shared.value.meta && typeof shared.value.meta === 'string' ? JSON.parse(shared.value.meta) : shared.value.meta
// todo: update swagger
await $api.dbViewShare.update(shared.value.id, { await $api.dbViewShare.update(shared.value.id, {
meta, meta,
} as any) })
toast.success('Successfully updated') toast.success('Successfully updated')
} catch (e) { } catch (e: any) {
toast.error(await extractSdkResponseErrorMsg(e)) toast.error(await extractSdkResponseErrorMsg(e))
} }
if (allowCSVDownload?.value) { if (allowCSVDownload?.value) {

3
packages/nc-gui-v2/composables/useColumnCreateStore.ts

@ -35,8 +35,7 @@ const [useProvideColumnCreateStore, useColumnCreateStore] = createInjectionState
title: 'title', title: 'title',
uidt: UITypes.SingleLineText, uidt: UITypes.SingleLineText,
...(column?.value || {}), ...(column?.value || {}),
// todo: swagger json update - include meta meta: column?.value?.meta || {},
meta: (column?.value as any)?.meta || {},
}) })
const additionalValidations = ref<Record<string, any>>({}) const additionalValidations = ref<Record<string, any>>({})

3
packages/nc-gui-v2/composables/useExpandedFormStore.ts

@ -84,9 +84,8 @@ const [useProvideExpandedFormStore, useExpandedFormStore] = useInjectionState((m
await api.utils.commentRow({ await api.utils.commentRow({
fk_model_id: meta.value?.id as string, fk_model_id: meta.value?.id as string,
row_id: rowId, row_id: rowId,
// todo: swagger type correction
description: comment.value, description: comment.value,
} as any) })
comment.value = '' comment.value = ''
message.success('Comment added successfully') message.success('Comment added successfully')

2
packages/nc-gui-v2/composables/useGridViewColumnWidth.ts

@ -4,7 +4,6 @@ import type { Ref } from 'vue'
import { useMetas } from './useMetas' import { useMetas } from './useMetas'
import { useUIPermission } from './useUIPermission' import { useUIPermission } from './useUIPermission'
// todo: update swagger
export function useGridViewColumnWidth(view: Ref<(GridType & { id?: string }) | undefined>) { export function useGridViewColumnWidth(view: Ref<(GridType & { id?: string }) | undefined>) {
const { css, load: loadCss, unload: unloadCss } = useStyleTag('') const { css, load: loadCss, unload: unloadCss } = useStyleTag('')
const { isUIAllowed } = useUIPermission() const { isUIAllowed } = useUIPermission()
@ -18,7 +17,6 @@ export function useGridViewColumnWidth(view: Ref<(GridType & { id?: string }) |
const columns = computed<ColumnType[]>(() => metas?.value?.[(view?.value as any)?.fk_model_id as string]?.columns) const columns = computed<ColumnType[]>(() => metas?.value?.[(view?.value as any)?.fk_model_id as string]?.columns)
watch( watch(
// todo : update type in swagger
[gridViewCols, resizingCol, resizingColWidth], [gridViewCols, resizingCol, resizingColWidth],
() => { () => {
let style = '' let style = ''

6
packages/nc-gui-v2/composables/useLTARStore.ts

@ -94,14 +94,13 @@ const [useProvideLTARStore, useLTARStore] = useInjectionState(
rowId.value, rowId.value,
colOptions.type as 'mm' | 'hm', colOptions.type as 'mm' | 'hm',
column?.value?.title, column?.value?.title,
// todo: swagger type correction
{ {
limit: childrenExcludedListPagination.size, limit: childrenExcludedListPagination.size,
offset: childrenExcludedListPagination.size * (childrenExcludedListPagination.page - 1), offset: childrenExcludedListPagination.size * (childrenExcludedListPagination.page - 1),
where: where:
childrenExcludedListPagination.query && childrenExcludedListPagination.query &&
`(${relatedTablePrimaryValueProp.value},like,${childrenExcludedListPagination.query})`, `(${relatedTablePrimaryValueProp.value},like,${childrenExcludedListPagination.query})`,
} as any, },
) )
} }
} catch (e: any) { } catch (e: any) {
@ -123,12 +122,11 @@ const [useProvideLTARStore, useLTARStore] = useInjectionState(
rowId.value, rowId.value,
colOptions.type as 'mm' | 'hm', colOptions.type as 'mm' | 'hm',
column?.value?.title, column?.value?.title,
// todo: swagger type correction
{ {
limit: childrenListPagination.size, limit: childrenListPagination.size,
offset: childrenListPagination.size * (childrenListPagination.page - 1), offset: childrenListPagination.size * (childrenListPagination.page - 1),
where: childrenListPagination.query && `(${relatedTablePrimaryValueProp.value},like,${childrenListPagination.query})`, where: childrenListPagination.query && `(${relatedTablePrimaryValueProp.value},like,${childrenListPagination.query})`,
} as any, },
) )
} catch (e: any) { } catch (e: any) {
notification.error({ notification.error({

8
packages/nc-gui-v2/composables/useViewColumns.ts

@ -94,16 +94,14 @@ export function useViewColumns(
const showSystemFields = computed({ const showSystemFields = computed({
get() { get() {
// todo: update swagger return view?.value?.show_system_fields || false
return (view?.value as any)?.show_system_fields || false
}, },
set(v) { set(v: boolean) {
if (view?.value?.id) { if (view?.value?.id) {
$api.dbView $api.dbView
.update(view.value.id, { .update(view.value.id, {
// todo: update swagger
show_system_fields: v, show_system_fields: v,
} as any) })
.finally(() => reloadData?.()) .finally(() => reloadData?.())
;(view.value as any).show_system_fields = v ;(view.value as any).show_system_fields = v
} }

6
packages/nc-gui-v2/composables/useViewFilters.ts

@ -10,7 +10,6 @@ export function useViewFilters(
reloadData?: () => void, reloadData?: () => void,
shared = false, shared = false,
) { ) {
// todo: update swagger
const filters = ref<(FilterType & { status?: 'update' | 'delete' | 'create'; parentId?: string })[]>([]) const filters = ref<(FilterType & { status?: 'update' | 'delete' | 'create'; parentId?: string })[]>([])
const { $api } = useNuxtApp() const { $api } = useNuxtApp()
@ -79,11 +78,10 @@ export function useViewFilters(
fk_parent_id: parentId, fk_parent_id: parentId,
}) })
} else { } else {
// todo: return type correction filters.value[i] = await $api.dbTableFilter.create(view?.value?.id as string, {
filters.value[i] = (await $api.dbTableFilter.create(view?.value?.id as string, {
...filter, ...filter,
fk_parent_id: parentId, fk_parent_id: parentId,
})) as any })
} }
reloadData?.() reloadData?.()
} }

3
packages/nc-gui-v2/composables/useViewSorts.ts

@ -12,8 +12,7 @@ export function useViewSorts(
const loadSorts = async () => { const loadSorts = async () => {
if (!view?.value) return if (!view?.value) return
// todo: api correction sorts.value = ((await $api.dbTableSort.list(view?.value?.id as string)) as any)?.sorts?.list
sorts.value = ((await $api.dbTableSort.list(view?.value?.id as string)) as any)?.sorts?.list as any[]
} }
const saveOrUpdate = async (sort: SortType, i: number) => { const saveOrUpdate = async (sort: SortType, i: number) => {

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

@ -1938,7 +1938,7 @@ export class Api<
*/ */
update: ( update: (
viewId: string, viewId: string,
data: { password?: string }, data: { password?: string; meta?: any },
params: RequestParams = {} params: RequestParams = {}
) => ) =>
this.request<SharedViewType, any>({ this.request<SharedViewType, any>({
@ -2026,10 +2026,10 @@ export class Api<
* @tags DB table sort * @tags DB table sort
* @name List * @name List
* @request GET:/api/v1/db/meta/views/{viewId}/sorts * @request GET:/api/v1/db/meta/views/{viewId}/sorts
* @response `200` `{ uuid?: string, url?: string }` OK * @response `200` `{ sorts?: { list?: (SortType)[] } }` OK
*/ */
list: (viewId: string, params: RequestParams = {}) => list: (viewId: string, params: RequestParams = {}) =>
this.request<{ uuid?: string; url?: string }, any>({ this.request<{ sorts?: { list?: SortType[] } }, any>({
path: `/api/v1/db/meta/views/${viewId}/sorts`, path: `/api/v1/db/meta/views/${viewId}/sorts`,
method: 'GET', method: 'GET',
format: 'json', format: 'json',
@ -2124,14 +2124,15 @@ export class Api<
* @tags DB table filter * @tags DB table filter
* @name Create * @name Create
* @request POST:/api/v1/db/meta/views/{viewId}/filters * @request POST:/api/v1/db/meta/views/{viewId}/filters
* @response `200` `void` OK * @response `200` `FilterType` OK
*/ */
create: (viewId: string, data: FilterType, params: RequestParams = {}) => create: (viewId: string, data: FilterType, params: RequestParams = {}) =>
this.request<void, any>({ this.request<FilterType, any>({
path: `/api/v1/db/meta/views/${viewId}/filters`, path: `/api/v1/db/meta/views/${viewId}/filters`,
method: 'POST', method: 'POST',
body: data, body: data,
type: ContentType.Json, type: ContentType.Json,
format: 'json',
...params, ...params,
}), }),
@ -2594,7 +2595,11 @@ export class Api<
rowId: string, rowId: string,
relationType: 'mm' | 'hm', relationType: 'mm' | 'hm',
columnName: string, columnName: string,
query?: { limit?: string; offset?: string }, query?: {
limit?: string | number;
offset?: string | number;
where?: string;
},
params: RequestParams = {} params: RequestParams = {}
) => ) =>
this.request<any, any>({ this.request<any, any>({
@ -2675,7 +2680,11 @@ export class Api<
rowId: string, rowId: string,
relationType: 'mm' | 'hm', relationType: 'mm' | 'hm',
columnName: string, columnName: string,
query?: { limit?: string; offset?: string }, query?: {
limit?: string | number;
offset?: string | number;
where?: string;
},
params: RequestParams = {} params: RequestParams = {}
) => ) =>
this.request<any, any>({ this.request<any, any>({

94
scripts/sdk/swagger.json

@ -942,27 +942,28 @@
"post": { "post": {
"summary": "", "summary": "",
"operationId": "project-shared-base-create", "operationId": "project-shared-base-create",
"responses": { "200": { "responses": {
"description": "OK", "200": {
"content": { "description": "OK",
"application/json": { "content": {
"schema": { "application/json": {
"type": "object", "schema": {
"properties": { "type": "object",
"uuid": { "properties": {
"type": "string" "uuid": {
}, "type": "string"
"url": { },
"type": "string" "url": {
}, "type": "string"
"roles": { },
"type": "string" "roles": {
"type": "string"
}
} }
} }
} }
} }
} }
}
}, },
"tags": [ "tags": [
"Project" "Project"
@ -1726,7 +1727,8 @@
"properties": { "properties": {
"password": { "password": {
"type": "string" "type": "string"
} },
"meta": {}
} }
} }
} }
@ -1851,11 +1853,16 @@
"schema": { "schema": {
"type": "object", "type": "object",
"properties": { "properties": {
"uuid": { "sorts": {
"type": "string" "type": "object",
}, "properties": {
"url": { "list": {
"type": "string" "type": "array",
"items": {
"$ref": "#/components/schemas/Sort"
}
}
}
} }
} }
} }
@ -1991,7 +1998,14 @@
"operationId": "db-table-filter-create", "operationId": "db-table-filter-create",
"responses": { "responses": {
"200": { "200": {
"description": "OK" "description": "OK",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Filter"
}
}
}
} }
}, },
"tags": [ "tags": [
@ -3831,17 +3845,30 @@
"parameters": [ "parameters": [
{ {
"schema": { "schema": {
"type": "string" "type": [
"string",
"number"
]
}, },
"in": "query", "in": "query",
"name": "limit" "name": "limit"
}, },
{ {
"schema": { "schema": {
"type": "string" "type": [
"string",
"number"
]
}, },
"in": "query", "in": "query",
"name": "offset" "name": "offset"
},
{
"schema": {
"type": "string"
},
"in": "query",
"name": "where"
} }
] ]
} }
@ -4035,17 +4062,30 @@
"parameters": [ "parameters": [
{ {
"schema": { "schema": {
"type": "string" "type": [
"string",
"number"
]
}, },
"in": "query", "in": "query",
"name": "limit" "name": "limit"
}, },
{ {
"schema": { "schema": {
"type": "string" "type": [
"string",
"number"
]
}, },
"in": "query", "in": "query",
"name": "offset" "name": "offset"
},
{
"schema": {
"type": "string"
},
"in": "query",
"name": "where"
} }
] ]
} }

Loading…
Cancel
Save