Browse Source

Merge pull request #3683 from nocodb/feat/add-meta-props-in-form-view

Feat: API - Add meta field to keep additional meta data
pull/3701/head
navi 2 years ago committed by GitHub
parent
commit
02f06569b5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 520
      packages/nocodb-sdk/package-lock.json
  2. 2
      packages/nocodb-sdk/src/lib/Api.ts
  3. 4
      packages/nocodb/src/lib/migrations/XcMigrationSourcev2.ts
  4. 34
      packages/nocodb/src/lib/migrations/v2/nc_019_add_meta_in_meta_tables.ts
  5. 10
      packages/nocodb/src/lib/models/FormView.ts
  6. 45
      packages/nocodb/src/lib/models/FormViewColumn.ts
  7. 19
      packages/nocodb/src/lib/utils/serialize.ts
  8. 10
      scripts/sdk/swagger.json

520
packages/nocodb-sdk/package-lock.json generated

@ -234,15 +234,6 @@
"vscode-textmate": "5.2.0"
}
},
"node_modules/pkg-conf/node_modules/path-exists": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz",
"integrity": "sha512-bpC7GYwiDYQ4wYLe+FA8lhRjhQCMcQGuSgGGqDkg/QerRWw9CmGRT0iSOVRSZJ29NMLZgIzqaljJ63oaL4NIJQ==",
"dev": true,
"engines": {
"node": ">=4"
}
},
"node_modules/swagger-typescript-api": {
"version": "10.0.1",
"resolved": "https://registry.npmjs.org/swagger-typescript-api/-/swagger-typescript-api-10.0.1.tgz",
@ -420,15 +411,6 @@
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/oas-resolver/node_modules/yargs-parser": {
"version": "21.1.1",
"resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz",
"integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==",
"dev": true,
"engines": {
"node": ">=12"
}
},
"node_modules/@istanbuljs/load-nyc-config/node_modules/camelcase": {
"version": "5.3.1",
"dev": true,
@ -452,15 +434,6 @@
"node": ">=10.0.0"
}
},
"node_modules/conventional-changelog-core/node_modules/path-exists": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz",
"integrity": "sha512-bpC7GYwiDYQ4wYLe+FA8lhRjhQCMcQGuSgGGqDkg/QerRWw9CmGRT0iSOVRSZJ29NMLZgIzqaljJ63oaL4NIJQ==",
"dev": true,
"engines": {
"node": ">=4"
}
},
"node_modules/@babel/highlight/node_modules/supports-color": {
"version": "5.5.0",
"dev": true,
@ -823,12 +796,6 @@
"eslint": "^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0 || ^8"
}
},
"node_modules/commitizen/node_modules/color-name": {
"version": "1.1.3",
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz",
"integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==",
"dev": true
},
"node_modules/decamelize": {
"version": "1.2.0",
"dev": true,
@ -1241,21 +1208,6 @@
"node": ">=6.9.0"
}
},
"node_modules/git-semver-tags/node_modules/normalize-package-data": {
"version": "3.0.3",
"resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-3.0.3.tgz",
"integrity": "sha512-p2W1sgqij3zMMyRC067Dg16bfzVH+w7hyegmpIvZ4JNjqtGOVAIvLmjBx3yP7YTe9vKJgkoNOPjwQGogDoMXFA==",
"dev": true,
"dependencies": {
"hosted-git-info": "^4.0.1",
"is-core-module": "^2.5.0",
"semver": "^7.3.4",
"validate-npm-package-license": "^3.0.1"
},
"engines": {
"node": ">=10"
}
},
"node_modules/cli-boxes": {
"version": "2.2.1",
"dev": true,
@ -1467,19 +1419,6 @@
"node": ">=4"
}
},
"node_modules/pkg-conf/node_modules/locate-path": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz",
"integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==",
"dev": true,
"dependencies": {
"p-locate": "^3.0.0",
"path-exists": "^3.0.0"
},
"engines": {
"node": ">=6"
}
},
"node_modules/@babel/core/node_modules/json5": {
"version": "2.2.1",
"dev": true,
@ -1510,18 +1449,6 @@
"node": ">=8"
}
},
"node_modules/git-semver-tags/node_modules/hosted-git-info": {
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-4.1.0.tgz",
"integrity": "sha512-kyCuEOWjJqZuDbRHzL8V93NzQhwIB71oFWSyzVo+KPZI+pnQPPxucdkrOZvkLRnrf5URsQM+IJ09Dw29cRALIA==",
"dev": true,
"dependencies": {
"lru-cache": "^6.0.0"
},
"engines": {
"node": ">=10"
}
},
"node_modules/prettier": {
"version": "2.7.1",
"resolved": "https://registry.npmjs.org/prettier/-/prettier-2.7.1.tgz",
@ -1764,18 +1691,6 @@
"dev": true,
"license": "MIT"
},
"node_modules/standard-version/node_modules/ansi-styles": {
"version": "3.2.1",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz",
"integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==",
"dev": true,
"dependencies": {
"color-convert": "^1.9.0"
},
"engines": {
"node": ">=4"
}
},
"node_modules/cosmiconfig-typescript-loader": {
"version": "1.0.6",
"dev": true,
@ -2284,12 +2199,6 @@
"node": ">=6.9.0"
}
},
"node_modules/nyc/node_modules/y18n": {
"version": "4.0.3",
"resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz",
"integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==",
"dev": true
},
"node_modules/@babel/template": {
"version": "7.16.7",
"dev": true,
@ -2804,18 +2713,6 @@
"node": ">=4.0"
}
},
"node_modules/conventional-changelog-core/node_modules/p-locate": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz",
"integrity": "sha512-nQja7m7gSKuewoVRen45CtVfODR3crN3goVQ0DDZ9N3yHxgpkuBhZqsaiotSQRrADUrne346peY7kT3TSACykg==",
"dev": true,
"dependencies": {
"p-limit": "^1.1.0"
},
"engines": {
"node": ">=4"
}
},
"node_modules/is-fullwidth-code-point": {
"version": "3.0.0",
"dev": true,
@ -3029,21 +2926,6 @@
"node": ">=8"
}
},
"node_modules/git-semver-tags/node_modules/normalize-package-data/node_modules/semver": {
"version": "7.3.7",
"resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz",
"integrity": "sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==",
"dev": true,
"dependencies": {
"lru-cache": "^6.0.0"
},
"bin": {
"semver": "bin/semver.js"
},
"engines": {
"node": ">=10"
}
},
"node_modules/cspell-io": {
"version": "4.1.7",
"dev": true,
@ -3152,12 +3034,6 @@
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/cz-conventional-changelog/node_modules/color-name": {
"version": "1.1.3",
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz",
"integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==",
"dev": true
},
"node_modules/strip-indent": {
"version": "3.0.0",
"dev": true,
@ -3280,18 +3156,6 @@
"node": ">= 10"
}
},
"node_modules/commitizen/node_modules/supports-color": {
"version": "5.5.0",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz",
"integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==",
"dev": true,
"dependencies": {
"has-flag": "^3.0.0"
},
"engines": {
"node": ">=4"
}
},
"node_modules/git-raw-commits/node_modules/meow": {
"version": "8.1.2",
"dev": true,
@ -3758,15 +3622,6 @@
"dev": true,
"license": "MIT"
},
"node_modules/standard-version/node_modules/color-convert": {
"version": "1.9.3",
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz",
"integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==",
"dev": true,
"dependencies": {
"color-name": "1.1.3"
}
},
"node_modules/@cspell/dict-cpp": {
"version": "1.1.40",
"dev": true,
@ -3976,18 +3831,6 @@
"node": "*"
}
},
"node_modules/inquirer/node_modules/onetime": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/onetime/-/onetime-2.0.1.tgz",
"integrity": "sha512-oyyPpiMaKARvvcgip+JV+7zci5L8D1W9RZIz2l1o08AM3pfspitVWnPt3mzHcBPp12oYMTy0pqrFs/C+m3EwsQ==",
"dev": true,
"dependencies": {
"mimic-fn": "^1.0.0"
},
"engines": {
"node": ">=4"
}
},
"node_modules/expand-tilde": {
"version": "2.0.2",
"dev": true,
@ -4454,15 +4297,6 @@
"url": "https://github.com/sponsors/mysticatea"
}
},
"node_modules/commitizen/node_modules/has-flag": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz",
"integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==",
"dev": true,
"engines": {
"node": ">=4"
}
},
"node_modules/levn": {
"version": "0.4.1",
"dev": true,
@ -4505,20 +4339,6 @@
"license": "MIT",
"optional": true
},
"node_modules/commitizen/node_modules/chalk": {
"version": "2.4.2",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz",
"integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==",
"dev": true,
"dependencies": {
"ansi-styles": "^3.2.1",
"escape-string-regexp": "^1.0.5",
"supports-color": "^5.3.0"
},
"engines": {
"node": ">=4"
}
},
"node_modules/ignore": {
"version": "5.2.0",
"dev": true,
@ -4926,15 +4746,6 @@
}
}
},
"node_modules/commitizen/node_modules/escape-string-regexp": {
"version": "1.0.5",
"resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz",
"integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==",
"dev": true,
"engines": {
"node": ">=0.8.0"
}
},
"node_modules/serialize-error/node_modules/type-fest": {
"version": "0.13.1",
"dev": true,
@ -6057,18 +5868,6 @@
"url": "https://github.com/sponsors/ljharb"
}
},
"node_modules/conventional-changelog-core/node_modules/p-limit": {
"version": "1.3.0",
"resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz",
"integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==",
"dev": true,
"dependencies": {
"p-try": "^1.0.0"
},
"engines": {
"node": ">=4"
}
},
"node_modules/oas-resolver/node_modules/yargs": {
"version": "17.5.1",
"resolved": "https://registry.npmjs.org/yargs/-/yargs-17.5.1.tgz",
@ -6209,15 +6008,6 @@
"node": ">=4"
}
},
"node_modules/conventional-changelog-core/node_modules/p-try": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz",
"integrity": "sha512-U1etNYuMJoIz3ZXSrrySFjsXQTWOx2/jdi86L+2pRvph/qMKL6sbcCYdH23fqsbm8TH2Gn0OybpT4eSFlCVHww==",
"dev": true,
"engines": {
"node": ">=4"
}
},
"node_modules/prettier-linter-helpers": {
"version": "1.0.0",
"dev": true,
@ -6443,15 +6233,6 @@
"node": ">=0.4.0"
}
},
"node_modules/gh-pages/node_modules/jsonfile": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz",
"integrity": "sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg==",
"dev": true,
"optionalDependencies": {
"graceful-fs": "^4.1.6"
}
},
"node_modules/ignore-walk": {
"version": "3.0.4",
"dev": true,
@ -6503,15 +6284,6 @@
"node": ">=6.0.0"
}
},
"node_modules/inquirer/node_modules/mimic-fn": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz",
"integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==",
"dev": true,
"engines": {
"node": ">=4"
}
},
"node_modules/cosmiconfig": {
"version": "7.0.1",
"dev": true,
@ -6795,19 +6567,6 @@
"node": ">=4"
}
},
"node_modules/conventional-changelog-core/node_modules/locate-path": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz",
"integrity": "sha512-NCI2kiDkyR7VeEKm27Kda/iQHyKJe1Bu0FlTbYp3CqJu+9IFe9bLyAjMxf5ZDDbEg+iMPzB5zYyUTSm8wVTKmA==",
"dev": true,
"dependencies": {
"p-locate": "^2.0.0",
"path-exists": "^3.0.0"
},
"engines": {
"node": ">=4"
}
},
"node_modules/doctrine": {
"version": "3.0.0",
"dev": true,
@ -7616,18 +7375,6 @@
"node": ">=0.4.0"
}
},
"node_modules/conventional-changelog-writer/node_modules/hosted-git-info": {
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-4.1.0.tgz",
"integrity": "sha512-kyCuEOWjJqZuDbRHzL8V93NzQhwIB71oFWSyzVo+KPZI+pnQPPxucdkrOZvkLRnrf5URsQM+IJ09Dw29cRALIA==",
"dev": true,
"dependencies": {
"lru-cache": "^6.0.0"
},
"engines": {
"node": ">=10"
}
},
"node_modules/eslint-plugin-import/node_modules/debug": {
"version": "2.6.9",
"dev": true,
@ -7809,15 +7556,6 @@
"node": ">=10.18.0 <11 || >=12.14.0 <13 || >=14"
}
},
"node_modules/commitizen/node_modules/color-convert": {
"version": "1.9.3",
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz",
"integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==",
"dev": true,
"dependencies": {
"color-name": "1.1.3"
}
},
"node_modules/oas-kit-common": {
"version": "1.0.8",
"resolved": "https://registry.npmjs.org/oas-kit-common/-/oas-kit-common-1.0.8.tgz",
@ -9254,12 +8992,6 @@
"node": ">=6.9.0"
}
},
"node_modules/standard-version/node_modules/color-name": {
"version": "1.1.3",
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz",
"integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==",
"dev": true
},
"node_modules/eslint/node_modules/@babel/code-frame": {
"version": "7.12.11",
"dev": true,
@ -9912,18 +9644,6 @@
"dev": true,
"license": "MIT"
},
"node_modules/pkg-conf/node_modules/p-locate": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz",
"integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==",
"dev": true,
"dependencies": {
"p-limit": "^2.0.0"
},
"engines": {
"node": ">=6"
}
},
"node_modules/normalize-package-data/node_modules/semver": {
"version": "5.7.1",
"dev": true,
@ -10047,18 +9767,6 @@
"engines": {
"node": ">=8"
}
},
"node_modules/commitizen/node_modules/ansi-styles": {
"version": "3.2.1",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz",
"integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==",
"dev": true,
"dependencies": {
"color-convert": "^1.9.0"
},
"engines": {
"node": ">=4"
}
}
},
"dependencies": {
@ -11395,41 +11103,6 @@
"strip-json-comments": "3.0.1"
},
"dependencies": {
"ansi-styles": {
"version": "3.2.1",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz",
"integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==",
"dev": true,
"requires": {
"color-convert": "^1.9.0"
}
},
"chalk": {
"version": "2.4.2",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz",
"integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==",
"dev": true,
"requires": {
"ansi-styles": "^3.2.1",
"escape-string-regexp": "^1.0.5",
"supports-color": "^5.3.0"
}
},
"color-convert": {
"version": "1.9.3",
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz",
"integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==",
"dev": true,
"requires": {
"color-name": "1.1.3"
}
},
"color-name": {
"version": "1.1.3",
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz",
"integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==",
"dev": true
},
"cz-conventional-changelog": {
"version": "3.2.0",
"dev": true,
@ -11443,12 +11116,6 @@
"word-wrap": "^1.0.3"
}
},
"escape-string-regexp": {
"version": "1.0.5",
"resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz",
"integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==",
"dev": true
},
"fs-extra": {
"version": "8.1.0",
"dev": true,
@ -11470,12 +11137,6 @@
"path-is-absolute": "^1.0.0"
}
},
"has-flag": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz",
"integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==",
"dev": true
},
"jsonfile": {
"version": "4.0.0",
"dev": true,
@ -11495,15 +11156,6 @@
"version": "3.0.1",
"dev": true
},
"supports-color": {
"version": "5.5.0",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz",
"integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==",
"dev": true,
"requires": {
"has-flag": "^3.0.0"
}
},
"universalify": {
"version": "0.1.2",
"dev": true
@ -11662,16 +11314,6 @@
"strip-bom": "^3.0.0"
}
},
"locate-path": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz",
"integrity": "sha512-NCI2kiDkyR7VeEKm27Kda/iQHyKJe1Bu0FlTbYp3CqJu+9IFe9bLyAjMxf5ZDDbEg+iMPzB5zYyUTSm8wVTKmA==",
"dev": true,
"requires": {
"p-locate": "^2.0.0",
"path-exists": "^3.0.0"
}
},
"normalize-package-data": {
"version": "3.0.3",
"dev": true,
@ -11682,36 +11324,6 @@
"validate-npm-package-license": "^3.0.1"
}
},
"p-limit": {
"version": "1.3.0",
"resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz",
"integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==",
"dev": true,
"requires": {
"p-try": "^1.0.0"
}
},
"p-locate": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz",
"integrity": "sha512-nQja7m7gSKuewoVRen45CtVfODR3crN3goVQ0DDZ9N3yHxgpkuBhZqsaiotSQRrADUrne346peY7kT3TSACykg==",
"dev": true,
"requires": {
"p-limit": "^1.1.0"
}
},
"p-try": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz",
"integrity": "sha512-U1etNYuMJoIz3ZXSrrySFjsXQTWOx2/jdi86L+2pRvph/qMKL6sbcCYdH23fqsbm8TH2Gn0OybpT4eSFlCVHww==",
"dev": true
},
"path-exists": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz",
"integrity": "sha512-bpC7GYwiDYQ4wYLe+FA8lhRjhQCMcQGuSgGGqDkg/QerRWw9CmGRT0iSOVRSZJ29NMLZgIzqaljJ63oaL4NIJQ==",
"dev": true
},
"path-type": {
"version": "3.0.0",
"dev": true,
@ -11817,15 +11429,6 @@
"through2": "^4.0.0"
},
"dependencies": {
"hosted-git-info": {
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-4.1.0.tgz",
"integrity": "sha512-kyCuEOWjJqZuDbRHzL8V93NzQhwIB71oFWSyzVo+KPZI+pnQPPxucdkrOZvkLRnrf5URsQM+IJ09Dw29cRALIA==",
"dev": true,
"requires": {
"lru-cache": "^6.0.0"
}
},
"meow": {
"version": "8.1.2",
"dev": true,
@ -12220,12 +11823,6 @@
"color-name": "1.1.3"
}
},
"color-name": {
"version": "1.1.3",
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz",
"integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==",
"dev": true
},
"escape-string-regexp": {
"version": "1.0.5",
"dev": true
@ -13225,15 +12822,6 @@
"pinkie-promise": "^2.0.0"
}
},
"jsonfile": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz",
"integrity": "sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg==",
"dev": true,
"requires": {
"graceful-fs": "^4.1.6"
}
},
"pify": {
"version": "2.3.0",
"dev": true
@ -13319,15 +12907,6 @@
"semver": "^6.0.0"
},
"dependencies": {
"hosted-git-info": {
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-4.1.0.tgz",
"integrity": "sha512-kyCuEOWjJqZuDbRHzL8V93NzQhwIB71oFWSyzVo+KPZI+pnQPPxucdkrOZvkLRnrf5URsQM+IJ09Dw29cRALIA==",
"dev": true,
"requires": {
"lru-cache": "^6.0.0"
}
},
"meow": {
"version": "8.1.2",
"dev": true,
@ -13345,29 +12924,6 @@
"yargs-parser": "^20.2.3"
}
},
"normalize-package-data": {
"version": "3.0.3",
"resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-3.0.3.tgz",
"integrity": "sha512-p2W1sgqij3zMMyRC067Dg16bfzVH+w7hyegmpIvZ4JNjqtGOVAIvLmjBx3yP7YTe9vKJgkoNOPjwQGogDoMXFA==",
"dev": true,
"requires": {
"hosted-git-info": "^4.0.1",
"is-core-module": "^2.5.0",
"semver": "^7.3.4",
"validate-npm-package-license": "^3.0.1"
},
"dependencies": {
"semver": {
"version": "7.3.7",
"resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz",
"integrity": "sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==",
"dev": true,
"requires": {
"lru-cache": "^6.0.0"
}
}
}
},
"semver": {
"version": "6.3.0",
"dev": true
@ -13750,21 +13306,6 @@
"integrity": "sha512-VHskAKYM8RfSFXwee5t5cbN5PZeq1Wrh6qd5bkyiXIf6UQcN6w/A0eXM9r6t8d+GYOh+o6ZhiEnb88LN/Y8m2w==",
"dev": true
},
"mimic-fn": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz",
"integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==",
"dev": true
},
"onetime": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/onetime/-/onetime-2.0.1.tgz",
"integrity": "sha512-oyyPpiMaKARvvcgip+JV+7zci5L8D1W9RZIz2l1o08AM3pfspitVWnPt3mzHcBPp12oYMTy0pqrFs/C+m3EwsQ==",
"dev": true,
"requires": {
"mimic-fn": "^1.0.0"
}
},
"restore-cursor": {
"version": "2.0.0",
"dev": true,
@ -14756,12 +14297,6 @@
"strip-ansi": "^6.0.0"
}
},
"y18n": {
"version": "4.0.3",
"resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz",
"integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==",
"dev": true
},
"yargs": {
"version": "15.4.1",
"dev": true,
@ -14838,12 +14373,6 @@
"y18n": "^5.0.5",
"yargs-parser": "^21.0.0"
}
},
"yargs-parser": {
"version": "21.1.1",
"resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz",
"integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==",
"dev": true
}
}
},
@ -15144,31 +14673,6 @@
"requires": {
"locate-path": "^3.0.0"
}
},
"locate-path": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz",
"integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==",
"dev": true,
"requires": {
"p-locate": "^3.0.0",
"path-exists": "^3.0.0"
}
},
"p-locate": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz",
"integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==",
"dev": true,
"requires": {
"p-limit": "^2.0.0"
}
},
"path-exists": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz",
"integrity": "sha512-bpC7GYwiDYQ4wYLe+FA8lhRjhQCMcQGuSgGGqDkg/QerRWw9CmGRT0iSOVRSZJ29NMLZgIzqaljJ63oaL4NIJQ==",
"dev": true
}
}
},
@ -15747,15 +15251,6 @@
"yargs": "^16.0.0"
},
"dependencies": {
"ansi-styles": {
"version": "3.2.1",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz",
"integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==",
"dev": true,
"requires": {
"color-convert": "^1.9.0"
}
},
"chalk": {
"version": "2.4.2",
"dev": true,
@ -15765,21 +15260,6 @@
"supports-color": "^5.3.0"
}
},
"color-convert": {
"version": "1.9.3",
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz",
"integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==",
"dev": true,
"requires": {
"color-name": "1.1.3"
}
},
"color-name": {
"version": "1.1.3",
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz",
"integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==",
"dev": true
},
"escape-string-regexp": {
"version": "1.0.5",
"resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz",

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

@ -401,6 +401,7 @@ export interface FormType {
columns?: FormColumnType[];
fk_model_id?: string;
lock_type?: 'collaborative' | 'locked' | 'personal';
meta?: any;
}
export interface FormColumnType {
@ -416,6 +417,7 @@ export interface FormColumnType {
created_at?: string;
updated_at?: string;
description?: string;
meta?: any;
}
export interface PaginatedType {

4
packages/nocodb/src/lib/migrations/XcMigrationSourcev2.ts

@ -6,6 +6,7 @@ import * as nc_015_add_meta_col_in_column_table from './v2/nc_015_add_meta_col_i
import * as nc_016_alter_hooklog_payload_types from './v2/nc_016_alter_hooklog_payload_types';
import * as nc_017_add_user_token_version_column from './v2/nc_017_add_user_token_version_column';
import * as nc_018_add_meta_in_view from './v2/nc_018_add_meta_in_view';
import * as nc_019_add_meta_in_meta_tables from './v2/nc_019_add_meta_in_meta_tables';
// Create a custom migration source class
export default class XcMigrationSourcev2 {
@ -23,6 +24,7 @@ export default class XcMigrationSourcev2 {
'nc_016_alter_hooklog_payload_types',
'nc_017_add_user_token_version_column',
'nc_018_add_meta_in_view',
'nc_019_add_meta_in_meta_tables',
]);
}
@ -48,6 +50,8 @@ export default class XcMigrationSourcev2 {
return nc_017_add_user_token_version_column;
case 'nc_018_add_meta_in_view':
return nc_018_add_meta_in_view;
case 'nc_019_add_meta_in_meta_tables':
return nc_019_add_meta_in_meta_tables;
}
}
}

