From e98b827a8204c9d8475f902129457e5ba36c3793 Mon Sep 17 00:00:00 2001 From: Khisby Al Ghofari Date: Mon, 17 Jul 2023 00:10:54 +0700 Subject: [PATCH 01/20] fix: wrong mysql meta sync UI Data Type --- .../nocodb/src/db/sql-mgr/code/models/xc/ModelXcMetaMysql.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/nocodb/src/db/sql-mgr/code/models/xc/ModelXcMetaMysql.ts b/packages/nocodb/src/db/sql-mgr/code/models/xc/ModelXcMetaMysql.ts index 84d478c6d2..faadaa9fd3 100644 --- a/packages/nocodb/src/db/sql-mgr/code/models/xc/ModelXcMetaMysql.ts +++ b/packages/nocodb/src/db/sql-mgr/code/models/xc/ModelXcMetaMysql.ts @@ -322,7 +322,7 @@ class ModelXcMetaMysql extends BaseModelXcMeta { case 'set': return 'MultiSelect'; case 'json': - return 'LongText'; + return 'JSON'; case 'blob': return 'LongText'; case 'geometry': From 8ab7166717e0614c0424f32788e86491970c6605 Mon Sep 17 00:00:00 2001 From: Khisby Al Ghofari Date: Tue, 18 Jul 2023 09:14:38 +0700 Subject: [PATCH 02/20] fix: wrong mysql meta sync UI Data Type --- .../nocodb/src/db/sql-mgr/code/models/xc/ModelXcMetaMssql.ts | 2 +- .../nocodb/src/db/sql-mgr/code/models/xc/ModelXcMetaOracle.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/nocodb/src/db/sql-mgr/code/models/xc/ModelXcMetaMssql.ts b/packages/nocodb/src/db/sql-mgr/code/models/xc/ModelXcMetaMssql.ts index d9180c812f..8a1d85fca9 100644 --- a/packages/nocodb/src/db/sql-mgr/code/models/xc/ModelXcMetaMssql.ts +++ b/packages/nocodb/src/db/sql-mgr/code/models/xc/ModelXcMetaMssql.ts @@ -590,7 +590,7 @@ class ModelXcMetaMssql extends BaseModelXcMeta { case 'set': return 'MultiSelect'; case 'json': - return 'LongText'; + return 'JSON'; case 'blob': return 'LongText'; case 'geometry': diff --git a/packages/nocodb/src/db/sql-mgr/code/models/xc/ModelXcMetaOracle.ts b/packages/nocodb/src/db/sql-mgr/code/models/xc/ModelXcMetaOracle.ts index 997d886de4..e216a151fe 100644 --- a/packages/nocodb/src/db/sql-mgr/code/models/xc/ModelXcMetaOracle.ts +++ b/packages/nocodb/src/db/sql-mgr/code/models/xc/ModelXcMetaOracle.ts @@ -370,7 +370,7 @@ class ModelXcMetaOracle extends BaseModelXcMeta { case 'set': return 'MultiSelect'; case 'json': - return 'LongText'; + return 'JSON'; } } From 801f35b2772fcb91416cf13cc7d32b3dd6fe60bb Mon Sep 17 00:00:00 2001 From: Pranav C Date: Sat, 22 Jul 2023 11:53:43 +0530 Subject: [PATCH 03/20] fix: include all fields in webhook payload regardless of view Signed-off-by: Pranav C --- packages/nocodb/src/db/BaseModelSqlv2.ts | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/packages/nocodb/src/db/BaseModelSqlv2.ts b/packages/nocodb/src/db/BaseModelSqlv2.ts index f39079c2fd..c31d9acba2 100644 --- a/packages/nocodb/src/db/BaseModelSqlv2.ts +++ b/packages/nocodb/src/db/BaseModelSqlv2.ts @@ -149,13 +149,18 @@ class BaseModelSqlv2 { id?: any, validateFormula = false, query: any = {}, + { + ignoreView = false, + }: { + ignoreView?: boolean; + } = {}, ): Promise { const qb = this.dbDriver(this.tnPath); const { ast, dependencyFields } = await getAst({ query, model: this.model, - view: this.viewId && (await View.get(this.viewId)), + view: ignoreView ? null : this.viewId && (await View.get(this.viewId)), }); await this.selectObject({ @@ -2018,7 +2023,7 @@ class BaseModelSqlv2 { await this.beforeUpdate(data, trx, cookie); - const prevData = await this.readByPk(id); + const prevData = await this.readByPk(id, false, {}, { ignoreView: true }); const query = this.dbDriver(this.tnPath) .update(updateObj) @@ -2026,7 +2031,7 @@ class BaseModelSqlv2 { await this.execAndParse(query); - const newData = await this.readByPk(id); + const newData = await this.readByPk(id, false, {}, { ignoreView: true }); await this.afterUpdate(prevData, newData, trx, cookie, updateObj); return newData; } catch (e) { From 5b34ffcabd92d219fca5f35e51bd14fa3b665c66 Mon Sep 17 00:00:00 2001 From: Pranav C Date: Sat, 22 Jul 2023 12:00:13 +0530 Subject: [PATCH 04/20] fix: include all fields in webhook payload regardless of view - insert/delete/bulk operations Signed-off-by: Pranav C --- packages/nocodb/src/db/BaseModelSqlv2.ts | 40 ++++++++++++++++++------ 1 file changed, 31 insertions(+), 9 deletions(-) diff --git a/packages/nocodb/src/db/BaseModelSqlv2.ts b/packages/nocodb/src/db/BaseModelSqlv2.ts index c31d9acba2..b0adba9476 100644 --- a/packages/nocodb/src/db/BaseModelSqlv2.ts +++ b/packages/nocodb/src/db/BaseModelSqlv2.ts @@ -1841,7 +1841,12 @@ class BaseModelSqlv2 { // handle if autogenerated primary key is used if (ag) { if (!response) await this.execAndParse(query); - response = await this.readByPk(data[ag.title]); + response = await this.readByPk( + data[ag.title], + false, + {}, + { ignoreView: true }, + ); } else if ( !response || (typeof response?.[0] !== 'object' && response?.[0] !== null) @@ -1869,7 +1874,7 @@ class BaseModelSqlv2 { })) as any )[0].id; } - response = await this.readByPk(id); + response = await this.readByPk(id, false, {}, { ignoreView: true }); } else { response = data; } @@ -1878,6 +1883,9 @@ class BaseModelSqlv2 { Array.isArray(response) ? response?.[0]?.[ai.title] : response?.[ai.title], + false, + {}, + { ignoreView: true }, ); } @@ -1894,7 +1902,7 @@ class BaseModelSqlv2 { let trx: Transaction = _trx; try { // retrieve data for handling params in hook - const data = await this.readByPk(id); + const data = await this.readByPk(id, false, {}, { ignoreView: true }); await this.beforeDelete(id, trx, cookie); const execQueries: ((trx: Transaction) => Promise)[] = []; @@ -2215,7 +2223,7 @@ class BaseModelSqlv2 { })) as any ).rows[0].id; } - response = await this.readByPk(id); + response = await this.readByPk(id, false, {}, { ignoreView: true }); } else { response = data; } @@ -2483,7 +2491,9 @@ class BaseModelSqlv2 { if (!raw) { for (const pkValues of updatePkValues) { - newData.push(await this.readByPk(pkValues)); + newData.push( + await this.readByPk(pkValues, false, {}, { ignoreView: true }), + ); } } @@ -2575,7 +2585,9 @@ class BaseModelSqlv2 { // pk not specified - bypass continue; } - deleted.push(await this.readByPk(pkValues)); + deleted.push( + await this.readByPk(pkValues, false, {}, { ignoreView: true }), + ); res.push(d); } @@ -3232,7 +3244,12 @@ class BaseModelSqlv2 { break; } - const response = await this.readByPk(rowId); + const response = await this.readByPk( + rowId, + false, + {}, + { ignoreView: true }, + ); await this.afterInsert(response, this.dbDriver, cookie); await this.afterAddChild(rowId, childId, cookie); } @@ -3281,7 +3298,12 @@ class BaseModelSqlv2 { const childTn = this.getTnPath(childTable); const parentTn = this.getTnPath(parentTable); - const prevData = await this.readByPk(rowId); + const prevData = await this.readByPk( + rowId, + false, + {}, + { ignoreView: true }, + ); switch (colOptions.type) { case RelationTypes.MANY_TO_MANY: @@ -3334,7 +3356,7 @@ class BaseModelSqlv2 { break; } - const newData = await this.readByPk(rowId); + const newData = await this.readByPk(rowId, false, {}, { ignoreView: true }); await this.afterUpdate(prevData, newData, this.dbDriver, cookie); await this.afterRemoveChild(rowId, childId, cookie); } From 3446578a8a88ac85e359895310e223a1f39e3089 Mon Sep 17 00:00:00 2001 From: mertmit Date: Sat, 22 Jul 2023 18:38:13 +0300 Subject: [PATCH 05/20] fix: kanban infinite load Signed-off-by: mertmit --- packages/nc-gui/components/smartsheet/Kanban.vue | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/packages/nc-gui/components/smartsheet/Kanban.vue b/packages/nc-gui/components/smartsheet/Kanban.vue index f9ad01f829..0248a84610 100644 --- a/packages/nc-gui/components/smartsheet/Kanban.vue +++ b/packages/nc-gui/components/smartsheet/Kanban.vue @@ -21,6 +21,7 @@ import { onBeforeUnmount, provide, useAttachment, + useDebounceFn, useKanbanViewStoreOrThrow, useUndoRedo, } from '#imports' @@ -30,6 +31,8 @@ interface Attachment { url: string } +const INFINITY_SCROLL_THRESHOLD = 100 + const meta = inject(MetaInj, ref()) const view = inject(ActiveViewInj, ref()) @@ -275,14 +278,14 @@ async function onMove(event: any, stackKey: string) { } } -const kanbanListScrollHandler = async (e: any) => { - if (e.target.scrollTop + e.target.clientHeight >= e.target.scrollHeight) { +const kanbanListScrollHandler = useDebounceFn(async (e: any) => { + if (e.target.scrollTop + e.target.clientHeight + INFINITY_SCROLL_THRESHOLD >= e.target.scrollHeight) { const stackTitle = e.target.getAttribute('data-stack-title') const pageSize = appInfo.defaultLimit || 25 const page = Math.ceil(formattedData.value.get(stackTitle)!.length / pageSize) await loadMoreKanbanData(stackTitle, { offset: page * pageSize }) } -} +}) const kanbanListRef = (kanbanListElement: HTMLElement) => { if (kanbanListElement) { From 77949e581a909a73d4557647f8284143202a5e63 Mon Sep 17 00:00:00 2001 From: Pranav C Date: Fri, 28 Jul 2023 11:58:29 +0530 Subject: [PATCH 06/20] fix: avoid keeping ref of all cells which is causing performance degrading Signed-off-by: Pranav C --- packages/nc-gui/components/smartsheet/Grid.vue | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/packages/nc-gui/components/smartsheet/Grid.vue b/packages/nc-gui/components/smartsheet/Grid.vue index a03b8b9635..ae875b4182 100644 --- a/packages/nc-gui/components/smartsheet/Grid.vue +++ b/packages/nc-gui/components/smartsheet/Grid.vue @@ -112,7 +112,7 @@ const expandedFormRow = ref() const expandedFormRowState = ref>() const gridWrapper = ref() const tableHeadEl = ref() -const tableBodyEl = ref() +const tableBodyEl = ref() const fillHandle = ref() const gridRect = useElementBounding(gridWrapper) @@ -917,8 +917,6 @@ function addEmptyRow(row?: number) { const fillHandleTop = ref() const fillHandleLeft = ref() -const cellRefs = ref<{ el: HTMLElement }[]>([]) - const showFillHandle = computed( () => !readOnly.value && @@ -929,13 +927,13 @@ const showFillHandle = computed( ) const refreshFillHandle = () => { - const cellRef = cellRefs.value.find( + const cellRef = [...(tableBodyEl.value?.querySelectorAll('td[data-row-index]') || [])].find( (cell) => - cell.el.dataset.rowIndex === String(isNaN(selectedRange.end.row) ? activeCell.row : selectedRange.end.row) && - cell.el.dataset.colIndex === String(isNaN(selectedRange.end.col) ? activeCell.col : selectedRange.end.col), + cell.dataset.rowIndex === String(isNaN(selectedRange.end.row) ? activeCell.row : selectedRange.end.row) && + cell.dataset.colIndex === String(isNaN(selectedRange.end.col) ? activeCell.col : selectedRange.end.col), ) if (cellRef) { - const cellRect = useElementBounding(cellRef.el) + const cellRect = useElementBounding(cellRef) if (!cellRect || !gridWrapper.value) return fillHandleTop.value = cellRect.top.value + cellRect.height.value - gridRect.top.value + gridWrapper.value.scrollTop fillHandleLeft.value = cellRect.left.value + cellRect.width.value - gridRect.left.value + gridWrapper.value.scrollLeft @@ -1132,7 +1130,6 @@ useEventListener(document, 'mouseup', () => { Date: Fri, 28 Jul 2023 12:22:50 +0300 Subject: [PATCH 09/20] refactor: use native call Signed-off-by: mertmit --- packages/nc-gui/components/smartsheet/Grid.vue | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/nc-gui/components/smartsheet/Grid.vue b/packages/nc-gui/components/smartsheet/Grid.vue index ae875b4182..689d2ae878 100644 --- a/packages/nc-gui/components/smartsheet/Grid.vue +++ b/packages/nc-gui/components/smartsheet/Grid.vue @@ -933,10 +933,10 @@ const refreshFillHandle = () => { cell.dataset.colIndex === String(isNaN(selectedRange.end.col) ? activeCell.col : selectedRange.end.col), ) if (cellRef) { - const cellRect = useElementBounding(cellRef) + const cellRect = cellRef.getBoundingClientRect() if (!cellRect || !gridWrapper.value) return - fillHandleTop.value = cellRect.top.value + cellRect.height.value - gridRect.top.value + gridWrapper.value.scrollTop - fillHandleLeft.value = cellRect.left.value + cellRect.width.value - gridRect.left.value + gridWrapper.value.scrollLeft + fillHandleTop.value = cellRect.top + cellRect.height - gridRect.top.value + gridWrapper.value.scrollTop + fillHandleLeft.value = cellRect.left + cellRect.width - gridRect.left.value + gridWrapper.value.scrollLeft } } From e6fb3eaa27666c2a2ed0e3ea9e120bc63aef104b Mon Sep 17 00:00:00 2001 From: mertmit Date: Fri, 28 Jul 2023 12:27:36 +0300 Subject: [PATCH 10/20] fix: use dynamic class to select last cell Signed-off-by: mertmit --- .../nc-gui/components/smartsheet/Grid.vue | 23 ++++++++++--------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/packages/nc-gui/components/smartsheet/Grid.vue b/packages/nc-gui/components/smartsheet/Grid.vue index 689d2ae878..216494d844 100644 --- a/packages/nc-gui/components/smartsheet/Grid.vue +++ b/packages/nc-gui/components/smartsheet/Grid.vue @@ -927,17 +927,15 @@ const showFillHandle = computed( ) const refreshFillHandle = () => { - const cellRef = [...(tableBodyEl.value?.querySelectorAll('td[data-row-index]') || [])].find( - (cell) => - cell.dataset.rowIndex === String(isNaN(selectedRange.end.row) ? activeCell.row : selectedRange.end.row) && - cell.dataset.colIndex === String(isNaN(selectedRange.end.col) ? activeCell.col : selectedRange.end.col), - ) - if (cellRef) { - const cellRect = cellRef.getBoundingClientRect() - if (!cellRect || !gridWrapper.value) return - fillHandleTop.value = cellRect.top + cellRect.height - gridRect.top.value + gridWrapper.value.scrollTop - fillHandleLeft.value = cellRect.left + cellRect.width - gridRect.left.value + gridWrapper.value.scrollLeft - } + nextTick(() => { + const cellRef = document.querySelector('.last-cell') + if (cellRef) { + const cellRect = cellRef.getBoundingClientRect() + if (!cellRect || !gridWrapper.value) return + fillHandleTop.value = cellRect.top + cellRect.height - gridRect.top.value + gridWrapper.value.scrollTop + fillHandleLeft.value = cellRect.left + cellRect.width - gridRect.left.value + gridWrapper.value.scrollLeft + } + }) } const addRowExpandOnClose = (row: Row) => { @@ -1138,6 +1136,9 @@ useEventListener(document, 'mouseup', () => { hasEditPermission && ((activeCell.row === rowIndex && activeCell.col === colIndex) || (selectedRange._start?.row === rowIndex && selectedRange._start?.col === colIndex)), + 'last-cell': + rowIndex === (isNaN(selectedRange.end.row) ? activeCell.row : selectedRange.end.row) && + colIndex === (isNaN(selectedRange.end.col) ? activeCell.col : selectedRange.end.col), 'nc-required-cell': isColumnRequiredAndNull(columnObj, row.row), 'align-middle': !rowHeight || rowHeight === 1, 'align-top': rowHeight && rowHeight !== 1, From 38179687f9e2200dd95c6f25f7fd43e8f3739417 Mon Sep 17 00:00:00 2001 From: pranavxc Date: Fri, 28 Jul 2023 10:55:16 +0000 Subject: [PATCH 11/20] [create-pull-request] automated change Signed-off-by: GitHub --- packages/nc-gui/package-lock.json | 54 +++++++++++++++++++------------ packages/nc-gui/package.json | 2 +- packages/nc-lib-gui/package.json | 2 +- packages/nocodb-sdk/package.json | 2 +- packages/nocodb/package-lock.json | 50 +++++++++++++--------------- packages/nocodb/package.json | 8 ++--- 6 files changed, 63 insertions(+), 55 deletions(-) diff --git a/packages/nc-gui/package-lock.json b/packages/nc-gui/package-lock.json index 63288dbf59..ea8ccadd64 100644 --- a/packages/nc-gui/package-lock.json +++ b/packages/nc-gui/package-lock.json @@ -30,7 +30,7 @@ "leaflet.markercluster": "^1.5.3", "locale-codes": "^1.3.1", "monaco-editor": "^0.33.0", - "nocodb-sdk": "file:../nocodb-sdk", + "nocodb-sdk": "0.109.5", "papaparse": "^5.3.2", "pinia": "^2.0.33", "qrcode": "^1.5.1", @@ -110,7 +110,8 @@ } }, "../nocodb-sdk": { - "version": "0.109.4", + "version": "0.109.5", + "extraneous": true, "license": "AGPL-3.0-or-later", "dependencies": { "axios": "^0.21.1", @@ -8719,7 +8720,6 @@ "version": "1.15.1", "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.1.tgz", "integrity": "sha512-yLAMQs+k0b2m7cVxpS1VKJVvoz7SS9Td1zss3XRwXj+ZDH00RJgnuLx7E44wx02kQLrdM3aOOy+FpzS7+8OizA==", - "devOptional": true, "funding": [ { "type": "individual", @@ -12238,8 +12238,21 @@ } }, "node_modules/nocodb-sdk": { - "resolved": "../nocodb-sdk", - "link": true + "version": "0.109.5", + "resolved": "https://registry.npmjs.org/nocodb-sdk/-/nocodb-sdk-0.109.5.tgz", + "integrity": "sha512-CGrTADus9bfUJ5qHcMqRN3OYwOmkRm7iRml54lXmE36WoxACQs/ACWi7OQkzDSsSpduPitHis0a0n83AmlBVYw==", + "dependencies": { + "axios": "^0.21.1", + "jsep": "^1.3.6" + } + }, + "node_modules/nocodb-sdk/node_modules/axios": { + "version": "0.21.4", + "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.4.tgz", + "integrity": "sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg==", + "dependencies": { + "follow-redirects": "^1.14.0" + } }, "node_modules/node-abi": { "version": "3.23.0", @@ -24716,8 +24729,7 @@ "follow-redirects": { "version": "1.15.1", "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.1.tgz", - "integrity": "sha512-yLAMQs+k0b2m7cVxpS1VKJVvoz7SS9Td1zss3XRwXj+ZDH00RJgnuLx7E44wx02kQLrdM3aOOy+FpzS7+8OizA==", - "devOptional": true + "integrity": "sha512-yLAMQs+k0b2m7cVxpS1VKJVvoz7SS9Td1zss3XRwXj+ZDH00RJgnuLx7E44wx02kQLrdM3aOOy+FpzS7+8OizA==" }, "form-data": { "version": "4.0.0", @@ -27267,22 +27279,22 @@ } }, "nocodb-sdk": { - "version": "file:../nocodb-sdk", + "version": "0.109.5", + "resolved": "https://registry.npmjs.org/nocodb-sdk/-/nocodb-sdk-0.109.5.tgz", + "integrity": "sha512-CGrTADus9bfUJ5qHcMqRN3OYwOmkRm7iRml54lXmE36WoxACQs/ACWi7OQkzDSsSpduPitHis0a0n83AmlBVYw==", "requires": { - "@typescript-eslint/eslint-plugin": "^4.0.1", - "@typescript-eslint/parser": "^4.0.1", "axios": "^0.21.1", - "cspell": "^4.1.0", - "eslint": "^7.8.0", - "eslint-config-prettier": "^6.11.0", - "eslint-plugin-eslint-comments": "^3.2.0", - "eslint-plugin-functional": "^3.0.2", - "eslint-plugin-import": "^2.22.0", - "eslint-plugin-prettier": "^4.0.0", - "jsep": "^1.3.6", - "npm-run-all": "^4.1.5", - "prettier": "^2.1.1", - "typescript": "^4.0.2" + "jsep": "^1.3.6" + }, + "dependencies": { + "axios": { + "version": "0.21.4", + "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.4.tgz", + "integrity": "sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg==", + "requires": { + "follow-redirects": "^1.14.0" + } + } } }, "node-abi": { diff --git a/packages/nc-gui/package.json b/packages/nc-gui/package.json index 44f0905daf..b1ba777e4a 100644 --- a/packages/nc-gui/package.json +++ b/packages/nc-gui/package.json @@ -54,7 +54,7 @@ "leaflet.markercluster": "^1.5.3", "locale-codes": "^1.3.1", "monaco-editor": "^0.33.0", - "nocodb-sdk": "file:../nocodb-sdk", + "nocodb-sdk": "0.109.5", "papaparse": "^5.3.2", "pinia": "^2.0.33", "qrcode": "^1.5.1", diff --git a/packages/nc-lib-gui/package.json b/packages/nc-lib-gui/package.json index 88960b9d9e..ca7291370c 100644 --- a/packages/nc-lib-gui/package.json +++ b/packages/nc-lib-gui/package.json @@ -1,6 +1,6 @@ { "name": "nc-lib-gui", - "version": "0.109.4", + "version": "0.109.5", "description": "NocoDB GUI", "author": { "name": "NocoDB", diff --git a/packages/nocodb-sdk/package.json b/packages/nocodb-sdk/package.json index 6b8cfe0f0d..2fc6ecc0a5 100644 --- a/packages/nocodb-sdk/package.json +++ b/packages/nocodb-sdk/package.json @@ -1,6 +1,6 @@ { "name": "nocodb-sdk", - "version": "0.109.4", + "version": "0.109.5", "description": "NocoDB SDK", "main": "build/main/index.js", "typings": "build/main/index.d.ts", diff --git a/packages/nocodb/package-lock.json b/packages/nocodb/package-lock.json index 5f589391bc..a12cfdb960 100644 --- a/packages/nocodb/package-lock.json +++ b/packages/nocodb/package-lock.json @@ -1,12 +1,12 @@ { "name": "nocodb", - "version": "0.109.4", + "version": "0.109.5", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "nocodb", - "version": "0.109.4", + "version": "0.109.5", "license": "AGPL-3.0-or-later", "dependencies": { "@google-cloud/storage": "^5.7.2", @@ -80,10 +80,10 @@ "mysql2": "^3.2.0", "nanoid": "^3.1.20", "nc-help": "^0.2.87", - "nc-lib-gui": "0.109.4", + "nc-lib-gui": "0.109.5", "nc-plugin": "^0.1.3", "ncp": "^2.0.0", - "nocodb-sdk": "file:../nocodb-sdk", + "nocodb-sdk": "0.109.5", "nodemailer": "^6.4.10", "object-hash": "^3.0.0", "object-sizeof": "^2.6.1", @@ -191,7 +191,8 @@ } }, "../nocodb-sdk": { - "version": "0.109.4", + "version": "0.109.5", + "extraneous": true, "license": "AGPL-3.0-or-later", "dependencies": { "axios": "^0.21.1", @@ -13158,9 +13159,9 @@ } }, "node_modules/nc-lib-gui": { - "version": "0.109.4", - "resolved": "https://registry.npmjs.org/nc-lib-gui/-/nc-lib-gui-0.109.4.tgz", - "integrity": "sha512-mvYaOAFfmw3JHzhAMVrGzOehTKpFjZXcstyt681/Ny3DLNKAycjOmJld0oA+YC7GY44Pp+zYGhhFfw/ovWaCTQ==", + "version": "0.109.5", + "resolved": "https://registry.npmjs.org/nc-lib-gui/-/nc-lib-gui-0.109.5.tgz", + "integrity": "sha512-A6za8yFO167OVd2MnGrzEFAOQ5Nx9UJ5zpk1iH7FC427TEHJOAbvlOYMVa3s7Pb8wjYKhZ5Mr4sBldtY0cKaHA==", "dependencies": { "express": "^4.17.1" } @@ -13207,8 +13208,13 @@ } }, "node_modules/nocodb-sdk": { - "resolved": "../nocodb-sdk", - "link": true + "version": "0.109.5", + "resolved": "https://registry.npmjs.org/nocodb-sdk/-/nocodb-sdk-0.109.5.tgz", + "integrity": "sha512-CGrTADus9bfUJ5qHcMqRN3OYwOmkRm7iRml54lXmE36WoxACQs/ACWi7OQkzDSsSpduPitHis0a0n83AmlBVYw==", + "dependencies": { + "axios": "^0.21.1", + "jsep": "^1.3.6" + } }, "node_modules/node-abort-controller": { "version": "3.1.1", @@ -28474,9 +28480,9 @@ } }, "nc-lib-gui": { - "version": "0.109.4", - "resolved": "https://registry.npmjs.org/nc-lib-gui/-/nc-lib-gui-0.109.4.tgz", - "integrity": "sha512-mvYaOAFfmw3JHzhAMVrGzOehTKpFjZXcstyt681/Ny3DLNKAycjOmJld0oA+YC7GY44Pp+zYGhhFfw/ovWaCTQ==", + "version": "0.109.5", + "resolved": "https://registry.npmjs.org/nc-lib-gui/-/nc-lib-gui-0.109.5.tgz", + "integrity": "sha512-A6za8yFO167OVd2MnGrzEFAOQ5Nx9UJ5zpk1iH7FC427TEHJOAbvlOYMVa3s7Pb8wjYKhZ5Mr4sBldtY0cKaHA==", "requires": { "express": "^4.17.1" } @@ -28511,22 +28517,12 @@ "integrity": "sha512-dBpDMdxv9Irdq66304OLfEmQ9tbNRFnFTuZiLo+bD+r332bBmMJ8GBLXklIXXgxd3+v9+KUnZaUR5PJMa75Gsg==" }, "nocodb-sdk": { - "version": "file:../nocodb-sdk", + "version": "0.109.5", + "resolved": "https://registry.npmjs.org/nocodb-sdk/-/nocodb-sdk-0.109.5.tgz", + "integrity": "sha512-CGrTADus9bfUJ5qHcMqRN3OYwOmkRm7iRml54lXmE36WoxACQs/ACWi7OQkzDSsSpduPitHis0a0n83AmlBVYw==", "requires": { - "@typescript-eslint/eslint-plugin": "^4.0.1", - "@typescript-eslint/parser": "^4.0.1", "axios": "^0.21.1", - "cspell": "^4.1.0", - "eslint": "^7.8.0", - "eslint-config-prettier": "^6.11.0", - "eslint-plugin-eslint-comments": "^3.2.0", - "eslint-plugin-functional": "^3.0.2", - "eslint-plugin-import": "^2.22.0", - "eslint-plugin-prettier": "^4.0.0", - "jsep": "^1.3.6", - "npm-run-all": "^4.1.5", - "prettier": "^2.1.1", - "typescript": "^4.0.2" + "jsep": "^1.3.6" } }, "node-abort-controller": { diff --git a/packages/nocodb/package.json b/packages/nocodb/package.json index f5c2acd199..0819d4922e 100644 --- a/packages/nocodb/package.json +++ b/packages/nocodb/package.json @@ -1,6 +1,6 @@ { "name": "nocodb", - "version": "0.109.4", + "version": "0.109.5", "description": "NocoDB Backend", "main": "dist/bundle.js", "author": { @@ -113,10 +113,10 @@ "mysql2": "^3.2.0", "nanoid": "^3.1.20", "nc-help": "^0.2.87", - "nc-lib-gui": "0.109.4", + "nc-lib-gui": "0.109.5", "nc-plugin": "^0.1.3", "ncp": "^2.0.0", - "nocodb-sdk": "file:../nocodb-sdk", + "nocodb-sdk": "0.109.5", "nodemailer": "^6.4.10", "object-hash": "^3.0.0", "object-sizeof": "^2.6.1", @@ -204,4 +204,4 @@ "coverageDirectory": "../coverage", "testEnvironment": "node" } -} +} \ No newline at end of file From abd63700a52a233d19e74630be77878130458ee3 Mon Sep 17 00:00:00 2001 From: Pranav C Date: Fri, 28 Jul 2023 17:04:03 +0530 Subject: [PATCH 12/20] chore: update sdk path Signed-off-by: Pranav C --- packages/nc-gui/package-lock.json | 52 +++++++++++---------------- packages/nc-gui/package.json | 2 +- packages/nocodb-sdk/package-lock.json | 4 +-- packages/nocodb/package-lock.json | 30 +++++++++------- packages/nocodb/package.json | 4 +-- 5 files changed, 42 insertions(+), 50 deletions(-) diff --git a/packages/nc-gui/package-lock.json b/packages/nc-gui/package-lock.json index ea8ccadd64..7ccbf09e52 100644 --- a/packages/nc-gui/package-lock.json +++ b/packages/nc-gui/package-lock.json @@ -30,7 +30,7 @@ "leaflet.markercluster": "^1.5.3", "locale-codes": "^1.3.1", "monaco-editor": "^0.33.0", - "nocodb-sdk": "0.109.5", + "nocodb-sdk": "file:../nocodb-sdk", "papaparse": "^5.3.2", "pinia": "^2.0.33", "qrcode": "^1.5.1", @@ -111,7 +111,6 @@ }, "../nocodb-sdk": { "version": "0.109.5", - "extraneous": true, "license": "AGPL-3.0-or-later", "dependencies": { "axios": "^0.21.1", @@ -8720,6 +8719,7 @@ "version": "1.15.1", "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.1.tgz", "integrity": "sha512-yLAMQs+k0b2m7cVxpS1VKJVvoz7SS9Td1zss3XRwXj+ZDH00RJgnuLx7E44wx02kQLrdM3aOOy+FpzS7+8OizA==", + "devOptional": true, "funding": [ { "type": "individual", @@ -12238,21 +12238,8 @@ } }, "node_modules/nocodb-sdk": { - "version": "0.109.5", - "resolved": "https://registry.npmjs.org/nocodb-sdk/-/nocodb-sdk-0.109.5.tgz", - "integrity": "sha512-CGrTADus9bfUJ5qHcMqRN3OYwOmkRm7iRml54lXmE36WoxACQs/ACWi7OQkzDSsSpduPitHis0a0n83AmlBVYw==", - "dependencies": { - "axios": "^0.21.1", - "jsep": "^1.3.6" - } - }, - "node_modules/nocodb-sdk/node_modules/axios": { - "version": "0.21.4", - "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.4.tgz", - "integrity": "sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg==", - "dependencies": { - "follow-redirects": "^1.14.0" - } + "resolved": "../nocodb-sdk", + "link": true }, "node_modules/node-abi": { "version": "3.23.0", @@ -24729,7 +24716,8 @@ "follow-redirects": { "version": "1.15.1", "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.1.tgz", - "integrity": "sha512-yLAMQs+k0b2m7cVxpS1VKJVvoz7SS9Td1zss3XRwXj+ZDH00RJgnuLx7E44wx02kQLrdM3aOOy+FpzS7+8OizA==" + "integrity": "sha512-yLAMQs+k0b2m7cVxpS1VKJVvoz7SS9Td1zss3XRwXj+ZDH00RJgnuLx7E44wx02kQLrdM3aOOy+FpzS7+8OizA==", + "devOptional": true }, "form-data": { "version": "4.0.0", @@ -27279,22 +27267,22 @@ } }, "nocodb-sdk": { - "version": "0.109.5", - "resolved": "https://registry.npmjs.org/nocodb-sdk/-/nocodb-sdk-0.109.5.tgz", - "integrity": "sha512-CGrTADus9bfUJ5qHcMqRN3OYwOmkRm7iRml54lXmE36WoxACQs/ACWi7OQkzDSsSpduPitHis0a0n83AmlBVYw==", + "version": "file:../nocodb-sdk", "requires": { + "@typescript-eslint/eslint-plugin": "^4.0.1", + "@typescript-eslint/parser": "^4.0.1", "axios": "^0.21.1", - "jsep": "^1.3.6" - }, - "dependencies": { - "axios": { - "version": "0.21.4", - "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.4.tgz", - "integrity": "sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg==", - "requires": { - "follow-redirects": "^1.14.0" - } - } + "cspell": "^4.1.0", + "eslint": "^7.8.0", + "eslint-config-prettier": "^6.11.0", + "eslint-plugin-eslint-comments": "^3.2.0", + "eslint-plugin-functional": "^3.0.2", + "eslint-plugin-import": "^2.22.0", + "eslint-plugin-prettier": "^4.0.0", + "jsep": "^1.3.6", + "npm-run-all": "^4.1.5", + "prettier": "^2.1.1", + "typescript": "^4.0.2" } }, "node-abi": { diff --git a/packages/nc-gui/package.json b/packages/nc-gui/package.json index b1ba777e4a..44f0905daf 100644 --- a/packages/nc-gui/package.json +++ b/packages/nc-gui/package.json @@ -54,7 +54,7 @@ "leaflet.markercluster": "^1.5.3", "locale-codes": "^1.3.1", "monaco-editor": "^0.33.0", - "nocodb-sdk": "0.109.5", + "nocodb-sdk": "file:../nocodb-sdk", "papaparse": "^5.3.2", "pinia": "^2.0.33", "qrcode": "^1.5.1", diff --git a/packages/nocodb-sdk/package-lock.json b/packages/nocodb-sdk/package-lock.json index 0aa5aabb3e..dda8da70f5 100644 --- a/packages/nocodb-sdk/package-lock.json +++ b/packages/nocodb-sdk/package-lock.json @@ -1,12 +1,12 @@ { "name": "nocodb-sdk", - "version": "0.109.4", + "version": "0.109.5", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "nocodb-sdk", - "version": "0.109.4", + "version": "0.109.5", "license": "AGPL-3.0-or-later", "dependencies": { "axios": "^0.21.1", diff --git a/packages/nocodb/package-lock.json b/packages/nocodb/package-lock.json index a12cfdb960..b8da539dec 100644 --- a/packages/nocodb/package-lock.json +++ b/packages/nocodb/package-lock.json @@ -83,7 +83,7 @@ "nc-lib-gui": "0.109.5", "nc-plugin": "^0.1.3", "ncp": "^2.0.0", - "nocodb-sdk": "0.109.5", + "nocodb-sdk": "file:../nocodb-sdk", "nodemailer": "^6.4.10", "object-hash": "^3.0.0", "object-sizeof": "^2.6.1", @@ -192,7 +192,6 @@ }, "../nocodb-sdk": { "version": "0.109.5", - "extraneous": true, "license": "AGPL-3.0-or-later", "dependencies": { "axios": "^0.21.1", @@ -13208,13 +13207,8 @@ } }, "node_modules/nocodb-sdk": { - "version": "0.109.5", - "resolved": "https://registry.npmjs.org/nocodb-sdk/-/nocodb-sdk-0.109.5.tgz", - "integrity": "sha512-CGrTADus9bfUJ5qHcMqRN3OYwOmkRm7iRml54lXmE36WoxACQs/ACWi7OQkzDSsSpduPitHis0a0n83AmlBVYw==", - "dependencies": { - "axios": "^0.21.1", - "jsep": "^1.3.6" - } + "resolved": "../nocodb-sdk", + "link": true }, "node_modules/node-abort-controller": { "version": "3.1.1", @@ -28517,12 +28511,22 @@ "integrity": "sha512-dBpDMdxv9Irdq66304OLfEmQ9tbNRFnFTuZiLo+bD+r332bBmMJ8GBLXklIXXgxd3+v9+KUnZaUR5PJMa75Gsg==" }, "nocodb-sdk": { - "version": "0.109.5", - "resolved": "https://registry.npmjs.org/nocodb-sdk/-/nocodb-sdk-0.109.5.tgz", - "integrity": "sha512-CGrTADus9bfUJ5qHcMqRN3OYwOmkRm7iRml54lXmE36WoxACQs/ACWi7OQkzDSsSpduPitHis0a0n83AmlBVYw==", + "version": "file:../nocodb-sdk", "requires": { + "@typescript-eslint/eslint-plugin": "^4.0.1", + "@typescript-eslint/parser": "^4.0.1", "axios": "^0.21.1", - "jsep": "^1.3.6" + "cspell": "^4.1.0", + "eslint": "^7.8.0", + "eslint-config-prettier": "^6.11.0", + "eslint-plugin-eslint-comments": "^3.2.0", + "eslint-plugin-functional": "^3.0.2", + "eslint-plugin-import": "^2.22.0", + "eslint-plugin-prettier": "^4.0.0", + "jsep": "^1.3.6", + "npm-run-all": "^4.1.5", + "prettier": "^2.1.1", + "typescript": "^4.0.2" } }, "node-abort-controller": { diff --git a/packages/nocodb/package.json b/packages/nocodb/package.json index 0819d4922e..2a1c30f8ca 100644 --- a/packages/nocodb/package.json +++ b/packages/nocodb/package.json @@ -116,7 +116,7 @@ "nc-lib-gui": "0.109.5", "nc-plugin": "^0.1.3", "ncp": "^2.0.0", - "nocodb-sdk": "0.109.5", + "nocodb-sdk": "file:../nocodb-sdk", "nodemailer": "^6.4.10", "object-hash": "^3.0.0", "object-sizeof": "^2.6.1", @@ -204,4 +204,4 @@ "coverageDirectory": "../coverage", "testEnvironment": "node" } -} \ No newline at end of file +} From 6e90e2258e537b8e19fb532c79028025629263eb Mon Sep 17 00:00:00 2001 From: Pranav C Date: Mon, 31 Jul 2023 18:11:12 +0530 Subject: [PATCH 13/20] fix: file read - allow only accessing files from intended folder Signed-off-by: Pranav C --- packages/nocodb/src/plugins/storage/Local.ts | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/packages/nocodb/src/plugins/storage/Local.ts b/packages/nocodb/src/plugins/storage/Local.ts index f0dbebf2a4..a6232ed32f 100644 --- a/packages/nocodb/src/plugins/storage/Local.ts +++ b/packages/nocodb/src/plugins/storage/Local.ts @@ -3,6 +3,7 @@ import path from 'path'; import { promisify } from 'util'; import mkdirp from 'mkdirp'; import axios from 'axios'; +import { NcError } from '../../helpers/catchError'; import { getToolDir } from '../../utils/nc-config'; import type { IStorageAdapterV2, XcFile } from 'nc-plugin'; import type { Readable } from 'stream'; @@ -102,9 +103,20 @@ export default class Local implements IStorageAdapterV2 { public async fileRead(filePath: string): Promise { try { - const fileData = await fs.promises.readFile( + // Get the absolute path to the base directory + const absoluteBasePath = path.resolve(getToolDir()); + + // Get the absolute path to the file + const absolutePath = path.resolve( path.join(getToolDir(), ...filePath.split('/')), ); + + // Check if the resolved path is within the intended directory + if (!absolutePath.startsWith(absoluteBasePath)) { + NcError.notFound('Invalid path'); + } + + const fileData = await fs.promises.readFile(absolutePath); return fileData; } catch (e) { throw e; From 1e303a5cbc7c7bf533a15528ec4bf73b32bcf387 Mon Sep 17 00:00:00 2001 From: Pranav C Date: Mon, 31 Jul 2023 22:35:30 +0530 Subject: [PATCH 14/20] fix: add validation and normalisation for all methods since write/list operations also vulnerable Signed-off-by: Pranav C --- packages/nocodb/src/plugins/storage/Local.ts | 50 +++++++++++++------- 1 file changed, 32 insertions(+), 18 deletions(-) diff --git a/packages/nocodb/src/plugins/storage/Local.ts b/packages/nocodb/src/plugins/storage/Local.ts index a6232ed32f..e7bff7fdce 100644 --- a/packages/nocodb/src/plugins/storage/Local.ts +++ b/packages/nocodb/src/plugins/storage/Local.ts @@ -12,7 +12,7 @@ export default class Local implements IStorageAdapterV2 { constructor() {} public async fileCreate(key: string, file: XcFile): Promise { - const destPath = path.join(getToolDir(), ...key.split('/')); + const destPath = this.validateAndNormalisePath(key); try { await mkdirp(path.dirname(destPath)); const data = await promisify(fs.readFile)(file.path); @@ -25,7 +25,7 @@ export default class Local implements IStorageAdapterV2 { } async fileCreateByUrl(key: string, url: string): Promise { - const destPath = path.join(getToolDir(), ...key.split('/')); + const destPath = this.validateAndNormalisePath(key); return new Promise((resolve, reject) => { axios .get(url, { @@ -72,7 +72,7 @@ export default class Local implements IStorageAdapterV2 { stream: Readable, ): Promise { return new Promise((resolve, reject) => { - const destPath = path.join(getToolDir(), ...key.split('/')); + const destPath = this.validateAndNormalisePath(key); try { mkdirp(path.dirname(destPath)).then(() => { const writableStream = fs.createWriteStream(destPath); @@ -87,12 +87,12 @@ export default class Local implements IStorageAdapterV2 { } public async fileReadByStream(key: string): Promise { - const srcPath = path.join(getToolDir(), ...key.split('/')); + const srcPath = this.validateAndNormalisePath(key); return fs.createReadStream(srcPath, { encoding: 'utf8' }); } public async getDirectoryList(key: string): Promise { - const destDir = path.join(getToolDir(), ...key.split('/')); + const destDir = this.validateAndNormalisePath(key); return fs.promises.readdir(destDir); } @@ -103,20 +103,9 @@ export default class Local implements IStorageAdapterV2 { public async fileRead(filePath: string): Promise { try { - // Get the absolute path to the base directory - const absoluteBasePath = path.resolve(getToolDir()); - - // Get the absolute path to the file - const absolutePath = path.resolve( - path.join(getToolDir(), ...filePath.split('/')), + const fileData = await fs.promises.readFile( + this.validateAndNormalisePath(filePath, true), ); - - // Check if the resolved path is within the intended directory - if (!absolutePath.startsWith(absoluteBasePath)) { - NcError.notFound('Invalid path'); - } - - const fileData = await fs.promises.readFile(absolutePath); return fileData; } catch (e) { throw e; @@ -130,4 +119,29 @@ export default class Local implements IStorageAdapterV2 { test(): Promise { return Promise.resolve(false); } + + // method for validate/normalise the path for avoid path traversal attack + protected validateAndNormalisePath( + fileOrFolderPath: string, + throw404 = false, + ): string { + // Get the absolute path to the base directory + const absoluteBasePath = path.resolve(getToolDir()); + + // Get the absolute path to the file + const absolutePath = path.resolve( + path.join(getToolDir(), ...fileOrFolderPath.split('/')), + ); + + // Check if the resolved path is within the intended directory + if (!absolutePath.startsWith(absoluteBasePath)) { + if (throw404) { + NcError.notFound(); + } else { + NcError.badRequest('Invalid path'); + } + } + + return absolutePath; + } } From 5fcb7c88acc661fed282dff06c51396e454a93ec Mon Sep 17 00:00:00 2001 From: Pranav C Date: Tue, 1 Aug 2023 12:36:24 +0530 Subject: [PATCH 15/20] fix: include `nc` along with base path since we are always uploading under that folder - base path contain sqlite file as well Signed-off-by: Pranav C --- packages/nocodb/src/plugins/storage/Local.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/nocodb/src/plugins/storage/Local.ts b/packages/nocodb/src/plugins/storage/Local.ts index e7bff7fdce..7d49e54f70 100644 --- a/packages/nocodb/src/plugins/storage/Local.ts +++ b/packages/nocodb/src/plugins/storage/Local.ts @@ -126,7 +126,7 @@ export default class Local implements IStorageAdapterV2 { throw404 = false, ): string { // Get the absolute path to the base directory - const absoluteBasePath = path.resolve(getToolDir()); + const absoluteBasePath = path.resolve(getToolDir(), 'nc'); // Get the absolute path to the file const absolutePath = path.resolve( From 19e6075f54096940c77d3e4a1c7c55d9f410c8be Mon Sep 17 00:00:00 2001 From: Anbarasu Date: Wed, 2 Aug 2023 14:57:36 +0530 Subject: [PATCH 16/20] fix: test webhook on condition --- packages/nocodb/src/helpers/webhookHelpers.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/nocodb/src/helpers/webhookHelpers.ts b/packages/nocodb/src/helpers/webhookHelpers.ts index c0fc56a448..400db86b71 100644 --- a/packages/nocodb/src/helpers/webhookHelpers.ts +++ b/packages/nocodb/src/helpers/webhookHelpers.ts @@ -271,7 +271,7 @@ export async function invokeWebhook( return; } - if (hook.condition) { + if (hook.condition && !testHook) { if (isBulkOperation) { const filteredData = []; for (const data of newData) { From 90413ddfa28bc1c6daef906ffd0315e4feae5c4d Mon Sep 17 00:00:00 2001 From: pranavxc Date: Wed, 2 Aug 2023 10:53:54 +0000 Subject: [PATCH 17/20] [create-pull-request] automated change Signed-off-by: GitHub --- packages/nc-gui/package-lock.json | 54 +++++++++++++++++++------------ packages/nc-gui/package.json | 2 +- packages/nc-lib-gui/package.json | 2 +- packages/nocodb-sdk/package.json | 2 +- packages/nocodb/package-lock.json | 50 +++++++++++++--------------- packages/nocodb/package.json | 8 ++--- 6 files changed, 63 insertions(+), 55 deletions(-) diff --git a/packages/nc-gui/package-lock.json b/packages/nc-gui/package-lock.json index 7ccbf09e52..e4c6379d78 100644 --- a/packages/nc-gui/package-lock.json +++ b/packages/nc-gui/package-lock.json @@ -30,7 +30,7 @@ "leaflet.markercluster": "^1.5.3", "locale-codes": "^1.3.1", "monaco-editor": "^0.33.0", - "nocodb-sdk": "file:../nocodb-sdk", + "nocodb-sdk": "0.109.6", "papaparse": "^5.3.2", "pinia": "^2.0.33", "qrcode": "^1.5.1", @@ -110,7 +110,8 @@ } }, "../nocodb-sdk": { - "version": "0.109.5", + "version": "0.109.6", + "extraneous": true, "license": "AGPL-3.0-or-later", "dependencies": { "axios": "^0.21.1", @@ -8719,7 +8720,6 @@ "version": "1.15.1", "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.1.tgz", "integrity": "sha512-yLAMQs+k0b2m7cVxpS1VKJVvoz7SS9Td1zss3XRwXj+ZDH00RJgnuLx7E44wx02kQLrdM3aOOy+FpzS7+8OizA==", - "devOptional": true, "funding": [ { "type": "individual", @@ -12238,8 +12238,21 @@ } }, "node_modules/nocodb-sdk": { - "resolved": "../nocodb-sdk", - "link": true + "version": "0.109.6", + "resolved": "https://registry.npmjs.org/nocodb-sdk/-/nocodb-sdk-0.109.6.tgz", + "integrity": "sha512-Zh4MjkurCPYl/eJWt9ChvoikMpDujI/F6IaQYb9bJBss6Ns4grdhKizCdvywb2dRYaGqXquzwrGg2jmpw/Xyxg==", + "dependencies": { + "axios": "^0.21.1", + "jsep": "^1.3.6" + } + }, + "node_modules/nocodb-sdk/node_modules/axios": { + "version": "0.21.4", + "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.4.tgz", + "integrity": "sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg==", + "dependencies": { + "follow-redirects": "^1.14.0" + } }, "node_modules/node-abi": { "version": "3.23.0", @@ -24716,8 +24729,7 @@ "follow-redirects": { "version": "1.15.1", "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.1.tgz", - "integrity": "sha512-yLAMQs+k0b2m7cVxpS1VKJVvoz7SS9Td1zss3XRwXj+ZDH00RJgnuLx7E44wx02kQLrdM3aOOy+FpzS7+8OizA==", - "devOptional": true + "integrity": "sha512-yLAMQs+k0b2m7cVxpS1VKJVvoz7SS9Td1zss3XRwXj+ZDH00RJgnuLx7E44wx02kQLrdM3aOOy+FpzS7+8OizA==" }, "form-data": { "version": "4.0.0", @@ -27267,22 +27279,22 @@ } }, "nocodb-sdk": { - "version": "file:../nocodb-sdk", + "version": "0.109.6", + "resolved": "https://registry.npmjs.org/nocodb-sdk/-/nocodb-sdk-0.109.6.tgz", + "integrity": "sha512-Zh4MjkurCPYl/eJWt9ChvoikMpDujI/F6IaQYb9bJBss6Ns4grdhKizCdvywb2dRYaGqXquzwrGg2jmpw/Xyxg==", "requires": { - "@typescript-eslint/eslint-plugin": "^4.0.1", - "@typescript-eslint/parser": "^4.0.1", "axios": "^0.21.1", - "cspell": "^4.1.0", - "eslint": "^7.8.0", - "eslint-config-prettier": "^6.11.0", - "eslint-plugin-eslint-comments": "^3.2.0", - "eslint-plugin-functional": "^3.0.2", - "eslint-plugin-import": "^2.22.0", - "eslint-plugin-prettier": "^4.0.0", - "jsep": "^1.3.6", - "npm-run-all": "^4.1.5", - "prettier": "^2.1.1", - "typescript": "^4.0.2" + "jsep": "^1.3.6" + }, + "dependencies": { + "axios": { + "version": "0.21.4", + "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.4.tgz", + "integrity": "sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg==", + "requires": { + "follow-redirects": "^1.14.0" + } + } } }, "node-abi": { diff --git a/packages/nc-gui/package.json b/packages/nc-gui/package.json index 44f0905daf..89e44c49b4 100644 --- a/packages/nc-gui/package.json +++ b/packages/nc-gui/package.json @@ -54,7 +54,7 @@ "leaflet.markercluster": "^1.5.3", "locale-codes": "^1.3.1", "monaco-editor": "^0.33.0", - "nocodb-sdk": "file:../nocodb-sdk", + "nocodb-sdk": "0.109.6", "papaparse": "^5.3.2", "pinia": "^2.0.33", "qrcode": "^1.5.1", diff --git a/packages/nc-lib-gui/package.json b/packages/nc-lib-gui/package.json index ca7291370c..bc6b9e6e18 100644 --- a/packages/nc-lib-gui/package.json +++ b/packages/nc-lib-gui/package.json @@ -1,6 +1,6 @@ { "name": "nc-lib-gui", - "version": "0.109.5", + "version": "0.109.6", "description": "NocoDB GUI", "author": { "name": "NocoDB", diff --git a/packages/nocodb-sdk/package.json b/packages/nocodb-sdk/package.json index 2fc6ecc0a5..ce941f5c5e 100644 --- a/packages/nocodb-sdk/package.json +++ b/packages/nocodb-sdk/package.json @@ -1,6 +1,6 @@ { "name": "nocodb-sdk", - "version": "0.109.5", + "version": "0.109.6", "description": "NocoDB SDK", "main": "build/main/index.js", "typings": "build/main/index.d.ts", diff --git a/packages/nocodb/package-lock.json b/packages/nocodb/package-lock.json index b8da539dec..daedc983b1 100644 --- a/packages/nocodb/package-lock.json +++ b/packages/nocodb/package-lock.json @@ -1,12 +1,12 @@ { "name": "nocodb", - "version": "0.109.5", + "version": "0.109.6", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "nocodb", - "version": "0.109.5", + "version": "0.109.6", "license": "AGPL-3.0-or-later", "dependencies": { "@google-cloud/storage": "^5.7.2", @@ -80,10 +80,10 @@ "mysql2": "^3.2.0", "nanoid": "^3.1.20", "nc-help": "^0.2.87", - "nc-lib-gui": "0.109.5", + "nc-lib-gui": "0.109.6", "nc-plugin": "^0.1.3", "ncp": "^2.0.0", - "nocodb-sdk": "file:../nocodb-sdk", + "nocodb-sdk": "0.109.6", "nodemailer": "^6.4.10", "object-hash": "^3.0.0", "object-sizeof": "^2.6.1", @@ -191,7 +191,8 @@ } }, "../nocodb-sdk": { - "version": "0.109.5", + "version": "0.109.6", + "extraneous": true, "license": "AGPL-3.0-or-later", "dependencies": { "axios": "^0.21.1", @@ -13158,9 +13159,9 @@ } }, "node_modules/nc-lib-gui": { - "version": "0.109.5", - "resolved": "https://registry.npmjs.org/nc-lib-gui/-/nc-lib-gui-0.109.5.tgz", - "integrity": "sha512-A6za8yFO167OVd2MnGrzEFAOQ5Nx9UJ5zpk1iH7FC427TEHJOAbvlOYMVa3s7Pb8wjYKhZ5Mr4sBldtY0cKaHA==", + "version": "0.109.6", + "resolved": "https://registry.npmjs.org/nc-lib-gui/-/nc-lib-gui-0.109.6.tgz", + "integrity": "sha512-HX0JuimDTgpliJowNDctjHGvsbkO8SZ1dq/i+WEIce1nlgxdBrOM+/79UlGMaeLWMb3RuU7zNLxpxYvvdoFs4w==", "dependencies": { "express": "^4.17.1" } @@ -13207,8 +13208,13 @@ } }, "node_modules/nocodb-sdk": { - "resolved": "../nocodb-sdk", - "link": true + "version": "0.109.6", + "resolved": "https://registry.npmjs.org/nocodb-sdk/-/nocodb-sdk-0.109.6.tgz", + "integrity": "sha512-Zh4MjkurCPYl/eJWt9ChvoikMpDujI/F6IaQYb9bJBss6Ns4grdhKizCdvywb2dRYaGqXquzwrGg2jmpw/Xyxg==", + "dependencies": { + "axios": "^0.21.1", + "jsep": "^1.3.6" + } }, "node_modules/node-abort-controller": { "version": "3.1.1", @@ -28474,9 +28480,9 @@ } }, "nc-lib-gui": { - "version": "0.109.5", - "resolved": "https://registry.npmjs.org/nc-lib-gui/-/nc-lib-gui-0.109.5.tgz", - "integrity": "sha512-A6za8yFO167OVd2MnGrzEFAOQ5Nx9UJ5zpk1iH7FC427TEHJOAbvlOYMVa3s7Pb8wjYKhZ5Mr4sBldtY0cKaHA==", + "version": "0.109.6", + "resolved": "https://registry.npmjs.org/nc-lib-gui/-/nc-lib-gui-0.109.6.tgz", + "integrity": "sha512-HX0JuimDTgpliJowNDctjHGvsbkO8SZ1dq/i+WEIce1nlgxdBrOM+/79UlGMaeLWMb3RuU7zNLxpxYvvdoFs4w==", "requires": { "express": "^4.17.1" } @@ -28511,22 +28517,12 @@ "integrity": "sha512-dBpDMdxv9Irdq66304OLfEmQ9tbNRFnFTuZiLo+bD+r332bBmMJ8GBLXklIXXgxd3+v9+KUnZaUR5PJMa75Gsg==" }, "nocodb-sdk": { - "version": "file:../nocodb-sdk", + "version": "0.109.6", + "resolved": "https://registry.npmjs.org/nocodb-sdk/-/nocodb-sdk-0.109.6.tgz", + "integrity": "sha512-Zh4MjkurCPYl/eJWt9ChvoikMpDujI/F6IaQYb9bJBss6Ns4grdhKizCdvywb2dRYaGqXquzwrGg2jmpw/Xyxg==", "requires": { - "@typescript-eslint/eslint-plugin": "^4.0.1", - "@typescript-eslint/parser": "^4.0.1", "axios": "^0.21.1", - "cspell": "^4.1.0", - "eslint": "^7.8.0", - "eslint-config-prettier": "^6.11.0", - "eslint-plugin-eslint-comments": "^3.2.0", - "eslint-plugin-functional": "^3.0.2", - "eslint-plugin-import": "^2.22.0", - "eslint-plugin-prettier": "^4.0.0", - "jsep": "^1.3.6", - "npm-run-all": "^4.1.5", - "prettier": "^2.1.1", - "typescript": "^4.0.2" + "jsep": "^1.3.6" } }, "node-abort-controller": { diff --git a/packages/nocodb/package.json b/packages/nocodb/package.json index 2a1c30f8ca..6fc9bd6749 100644 --- a/packages/nocodb/package.json +++ b/packages/nocodb/package.json @@ -1,6 +1,6 @@ { "name": "nocodb", - "version": "0.109.5", + "version": "0.109.6", "description": "NocoDB Backend", "main": "dist/bundle.js", "author": { @@ -113,10 +113,10 @@ "mysql2": "^3.2.0", "nanoid": "^3.1.20", "nc-help": "^0.2.87", - "nc-lib-gui": "0.109.5", + "nc-lib-gui": "0.109.6", "nc-plugin": "^0.1.3", "ncp": "^2.0.0", - "nocodb-sdk": "file:../nocodb-sdk", + "nocodb-sdk": "0.109.6", "nodemailer": "^6.4.10", "object-hash": "^3.0.0", "object-sizeof": "^2.6.1", @@ -204,4 +204,4 @@ "coverageDirectory": "../coverage", "testEnvironment": "node" } -} +} \ No newline at end of file From 397e0854ed13d90d1d24c27a7944baa449520f82 Mon Sep 17 00:00:00 2001 From: Pranav C Date: Wed, 2 Aug 2023 17:10:31 +0530 Subject: [PATCH 18/20] chore: update sdk path Signed-off-by: Pranav C --- packages/nc-gui/package-lock.json | 52 +++++++++++---------------- packages/nc-gui/package.json | 2 +- packages/nocodb-sdk/package-lock.json | 4 +-- packages/nocodb/package-lock.json | 30 +++++++++------- packages/nocodb/package.json | 4 +-- 5 files changed, 42 insertions(+), 50 deletions(-) diff --git a/packages/nc-gui/package-lock.json b/packages/nc-gui/package-lock.json index e4c6379d78..dc0198bb4f 100644 --- a/packages/nc-gui/package-lock.json +++ b/packages/nc-gui/package-lock.json @@ -30,7 +30,7 @@ "leaflet.markercluster": "^1.5.3", "locale-codes": "^1.3.1", "monaco-editor": "^0.33.0", - "nocodb-sdk": "0.109.6", + "nocodb-sdk": "file:../nocodb-sdk", "papaparse": "^5.3.2", "pinia": "^2.0.33", "qrcode": "^1.5.1", @@ -111,7 +111,6 @@ }, "../nocodb-sdk": { "version": "0.109.6", - "extraneous": true, "license": "AGPL-3.0-or-later", "dependencies": { "axios": "^0.21.1", @@ -8720,6 +8719,7 @@ "version": "1.15.1", "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.1.tgz", "integrity": "sha512-yLAMQs+k0b2m7cVxpS1VKJVvoz7SS9Td1zss3XRwXj+ZDH00RJgnuLx7E44wx02kQLrdM3aOOy+FpzS7+8OizA==", + "devOptional": true, "funding": [ { "type": "individual", @@ -12238,21 +12238,8 @@ } }, "node_modules/nocodb-sdk": { - "version": "0.109.6", - "resolved": "https://registry.npmjs.org/nocodb-sdk/-/nocodb-sdk-0.109.6.tgz", - "integrity": "sha512-Zh4MjkurCPYl/eJWt9ChvoikMpDujI/F6IaQYb9bJBss6Ns4grdhKizCdvywb2dRYaGqXquzwrGg2jmpw/Xyxg==", - "dependencies": { - "axios": "^0.21.1", - "jsep": "^1.3.6" - } - }, - "node_modules/nocodb-sdk/node_modules/axios": { - "version": "0.21.4", - "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.4.tgz", - "integrity": "sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg==", - "dependencies": { - "follow-redirects": "^1.14.0" - } + "resolved": "../nocodb-sdk", + "link": true }, "node_modules/node-abi": { "version": "3.23.0", @@ -24729,7 +24716,8 @@ "follow-redirects": { "version": "1.15.1", "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.1.tgz", - "integrity": "sha512-yLAMQs+k0b2m7cVxpS1VKJVvoz7SS9Td1zss3XRwXj+ZDH00RJgnuLx7E44wx02kQLrdM3aOOy+FpzS7+8OizA==" + "integrity": "sha512-yLAMQs+k0b2m7cVxpS1VKJVvoz7SS9Td1zss3XRwXj+ZDH00RJgnuLx7E44wx02kQLrdM3aOOy+FpzS7+8OizA==", + "devOptional": true }, "form-data": { "version": "4.0.0", @@ -27279,22 +27267,22 @@ } }, "nocodb-sdk": { - "version": "0.109.6", - "resolved": "https://registry.npmjs.org/nocodb-sdk/-/nocodb-sdk-0.109.6.tgz", - "integrity": "sha512-Zh4MjkurCPYl/eJWt9ChvoikMpDujI/F6IaQYb9bJBss6Ns4grdhKizCdvywb2dRYaGqXquzwrGg2jmpw/Xyxg==", + "version": "file:../nocodb-sdk", "requires": { + "@typescript-eslint/eslint-plugin": "^4.0.1", + "@typescript-eslint/parser": "^4.0.1", "axios": "^0.21.1", - "jsep": "^1.3.6" - }, - "dependencies": { - "axios": { - "version": "0.21.4", - "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.4.tgz", - "integrity": "sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg==", - "requires": { - "follow-redirects": "^1.14.0" - } - } + "cspell": "^4.1.0", + "eslint": "^7.8.0", + "eslint-config-prettier": "^6.11.0", + "eslint-plugin-eslint-comments": "^3.2.0", + "eslint-plugin-functional": "^3.0.2", + "eslint-plugin-import": "^2.22.0", + "eslint-plugin-prettier": "^4.0.0", + "jsep": "^1.3.6", + "npm-run-all": "^4.1.5", + "prettier": "^2.1.1", + "typescript": "^4.0.2" } }, "node-abi": { diff --git a/packages/nc-gui/package.json b/packages/nc-gui/package.json index 89e44c49b4..44f0905daf 100644 --- a/packages/nc-gui/package.json +++ b/packages/nc-gui/package.json @@ -54,7 +54,7 @@ "leaflet.markercluster": "^1.5.3", "locale-codes": "^1.3.1", "monaco-editor": "^0.33.0", - "nocodb-sdk": "0.109.6", + "nocodb-sdk": "file:../nocodb-sdk", "papaparse": "^5.3.2", "pinia": "^2.0.33", "qrcode": "^1.5.1", diff --git a/packages/nocodb-sdk/package-lock.json b/packages/nocodb-sdk/package-lock.json index dda8da70f5..c647526d52 100644 --- a/packages/nocodb-sdk/package-lock.json +++ b/packages/nocodb-sdk/package-lock.json @@ -1,12 +1,12 @@ { "name": "nocodb-sdk", - "version": "0.109.5", + "version": "0.109.6", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "nocodb-sdk", - "version": "0.109.5", + "version": "0.109.6", "license": "AGPL-3.0-or-later", "dependencies": { "axios": "^0.21.1", diff --git a/packages/nocodb/package-lock.json b/packages/nocodb/package-lock.json index daedc983b1..6774504e4d 100644 --- a/packages/nocodb/package-lock.json +++ b/packages/nocodb/package-lock.json @@ -83,7 +83,7 @@ "nc-lib-gui": "0.109.6", "nc-plugin": "^0.1.3", "ncp": "^2.0.0", - "nocodb-sdk": "0.109.6", + "nocodb-sdk": "file:../nocodb-sdk", "nodemailer": "^6.4.10", "object-hash": "^3.0.0", "object-sizeof": "^2.6.1", @@ -192,7 +192,6 @@ }, "../nocodb-sdk": { "version": "0.109.6", - "extraneous": true, "license": "AGPL-3.0-or-later", "dependencies": { "axios": "^0.21.1", @@ -13208,13 +13207,8 @@ } }, "node_modules/nocodb-sdk": { - "version": "0.109.6", - "resolved": "https://registry.npmjs.org/nocodb-sdk/-/nocodb-sdk-0.109.6.tgz", - "integrity": "sha512-Zh4MjkurCPYl/eJWt9ChvoikMpDujI/F6IaQYb9bJBss6Ns4grdhKizCdvywb2dRYaGqXquzwrGg2jmpw/Xyxg==", - "dependencies": { - "axios": "^0.21.1", - "jsep": "^1.3.6" - } + "resolved": "../nocodb-sdk", + "link": true }, "node_modules/node-abort-controller": { "version": "3.1.1", @@ -28517,12 +28511,22 @@ "integrity": "sha512-dBpDMdxv9Irdq66304OLfEmQ9tbNRFnFTuZiLo+bD+r332bBmMJ8GBLXklIXXgxd3+v9+KUnZaUR5PJMa75Gsg==" }, "nocodb-sdk": { - "version": "0.109.6", - "resolved": "https://registry.npmjs.org/nocodb-sdk/-/nocodb-sdk-0.109.6.tgz", - "integrity": "sha512-Zh4MjkurCPYl/eJWt9ChvoikMpDujI/F6IaQYb9bJBss6Ns4grdhKizCdvywb2dRYaGqXquzwrGg2jmpw/Xyxg==", + "version": "file:../nocodb-sdk", "requires": { + "@typescript-eslint/eslint-plugin": "^4.0.1", + "@typescript-eslint/parser": "^4.0.1", "axios": "^0.21.1", - "jsep": "^1.3.6" + "cspell": "^4.1.0", + "eslint": "^7.8.0", + "eslint-config-prettier": "^6.11.0", + "eslint-plugin-eslint-comments": "^3.2.0", + "eslint-plugin-functional": "^3.0.2", + "eslint-plugin-import": "^2.22.0", + "eslint-plugin-prettier": "^4.0.0", + "jsep": "^1.3.6", + "npm-run-all": "^4.1.5", + "prettier": "^2.1.1", + "typescript": "^4.0.2" } }, "node-abort-controller": { diff --git a/packages/nocodb/package.json b/packages/nocodb/package.json index 6fc9bd6749..51e37a6a4e 100644 --- a/packages/nocodb/package.json +++ b/packages/nocodb/package.json @@ -116,7 +116,7 @@ "nc-lib-gui": "0.109.6", "nc-plugin": "^0.1.3", "ncp": "^2.0.0", - "nocodb-sdk": "0.109.6", + "nocodb-sdk": "file:../nocodb-sdk", "nodemailer": "^6.4.10", "object-hash": "^3.0.0", "object-sizeof": "^2.6.1", @@ -204,4 +204,4 @@ "coverageDirectory": "../coverage", "testEnvironment": "node" } -} \ No newline at end of file +} From 8bf7c4faaf5021c7e3f417f7220a059babbc3207 Mon Sep 17 00:00:00 2001 From: Wing-Kam Wong Date: Wed, 2 Aug 2023 20:51:06 +0800 Subject: [PATCH 19/20] fix(nc-gui): lint errors --- packages/nc-gui/components/smartsheet/Pagination.vue | 6 ++++-- packages/nc-gui/components/smartsheet/header/Icon.vue | 4 ++-- packages/nc-gui/components/tabs/Smartsheet.vue | 2 +- .../nc-gui/components/virtual-cell/components/ItemChip.vue | 1 - .../components/virtual-cell/components/ListChildItems.vue | 1 - .../nc-gui/components/virtual-cell/components/ListItems.vue | 1 - packages/nc-gui/composables/useMultiSelect/index.ts | 4 ---- 7 files changed, 7 insertions(+), 12 deletions(-) diff --git a/packages/nc-gui/components/smartsheet/Pagination.vue b/packages/nc-gui/components/smartsheet/Pagination.vue index 7cc08d7d3e..4bd45cd171 100644 --- a/packages/nc-gui/components/smartsheet/Pagination.vue +++ b/packages/nc-gui/components/smartsheet/Pagination.vue @@ -2,9 +2,11 @@ import { ChangePageInj, PaginationDataInj, computed, iconMap, inject, isRtlLang, useI18n } from '#imports' import type { Language } from '~/lib' -const props = defineProps<{ +interface Props { alignCountOnRight?: boolean -}>() +} + +const { alignCountOnRight } = defineProps() const { locale } = useI18n() diff --git a/packages/nc-gui/components/smartsheet/header/Icon.vue b/packages/nc-gui/components/smartsheet/header/Icon.vue index ff56b943ea..159ef471b0 100644 --- a/packages/nc-gui/components/smartsheet/header/Icon.vue +++ b/packages/nc-gui/components/smartsheet/header/Icon.vue @@ -1,8 +1,8 @@