diff --git a/packages/nc-gui-v2/components/smartsheet-toolbar/ShareView.vue b/packages/nc-gui-v2/components/smartsheet-toolbar/ShareView.vue index d2a6484f22..b610f9af32 100644 --- a/packages/nc-gui-v2/components/smartsheet-toolbar/ShareView.vue +++ b/packages/nc-gui-v2/components/smartsheet-toolbar/ShareView.vue @@ -65,12 +65,11 @@ async function saveAllowCSVDownload() { try { 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, { meta, - } as any) + }) toast.success('Successfully updated') - } catch (e) { + } catch (e: any) { toast.error(await extractSdkResponseErrorMsg(e)) } if (allowCSVDownload?.value) { diff --git a/packages/nc-gui-v2/composables/useColumnCreateStore.ts b/packages/nc-gui-v2/composables/useColumnCreateStore.ts index 751dbb4e8c..dd26990689 100644 --- a/packages/nc-gui-v2/composables/useColumnCreateStore.ts +++ b/packages/nc-gui-v2/composables/useColumnCreateStore.ts @@ -35,8 +35,7 @@ const [useProvideColumnCreateStore, useColumnCreateStore] = createInjectionState title: 'title', uidt: UITypes.SingleLineText, ...(column?.value || {}), - // todo: swagger json update - include meta - meta: (column?.value as any)?.meta || {}, + meta: column?.value?.meta || {}, }) const additionalValidations = ref>({}) diff --git a/packages/nc-gui-v2/composables/useExpandedFormStore.ts b/packages/nc-gui-v2/composables/useExpandedFormStore.ts index 6c78f9f150..6db77e2669 100644 --- a/packages/nc-gui-v2/composables/useExpandedFormStore.ts +++ b/packages/nc-gui-v2/composables/useExpandedFormStore.ts @@ -84,9 +84,8 @@ const [useProvideExpandedFormStore, useExpandedFormStore] = useInjectionState((m await api.utils.commentRow({ fk_model_id: meta.value?.id as string, row_id: rowId, - // todo: swagger type correction description: comment.value, - } as any) + }) comment.value = '' message.success('Comment added successfully') diff --git a/packages/nc-gui-v2/composables/useGridViewColumnWidth.ts b/packages/nc-gui-v2/composables/useGridViewColumnWidth.ts index ebf2f3af81..1e365cc54d 100644 --- a/packages/nc-gui-v2/composables/useGridViewColumnWidth.ts +++ b/packages/nc-gui-v2/composables/useGridViewColumnWidth.ts @@ -4,7 +4,6 @@ import type { Ref } from 'vue' import { useMetas } from './useMetas' import { useUIPermission } from './useUIPermission' -// todo: update swagger export function useGridViewColumnWidth(view: Ref<(GridType & { id?: string }) | undefined>) { const { css, load: loadCss, unload: unloadCss } = useStyleTag('') const { isUIAllowed } = useUIPermission() @@ -18,7 +17,6 @@ export function useGridViewColumnWidth(view: Ref<(GridType & { id?: string }) | const columns = computed(() => metas?.value?.[(view?.value as any)?.fk_model_id as string]?.columns) watch( - // todo : update type in swagger [gridViewCols, resizingCol, resizingColWidth], () => { let style = '' diff --git a/packages/nc-gui-v2/composables/useLTARStore.ts b/packages/nc-gui-v2/composables/useLTARStore.ts index 4a77b149de..d247346e0c 100644 --- a/packages/nc-gui-v2/composables/useLTARStore.ts +++ b/packages/nc-gui-v2/composables/useLTARStore.ts @@ -94,14 +94,13 @@ const [useProvideLTARStore, useLTARStore] = useInjectionState( rowId.value, colOptions.type as 'mm' | 'hm', column?.value?.title, - // todo: swagger type correction { limit: childrenExcludedListPagination.size, offset: childrenExcludedListPagination.size * (childrenExcludedListPagination.page - 1), where: childrenExcludedListPagination.query && `(${relatedTablePrimaryValueProp.value},like,${childrenExcludedListPagination.query})`, - } as any, + }, ) } } catch (e: any) { @@ -123,12 +122,11 @@ const [useProvideLTARStore, useLTARStore] = useInjectionState( rowId.value, colOptions.type as 'mm' | 'hm', column?.value?.title, - // todo: swagger type correction { limit: childrenListPagination.size, offset: childrenListPagination.size * (childrenListPagination.page - 1), where: childrenListPagination.query && `(${relatedTablePrimaryValueProp.value},like,${childrenListPagination.query})`, - } as any, + }, ) } catch (e: any) { notification.error({ diff --git a/packages/nc-gui-v2/composables/useViewColumns.ts b/packages/nc-gui-v2/composables/useViewColumns.ts index 302dcb1372..c234383141 100644 --- a/packages/nc-gui-v2/composables/useViewColumns.ts +++ b/packages/nc-gui-v2/composables/useViewColumns.ts @@ -94,16 +94,14 @@ export function useViewColumns( const showSystemFields = computed({ get() { - // todo: update swagger - return (view?.value as any)?.show_system_fields || false + return view?.value?.show_system_fields || false }, - set(v) { + set(v: boolean) { if (view?.value?.id) { $api.dbView .update(view.value.id, { - // todo: update swagger show_system_fields: v, - } as any) + }) .finally(() => reloadData?.()) ;(view.value as any).show_system_fields = v } diff --git a/packages/nc-gui-v2/composables/useViewFilters.ts b/packages/nc-gui-v2/composables/useViewFilters.ts index aba040db8f..444e22df2a 100644 --- a/packages/nc-gui-v2/composables/useViewFilters.ts +++ b/packages/nc-gui-v2/composables/useViewFilters.ts @@ -10,7 +10,6 @@ export function useViewFilters( reloadData?: () => void, shared = false, ) { - // todo: update swagger const filters = ref<(FilterType & { status?: 'update' | 'delete' | 'create'; parentId?: string })[]>([]) const { $api } = useNuxtApp() @@ -79,11 +78,10 @@ export function useViewFilters( fk_parent_id: parentId, }) } 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, fk_parent_id: parentId, - })) as any + }) } reloadData?.() } diff --git a/packages/nc-gui-v2/composables/useViewSorts.ts b/packages/nc-gui-v2/composables/useViewSorts.ts index 7d1bcf00f7..b55e4c209b 100644 --- a/packages/nc-gui-v2/composables/useViewSorts.ts +++ b/packages/nc-gui-v2/composables/useViewSorts.ts @@ -12,8 +12,7 @@ export function useViewSorts( const loadSorts = async () => { if (!view?.value) return - // todo: api correction - sorts.value = ((await $api.dbTableSort.list(view?.value?.id as string)) as any)?.sorts?.list as any[] + sorts.value = ((await $api.dbTableSort.list(view?.value?.id as string)) as any)?.sorts?.list } const saveOrUpdate = async (sort: SortType, i: number) => { diff --git a/packages/nocodb-sdk/src/lib/Api.ts b/packages/nocodb-sdk/src/lib/Api.ts index 2953e6a899..e1a5172b05 100644 --- a/packages/nocodb-sdk/src/lib/Api.ts +++ b/packages/nocodb-sdk/src/lib/Api.ts @@ -1938,7 +1938,7 @@ export class Api< */ update: ( viewId: string, - data: { password?: string }, + data: { password?: string; meta?: any }, params: RequestParams = {} ) => this.request({ @@ -2026,10 +2026,10 @@ export class Api< * @tags DB table sort * @name List * @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 = {}) => - this.request<{ uuid?: string; url?: string }, any>({ + this.request<{ sorts?: { list?: SortType[] } }, any>({ path: `/api/v1/db/meta/views/${viewId}/sorts`, method: 'GET', format: 'json', @@ -2124,14 +2124,15 @@ export class Api< * @tags DB table filter * @name Create * @request POST:/api/v1/db/meta/views/{viewId}/filters - * @response `200` `void` OK + * @response `200` `FilterType` OK */ create: (viewId: string, data: FilterType, params: RequestParams = {}) => - this.request({ + this.request({ path: `/api/v1/db/meta/views/${viewId}/filters`, method: 'POST', body: data, type: ContentType.Json, + format: 'json', ...params, }), @@ -2594,7 +2595,11 @@ export class Api< rowId: string, relationType: 'mm' | 'hm', columnName: string, - query?: { limit?: string; offset?: string }, + query?: { + limit?: string | number; + offset?: string | number; + where?: string; + }, params: RequestParams = {} ) => this.request({ @@ -2675,7 +2680,11 @@ export class Api< rowId: string, relationType: 'mm' | 'hm', columnName: string, - query?: { limit?: string; offset?: string }, + query?: { + limit?: string | number; + offset?: string | number; + where?: string; + }, params: RequestParams = {} ) => this.request({ diff --git a/scripts/sdk/swagger.json b/scripts/sdk/swagger.json index b6656f5b49..cc86c31a03 100644 --- a/scripts/sdk/swagger.json +++ b/scripts/sdk/swagger.json @@ -942,27 +942,28 @@ "post": { "summary": "", "operationId": "project-shared-base-create", - "responses": { "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "type": "object", - "properties": { - "uuid": { - "type": "string" - }, - "url": { - "type": "string" - }, - "roles": { - "type": "string" + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "uuid": { + "type": "string" + }, + "url": { + "type": "string" + }, + "roles": { + "type": "string" + } } } } } } - } }, "tags": [ "Project" @@ -1726,7 +1727,8 @@ "properties": { "password": { "type": "string" - } + }, + "meta": {} } } } @@ -1851,11 +1853,16 @@ "schema": { "type": "object", "properties": { - "uuid": { - "type": "string" - }, - "url": { - "type": "string" + "sorts": { + "type": "object", + "properties": { + "list": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Sort" + } + } + } } } } @@ -1991,7 +1998,14 @@ "operationId": "db-table-filter-create", "responses": { "200": { - "description": "OK" + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Filter" + } + } + } } }, "tags": [ @@ -3831,17 +3845,30 @@ "parameters": [ { "schema": { - "type": "string" + "type": [ + "string", + "number" + ] }, "in": "query", "name": "limit" }, { "schema": { - "type": "string" + "type": [ + "string", + "number" + ] }, "in": "query", "name": "offset" + }, + { + "schema": { + "type": "string" + }, + "in": "query", + "name": "where" } ] } @@ -4035,17 +4062,30 @@ "parameters": [ { "schema": { - "type": "string" + "type": [ + "string", + "number" + ] }, "in": "query", "name": "limit" }, { "schema": { - "type": "string" + "type": [ + "string", + "number" + ] }, "in": "query", "name": "offset" + }, + { + "schema": { + "type": "string" + }, + "in": "query", + "name": "where" } ] }