34
packages/nocodb/src/lib/migrations/v2/nc_019_add_meta_in_meta_tables.ts

@ -0,0 +1,34 @@
import Knex from 'knex';
import { MetaTable } from '../../utils/globals';
const up = async (knex: Knex) => {
await knex.schema.alterTable(MetaTable.FORM_VIEW, (table) => {
table.text('meta');
});
await knex.schema.alterTable(MetaTable.FORM_VIEW_COLUMNS, (table) => {
table.text('meta');
});
await knex.schema.alterTable(MetaTable.GRID_VIEW, (table) => {
table.text('meta');
});
await knex.schema.alterTable(MetaTable.GALLERY_VIEW, (table) => {
table.text('meta');
});
};
const down = async (knex) => {
await knex.schema.alterTable(MetaTable.FORM_VIEW, (table) => {
table.dropColumns('meta');
});
await knex.schema.alterTable(MetaTable.FORM_VIEW_COLUMNS, (table) => {
table.dropColumns('meta');
});
await knex.schema.alterTable(MetaTable.GRID_VIEW, (table) => {
table.dropColumns('meta');
});
await knex.schema.alterTable(MetaTable.GALLERY_VIEW, (table) => {
table.dropColumns('meta');
});
};
export { up, down };

10
packages/nocodb/src/lib/models/FormView.ts

@ -1,6 +1,7 @@
import Noco from '../Noco';
import { CacheGetType, CacheScope, MetaTable } from '../utils/globals';
import { FormType } from 'nocodb-sdk';
import { deserializeJSON, serializeJSON } from '../utils/serialize';
import FormViewColumn from './FormViewColumn';
import View from './View';
import NocoCache from '../cache/NocoCache';
@ -26,6 +27,7 @@ export default class FormView implements FormType {
project_id?: string;
base_id?: string;
meta?: string | Record<string, any>;
constructor(data: FormView) {
Object.assign(this, data);
@ -42,7 +44,10 @@ export default class FormView implements FormType {
view = await ncMeta.metaGet2(null, null, MetaTable.FORM_VIEW, {
fk_view_id: viewId,
});
await NocoCache.set(`${CacheScope.FORM_VIEW}:${viewId}`, view);
if (view) {
view.meta = deserializeJSON(view.meta);
await NocoCache.set(`${CacheScope.FORM_VIEW}:${viewId}`, view);
}
}
return view && new FormView(view);
}
@ -62,6 +67,7 @@ export default class FormView implements FormType {
logo_url: view.logo_url,
submit_another_form: view.submit_another_form,
show_blank_form: view.show_blank_form,
meta: serializeJSON(view.meta),
};
if (!(view.project_id && view.base_id)) {
const viewRef = await View.get(view.fk_view_id);
@ -92,8 +98,10 @@ export default class FormView implements FormType {
o.logo_url = body.logo_url;
o.submit_another_form = body.submit_another_form;
o.show_blank_form = body.show_blank_form;
o.meta = body.meta;
// set cache
await NocoCache.set(key, o);
o.meta = serializeJSON(body.meta);
}
// update meta
return await ncMeta.metaUpdate(

45
packages/nocodb/src/lib/models/FormViewColumn.ts

@ -1,6 +1,7 @@
import Noco from '../Noco';
import { CacheGetType, CacheScope, MetaTable } from '../utils/globals';
import { FormColumnType } from 'nocodb-sdk';
import { deserializeJSON, serializeJSON } from '../utils/serialize';
import View from './View';
import NocoCache from '../cache/NocoCache';
import { extractProps } from '../meta/helpers/extractProps';
@ -18,6 +19,7 @@ export default class FormViewColumn implements FormColumnType {
fk_column_id?: string;
project_id?: string;
base_id?: string;
meta?: string | Record<string, any>;
constructor(data: FormViewColumn) {
Object.assign(this, data);
@ -25,28 +27,35 @@ export default class FormViewColumn implements FormColumnType {
uuid?: any;
public static async get(formViewId: string, ncMeta = Noco.ncMeta) {
let view =
formViewId &&
public static async get(formViewColumnId: string, ncMeta = Noco.ncMeta) {
let viewColumn =
formViewColumnId &&
(await NocoCache.get(
`${CacheScope.FORM_VIEW_COLUMN}:${formViewId}`,
`${CacheScope.FORM_VIEW_COLUMN}:${formViewColumnId}`,
CacheGetType.TYPE_OBJECT
));
if (!view) {
view = await ncMeta.metaGet2(
if (!viewColumn) {
viewColumn = await ncMeta.metaGet2(
null,
null,
MetaTable.FORM_VIEW_COLUMNS,
formViewId
formViewColumnId
);
viewColumn.meta =
viewColumn.meta && typeof viewColumn.meta === 'string'
? JSON.parse(viewColumn.meta)
: viewColumn.meta;
}
await NocoCache.set(`${CacheScope.FORM_VIEW_COLUMN}:${formViewId}`, view);
await NocoCache.set(
`${CacheScope.FORM_VIEW_COLUMN}:${formViewColumnId}`,
viewColumn
);
return view && new FormViewColumn(view);
return viewColumn && new FormViewColumn(viewColumn);
}
static async insert(column: Partial<FormViewColumn>, ncMeta = Noco.ncMeta) {
const insertObj = {
const insertObj: Partial<FormViewColumn> = {
fk_view_id: column.fk_view_id,
fk_column_id: column.fk_column_id,
order: await ncMeta.metaGetNextOrder(MetaTable.FORM_VIEW_COLUMNS, {
@ -61,6 +70,10 @@ export default class FormViewColumn implements FormColumnType {
required: column.required,
};
if (column.meta) {
insertObj.meta = serializeJSON(column.meta);
}
if (!(column.project_id && column.base_id)) {
const viewRef = await View.get(column.fk_view_id, ncMeta);
insertObj.project_id = viewRef.project_id;
@ -113,6 +126,11 @@ export default class FormViewColumn implements FormColumnType {
},
}
);
for (const viewColumn of viewColumns) {
viewColumn.meta = deserializeJSON(viewColumn.meta);
}
await NocoCache.setList(
CacheScope.FORM_VIEW_COLUMN,
[viewId],
@ -139,7 +157,9 @@ export default class FormViewColumn implements FormColumnType {
'required',
'show',
'order',
'meta',
]);
// get existing cache
const key = `${CacheScope.FORM_VIEW_COLUMN}:${columnId}`;
const o = await NocoCache.get(key, CacheGetType.TYPE_OBJECT);
@ -148,6 +168,11 @@ export default class FormViewColumn implements FormColumnType {
// set cache
await NocoCache.set(key, o);
}
if (insertObj.meta) {
insertObj.meta = serializeJSON(insertObj.meta);
}
// update meta
await ncMeta.metaUpdate(
null,

19
packages/nocodb/src/lib/utils/serialize.ts

@ -0,0 +1,19 @@
export const serializeJSON = (data: string | Record<string, any>) => {
// if already in string format ignore stringify
if (typeof data === 'string') {
return data;
}
return JSON.stringify(data);
};
export const deserializeJSON = (data: string | Record<string, any>) => {
// if already in object format ignore parse
if (typeof data === 'object') {
return data ?? {};
}
try {
return JSON.parse(data) ?? {};
} catch (e) {
return {};
}
};

10
scripts/sdk/swagger.json

@ -6195,7 +6195,9 @@
]
}
},
"required": ["title"]
"required": [
"title"
]
},
"TableInfo": {
"title": "Table",
@ -7283,7 +7285,8 @@
"locked",
"personal"
]
}
},
"meta": {}
}
},
"FormColumn": {
@ -7346,7 +7349,8 @@
"description": {
"type": "string",
"minLength": 1
}
},
"meta": {}
}
},
"Paginated": {

Loading…
Cancel
Save