Browse Source

Merge pull request #4237 from nocodb/refactor/nocodb-project-structure

refactor: nocodb project structure
pull/2780/head
աɨռɢӄաօռɢ 2 years ago committed by GitHub
parent
commit
42d839be7a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 889
      .all-contributorsrc
  2. 0
      .github/PULL_REQUEST_TEMPLATE.md
  3. 0
      .github/SPONSORS.md
  4. 22
      .github/workflows/ci-cd.yml
  5. 20
      README.md
  6. 42
      Run.md
  7. 48
      docker-compose/mssql/docker-compose.yml
  8. 61
      docker-compose/mysql/docker-compose.yml
  9. 98
      docker-compose/nginx-proxy-manager/docker-compose.yml
  10. 126
      docker-compose/nginx/docker-compose.yml
  11. 45
      docker-compose/pg/docker-compose.yml
  12. 203
      docker-compose/traefik/docker-compose.yml
  13. 0
      markdown/plugins/google-auth.md
  14. 0
      markdown/plugins/s3.md
  15. 0
      markdown/readme/languages/README.md
  16. 2
      markdown/readme/languages/chinese.md
  17. 0
      markdown/readme/languages/dutch.md
  18. 0
      markdown/readme/languages/french.md
  19. 2
      markdown/readme/languages/german.md
  20. 0
      markdown/readme/languages/indonesian.md
  21. 0
      markdown/readme/languages/italian.md
  22. 0
      markdown/readme/languages/japanese.md
  23. 0
      markdown/readme/languages/korean.md
  24. 0
      markdown/readme/languages/portuguese.md
  25. 0
      markdown/readme/languages/russian.md
  26. 0
      markdown/readme/languages/spanish.md
  27. 1599
      package-lock.json
  28. 25
      package.json
  29. 682
      packages/nc-cli/LICENSE
  30. 1
      packages/nc-cli/README.md
  31. 1321
      packages/nc-cli/package-lock.json
  32. 24
      packages/nc-cli/package.json
  33. 34
      packages/nc-cli/src/index.ts
  34. 19
      packages/nc-cli/src/lib/CliMgr.ts
  35. 79
      packages/nc-cli/src/lib/mgr/AppMgr.ts
  36. 49
      packages/nc-cli/src/lib/mgr/Client.ts
  37. 38
      packages/nc-cli/src/lib/mgr/ComponentMgr.ts
  38. 26
      packages/nc-cli/src/lib/mgr/DockerMgr.ts
  39. 23
      packages/nc-cli/src/lib/mgr/InstantMgr.ts
  40. 52
      packages/nc-cli/src/lib/mgr/MigrationMgr.ts
  41. 44
      packages/nc-cli/src/lib/mgr/ModelMgr.ts
  42. 782
      packages/nc-cli/src/lib/mgr/NewMgr.ts
  43. 306
      packages/nc-cli/src/lib/mgr/OldNewMgr.ts
  44. 534
      packages/nc-cli/src/lib/mgr/PermissionsMgr.ts
  45. 555
      packages/nc-cli/src/lib/mgr/PermissionsMgrJs.ts
  46. 93
      packages/nc-cli/src/lib/mgr/SocialMgr.ts
  47. 19
      packages/nc-cli/src/lib/mgr/SocialText.ts
  48. 280
      packages/nc-cli/src/lib/mgr/TryMgr.ts
  49. 79
      packages/nc-cli/src/lib/mgr/XcInstantMgr.ts
  50. 55
      packages/nc-cli/src/lib/prompts/Menu.ts
  51. 32
      packages/nc-cli/src/lib/prompts/RunOrDownload.ts
  52. 31
      packages/nc-cli/src/lib/util/Lang.ts
  53. 347
      packages/nc-cli/src/lib/util/Locales.ts
  54. 301
      packages/nc-cli/src/lib/util/Util.ts
  55. 5
      packages/nc-cli/src/lib/util/config.ts
  56. 661
      packages/nc-gui/LICENSE
  57. 644
      packages/nc-gui/package-lock.json
  58. 18
      packages/nc-gui/package.json
  59. 661
      packages/nc-lib-gui/LICENSE
  60. 9
      packages/nc-lib-gui/__tests__/xc-tool-web.test.js
  61. 11
      packages/nc-lib-gui/lib/XcLibGui.js
  62. 1
      packages/nc-lib-gui/license.txt
  63. 222
      packages/nc-lib-gui/package-lock.json
  64. 7
      packages/nc-lib-gui/package.json
  65. 64
      packages/nc-plugin/.circleci/config.yml
  66. 3
      packages/nc-plugin/.github/CONTRIBUTING.md
  67. 9
      packages/nc-plugin/.github/ISSUE_TEMPLATE.md
  68. 7
      packages/nc-plugin/.github/PULL_REQUEST_TEMPLATE.md
  69. 8
      packages/nc-plugin/.vscode/extensions.json
  70. 29
      packages/nc-plugin/.vscode/launch.json
  71. 7
      packages/nc-plugin/.vscode/settings.json
  72. 682
      packages/nc-plugin/LICENSE
  73. 51
      packages/nc-plugin/package-lock.json
  74. 21
      packages/nc-plugin/package.json
  75. 14
      packages/nc-plugin/src/index.ts
  76. 21
      packages/nc-plugin/src/lib/IEmailAdapter.ts
  77. 17
      packages/nc-plugin/src/lib/IStorageAdapter.ts
  78. 9
      packages/nc-plugin/src/lib/IStorageAdapterV2.ts
  79. 16
      packages/nc-plugin/src/lib/IWebhookNotificationAdapter.ts
  80. 11
      packages/nc-plugin/src/lib/XcEmailPlugin.ts
  81. 16
      packages/nc-plugin/src/lib/XcPlugin.ts
  82. 13
      packages/nc-plugin/src/lib/XcPluginConfig.ts
  83. 21
      packages/nc-plugin/src/lib/XcPluginHooks.ts
  84. 5
      packages/nc-plugin/src/lib/XcPluginMigration.ts
  85. 9
      packages/nc-plugin/src/lib/XcStoragePlugin.ts
  86. 10
      packages/nc-plugin/src/lib/XcWebhookNotificationPlugin.ts
  87. 682
      packages/noco-docs/LICENSE
  88. 6
      packages/noco-docs/content/en/engineering/testing.md
  89. 4
      packages/noco-docs/content/en/getting-started/installation.md
  90. 83
      packages/noco-docs/package-lock.json
  91. 15
      packages/noco-docs/package.json
  92. 23
      packages/noco-i18n/.gitignore
  93. 21
      packages/noco-i18n/LICENSE
  94. 62
      packages/noco-i18n/README.md
  95. 5
      packages/noco-i18n/babel.config.js
  96. 12222
      packages/noco-i18n/package-lock.json
  97. 45
      packages/noco-i18n/package.json
  98. BIN
      packages/noco-i18n/public/favicon.ico
  99. 17
      packages/noco-i18n/public/index.html
  100. 26
      packages/noco-i18n/src/App.vue
  101. Some files were not shown because too many files have changed in this diff Show More

889
.all-contributorsrc

@ -1,889 +0,0 @@
{
"projectName": "nocodb",
"projectOwner": "nocodb",
"repoType": "github",
"repoHost": "https://github.com",
"files": [
"README.md"
],
"imageSize": 100,
"commit": false,
"commitConvention": "none",
"contributors": [
{
"login": "o1lab",
"name": "o1lab",
"avatar_url": "https://avatars.githubusercontent.com/u/5435402?v=4",
"profile": "https://github.com/o1lab",
"contributions": [
"code"
]
},
{
"login": "pranavxc",
"name": "Pranav C",
"avatar_url": "https://avatars.githubusercontent.com/u/61551451?v=4",
"profile": "https://github.com/pranavxc",
"contributions": [
"code"
]
},
{
"login": "bvkatwijk",
"name": "Boris van Katwijk",
"avatar_url": "https://avatars.githubusercontent.com/u/18490578?v=4",
"profile": "http://bvkatwijk.nl/",
"contributions": [
"code"
]
},
{
"login": "markuman",
"name": "Markus Bergholz",
"avatar_url": "https://avatars.githubusercontent.com/u/3920157?v=4",
"profile": "https://stackshare.io/markuman/my-stack",
"contributions": [
"code"
]
},
{
"login": "DanielRuf",
"name": "Daniel Ruf",
"avatar_url": "https://avatars.githubusercontent.com/u/827205?v=4",
"profile": "https://daniel-ruf.de/",
"contributions": [
"code"
]
},
{
"login": "bertyhell",
"name": "Bert Verhelst",
"avatar_url": "https://avatars.githubusercontent.com/u/1710840?v=4",
"profile": "http://bertverhelst.ga/",
"contributions": [
"code"
]
},
{
"login": "chocholand",
"name": "JaeWon",
"avatar_url": "https://avatars.githubusercontent.com/u/6572227?v=4",
"profile": "https://github.com/chocholand",
"contributions": [
"code"
]
},
{
"login": "0xflotus",
"name": "0xflotus",
"avatar_url": "https://avatars.githubusercontent.com/u/26602940?v=4",
"profile": "https://github.com/0xflotus",
"contributions": [
"code"
]
},
{
"login": "sguionni",
"name": "Simon Guionniere",
"avatar_url": "https://avatars.githubusercontent.com/u/3633017?v=4",
"profile": "http://www.simonguionniere.com/",
"contributions": [
"code"
]
},
{
"login": "extremeshok",
"name": "eXtremeSHOK",
"avatar_url": "https://avatars.githubusercontent.com/u/5957328?v=4",
"profile": "https://clients.extremeshok.com/",
"contributions": [
"code"
]
},
{
"login": "v2io",
"name": "v2io",
"avatar_url": "https://avatars.githubusercontent.com/u/48987429?v=4",
"profile": "https://github.com/v2io",
"contributions": [
"code"
]
},
{
"login": "soaserele",
"name": "Stanislav Oaserele",
"avatar_url": "https://avatars.githubusercontent.com/u/1093368?v=4",
"profile": "https://github.com/soaserele",
"contributions": [
"code"
]
},
{
"login": "ans-4175",
"name": "Ahmad Anshorimuslim Syuhada",
"avatar_url": "https://avatars.githubusercontent.com/u/3961872?v=4",
"profile": "https://ans4175.dev/",
"contributions": [
"code"
]
},
{
"login": "lotas",
"name": "Yaraslau Kurmyza",
"avatar_url": "https://avatars.githubusercontent.com/u/83861?v=4",
"profile": "https://github.com/lotas",
"contributions": [
"code"
]
},
{
"login": "ferrybig",
"name": "Fernando van Loenhout",
"avatar_url": "https://avatars.githubusercontent.com/u/1576684?v=4",
"profile": "http://stackexchange.com/users/1677570/ferrybig",
"contributions": [
"code"
]
},
{
"login": "jrevault",
"name": "jrevault",
"avatar_url": "https://avatars.githubusercontent.com/u/1001585?v=4",
"profile": "http://blog.quidquid.fr/",
"contributions": [
"code"
]
},
{
"login": "atilacamurca",
"name": "Átila Camurça Alves",
"avatar_url": "https://avatars.githubusercontent.com/u/508624?v=4",
"profile": "https://github.com/atilacamurca",
"contributions": [
"code"
]
},
{
"login": "simonbowen",
"name": "Simon Bowen",
"avatar_url": "https://avatars.githubusercontent.com/u/8931?v=4",
"profile": "https://github.com/simonbowen",
"contributions": [
"code"
]
},
{
"login": "wingkwong",
"name": "աɨռɢӄաօռɢ",
"avatar_url": "https://avatars.githubusercontent.com/u/35857179?v=4",
"profile": "https://wingk-wong.blogspot.com/",
"contributions": [
"code"
]
},
{
"login": "ferdiga",
"name": "Ferdinand Gassauer",
"avatar_url": "https://avatars.githubusercontent.com/u/6248560?v=4",
"profile": "https://github.com/ferdiga",
"contributions": [
"code"
]
},
{
"login": "Flatroy",
"name": "George Daneke",
"avatar_url": "https://avatars.githubusercontent.com/u/4980165?v=4",
"profile": "https://daneke.ru/",
"contributions": [
"code"
]
},
{
"login": "jwillmer",
"name": "Jens Willmer",
"avatar_url": "https://avatars.githubusercontent.com/u/1503577?v=4",
"profile": "https://jwillmer.de/",
"contributions": [
"code"
]
},
{
"login": "bhanuc",
"name": "Bhanu Pratap Chaudhary",
"avatar_url": "https://avatars.githubusercontent.com/u/2958857?v=4",
"profile": "http://bhanu.io/",
"contributions": [
"code"
]
},
{
"login": "jwetzell",
"name": "Joel Wetzell",
"avatar_url": "https://avatars.githubusercontent.com/u/18341515?v=4",
"profile": "https://github.com/jwetzell",
"contributions": [
"code"
]
},
{
"login": "SebGTx",
"name": "SebGTx",
"avatar_url": "https://avatars.githubusercontent.com/u/8062146?v=4",
"profile": "https://github.com/SebGTx",
"contributions": [
"code"
]
},
{
"login": "FarazPatankar",
"name": "Faraz Patankar",
"avatar_url": "https://avatars.githubusercontent.com/u/10681116?v=4",
"profile": "https://farazpatankar.com/",
"contributions": [
"code"
]
},
{
"login": "pixplix",
"name": "PixPlix",
"avatar_url": "https://avatars.githubusercontent.com/u/71349937?v=4",
"profile": "https://pixplix.com/",
"contributions": [
"code"
]
},
{
"login": "janrito",
"name": "Alejandro Giacometti",
"avatar_url": "https://avatars.githubusercontent.com/u/31504?v=4",
"profile": "http://alejandro.giacometti.me/",
"contributions": [
"code"
]
},
{
"login": "bmscmoreira",
"name": "Bruno Moreira",
"avatar_url": "https://avatars.githubusercontent.com/u/3017910?v=4",
"profile": "https://brunomoreira.opo.pt",
"contributions": [
"code"
]
},
{
"login": "AztrexDX",
"name": "AztrexDX",
"avatar_url": "https://avatars.githubusercontent.com/u/86340924?v=4",
"profile": "https://github.com/AztrexDX",
"contributions": [
"code"
]
},
{
"login": "ejose19",
"name": "ejose19",
"avatar_url": "https://avatars.githubusercontent.com/u/8742215?v=4",
"profile": "https://github.com/ejose19",
"contributions": [
"code"
]
},
{
"login": "maximeag",
"name": "Maxime",
"avatar_url": "https://avatars.githubusercontent.com/u/3855368?v=4",
"profile": "https://github.com/maximeag",
"contributions": [
"code"
]
},
{
"login": "dstala",
"name": "dstala",
"avatar_url": "https://avatars.githubusercontent.com/u/86527202?v=4",
"profile": "https://github.com/dstala",
"contributions": [
"code"
]
},
{
"login": "loftwah",
"name": "loftwah",
"avatar_url": "https://avatars.githubusercontent.com/u/19922556?v=4",
"profile": "https://github.com/loftwah",
"contributions": [
"code"
]
},
{
"login": "mrtngrsbch",
"name": "Martin Gersbach",
"avatar_url": "https://avatars.githubusercontent.com/u/693328?v=4",
"profile": "https://museosabiertos.org",
"contributions": [
"code"
]
},
{
"login": "ArjenR",
"name": "ArjenR",
"avatar_url": "https://avatars.githubusercontent.com/u/4269186?v=4",
"profile": "https://github.com/ArjenR",
"contributions": [
"code"
]
},
{
"login": "kunggom",
"name": "조진식 (Jo Jinsik)",
"avatar_url": "https://avatars.githubusercontent.com/u/32009637?v=4",
"profile": "https://github.com/kunggom",
"contributions": [
"code"
]
},
{
"login": "tianberg",
"name": "tianchunfeng",
"avatar_url": "https://avatars.githubusercontent.com/u/90968567?v=4",
"profile": "http://www.cuobiezi.net",
"contributions": [
"code"
]
},
{
"login": "cthulberg",
"name": "Andrea",
"avatar_url": "https://avatars.githubusercontent.com/u/5301275?v=4",
"profile": "https://github.com/cthulberg",
"contributions": [
"code"
]
},
{
"login": "eevleevs",
"name": "Giulio Malventi",
"avatar_url": "https://avatars.githubusercontent.com/u/5012744?v=4",
"profile": "https://github.com/eevleevs",
"contributions": [
"code"
]
},
{
"login": "dev-z",
"name": "Md. Ishtiaque Zafar",
"avatar_url": "https://avatars.githubusercontent.com/u/8604312?v=4",
"profile": "https://dev-z.github.io",
"contributions": [
"code"
]
},
{
"login": "ChasLui",
"name": "ChasLui",
"avatar_url": "https://avatars.githubusercontent.com/u/10083758?v=4",
"profile": "http://www.chaslui.com",
"contributions": [
"code"
]
},
{
"login": "ZhansayaM",
"name": "Zhansaya Maksut",
"avatar_url": "https://avatars.githubusercontent.com/u/41486762?v=4",
"profile": "https://www.linkedin.com/in/zhansayam/",
"contributions": [
"code"
]
},
{
"login": "agkfri",
"name": "agkfri",
"avatar_url": "https://avatars.githubusercontent.com/u/37952138?v=4",
"profile": "https://github.com/agkfri",
"contributions": [
"code"
]
},
{
"login": "iqiziqi",
"name": "Ziqi",
"avatar_url": "https://avatars.githubusercontent.com/u/8640316?v=4",
"profile": "https://github.com/iqiziqi",
"contributions": [
"code"
]
},
{
"login": "AllanSiqueira",
"name": "Allan Siqueira",
"avatar_url": "https://avatars.githubusercontent.com/u/14025084?v=4",
"profile": "https://github.com/AllanSiqueira",
"contributions": [
"code"
]
},
{
"login": "ahmadfatihin",
"name": "Fatih",
"avatar_url": "https://avatars.githubusercontent.com/u/54095238?v=4",
"profile": "https://creatify.my.id/",
"contributions": [
"code"
]
},
{
"login": "roman-rezinkin",
"name": "Roman Rezinkin",
"avatar_url": "https://avatars.githubusercontent.com/u/17882264?v=4",
"profile": "https://github.com/roman-rezinkin",
"contributions": [
"code"
]
},
{
"login": "fragalcer",
"name": "Francisco Gallardo",
"avatar_url": "https://avatars.githubusercontent.com/u/31025299?v=4",
"profile": "https://github.com/fragalcer",
"contributions": [
"code"
]
},
{
"login": "sesam",
"name": "Simon B.",
"avatar_url": "https://avatars.githubusercontent.com/u/8921?v=4",
"profile": "https://github.com/sesam",
"contributions": [
"code"
]
},
{
"login": "lielfr",
"name": "Liel Fridman",
"avatar_url": "https://avatars.githubusercontent.com/u/360928?v=4",
"profile": "https://github.com/lielfr",
"contributions": [
"code"
]
},
{
"login": "rubjo",
"name": "rubjo",
"avatar_url": "https://avatars.githubusercontent.com/u/42270947?v=4",
"profile": "https://github.com/rubjo",
"contributions": [
"code"
]
},
{
"login": "kinga-marszalkowska",
"name": "Kinga Marszałkowska",
"avatar_url": "https://avatars.githubusercontent.com/u/64398325?v=4",
"profile": "https://github.com/kinga-marszalkowska",
"contributions": [
"code"
]
},
{
"login": "dahawk",
"name": "Christof Horschitz",
"avatar_url": "https://avatars.githubusercontent.com/u/10920640?v=4",
"profile": "https://nimbusec.com",
"contributions": [
"code"
]
},
{
"login": "bebora",
"name": "Simone",
"avatar_url": "https://avatars.githubusercontent.com/u/32399075?v=4",
"profile": "https://github.com/bebora",
"contributions": [
"code"
]
},
{
"login": "tyonirwansyah",
"name": "Tyo Nirwansyah",
"avatar_url": "https://avatars.githubusercontent.com/u/73389687?v=4",
"profile": "https://github.com/tyonirwansyah",
"contributions": [
"code"
]
},
{
"login": "jiione",
"name": "jiwon",
"avatar_url": "https://avatars.githubusercontent.com/u/83341978?v=4",
"profile": "https://github.com/jiione",
"contributions": [
"code"
]
},
{
"login": "mikepsinn",
"name": "Mike P. Sinn",
"avatar_url": "https://avatars.githubusercontent.com/u/2808553?v=4",
"profile": "http://quantimo.do",
"contributions": [
"code"
]
},
{
"login": "candideu",
"name": "candideu",
"avatar_url": "https://avatars.githubusercontent.com/u/55474996?v=4",
"profile": "https://github.com/candideu",
"contributions": [
"code"
]
},
{
"login": "SiderealArt",
"name": "SiderealArt",
"avatar_url": "https://avatars.githubusercontent.com/u/30827929?v=4",
"profile": "http://siderealart.me",
"contributions": [
"code"
]
},
{
"login": "vijayrathore8492",
"name": "Vijay Rathore",
"avatar_url": "https://avatars.githubusercontent.com/u/17380265?v=4",
"profile": "http://vijayrathore.me",
"contributions": [
"code"
]
},
{
"login": "John-Appleseed",
"name": "John Appleseed",
"avatar_url": "https://avatars.githubusercontent.com/u/7055847?v=4",
"profile": "https://github.com/John-Appleseed",
"contributions": [
"code"
]
},
{
"login": "Korayem",
"name": "Salem Korayem",
"avatar_url": "https://avatars.githubusercontent.com/u/198332?v=4",
"profile": "https://github.com/Korayem",
"contributions": [
"code"
]
},
{
"login": "dubiao",
"name": "标",
"avatar_url": "https://avatars.githubusercontent.com/u/4001793?v=4",
"profile": "https://github.com/dubiao",
"contributions": [
"code"
]
},
{
"login": "willnewii",
"name": "诗人的咸鱼",
"avatar_url": "https://avatars.githubusercontent.com/u/652003?v=4",
"profile": "https://github.com/willnewii",
"contributions": [
"code"
]
},
{
"login": "bitbytejoy",
"name": "bitbytejoy",
"avatar_url": "https://avatars.githubusercontent.com/u/11807034?v=4",
"profile": "https://github.com/bitbytejoy",
"contributions": [
"code"
]
},
{
"login": "pan93412",
"name": "pan93412",
"avatar_url": "https://avatars.githubusercontent.com/u/28441561?v=4",
"profile": "http://blog.pan93.com",
"contributions": [
"code"
]
},
{
"login": "LancerComet",
"name": "LancerComet",
"avatar_url": "https://avatars.githubusercontent.com/u/10321350?v=4",
"profile": "https://github.com/LancerComet",
"contributions": [
"code"
]
},
{
"login": "mertmit",
"name": "mertmit",
"avatar_url": "https://avatars.githubusercontent.com/u/59797957?v=4",
"profile": "https://github.com/mertmit",
"contributions": [
"code"
]
},
{
"login": "atompi",
"name": "Atom Pi",
"avatar_url": "https://avatars.githubusercontent.com/u/6419682?v=4",
"profile": "https://blog.atompi.com",
"contributions": [
"code"
]
},
{
"login": "OskarsPakers",
"name": "Oskars",
"avatar_url": "https://avatars.githubusercontent.com/u/3343347?v=4",
"profile": "https://github.com/OskarsPakers",
"contributions": [
"code"
]
},
{
"login": "dolibit-ut",
"name": "UT from dolibit",
"avatar_url": "https://avatars.githubusercontent.com/u/45215329?v=4",
"profile": "http://dolibit.de",
"contributions": [
"code"
]
},
{
"login": "blucky",
"name": "Blucky",
"avatar_url": "https://avatars.githubusercontent.com/u/42397?v=4",
"profile": "https://github.com/blucky",
"contributions": [
"code"
]
},
{
"login": "TsjipTsjip",
"name": "TsjipTsjip",
"avatar_url": "https://avatars.githubusercontent.com/u/19798667?v=4",
"profile": "https://github.com/TsjipTsjip",
"contributions": [
"code"
]
},
{
"login": "dhrrgn",
"name": "Dan Horrigan",
"avatar_url": "https://avatars.githubusercontent.com/u/149921?v=4",
"profile": "https://github.com/dhrrgn",
"contributions": [
"code"
]
},
{
"login": "AmitJoki",
"name": "Amit Joki",
"avatar_url": "https://avatars.githubusercontent.com/u/5158554?v=4",
"profile": "https://amitjoki.github.io",
"contributions": [
"code"
]
},
{
"login": "tympaniplayer",
"name": "Nate",
"avatar_url": "https://avatars.githubusercontent.com/u/1745731?v=4",
"profile": "https://github.com/tympaniplayer",
"contributions": [
"code"
]
},
{
"login": "RobinFrcd",
"name": "Robin Fourcade",
"avatar_url": "https://avatars.githubusercontent.com/u/29704178?v=4",
"profile": "https://github.com/RobinFrcd",
"contributions": [
"code"
]
},
{
"login": "zprial",
"name": "zprial",
"avatar_url": "https://avatars.githubusercontent.com/u/33095380?v=4",
"profile": "https://github.com/zprial",
"contributions": [
"code"
]
},
{
"login": "nilsreichardt",
"name": "Nils Reichardt",
"avatar_url": "https://avatars.githubusercontent.com/u/24459435?v=4",
"profile": "https://github.com/nilsreichardt",
"contributions": [
"code"
]
},
{
"login": "iamnamananand996",
"name": "Naman Anand",
"avatar_url": "https://avatars.githubusercontent.com/u/31537362?v=4",
"profile": "https://github.com/iamnamananand996",
"contributions": [
"code"
]
},
{
"login": "GeoffMaciolek",
"name": "Geo Maciolek",
"avatar_url": "https://avatars.githubusercontent.com/u/10995633?v=4",
"profile": "https://github.com/GeoffMaciolek",
"contributions": [
"code"
]
},
{
"login": "mudream4869",
"name": "神楽坂帕琪",
"avatar_url": "https://avatars.githubusercontent.com/u/6008539?v=4",
"profile": "http://blog.mukyu.tw/",
"contributions": [
"code"
]
},
{
"login": "titouancreach",
"name": "Titouan CREACH",
"avatar_url": "https://avatars.githubusercontent.com/u/3995719?v=4",
"profile": "https://github.com/titouancreach",
"contributions": [
"code"
]
},
{
"login": "youyiio",
"name": "youyiio",
"avatar_url": "https://avatars.githubusercontent.com/u/49471274?v=4",
"profile": "https://www.youyi.io",
"contributions": [
"code"
]
},
{
"login": "RK311y",
"name": "River Kelly",
"avatar_url": "https://avatars.githubusercontent.com/u/65210753?v=4",
"profile": "https://github.com/RK311y",
"contributions": [
"code"
]
},
{
"login": "LepkoQQ",
"name": "LepkoQQ",
"avatar_url": "https://avatars.githubusercontent.com/u/2662937?v=4",
"profile": "https://github.com/LepkoQQ",
"contributions": [
"code"
]
},
{
"login": "QuentinDstl",
"name": "quentin",
"avatar_url": "https://avatars.githubusercontent.com/u/56829191?v=4",
"profile": "https://cornernewclub.fr",
"contributions": [
"code"
]
},
{
"login": "cande1gut",
"name": "Cande",
"avatar_url": "https://avatars.githubusercontent.com/u/5407915?v=4",
"profile": "http://cande.me",
"contributions": [
"code"
]
},
{
"login": "seokjunjin",
"name": "Seokjun Jin",
"avatar_url": "https://avatars.githubusercontent.com/u/46950889?v=4",
"profile": "https://github.com/seokjunjin",
"contributions": [
"translation"
]
},
{
"login": "systemctls",
"name": "jinxm",
"avatar_url": "https://avatars.githubusercontent.com/u/37177191?v=4",
"profile": "https://github.com/systemctls",
"contributions": [
"code"
]
},
{
"login": "yohanboniface",
"name": "Yohan Boniface",
"avatar_url": "https://avatars.githubusercontent.com/u/146023?v=4",
"profile": "https://yohanboniface.me",
"contributions": [
"translation"
]
},
{
"login": "drsantam",
"name": "Santam Chakraborty",
"avatar_url": "https://avatars.githubusercontent.com/u/10681456?v=4",
"profile": "https://github.com/drsantam",
"contributions": [
"translation"
]
},
{
"login": "eltociear",
"name": "Ikko Ashimine",
"avatar_url": "https://avatars.githubusercontent.com/u/22633385?v=4",
"profile": "https://bandism.net/",
"contributions": [
"code"
]
},
{
"login": "asheerrizvi",
"name": "Asheer Rizvi",
"avatar_url": "https://avatars.githubusercontent.com/u/17976252?v=4",
"profile": "http://asheerrizvi.com",
"contributions": [
"code"
]
},
{
"login": "dolsem",
"name": "Denis Olsem",
"avatar_url": "https://avatars.githubusercontent.com/u/14323955?v=4",
"profile": "https://github.com/dolsem",
"contributions": [
"code"
]
},
{
"login": "chetanverma16",
"name": "Chetan Verma",
"avatar_url": "https://avatars.githubusercontent.com/u/16558205?v=4",
"profile": "http://chetanverma.com/",
"contributions": [
"code"
]
}
],
"contributorsPerLine": 7,
"skipCi": true
}

0
.github/pull_request_template.md → .github/PULL_REQUEST_TEMPLATE.md

0
.github/sponsors.md → .github/SPONSORS.md

22
.github/workflows/ci-cd.yml

@ -59,7 +59,7 @@ jobs:
start: |
npm run start:api:cache
npm run start:web
docker-compose -f ./scripts/docker-compose-cypress.yml up -d
docker-compose -f ./scripts/cypress/docker-compose-cypress.yml up -d
spec: "./scripts/cypress/integration/test/restTableOps.js"
wait-on: "http://localhost:8080, http://localhost:3000/_nuxt/assets/img/icons/512x512-trans.png"
wait-on-timeout: 1200
@ -105,7 +105,7 @@ jobs:
start: |
npm run start:api:cache
npm run start:web
docker-compose -f ./scripts/docker-compose-cypress.yml up -d
docker-compose -f ./scripts/cypress/docker-compose-cypress.yml up -d
spec: "./scripts/cypress/integration/test/restViews.js"
wait-on: "http://localhost:8080, http://localhost:3000/_nuxt/assets/img/icons/512x512-trans.png"
wait-on-timeout: 1200
@ -151,7 +151,7 @@ jobs:
start: |
npm run start:api:cache
npm run start:web
docker-compose -f ./scripts/docker-compose-cypress.yml up -d
docker-compose -f ./scripts/cypress/docker-compose-cypress.yml up -d
spec: "./scripts/cypress/integration/test/restRoles.js"
wait-on: "http://localhost:8080, http://localhost:3000/_nuxt/assets/img/icons/512x512-trans.png"
wait-on-timeout: 1200
@ -197,7 +197,7 @@ jobs:
start: |
npm run start:api:cache
npm run start:web
docker-compose -f ./scripts/docker-compose-cypress.yml up -d
docker-compose -f ./scripts/cypress/docker-compose-cypress.yml up -d
spec: "./scripts/cypress/integration/test/restMisc.js"
wait-on: "http://localhost:8080, http://localhost:3000/_nuxt/assets/img/icons/512x512-trans.png"
wait-on-timeout: 1200
@ -243,7 +243,7 @@ jobs:
start: |
npm run start:xcdb-api:cache
npm run start:web
docker-compose -f ./scripts/docker-compose-cypress.yml up -d
docker-compose -f ./scripts/cypress/docker-compose-cypress.yml up -d
spec: "./scripts/cypress/integration/test/xcdb-restTableOps.js"
wait-on: "http://localhost:8080, http://localhost:3000/_nuxt/assets/img/icons/512x512-trans.png"
wait-on-timeout: 1200
@ -289,7 +289,7 @@ jobs:
start: |
npm run start:xcdb-api:cache
npm run start:web
docker-compose -f ./scripts/docker-compose-cypress.yml up -d
docker-compose -f ./scripts/cypress/docker-compose-cypress.yml up -d
spec: "./scripts/cypress/integration/test/xcdb-restViews.js"
wait-on: "http://localhost:8080, http://localhost:3000/_nuxt/assets/img/icons/512x512-trans.png"
wait-on-timeout: 1200
@ -335,7 +335,7 @@ jobs:
start: |
npm run start:xcdb-api:cache
npm run start:web
docker-compose -f ./scripts/docker-compose-cypress.yml up -d
docker-compose -f ./scripts/cypress/docker-compose-cypress.yml up -d
spec: "./scripts/cypress/integration/test/xcdb-restRoles.js"
wait-on: "http://localhost:8080, http://localhost:3000/_nuxt/assets/img/icons/512x512-trans.png"
wait-on-timeout: 1200
@ -381,7 +381,7 @@ jobs:
start: |
npm run start:xcdb-api:cache
npm run start:web
docker-compose -f ./scripts/docker-compose-cypress.yml up -d
docker-compose -f ./scripts/cypress/docker-compose-cypress.yml up -d
spec: "./scripts/cypress/integration/test/xcdb-restMisc.js"
wait-on: "http://localhost:8080, http://localhost:3000/_nuxt/assets/img/icons/512x512-trans.png"
wait-on-timeout: 1200
@ -612,7 +612,7 @@ jobs:
cp ./scripts/cypress/fixtures/quickTest/noco_0_91_7.db ./packages/nocodb/noco.db
npm run start:api:cache
npm run start:web
docker-compose -f ./scripts/docker-compose-cypress.yml up -d
docker-compose -f ./scripts/cypress/docker-compose-cypress.yml up -d
spec: "./scripts/cypress/integration/test/quickTest.js"
wait-on: "http://localhost:8080, http://localhost:3000/_nuxt/assets/img/icons/512x512-trans.png"
wait-on-timeout: 1200
@ -707,7 +707,7 @@ jobs:
run: npm install
- name: setup mysql
working-directory: ./
run: docker-compose -f ./scripts/docker-compose-cypress.yml up -d
run: docker-compose -f ./scripts/cypress/docker-compose-cypress.yml up -d
- name: run unit tests
working-directory: ./packages/nocodb
run: npm run test:unit
@ -745,7 +745,7 @@ jobs:
start: |
npm run start:api:cache
npm run start:web
docker-compose -f ./scripts/docker-compose-cypress.yml up -d
docker-compose -f ./scripts/cypress/docker-compose-cypress.yml up -d
spec: "./scripts/cypress/integration/test/db-independent.js"
wait-on: "http://localhost:8080, http://localhost:3000/_nuxt/assets/img/icons/512x512-trans.png"
wait-on-timeout: 1200

20
README.md

@ -45,20 +45,20 @@ Turns any MySQL, PostgreSQL, SQL Server, SQLite & MariaDB into a smart-spreadshe
<div align="center">
[<img height="38" src="https://user-images.githubusercontent.com/61551451/135263434-75fe793d-42af-49e4-b964-d70920e41655.png">](scripts/markdown/readme/languages/chinese.md)
[<img height="38" src="https://user-images.githubusercontent.com/61551451/135263474-787d71e7-3a87-42a8-92a8-be1d1f55413d.png">](scripts/markdown/readme/languages/french.md)
[<img height="38" src="https://user-images.githubusercontent.com/61551451/135263531-fae58600-6616-4b43-95a0-5891019dd35d.png">](scripts/markdown/readme/languages/german.md)
[<img height="38" src="https://user-images.githubusercontent.com/61551451/135263589-3dbeda9a-0d2e-4bbd-b1fc-691404bb74fb.png">](scripts/markdown/readme/languages/spanish.md)
[<img height="38" src="https://user-images.githubusercontent.com/61551451/135263669-f567196a-d4e8-4143-a80a-93d3be32ba90.png">](scripts/markdown/readme/languages/portuguese.md)
[<img height="38" src="https://user-images.githubusercontent.com/61551451/135263707-ba4e04a4-268a-4626-91b8-048e572fd9f6.png">](scripts/markdown/readme/languages/italian.md)
[<img height="38" src="https://user-images.githubusercontent.com/61551451/135263770-38e3e79d-11d4-472e-ac27-ae0f17cf65c4.png">](scripts/markdown/readme/languages/japanese.md)
[<img height="38" src="https://user-images.githubusercontent.com/61551451/135263822-28fce9de-915a-44dc-962d-7a61d340e91d.png">](scripts/markdown/readme/languages/korean.md)
[<img height="38" src="https://user-images.githubusercontent.com/61551451/135263888-151d4ad1-7084-4943-97c9-56f28cd40b80.png">](scripts/markdown/readme/languages/russian.md)
[<img height="38" src="https://user-images.githubusercontent.com/61551451/135263434-75fe793d-42af-49e4-b964-d70920e41655.png">](markdown/readme/languages/chinese.md)
[<img height="38" src="https://user-images.githubusercontent.com/61551451/135263474-787d71e7-3a87-42a8-92a8-be1d1f55413d.png">](markdown/readme/languages/french.md)
[<img height="38" src="https://user-images.githubusercontent.com/61551451/135263531-fae58600-6616-4b43-95a0-5891019dd35d.png">](markdown/readme/languages/german.md)
[<img height="38" src="https://user-images.githubusercontent.com/61551451/135263589-3dbeda9a-0d2e-4bbd-b1fc-691404bb74fb.png">](markdown/readme/languages/spanish.md)
[<img height="38" src="https://user-images.githubusercontent.com/61551451/135263669-f567196a-d4e8-4143-a80a-93d3be32ba90.png">](markdown/readme/languages/portuguese.md)
[<img height="38" src="https://user-images.githubusercontent.com/61551451/135263707-ba4e04a4-268a-4626-91b8-048e572fd9f6.png">](markdown/readme/languages/italian.md)
[<img height="38" src="https://user-images.githubusercontent.com/61551451/135263770-38e3e79d-11d4-472e-ac27-ae0f17cf65c4.png">](markdown/readme/languages/japanese.md)
[<img height="38" src="https://user-images.githubusercontent.com/61551451/135263822-28fce9de-915a-44dc-962d-7a61d340e91d.png">](markdown/readme/languages/korean.md)
[<img height="38" src="https://user-images.githubusercontent.com/61551451/135263888-151d4ad1-7084-4943-97c9-56f28cd40b80.png">](markdown/readme/languages/russian.md)
</div>
<p align="center"><a href="scripts/markdown/readme/languages/README.md"><b>See other languages »</b></a></p>
<p align="center"><a href="markdown/readme/languages/README.md"><b>See other languages »</b></a></p>
<img src="https://static.scarf.sh/a.png?x-pxid=c12a77cc-855e-4602-8a0f-614b2d0da56a" />

42
Run.md

@ -1,42 +0,0 @@
# Setup
#### Setting up dev environment
- Clone `nocodb/nocodb` GitHub repo and checkout to `feat/v2` branch
```sh
git clone https://github.com/nocodb/nocodb
cd nocodb
```
- Navigate to `nocodb-sdk` package folder, install and build the package
```sh
cd packages/nocodb-sdk
npm install
npm run build
```
#### Running backend
```sh
# Navigate to `nocodb` package and install dependencies
cd packages/nocodb
npm install
# requires sqlite3
npm run watch:run
# if you have mysql on localhost (set its password as password)
# npm run watch:run:mysql
```
#### Running frontend
```sh
# Navigate to `nc-gui` package and install dependencies
cd packages/nc-gui
npm install
npm run dev
```

48
docker-compose/mssql/docker-compose.yml

@ -1,33 +1,31 @@
version: '2.4'
services:
root_db:
image: mcr.microsoft.com/mssql/server:2017-latest
version: "2.4"
services:
nocodb:
depends_on:
root_db:
condition: service_healthy
environment:
NC_DB: "mssql://root_db:1433?u=sa&p=Password123.&d=root_db"
image: "nocodb/nocodb:latest"
ports:
- "8080:8080"
restart: always
volumes:
- db_data:/var/opt/mssql
environment:
volumes:
- "nc_data:/usr/app/data"
root_db:
environment:
ACCEPT_EULA: "Y"
SA_PASSWORD: Password123.
ACCEPT_EULA: Y
healthcheck:
test: /opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P "$$SA_PASSWORD" -Q "SELECT 1" || exit 1
healthcheck:
interval: 10s
timeout: 3s
retries: 10
start_period: 10s
nocodb:
depends_on:
root_db:
condition: service_healthy
image: nocodb/nocodb:latest
ports:
- "8080:8080"
test: "/opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P \"$$SA_PASSWORD\" -Q \"SELECT 1\" || exit 1"
timeout: 3s
image: "mcr.microsoft.com/mssql/server:2017-latest"
restart: always
volumes:
- nc_data:/usr/app/data
environment:
NC_DB: "mssql://root_db:1433?u=sa&p=Password123.&d=root_db"
volumes:
volumes:
- "db_data:/var/opt/mssql"
volumes:
db_data: {}
nc_data: {}

61
docker-compose/mysql/docker-compose.yml

@ -1,36 +1,39 @@
version: '2.1'
services:
root_db:
image: mysql:5.7
volumes:
- db_data:/var/lib/mysql
# below line shows how to change charset and collation
# uncomment it if necessary
# command: --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
version: "2.1"
services:
nocodb:
depends_on:
root_db:
condition: service_healthy
environment:
NC_DB: "mysql2://root_db:3306?u=noco&p=password&d=root_db"
image: "nocodb/nocodb:latest"
ports:
- "8080:8080"
restart: always
environment:
MYSQL_ROOT_PASSWORD: password
volumes:
- "nc_data:/usr/app/data"
root_db:
environment:
MYSQL_DATABASE: root_db
MYSQL_USER: noco
MYSQL_PASSWORD: password
healthcheck:
test: [ "CMD", "mysqladmin" ,"ping", "-h", "localhost" ]
timeout: 20s
MYSQL_ROOT_PASSWORD: password
MYSQL_USER: noco
healthcheck:
retries: 10
nocodb:
depends_on:
root_db:
condition: service_healthy
image: nocodb/nocodb:latest
ports:
- "8080:8080"
test:
- CMD
- mysqladmin
- ping
- "-h"
- localhost
timeout: 20s
image: "mysql:5.7"
restart: always
volumes:
- nc_data:/usr/app/data
environment:
NC_DB: "mysql2://root_db:3306?u=noco&p=password&d=root_db"
volumes:
volumes:
- "db_data:/var/lib/mysql"
# below line shows how to change charset and collation
# uncomment it if necessary
# command: --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
volumes:
db_data: {}
nc_data: {}

98
docker-compose/nginx-proxy-manager/docker-compose.yml

@ -1,58 +1,58 @@
version: '2.1'
services:
root_db:
image: mysql:5.7
volumes:
- db_data:/var/lib/mysql
restart: always
environment:
MYSQL_ROOT_PASSWORD: password
MYSQL_DATABASE: root_db
MYSQL_USER: noco
MYSQL_PASSWORD: password
healthcheck:
test: [ "CMD", "mysqladmin" ,"ping", "-h", "localhost" ]
timeout: 20s
retries: 10
networks:
- default
nocodb:
depends_on:
root_db:
condition: service_healthy
image: nocodb/nocodb:latest
restart: always
volumes:
- nc_data:/usr/app/data
environment:
NC_DB: "mysql2://root_db:3306?u=noco&p=password&d=root_db"
networks:
- default
- nginxproxy
nginx-proxy-manager:
image: jlesage/nginx-proxy-manager
restart: always
environment:
PUID: 1000
networks:
default: ~
nginxproxy: ~
services:
nginx-proxy-manager:
environment:
PGID: 1000
PUID: 1000
TZ: Europe/Amsterdam
ports:
image: jlesage/nginx-proxy-manager
networks:
- nginxproxy
ports:
- "8181:8181"
- "80:8080"
- "443:4443"
volumes:
- nginx-proxy-manager:/config:rw
networks:
restart: always
volumes:
- "nginx-proxy-manager:/config:rw"
nocodb:
depends_on:
root_db:
condition: service_healthy
environment:
NC_DB: "mysql2://root_db:3306?u=noco&p=password&d=root_db"
image: "nocodb/nocodb:latest"
networks:
- default
- nginxproxy
volumes:
nginx-proxy-manager: {}
restart: always
volumes:
- "nc_data:/usr/app/data"
root_db:
environment:
MYSQL_DATABASE: root_db
MYSQL_PASSWORD: password
MYSQL_ROOT_PASSWORD: password
MYSQL_USER: noco
healthcheck:
retries: 10
test:
- CMD
- mysqladmin
- ping
- "-h"
- localhost
timeout: 20s
image: "mysql:5.7"
networks:
- default
restart: always
volumes:
- "db_data:/var/lib/mysql"
volumes:
db_data: {}
nc_data: {}
networks:
default:
nginxproxy:
nginx-proxy-manager: {}

126
docker-compose/nginx/docker-compose.yml

@ -1,68 +1,66 @@
version: '3.9'
networks:
frontend:
external: false
backend:
external: false
version: "3.9"
networks:
backend:
external: false
frontend:
external: false
# This is an example setup with an Nginx reverse proxy.
# If you already have an Nginx reverse proxy running,
# then allow the docker-compose.yml to reference an external network that the reverse proxy container is on
# (in lieu of the frontend network in this file) and have the NocoDB container connect to it.
services:
reverse_proxy:
image: nginx:alpine
container_name: reverse_proxy
volumes:
- ./certbot:/etc/letsencrypt:ro # SSL certs
- ./nginx:/etc/nginx # Nginx config file
- path/to/webroot:/usr/share/nginx/html # Mount directory web site files for webroot certificate validation with Certbot
ports:
- 80:80
- 443:443
restart: unless-stopped
networks:
- frontend
certbot:
image: certbot/certbot
container_name: certbot
volumes:
- ./certbot:/etc/letsencrypt
- path/to/webroot:/var/www/html # For webroot certificate validation
depends_on:
- reverse_proxy
command: certonly --webroot --webroot-path=/var/www/html --email user@example.domain --agree-tos --no-eff-email -d example.domain,www.example.domain,nocodb.example.domain
nocodb_app:
image: nocodb/nocodb:latest
container_name: nocodb_app
restart: unless-stopped
volumes:
- ./nocodb/data:/usr/app/data
networks:
- backend
- frontend
environment:
NC_DB: mysql2://nocodb_database:3306?u=root&p=${MYSQL_ROOT_PASSWORD}&d=${MYSQL_DATABASE} # While it is not good practice to use the Root user, there were issues with granting privileges to a new user using the Linuxserver MariaDB image.
NC_PUBLIC_URL: ${NC_PUBLIC_URL}
NC_AUTH_JWT_SECRET: ${NC_AUTH_JWT_SECRET}
depends_on:
- nocodb_database
nocodb_database:
image: ghcr.io/linuxserver/mariadb:alpine # Using the non-official MariaDB image because it is an alpine distro and has a considerably smaller footprint.
container_name: nocodb_database
volumes:
- ./mariadb/config:/config
- ./mariadb/data:/var/lib/mysql
networks:
- backend
restart: always
environment:
- MYSQL_ROOT_PASSWORD
- MYSQL_DATABASE
- MYSQL_USER
- MYSQL_PASSWORD
services:
certbot:
command: "certonly --webroot --webroot-path=/var/www/html --email user@example.domain --agree-tos --no-eff-email -d example.domain,www.example.domain,nocodb.example.domain"
container_name: certbot
depends_on:
- reverse_proxy
image: certbot/certbot
volumes:
- "./certbot:/etc/letsencrypt"
- "path/to/webroot:/var/www/html" # For webroot certificate validation
nocodb_app:
container_name: nocodb_app
depends_on:
- nocodb_database
environment:
NC_AUTH_JWT_SECRET: "${NC_AUTH_JWT_SECRET}"
# while it is not good practice to use the Root user,
# there were issues with granting privileges to a new user using the Linux server MariaDB image.
NC_DB: "mysql2://nocodb_database:3306?u=root&p=${MYSQL_ROOT_PASSWORD}&d=${MYSQL_DATABASE}"
NC_PUBLIC_URL: "${NC_PUBLIC_URL}"
image: "nocodb/nocodb:latest"
networks:
- backend
- frontend
restart: unless-stopped
volumes:
- "./nocodb/data:/usr/app/data"
nocodb_database:
container_name: nocodb_database
environment:
- MYSQL_ROOT_PASSWORD
- MYSQL_DATABASE
- MYSQL_USER
- MYSQL_PASSWORD
# using the non-official MariaDB image
# because it is an alpine distro and has a considerably smaller footprint
image: "ghcr.io/linuxserver/mariadb:alpine"
networks:
- backend
restart: always
volumes:
- "./mariadb/config:/config"
- "./mariadb/data:/var/lib/mysql"
reverse_proxy:
container_name: reverse_proxy
image: "nginx:alpine"
networks:
- frontend
ports:
- "80:80"
- "443:443"
restart: unless-stopped
volumes:
- "./certbot:/etc/letsencrypt:ro" # SSL certs
- "./nginx:/etc/nginx" # Nginx config file
- "path/to/webroot:/usr/share/nginx/html" # Mount directory web site files for webroot certificate validation with Certbot

45
docker-compose/pg/docker-compose.yml

@ -1,32 +1,31 @@
version: '2.1'
services:
root_db:
image: postgres
services:
nocodb:
depends_on:
root_db:
condition: service_healthy
environment:
NC_DB: "pg://root_db:5432?u=postgres&p=password&d=root_db"
image: "nocodb/nocodb:latest"
ports:
- "8080:8080"
restart: always
volumes:
- db_data:/var/lib/postgresql/data
environment:
volumes:
- "nc_data:/usr/app/data"
root_db:
environment:
POSTGRES_DB: root_db
POSTGRES_PASSWORD: password
POSTGRES_USER: postgres
POSTGRES_DB: root_db
healthcheck:
test: pg_isready -U "$$POSTGRES_USER" -d "$$POSTGRES_DB"
healthcheck:
interval: 10s
timeout: 2s
retries: 10
nocodb:
depends_on:
root_db:
condition: service_healthy
image: nocodb/nocodb:latest
ports:
- "8080:8080"
test: "pg_isready -U \"$$POSTGRES_USER\" -d \"$$POSTGRES_DB\""
timeout: 2s
image: postgres
restart: always
volumes:
- nc_data:/usr/app/data
environment:
NC_DB: "pg://root_db:5432?u=postgres&p=password&d=root_db"
volumes:
volumes:
- "db_data:/var/lib/postgresql/data"
volumes:
db_data: {}
nc_data: {}

203
docker-compose/traefik/docker-compose.yml

@ -1,107 +1,102 @@
version: "3.7"
networks:
traefik_proxy:
name: traefik_proxy
volumes:
letsencrypt:
networks:
traefik_proxy:
name: traefik_proxy
services:
nocodb:
container_name: nocodb
depends_on:
- nocodb-db
environment:
- "NC_DB=pg://nocodb-db:5432?u=${DATABASE_USER}&p=${DATABASE_PW}&d=${DATABASE_NAME}"
- "NC_PUBLIC_URL=https://nocodb.${DOMAINNAME}"
- NC_DISABLE_TELE=true
image: "nocodb/nocodb:latest"
labels:
- traefik.enable=true
- traefik.http.services.nocodb.loadbalancer.server.port=8080
- "traefik.http.routers.nocodb.rule=Host(`nocodb.${DOMAINNAME}`)"
- traefik.http.routers.nocodb.entrypoints=https
- com.centurylinklabs.watchtower.enable=true
networks:
- traefik_proxy
restart: always
volumes:
- "nocodb-data:/usr/app/data"
nocodb-db:
container_name: nocodb-db
environment:
POSTGRES_DB: "${DATABASE_NAME}"
POSTGRES_PASSWORD: "${DATABASE_PW}"
POSTGRES_USER: "${DATABASE_USER}"
healthcheck:
interval: 10s
retries: 10
test: "pg_isready -U ${DATABASE_USER} -d ${DATABASE_NAME}"
timeout: 2s
image: "postgres:12.1-alpine"
networks:
- traefik_proxy
restart: always
volumes:
- "nocodb-db:/var/lib/postgresql/data"
traefik:
command:
- "--providers.docker=true"
- "--ping=true"
- "--ping.entryPoint=ping"
- "--providers.docker.exposedbydefault=false"
- "--providers.docker.network=traefik_proxy"
- "--entryPoints.ping.address=:8081"
- "--entrypoints.http.address=:80"
- "--entrypoints.https.address=:443"
- "--entrypoints.https.http.tls.certresolver=letsencrypt"
- "--entrypoints.https.http.tls.domains[0].main=${DOMAINNAME}"
- "--entrypoints.https.http.tls.domains[0].sans=*.${DOMAINNAME}"
- "--entrypoints.http.http.redirections.entryPoint.to=https"
- "--entrypoints.http.http.redirections.entryPoint.scheme=https"
- "--certificatesresolvers.letsencrypt.acme.dnsChallenge.delayBeforeCheck=15"
- "--certificatesresolvers.letsencrypt.acme.dnschallenge.provider=cloudflare"
- "--certificatesresolvers.letsencrypt.acme.email=info@${DOMAINNAME}"
- "--certificatesresolvers.letsencrypt.acme.storage=/letsencrypt/acme.json"
- "--certificatesResolvers.letsencrypt.acme.dnsChallenge.resolvers=1.1.1.1:53,1.0.0.1:53"
container_name: traefik
environment:
- "CF_DNS_API_TOKEN=${CLOUDFLARE_TOKEN}"
healthcheck:
retries: 3
test:
- CMD
- wget
- "-c"
- "http://localhost:8081/ping"
timeout: 3s
image: "traefik:v2.2"
networks:
- default
- traefik_proxy
ports:
- "80:80"
- "443:443"
restart: always
volumes:
- "letsencrypt:/letsencrypt"
- "/var/run/docker.sock:/var/run/docker.sock:ro"
watchtower:
command: "--schedule \"0 5 * * *\" --cleanup --label-enable"
container_name: watchtower
image: containrrr/watchtower
labels:
- com.centurylinklabs.watchtower.enable=true
networks:
- traefik_proxy
restart: always
volumes:
- "/var/run/docker.sock:/var/run/docker.sock:ro"
volumes:
letsencrypt:
name: traefik-letsencrypt
nocodb-db:
name: nocodb-db
nocodb-data:
nocodb-data:
name: nocodb-data
services:
traefik:
image: traefik:v2.2
container_name: traefik
restart: always
command:
#- "--log.level=DEBUG"
- "--providers.docker=true"
- "--ping=true"
- "--ping.entryPoint=ping"
- "--providers.docker.exposedbydefault=false"
- "--providers.docker.network=traefik_proxy"
- "--entryPoints.ping.address=:8081"
- "--entrypoints.http.address=:80"
- "--entrypoints.https.address=:443"
- "--entrypoints.https.http.tls.certresolver=letsencrypt"
- "--entrypoints.https.http.tls.domains[0].main=${DOMAINNAME}"
- "--entrypoints.https.http.tls.domains[0].sans=*.${DOMAINNAME}"
- "--entrypoints.http.http.redirections.entryPoint.to=https"
- "--entrypoints.http.http.redirections.entryPoint.scheme=https"
- "--certificatesresolvers.letsencrypt.acme.dnsChallenge.delayBeforeCheck=15"
- "--certificatesresolvers.letsencrypt.acme.dnschallenge.provider=cloudflare"
- "--certificatesresolvers.letsencrypt.acme.email=info@${DOMAINNAME}"
- "--certificatesresolvers.letsencrypt.acme.storage=/letsencrypt/acme.json"
- "--certificatesResolvers.letsencrypt.acme.dnsChallenge.resolvers=1.1.1.1:53,1.0.0.1:53"
environment:
- CF_DNS_API_TOKEN=${CLOUDFLARE_TOKEN}
healthcheck:
test: ["CMD", "wget", "-c", "http://localhost:8081/ping"]
timeout: 3s
retries: 3
networks:
- default
- traefik_proxy
ports:
- "80:80"
- "443:443"
volumes:
- "letsencrypt:/letsencrypt"
- /var/run/docker.sock:/var/run/docker.sock:ro
watchtower:
image: containrrr/watchtower
container_name: watchtower
restart: always
networks:
- traefik_proxy
command: --schedule "0 5 * * *" --cleanup --label-enable
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
labels:
- "com.centurylinklabs.watchtower.enable=true"
nocodb:
container_name: nocodb
image: nocodb/nocodb:latest
restart: always
volumes:
- nocodb-data:/usr/app/data
networks:
- traefik_proxy
environment:
- NC_DB=pg://nocodb-db:5432?u=${DATABASE_USER}&p=${DATABASE_PW}&d=${DATABASE_NAME}
- NC_PUBLIC_URL=https://nocodb.${DOMAINNAME}
- NC_DISABLE_TELE=true
labels:
- "traefik.enable=true"
- "traefik.http.services.nocodb.loadbalancer.server.port=8080"
- "traefik.http.routers.nocodb.rule=Host(`nocodb.${DOMAINNAME}`)"
- "traefik.http.routers.nocodb.entrypoints=https"
- "com.centurylinklabs.watchtower.enable=true"
depends_on:
- nocodb-db
nocodb-db:
image: postgres:12.1-alpine
container_name: nocodb-db
restart: always
networks:
- traefik_proxy
environment:
POSTGRES_USER: ${DATABASE_USER}
POSTGRES_PASSWORD: ${DATABASE_PW}
POSTGRES_DB: ${DATABASE_NAME}
volumes:
- nocodb-db:/var/lib/postgresql/data
healthcheck:
test: pg_isready -U ${DATABASE_USER} -d ${DATABASE_NAME}
interval: 10s
timeout: 2s
retries: 10
nocodb-db:
name: nocodb-db

0
scripts/markdown/plugins/google-auth.md → markdown/plugins/google-auth.md

0
scripts/markdown/plugins/s3.md → markdown/plugins/s3.md

0
scripts/markdown/readme/languages/README.md → markdown/readme/languages/README.md

2
scripts/markdown/readme/languages/chinese.md → markdown/readme/languages/chinese.md

@ -262,7 +262,7 @@ npm run dev
npm install
# 使用 docker compose 运行带有所需数据库的 mysql 数据库
docker-compose -f ./scripts/docker-compose-cypress.yml up
docker-compose -f ./scripts/cypress/docker-compose-cypress.yml up
# 使用以下命令运行后端 api
npm run start:api

0
scripts/markdown/readme/languages/dutch.md → markdown/readme/languages/dutch.md

0
scripts/markdown/readme/languages/french.md → markdown/readme/languages/french.md

2
scripts/markdown/readme/languages/german.md → markdown/readme/languages/german.md

@ -244,7 +244,7 @@ npm run dev
npm install
# MySQL-Datenbank mit der benötigten Datenbank mit Docker Compose ausführen
docker-compose -f ./scripts/docker-compose-cypress.yml up
docker-compose -f ./scripts/cypress/docker-compose-cypress.yml up
# Backend API mit folgendem Befehl ausführen
npm run start:api

0
scripts/markdown/readme/languages/indonesian.md → markdown/readme/languages/indonesian.md

0
scripts/markdown/readme/languages/italian.md → markdown/readme/languages/italian.md

0
scripts/markdown/readme/languages/japanese.md → markdown/readme/languages/japanese.md

0
scripts/markdown/readme/languages/korean.md → markdown/readme/languages/korean.md

0
scripts/markdown/readme/languages/portuguese.md → markdown/readme/languages/portuguese.md

0
scripts/markdown/readme/languages/russian.md → markdown/readme/languages/russian.md

0
scripts/markdown/readme/languages/spanish.md → markdown/readme/languages/spanish.md

1599
package-lock.json generated

File diff suppressed because it is too large Load Diff

25
package.json

@ -1,32 +1,39 @@
{
"name": "root",
"name": "nocodb-root",
"description": "NocoDB Root",
"private": true,
"author": {
"name": "NocoDB Inc",
"url": "https://nocodb.com/"
},
"homepage": "https://github.com/nocodb/nocodb",
"repository": {
"type": "git",
"url": "https://github.com/nocodb/nocodb.git"
},
"bugs": {
"url": "https://github.com/nocodb/nocodb/issues"
},
"license": "AGPL-3.0-or-later",
"devDependencies": {
"@4tw/cypress-drag-drop": "^2.0.0",
"cross-env": "^7.0.3",
"cypress": "^9.2.0",
"cypress-file-upload": "^5.0.8",
"cypress-iframe": "^1.0.1",
"fs": "0.0.1-security",
"jsdoc-to-markdown": "^5.0.3",
"lerna": "^3.20.1",
"scriptjs": "^2.5.9",
"xlsx": "^0.17.4"
},
"scripts": {
"build:common": "cd ./packages/nocodb-sdk; npm install; npm run build",
"install:common": "cd ./packages/nocodb; npm install ../nocodb-sdk; cd ../nc-gui; npm install ../nocodb-sdk",
"start:api": "npm run build:common ; cd ./packages/nocodb; npm install ../nocodb-sdk; npm install; NC_DISABLE_CACHE=true NC_DISABLE_TELE=true npm run watch:run:cypress",
"start:xcdb-api-v1-backup": "npm run build:common ; cd ./packages/nocodb; npm install ../nocodb-sdk;npm install; NC_DISABLE_CACHE=true NC_DISABLE_TELE=true NC_INFLECTION=camelize DATABASE_URL=sqlite:../../../scripts/cypress/fixtures/sqlite-sakila/sakila.db npm run watch:run:cypress",
"start:xcdb-api": "npm run build:common ; cd ./packages/nocodb; npm install ../nocodb-sdk;npm install; NC_EXPORT_MAX_TIMEOUT=60000 NC_DISABLE_CACHE=true NC_DISABLE_TELE=true NC_INFLECTION=camelize DATABASE_URL=sqlite:../../../scripts/cypress/fixtures/sqlite-sakila/sakila.db npm run watch:run:cypress",
"start:api:cache": "npm run build:common ; cd ./packages/nocodb; npm install ../nocodb-sdk;npm install; NC_EXPORT_MAX_TIMEOUT=60000 NC_DISABLE_TELE=true npm run watch:run:cypress",
"start:api:cache:pg": "npm run build:common ; cd ./packages/nocodb; npm install ../nocodb-sdk; npm install; NC_DISABLE_TELE=true npm run watch:run:cypress:pg",
"start:api:cache:pg:cyquick": "npm run build:common ; cd ./packages/nocodb; npm install ../nocodb-sdk; npm install; NC_DISABLE_TELE=true npm run watch:run:cypress:pg:cyquick",
"start:xcdb-api:cache-v1-backup": "npm run build:common ; cd ./packages/nocodb; npm install ../nocodb-sdk; npm install; NC_DISABLE_TELE=true NC_INFLECTION=camelize DATABASE_URL=sqlite:../../../scripts/cypress/fixtures/sqlite-sakila/sakila.db npm run watch:run:cypress",
"start:xcdb-api:cache": "npm run build:common ; cd ./packages/nocodb; npm install ../nocodb-sdk; npm install; NC_EXPORT_MAX_TIMEOUT=60000 NC_DISABLE_TELE=true NC_INFLECTION=camelize DATABASE_URL=sqlite:../../../scripts/cypress/fixtures/sqlite-sakila/sakila.db npm run watch:run:cypress",
"start:web-v1-backup": "npm run build:common ; cd ./packages/nc-gui; npm install ../nocodb-sdk; npm install; npm run dev",
"start:web": "npm run build:common ; cd ./packages/nc-gui; npm install ../nocodb-sdk; npm install; ANT_MESSAGE_DURATION=0.5 npm run dev",
"cypress-v1-backup:run": "cypress run --config-file ./scripts/cypress/cypress.json",
"cypress-v1-backup:open": "cypress open --config-file ./scripts/cypress/cypress.json",
"cypress:run": "cypress run --config-file ./scripts/cypress/cypress.json",
"cypress:open": "cypress open --config-file ./scripts/cypress/cypress.json",
"cypress:clear": "cypress cache clear",

682
packages/nc-cli/LICENSE

@ -1,21 +1,661 @@
MIT License
Copyright (c) 2021 nocodb
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
GNU AFFERO GENERAL PUBLIC LICENSE
Version 3, 19 November 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU Affero General Public License is a free, copyleft license for
software and other kinds of works, specifically designed to ensure
cooperation with the community in the case of network server software.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
our General Public Licenses are intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
Developers that use our General Public Licenses protect your rights
with two steps: (1) assert copyright on the software, and (2) offer
you this License which gives you legal permission to copy, distribute
and/or modify the software.
A secondary benefit of defending all users' freedom is that
improvements made in alternate versions of the program, if they
receive widespread use, become available for other developers to
incorporate. Many developers of free software are heartened and
encouraged by the resulting cooperation. However, in the case of
software used on network servers, this result may fail to come about.
The GNU General Public License permits making a modified version and
letting the public access it on a server without ever releasing its
source code to the public.
The GNU Affero General Public License is designed specifically to
ensure that, in such cases, the modified source code becomes available
to the community. It requires the operator of a network server to
provide the source code of the modified version running there to the
users of that server. Therefore, public use of a modified version, on
a publicly accessible server, gives the public access to the source
code of the modified version.
An older license, called the Affero General Public License and
published by Affero, was designed to accomplish similar goals. This is
a different license, not a version of the Affero GPL, but Affero has
released a new version of the Affero GPL which permits relicensing under
this license.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU Affero General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Remote Network Interaction; Use with the GNU General Public License.
Notwithstanding any other provision of this License, if you modify the
Program, your modified version must prominently offer all users
interacting with it remotely through a computer network (if your version
supports such interaction) an opportunity to receive the Corresponding
Source of your version by providing access to the Corresponding Source
from a network server at no charge, through some standard or customary
means of facilitating copying of software. This Corresponding Source
shall include the Corresponding Source for any work covered by version 3
of the GNU General Public License that is incorporated pursuant to the
following paragraph.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the work with which it is combined will remain governed by version
3 of the GNU General Public License.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU Affero General Public License from time to time. Such new versions
will be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU Affero General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU Affero General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU Affero General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published
by the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If your software can interact with users remotely through a computer
network, you should also make sure that it provides a way for users to
get its source. For example, if your program is a web application, its
interface could display a "Source" link that leads users to an archive
of the code. There are many ways you could offer source, and different
solutions will be better for different programs; see section 13 for the
specific requirements.
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU AGPL, see
<http://www.gnu.org/licenses/>.

1
packages/nc-cli/README.md

@ -1,2 +1,3 @@
# nc-cli
Create a NocoDB Application with CLI

1321
packages/nc-cli/package-lock.json generated

File diff suppressed because it is too large Load Diff

24
packages/nc-cli/package.json

@ -1,11 +1,23 @@
{
"name": "create-nocodb-app",
"version": "0.1.28",
"description": "nc-cli",
"description": "Create NocoDB app using CLI",
"private": true,
"author": {
"name": "NocoDB Inc",
"url": "https://nocodb.com/"
},
"homepage": "https://github.com/nocodb/nocodb",
"repository": {
"type": "git",
"url": "https://github.com/nocodb/nocodb.git"
},
"bugs": {
"url": "https://github.com/nocodb/nocodb/issues"
},
"license": "AGPL-3.0-or-later",
"main": "dist/bundle.js",
"module": "dist/bundle.js",
"repository": "https://github.com/nocodb/nocodb/blob/master/packages/nc-cli",
"license": "MIT",
"keywords": [],
"bin": {
"noco": "./dist/bundle.js",
@ -75,7 +87,6 @@
"ora": "^4.0.5",
"os-locale": "^5.0.0",
"pg": "^8.3.2",
"sha.js": "^2.4.11",
"shelljs": "^0.8.4",
"tcp-port-used": "^1.0.1",
"unique-names-generator": "^4.5.0",
@ -84,15 +95,12 @@
"yargs": "^15.4.1"
},
"devDependencies": {
"@bitjson/npm-scripts-info": "^1.0.0",
"@bitjson/typedoc": "^0.15.0-0",
"@istanbuljs/nyc-config-typescript": "^0.1.3",
"ava": "2.2.0",
"codecov": "^3.5.0",
"copy-webpack-plugin": "^7.0.0",
"cz-conventional-changelog": "^2.1.0",
"gh-pages": "^2.0.1",
"javascript-obfuscator": "^2.6.0",
"npm-run-all": "^4.1.5",
"nyc": "^14.1.1",
"open-cli": "^5.0.0",
@ -106,7 +114,7 @@
"tslint-immutable": "^6.0.1",
"typescript": "^3.5.3",
"webpack": "^5.1.0",
"webpack-cli": "^4.0.0",
"webpack-cli": "^4.10.0",
"webpack-node-externals": "^2.5.2"
},
"ava": {

34
packages/nc-cli/src/index.ts

@ -6,48 +6,54 @@ import Util from './lib/util/Util';
import updateNotifier from 'update-notifier';
// tslint:disable-next-line:no-var-requires
const pkg = require('../package.json');
import yargs from 'yargs';
const {uniqueNamesGenerator, starWars, adjectives, animals} = require('unique-names-generator');
const {
uniqueNamesGenerator,
starWars,
adjectives,
animals
} = require('unique-names-generator');
/* get cli args */
const args = yargs
.alias('u', 'url')
.alias('m', 'module')
.alias('n', 'nomodel')
.help('help')
.argv;
.help('help').argv;
/* cwd is reference to all commands */
args.folder = process.cwd();
/* handle command */
(async () => {
// Checks for available update and returns an instance
const notifier = updateNotifier({ pkg });
// Checks for available update and returns an instance
const notifier = updateNotifier({pkg});
// Notify using the built-in convenience method
// Notify using the built-in convenience method
notifier.notify();
if (args._) {
if (!args._.length) {
await SocialMgr.showPrompt();
args._.unshift(uniqueNamesGenerator({
dictionaries: [[starWars], [adjectives, animals]][Math.floor(Math.random() * 2)]
}).toLowerCase().replace(/[ -]/g, '_'));
args._.unshift(
uniqueNamesGenerator({
dictionaries: [[starWars], [adjectives, animals]][
Math.floor(Math.random() * 2)
]
})
.toLowerCase()
.replace(/[ -]/g, '_')
);
}
await CliMgr.process(args);
} else {
Util.showHelp(args);
process.exit(0)
process.exit(0);
}
})().catch(err => {
console.error('\n\nThere was an error processing command:');
console.error(err);
});

19
packages/nc-cli/src/lib/CliMgr.ts

@ -12,14 +12,13 @@ import client from './mgr/Client';
// import PermissionsMgr from './mgr/PermissionsMgr';
// import SocialMgr from './mgr/SocialMgr';
// import DockerMgr from "./mgr/DockerMgr";
import NewMgr from "./mgr/NewMgr";
import NewMgr from './mgr/NewMgr';
// import TryMgr from "./mgr/TryMgr";
let cmdProcessedOnce = 0;
let cmdOriginalArgs = null;
class CliMgr {
public static async runCmd(str) {
shell.echo(`\nNow, executing command : ${str}\n\n`.blue);
if (shell.exec(str).code !== 0) {
@ -30,13 +29,11 @@ class CliMgr {
}
public static async process(args) {
cmdOriginalArgs = cmdOriginalArgs ? cmdOriginalArgs : args;
try {
if (args._ && args._.length) {
switch (args._[0]) {
case 'man':
if (args._.length > 1) {
Util.showHelpForCommand(args);
@ -53,11 +50,11 @@ class CliMgr {
if (await NewMgr.getNewProjectInput(args)) {
if (args._[0] === 'gap') {
console.log('gRPC code generation is not yet supported.');
process.exit(0)
process.exit(0);
}
await client.requestSend(args)
await client.requestSend(args);
} else {
process.exit(0)
process.exit(0);
}
break;
@ -405,7 +402,6 @@ class CliMgr {
// process.exit(0)
// break;
default:
if (!cmdProcessedOnce) {
cmdProcessedOnce = 1;
@ -413,9 +409,11 @@ class CliMgr {
args._.unshift('new');
await this.process(args);
} else {
console.log(`\nUnknown command. ${cmdOriginalArgs._[0]} -- please see help below`);
console.log(
`\nUnknown command. ${cmdOriginalArgs._[0]} -- please see help below`
);
Util.showHelp(cmdOriginalArgs);
process.exit(0)
process.exit(0);
}
break;
}
@ -427,4 +425,3 @@ class CliMgr {
}
export default CliMgr;

79
packages/nc-cli/src/lib/mgr/AppMgr.ts

@ -11,11 +11,14 @@ import('colors');
const PROGRESS_WIDTH = 30;
class AppMgr {
public static async install(args) {
try {
const spinner = ora({text: 'Downloading Desktop App from Github..'.green.bold(), spinner: 'dots2', color: 'green'}).start();
const {src, dest} = await AppMgr.getDownloadLink(args);
const spinner = ora({
text: 'Downloading Desktop App from Github..'.green.bold(),
spinner: 'dots2',
color: 'green'
}).start();
const { src, dest } = await AppMgr.getDownloadLink(args);
console.log(`\t${src}`);
@ -23,20 +26,25 @@ class AppMgr {
// console.log(progress)
// Report download progress
const p = PROGRESS_WIDTH * progress.percent;
spinner.text = `Downloading Desktop App now..\n[${
Array.from({length: PROGRESS_WIDTH}, (_, i) => i <= p ? '=' : ' ').join('')
}] ${(progress.transferred / (1024 * 1024)).toFixed(2)}MB/${(progress.total / (1024 * 1024)).toFixed(2)}MB\n`.green.bold()
spinner.text = `Downloading Desktop App now..\n[${Array.from(
{ length: PROGRESS_WIDTH },
(_, i) => (i <= p ? '=' : ' ')
).join('')}] ${(progress.transferred / (1024 * 1024)).toFixed(2)}MB/${(
progress.total /
(1024 * 1024)
).toFixed(2)}MB\n`.green.bold();
});
// spinner.prefixText = '';
spinner.succeed(`Installable downloaded successfully at ./${dest}`.green.bold());
spinner.succeed(
`Installable downloaded successfully at ./${dest}`.green.bold()
);
console.log(`\nInstallable will open automatically now.`.green.bold);
console.log(`If not, please install it manually.`.green.bold);
if (os.type() === 'Windows_NT') {
// open(dest, {wait: true, app: 'explorer.exe'})
} else {
open(dest, {wait: true});
open(dest, { wait: true });
}
} catch (e) {
console.error(`Error in xc app.install`, e);
}
@ -45,7 +53,9 @@ class AppMgr {
public static async open(args) {
try {
const runCommand = AppMgr.getOpenCommand(args);
if (!runCommand) { return }
if (!runCommand) {
return;
}
if (shell.exec(runCommand).code !== 0) {
shell.echo(`\n\nError running command internally`.red);
shell.echo(`\nExiting...`.red);
@ -56,20 +66,27 @@ class AppMgr {
}
}
public static async getDownloadLink(args):Promise<any> {
public static async getDownloadLink(args): Promise<any> {
try {
let src;
let dest;
const urls:any = {};
const urls: any = {};
const res = await axios.get('https://api.github.com/repos/xgenecloud/xc-desktop-app/releases?page=1')
const res = await axios.get(
'https://api.github.com/repos/xgenecloud/xc-desktop-app/releases?page=1'
);
let status = 0;
for (let i = 0; i < res.data.length && status !== 15; i++) {
const assets = res.data[i].assets;
for (const {name, browser_download_url} of assets) {
switch (name.split('.').pop().toLowerCase()) {
for (const { name, browser_download_url } of assets) {
switch (
name
.split('.')
.pop()
.toLowerCase()
) {
case 'dmg':
urls.dmg = urls.dmg || browser_download_url;
status = status | 1;
@ -92,22 +109,24 @@ class AppMgr {
switch (os.type()) {
case 'Linux':
const linuxInfo = osInfo({mode: 'sync'});
if (args.debian) { src = urls.deb; }
else if (args.rpm) { src = urls.rpm; }
else {
const linuxInfo = osInfo({ mode: 'sync' });
if (args.debian) {
src = urls.deb;
} else if (args.rpm) {
src = urls.rpm;
} else {
switch (linuxInfo.id) {
case 'ubuntu':
case 'raspberry':
src = urls.deb
src = urls.deb;
break;
case 'fedora':
src = urls.rpm
src = urls.rpm;
break;
default:
src = urls.rpm
src = urls.rpm;
}
}
}
break;
case 'Darwin':
src = urls.dmg;
@ -120,22 +139,22 @@ class AppMgr {
}
dest = src.split('/').pop();
return {src, dest}
return { src, dest };
} catch (e) {
console.log(e)
console.log(e);
}
}
public static getOpenCommand(_args):any {
public static getOpenCommand(_args): any {
switch (os.type()) {
case 'Linux':
return 'xgenecloud'
return 'xgenecloud';
break;
case 'Darwin':
return 'open -a xgenecloud'
return 'open -a xgenecloud';
break;
case 'Windows_NT':
console.info('Open xgenecloud desktop app from Windows start menu')
console.info('Open xgenecloud desktop app from Windows start menu');
break;
default:
@ -144,6 +163,4 @@ class AppMgr {
}
}
export default AppMgr;

49
packages/nc-cli/src/lib/mgr/Client.ts

@ -9,18 +9,11 @@ import shell from 'shelljs';
// import {CmdSocketServer} from 'nc-help';
// import SocialMgr from './SocialMgr';
class Client {
public static async requestSend(_args) {
try {
// await CmdSocketServer.cmdHandler(null, null, args);
// const portOpen = await tcpPortUsed.check(config.port, 'localhost');
// if (portOpen) {
//
// // client.emit('__REQUEST__', args);
@ -28,7 +21,6 @@ class Client {
// await promprRunOrDownload.handle(args)
// process.exit(0);
// }
} catch (e) {
console.log('Error generating code.', e.message);
throw e;
@ -37,7 +29,6 @@ class Client {
}
public static async runCmd(str): Promise<any> {
shell.echo(`\nNow, executing command : ${str}\n\n`.blue);
const code = shell.exec(str).code;
if (code !== 0) {
@ -45,16 +36,12 @@ class Client {
// shell.echo(`\nExiting...`.red);
shell.exit(1);
}
return 0
return 0;
}
public static async responseHandle(args) {
try {
switch (args._[0]) {
case 'ga':
case 'gar':
case 'gen.apis':
@ -65,19 +52,29 @@ class Client {
if (!args.err) {
// SocialMgr.setCreatedApis(true)
if (os.type() === 'Windows_NT') {
console.log(boxen(`# APIs generated successfully\n\n# Please run the following commands\n${('cd ' + path.dirname(args.folder) + '; npm install ; npm run dev\n').green.bold}`, {
borderColor: 'green',
borderStyle: 'round',
margin: 1,
padding: 1
} as any));
console.log(
boxen(
`# APIs generated successfully\n\n# Please run the following commands\n${
(
'cd ' +
path.dirname(args.folder) +
'; npm install ; npm run dev\n'
).green.bold
}`,
{
borderColor: 'green',
borderStyle: 'round',
margin: 1,
padding: 1
} as any
)
);
} else {
await Client.runCmd(`npm install; npm run dev;`);
}
}
break;
case 'gc':
case 'gen.controller':
break;
@ -123,10 +120,10 @@ class Client {
case 'm':
break;
case 'db.migrate.sql.dump' :
case 'dmm' :
case 'dmmd' :
console.log('db.migrate.sql.dump finished')
case 'db.migrate.sql.dump':
case 'dmm':
case 'dmmd':
console.log('db.migrate.sql.dump finished');
break;
default:
@ -136,7 +133,6 @@ class Client {
throw e;
}
}
}
//
@ -162,4 +158,3 @@ class Client {
//
export default Client;

38
packages/nc-cli/src/lib/mgr/ComponentMgr.ts

@ -2,36 +2,30 @@ import inquirer from 'inquirer';
import path from 'path';
class ComponentMgr {
public static async add(_args) {
const components = require(path.join(process.cwd(), './server/app.components.js'))
const answer = await inquirer
.prompt([
{
choices: components.components.map(component => component.title),
message: 'Choose after which component should we insert the new component?',
name: 'compoonent',
type: 'list'
}
])
const components = require(path.join(
process.cwd(),
'./server/app.components.js'
));
const answer = await inquirer.prompt([
{
choices: components.components.map(component => component.title),
message:
'Choose after which component should we insert the new component?',
name: 'compoonent',
type: 'list'
}
]);
return answer.compoonent;
}
// tslint:disable-next-line:no-empty
public static async rename(_args) {
}
public static async rename(_args) {}
// tslint:disable-next-line:no-empty
public static async delete(_args) {
}
public static async delete(_args) {}
}
export default ComponentMgr;

26
packages/nc-cli/src/lib/mgr/DockerMgr.ts

@ -1,23 +1,21 @@
import NewMgr from "./NewMgr";
import NewMgr from './NewMgr';
import('colors');
import fs from 'fs';
import path from 'path';
class DockerMgr extends NewMgr {
public static async genDockerfile(args: any) {
const dockerFilePath = path.join(process.cwd(), 'Dockerfile');
try {
args._.push('placeholder')
if(await this.getNewProjectInput(args)) {
args._.push('placeholder');
if (await this.getNewProjectInput(args)) {
const dockerfileContent = this.getDockerfileContent(args);
fs.writeFileSync(dockerFilePath, dockerfileContent);
console.log(`Docker file created successfully`.green.bold)
console.log(`\tFile location : ${dockerFilePath}`.green)
console.log(`\tdocker build . -t xc`.green.bold)
}else{
console.log(`Docker file created successfully`.green.bold);
console.log(`\tFile location : ${dockerFilePath}`.green);
console.log(`\tdocker build . -t xc`.green.bold);
} else {
// console.log('Database connection failed')
}
} catch (e) {
@ -31,14 +29,12 @@ class DockerMgr extends NewMgr {
ENV PORT 8080
ENV NODE_ENV=dev
ENV TOOL_DIR=/tool
${
args.url.map((url, i) => `ENV DB_URL${i > 0 ? i + 1 : ''}=${url}`).join('\r\n')
}
${args.url
.map((url, i) => `ENV DB_URL${i > 0 ? i + 1 : ''}=${url}`)
.join('\r\n')}
`
`;
}
}
export default DockerMgr;

23
packages/nc-cli/src/lib/mgr/InstantMgr.ts

@ -4,7 +4,7 @@
// import path from 'path';
// import URL from 'url';
import express from 'express';
import {XcApis, XcConfigFactory,} from "xc-instant";
import { XcApis, XcConfigFactory } from 'xc-instant';
import('colors');
@ -42,28 +42,28 @@ import('colors');
// };
class InstantMgr {
public static async getNewProjectInput(args): Promise<any> {
if (args._.length < 2) {
const usage = '\n$ xc instant "mysql://localhost:3306?u=root&p=password&d=database&a=rest"'.green.bold
console.log(`\n\nWarning! missing connection URL\n\nExample Usage:\n${usage}\n`.red.bold);
const usage = '\n$ xc instant "mysql://localhost:3306?u=root&p=password&d=database&a=rest"'
.green.bold;
console.log(
`\n\nWarning! missing connection URL\n\nExample Usage:\n${usage}\n`.red
.bold
);
return false;
}
const config = XcConfigFactory.makeFromUrls(args._.slice(1))
const config = XcConfigFactory.makeFromUrls(args._.slice(1));
const server = express();
server.set('view engine', 'ejs');
const app = new XcApis(config)
const app = new XcApis(config);
server.use(await app.init());
server.listen('8080', () => console.log('App started'));
// /* Construct database URL from prompt */
// const dbTypes = Object.keys(dbDefaults);
// args.url = []
@ -210,10 +210,8 @@ class InstantMgr {
// args._[0] = answers.projectType === 'REST APIs' ? 'gar' : 'gag';
// args.url.push(url);
// return NewMgr.testConnection(args)
}
// public static async testConnection({url}) {
//
// for (const u of url) {
@ -243,7 +241,6 @@ class InstantMgr {
// return true;
// }
// public static async isPortOpen(host, port) {
// try {
// return await tcpPortUsed.check(+port, host)
@ -253,8 +250,6 @@ class InstantMgr {
// return true;
// }
// }
}
export default InstantMgr;

52
packages/nc-cli/src/lib/mgr/MigrationMgr.ts

@ -1,15 +1,14 @@
import {Migrator} from 'xc-migrator-ts';
const migrator = new Migrator()
import { Migrator } from 'xc-migrator-ts';
const migrator = new Migrator();
class MigrationMgr {
public static _getFolder(args) {
args.folder = args.folder || process.cwd();
}
public static async init(args) {
try {
args.type = args.type || "mysql";
args.type = args.type || 'mysql';
await migrator.init(args);
} catch (e) {
console.log('db.migrate.init : Error occured', e);
@ -27,9 +26,9 @@ class MigrationMgr {
public static async create(args) {
try {
this._getFolder(args)
this._getFolder(args);
await migrator.migrationsCreate({
dbAlias: args.dbAlias || "primary",
dbAlias: args.dbAlias || 'primary',
folder: args.folder
});
} catch (e) {
@ -38,10 +37,8 @@ class MigrationMgr {
}
public static async up(args) {
try {
this._getFolder(args)
this._getFolder(args);
let migrationSteps = args.steps || 9999;
@ -49,27 +46,24 @@ class MigrationMgr {
migrationSteps = 0;
}
const migratorInst = new Migrator()
const migratorInst = new Migrator();
await migratorInst.migrationsUp({
dbAlias: args.dbAlias || "primary",
env: args.env || "dev",
dbAlias: args.dbAlias || 'primary',
env: args.env || 'dev',
file: args.file || null,
folder: args.folder,
migrationSteps,
onlyList: args.list,
sqlContentMigrate: (+args.sqlContentMigrate === 0 ? 0 : 1)
sqlContentMigrate: +args.sqlContentMigrate === 0 ? 0 : 1
});
} catch (e) {
console.log('db.migrate.up : Error occured', e);
}
}
public static async down(args) {
try {
this._getFolder(args)
this._getFolder(args);
let migrationSteps = args.steps || 9999;
@ -78,25 +72,22 @@ class MigrationMgr {
}
await migrator.migrationsDown({
dbAlias: args.dbAlias || "primary",
env: args.env || "dev",
dbAlias: args.dbAlias || 'primary',
env: args.env || 'dev',
file: args.file || null,
folder: args.folder,
migrationSteps,
onlyList: args.list,
sqlContentMigrate: (+args.sqlContentMigrate === 0 ? 0 : 1)
sqlContentMigrate: +args.sqlContentMigrate === 0 ? 0 : 1
});
} catch (e) {
console.log('db.migrate.down : Error occured', e);
}
}
public static async list(args) {
try {
this._getFolder(args)
this._getFolder(args);
let migrationSteps = args.steps || 9999;
@ -105,8 +96,8 @@ class MigrationMgr {
}
const data = await migrator.migrationsUp({
dbAlias: args.dbAlias || "primary",
env: args.env || "dev",
dbAlias: args.dbAlias || 'primary',
env: args.env || 'dev',
file: args.file || null,
folder: args.folder,
migrationSteps,
@ -114,25 +105,20 @@ class MigrationMgr {
});
console.log(data.data.object.list);
} catch (e) {
console.log('db.migrate.up : Error occured', e);
}
}
public static async clean(args) {
try {
args.type = args.type || "mysql";
args.type = args.type || 'mysql';
await migrator.clean(args);
} catch (e) {
console.log('db.migrate.clean : Error occured', e);
}
}
}
// expose class
export default MigrationMgr;
export default MigrationMgr;

44
packages/nc-cli/src/lib/mgr/ModelMgr.ts

@ -3,8 +3,6 @@ import glob from 'glob';
import path from 'path';
class ModelMgr {
/***
*
* @param args
@ -18,25 +16,43 @@ class ModelMgr {
args.dbAlias = args.dbAlias || '*';
if (args.models) {
for (const model of args.models.split('.')) {
for (const file of glob.sync(path.join(args.folder, 'server', 'models', args.dbAlias,model, `${model}.meta.*.js`))) {
await fsExtra.remove(file)
console.log(`Removed successfully : ${path.basename(file)}`.green.bold)
for (const file of glob.sync(
path.join(
args.folder,
'server',
'models',
args.dbAlias,
model,
`${model}.meta.*.js`
)
)) {
await fsExtra.remove(file);
console.log(
`Removed successfully : ${path.basename(file)}`.green.bold
);
}
}
} else {
for (const file of glob.sync(path.join(args.folder, 'server', 'models', args.dbAlias, '*', '*.meta.*.js'))) {
await fsExtra.remove(file)
console.log(`Removed successfully : ${path.basename(file)}`.green.bold)
for (const file of glob.sync(
path.join(
args.folder,
'server',
'models',
args.dbAlias,
'*',
'*.meta.*.js'
)
)) {
await fsExtra.remove(file);
console.log(
`Removed successfully : ${path.basename(file)}`.green.bold
);
}
}
}catch (e) {
console.log(`Error while removing backup file`.red.bold)
} catch (e) {
console.log(`Error while removing backup file`.red.bold);
}
}
}
export default ModelMgr;

782
packages/nc-cli/src/lib/mgr/NewMgr.ts

@ -5,14 +5,14 @@ import mkdirp from 'mkdirp';
import path from 'path';
import tcpPortUsed from 'tcp-port-used';
import URL from 'url';
import {promisify} from "util";
import Util from "../util/Util";
import { promisify } from 'util';
import Util from '../util/Util';
import {v4 as uuidv4} from 'uuid';
import * as fs from "fs";
import Lang, {STR} from "../util/Lang";
import boxen from 'boxen';
import * as fs from 'fs';
import os from 'os';
import boxen from "boxen";
import { v4 as uuidv4 } from 'uuid';
import Lang, { STR } from '../util/Lang';
// @ts-ignore
const colors = require('colors');
@ -45,7 +45,7 @@ const dbDefaults = {
username: 'sa',
password: '',
database: ''
},
}
};
// const apiTypeMapping = {
@ -58,9 +58,7 @@ const dbDefaults = {
// 'Typescript': 'ts',
// }
class NewMgr {
/**
*
* Does the below :
@ -73,143 +71,158 @@ class NewMgr {
* @returns {Promise<string|string|boolean|*>}
*/
public static async getNewProjectInput(args): Promise<any> {
if (args._.length < 2) {
const usage = '\n$ xc new project_name'.green.bold
console.log(`\n\nWarning! missing project name\n\nExample Usage:\n${usage}\n`.red.bold);
const usage = '\n$ xc new project_name'.green.bold;
console.log(
`\n\nWarning! missing project name\n\nExample Usage:\n${usage}\n`.red
.bold
);
return false;
}
/* Construct database URL from prompt */
const dbTypes = Object.keys(dbDefaults);
args.url = []
console.log(`NocoDB requires a database to store metadata of database-spreadsheets.\nPlease enter the database credentials (defaults to SQLite3)`.green.bold)
const answers = await inquirer
.prompt([
{
name: 'type',
type: 'list',
message: Lang.getString(STR.DB_TYPE),// '🔥 Choose SQL Database type\t:',
choices: dbTypes.map(t => ({
name: t,
value: t,
short: t.green.bold
})),
default: 'sqlite3',
transformer(color) {
return chalkPipe(color)(color.green.bold);
}
args.url = [];
console.log(
`NocoDB requires a database to store metadata of database-spreadsheets.\nPlease enter the database credentials (defaults to SQLite3)`
.green.bold
);
const answers = await inquirer.prompt([
{
name: 'type',
type: 'list',
message: Lang.getString(STR.DB_TYPE), // '🔥 Choose SQL Database type\t:',
choices: dbTypes.map(t => ({
name: t,
value: t,
short: t.green.bold
})),
default: 'sqlite3',
transformer(color) {
return chalkPipe(color)(color.green.bold);
}
},
{
name: 'host',
type: 'input',
message: Lang.getString(STR.DB_HOST), // '👉 Enter database host name\t:',
default(ans) {
return dbDefaults[ans.type].host;
},
{
name: 'host',
type: 'input',
message: Lang.getString(STR.DB_HOST),// '👉 Enter database host name\t:',
default(ans) {
return dbDefaults[ans.type].host
},
transformer(color) {
return chalkPipe(color)(color.green.bold);
},
when({type}) {
return type !== 'sqlite3'
transformer(color) {
return chalkPipe(color)(color.green.bold);
},
when({ type }) {
return type !== 'sqlite3';
}
},
{
name: 'port',
type: 'number',
message: Lang.getString(STR.DB_PORT), // '👉 Enter database port number\t:',
default(ans) {
return dbDefaults[ans.type].port;
},
transformer(color) {
try {
return color.green.bold;
} catch (e) {
return color;
}
},
{
name: 'port',
type: 'number',
message: Lang.getString(STR.DB_PORT),// '👉 Enter database port number\t:',
default(ans) {
return dbDefaults[ans.type].port
},
transformer(color) {
try {
return color.green.bold;
} catch (e) {
return color
}
},
validate(port, answers) {
const done = this.async();
if (answers.host === 'host.docker.internal' || answers.host === 'docker.for.win.localhost') {
done(null, true)
} else {
NewMgr.isPortOpen(answers.host, port).then(isOpen => {
validate(port, answers) {
const done = this.async();
if (
answers.host === 'host.docker.internal' ||
answers.host === 'docker.for.win.localhost'
) {
done(null, true);
} else {
NewMgr.isPortOpen(answers.host, port)
.then(isOpen => {
if (isOpen) {
done(null, true)
done(null, true);
} else {
// done('Port is not open')
console.log(`\n\n😩 ${answers.host}:${port} is not open please start the database if you haven't\n`.red.bold)
console.log(
`\n\n😩 ${answers.host}:${port} is not open please start the database if you haven't\n`
.red.bold
);
process.exit(0);
}
}).catch(done)
}
},
when({type}) {
return type !== 'sqlite3'
})
.catch(done);
}
},
{
name: 'username',
type: 'input',
message: Lang.getString(STR.DB_USER), // '👉 Enter database username\t:',
default(ans) {
return dbDefaults[ans.type].username
},
transformer(color) {
return chalkPipe(color)(color.green.bold);
},
when({type}) {
return type !== 'sqlite3'
}
when({ type }) {
return type !== 'sqlite3';
}
},
{
name: 'username',
type: 'input',
message: Lang.getString(STR.DB_USER), // '👉 Enter database username\t:',
default(ans) {
return dbDefaults[ans.type].username;
},
{
name: 'password',
type: 'input',
mask: true,
message: Lang.getString(STR.DB_PASSWORD), // '🙈 Enter database password\t:',
transformer(color) {
return new Array(color.length).fill('*'.green.bold).join('')
},
when({type}) {
return type !== 'sqlite3'
}
transformer(color) {
return chalkPipe(color)(color.green.bold);
},
{
name: 'database',
type: 'input',
default(_ans) {
return args._[1] + '_dev';
},
message: Lang.getString(STR.DB_SCHEMA), // '👉 Enter database/schema name\t:',
transformer(color) {
return chalkPipe(color)(color.green.bold);
},
when({type}) {
return type !== 'sqlite3'
}
when({ type }) {
return type !== 'sqlite3';
}
},
{
name: 'password',
type: 'input',
mask: true,
message: Lang.getString(STR.DB_PASSWORD), // '🙈 Enter database password\t:',
transformer(color) {
return new Array(color.length).fill('*'.green.bold).join('');
},
{
name: 'projectType',
type: 'list',
message: Lang.getString(STR.PROJECT_TYPE), // '🚀 How do you want to run it\t:',
choices: [ 'As Node.js Project','As Docker', //'Try XC Instant App (Without scaffolding code)'
].map(t => ({
name: t,
value: t,
short: t.green.bold
})),
transformer(color) {
return chalkPipe(color)(color.green.bold);
},
when({ type }) {
return type !== 'sqlite3';
}
},
{
name: 'database',
type: 'input',
default(_ans) {
return args._[1] + '_dev';
},
])
message: Lang.getString(STR.DB_SCHEMA), // '👉 Enter database/schema name\t:',
transformer(color) {
return chalkPipe(color)(color.green.bold);
},
when({ type }) {
return type !== 'sqlite3';
}
},
{
name: 'projectType',
type: 'list',
message: Lang.getString(STR.PROJECT_TYPE), // '🚀 How do you want to run it\t:',
choices: [
'As Node.js Project',
'As Docker' // 'Try XC Instant App (Without scaffolding code)'
].map(t => ({
name: t,
value: t,
short: t.green.bold
})),
transformer(color) {
return chalkPipe(color)(color.green.bold);
}
}
]);
/* if not valid retry getting right input */
if (answers.type !== 'sqlite3' && !answers.database) {
console.log('\n\tWarning! Database name can NOT be empty. Retry.\n '.red.bold);
console.log(
'\n\tWarning! Database name can NOT be empty. Retry.\n '.red.bold
);
this.getNewProjectInput(args);
}
@ -226,230 +239,270 @@ class NewMgr {
}
if (answers.projectType === 'mvc' && !answers.isForExisting) {
/* attach new project name to path and 'cd' to that folder */
args.folder = path.join(args.folder, args._[1]);
mkdirp.sync(args.folder);
process.chdir(args.folder);
await Util.runCmd(`cd ${Util.escapeShellArg(args.folder)}`);
await promisify(download)('direct:https://github.com/nocodb/nocodb-seed/archive/refs/heads/main.zip', args.folder);
await promisify(download)(
'direct:https://github.com/nocodb/nocodb-seed/archive/refs/heads/main.zip',
args.folder
);
if (answers.type !== 'sqlite3') {
fs.appendFileSync(path.join(args.folder, '.env'), `NC_DB=${answers.type}://${answers.host}:${answers.port}?u=${answers.username}&p=${answers.password}&d=${answers.database}`)
fs.appendFileSync(
path.join(args.folder, '.env'),
`NC_DB=${answers.type}://${answers.host}:${answers.port}?u=${answers.username}&p=${answers.password}&d=${answers.database}`
);
}
if (os.type() === 'Windows_NT') {
console.log(boxen(`# Project created successfully\n\n# Please run the following commands\n\n${('cd ' + Util.escapeShellArg(args.folder) + '\nnpm install \nnpm start\n').green.bold}`, {
borderColor: 'green',
borderStyle: 'round',
margin: 1,
padding: 1
} as any));
console.log(
boxen(
`# Project created successfully\n\n# Please run the following commands\n\n${
(
'cd ' +
Util.escapeShellArg(args.folder) +
'\nnpm install \nnpm start\n'
).green.bold
}`,
{
borderColor: 'green',
borderStyle: 'round',
margin: 1,
padding: 1
} as any
)
);
} else {
await Util.runCmd(`npm install; npm run start;`);
}
} else if (answers.projectType) {
let env = '';
if (answers.type !== 'sqlite3') {
env = `--env NC_DB="${answers.type}://${answers.host}:${answers.port}?u=${answers.username}&p=${answers.password}&d=${answers.database}"`
env = `--env NC_DB="${answers.type}://${answers.host}:${answers.port}?u=${answers.username}&p=${answers.password}&d=${answers.database}"`;
}
const linuxHost = os.type() === 'Linux' ? '--net=host' : '';
if (os.type() === 'Windows_NT') {
// tslint:disable-next-line:ban-comma-operator
console.log(boxen(`# Please run the following docker commands\n\n${(`docker run -p 8080:8080 ${linuxHost} -d ${env} nocodb/nocodb:latest`).green.bold}\n`, {
borderColor: 'green',
borderStyle: 'round',
margin: 1,
padding: 1
} as any));
console.log(
boxen(
`# Please run the following docker commands\n\n${
`docker run -p 8080:8080 ${linuxHost} -d ${env} nocodb/nocodb:latest`
.green.bold
}\n`,
{
borderColor: 'green',
borderStyle: 'round',
margin: 1,
padding: 1
} as any
)
);
} else {
await Util.runCmd(`docker run -p 8080:8080 ${linuxHost} -d ${env} nocodb/nocodb:latest`);
await Util.runCmd(
`docker run -p 8080:8080 ${linuxHost} -d ${env} nocodb/nocodb:latest`
);
}
}
}
public static async getNewProjectInputOld(args): Promise<any> {
if (args._.length < 2) {
const usage = '\n$ xc new project_name'.green.bold
console.log(`\n\nWarning! missing project name\n\nExample Usage:\n${usage}\n`.red.bold);
const usage = '\n$ xc new project_name'.green.bold;
console.log(
`\n\nWarning! missing project name\n\nExample Usage:\n${usage}\n`.red
.bold
);
return false;
}
/* Construct database URL from prompt */
const dbTypes = Object.keys(dbDefaults);
args.url = []
const answers = await inquirer
.prompt([
{
name: 'type',
type: 'list',
message: Lang.getString(STR.DB_TYPE),// '🔥 Choose SQL Database type\t:',
choices: dbTypes.map(t => ({
name: t,
value: t,
short: t.green.bold
})),
default: 'mysql2',
transformer(color) {
return chalkPipe(color)(color.green.bold);
}
args.url = [];
const answers = await inquirer.prompt([
{
name: 'type',
type: 'list',
message: Lang.getString(STR.DB_TYPE), // '🔥 Choose SQL Database type\t:',
choices: dbTypes.map(t => ({
name: t,
value: t,
short: t.green.bold
})),
default: 'mysql2',
transformer(color) {
return chalkPipe(color)(color.green.bold);
}
},
{
name: 'host',
type: 'input',
message: Lang.getString(STR.DB_HOST), // '👉 Enter database host name\t:',
default(ans) {
return dbDefaults[ans.type].host;
},
transformer(color) {
return chalkPipe(color)(color.green.bold);
},
when({ type }) {
return type !== 'sqlite3';
}
},
{
name: 'port',
type: 'number',
message: Lang.getString(STR.DB_PORT), // '👉 Enter database port number\t:',
default(ans) {
return dbDefaults[ans.type].port;
},
{
name: 'host',
type: 'input',
message: Lang.getString(STR.DB_HOST),// '👉 Enter database host name\t:',
default(ans) {
return dbDefaults[ans.type].host
},
transformer(color) {
return chalkPipe(color)(color.green.bold);
},
when({type}) {
return type !== 'sqlite3'
transformer(color) {
try {
return color.green.bold;
} catch (e) {
return color;
}
},
{
name: 'port',
type: 'number',
message: Lang.getString(STR.DB_PORT),// '👉 Enter database port number\t:',
default(ans) {
return dbDefaults[ans.type].port
},
transformer(color) {
try {
return color.green.bold;
} catch (e) {
return color
}
},
validate(port, answers) {
const done = this.async();
if (answers.host === 'host.docker.internal' || answers.host === 'docker.for.win.localhost') {
done(null, true)
} else {
NewMgr.isPortOpen(answers.host, port).then(isOpen => {
validate(port, answers) {
const done = this.async();
if (
answers.host === 'host.docker.internal' ||
answers.host === 'docker.for.win.localhost'
) {
done(null, true);
} else {
NewMgr.isPortOpen(answers.host, port)
.then(isOpen => {
if (isOpen) {
done(null, true)
done(null, true);
} else {
// done('Port is not open')
console.log(`\n\n😩 ${answers.host}:${port} is not open please start the database if you haven't\n`.red.bold)
console.log(
`\n\n😩 ${answers.host}:${port} is not open please start the database if you haven't\n`
.red.bold
);
process.exit(0);
}
}).catch(done)
}
},
when({type}) {
return type !== 'sqlite3'
})
.catch(done);
}
},
{
name: 'username',
type: 'input',
message: Lang.getString(STR.DB_USER), // '👉 Enter database username\t:',
default(ans) {
return dbDefaults[ans.type].username
},
transformer(color) {
return chalkPipe(color)(color.green.bold);
},
when({type}) {
return type !== 'sqlite3'
}
when({ type }) {
return type !== 'sqlite3';
}
},
{
name: 'username',
type: 'input',
message: Lang.getString(STR.DB_USER), // '👉 Enter database username\t:',
default(ans) {
return dbDefaults[ans.type].username;
},
{
name: 'password',
type: 'input',
mask: true,
message: Lang.getString(STR.DB_PASSWORD), // '🙈 Enter database password\t:',
transformer(color) {
return new Array(color.length).fill('*'.green.bold).join('')
},
when({type}) {
return type !== 'sqlite3'
}
transformer(color) {
return chalkPipe(color)(color.green.bold);
},
{
name: 'database',
type: 'input',
default(_ans) {
return args._[1] + '_dev';
},
message: Lang.getString(STR.DB_SCHEMA), // '👉 Enter database/schema name\t:',
transformer(color) {
return chalkPipe(color)(color.green.bold);
},
when({type}) {
return type !== 'sqlite3'
}
when({ type }) {
return type !== 'sqlite3';
}
},
{
name: 'password',
type: 'input',
mask: true,
message: Lang.getString(STR.DB_PASSWORD), // '🙈 Enter database password\t:',
transformer(color) {
return new Array(color.length).fill('*'.green.bold).join('');
},
{
name: 'apiType',
type: 'list',
message: Lang.getString(STR.DB_API), // '🚀 Enter API type to generate\t:',
choices: ['REST APIs', 'GRAPHQL APIs', 'gRPC APIs'].map(t => ({
name: t,
value: t,
short: t.green.bold
})),
transformer(color) {
return chalkPipe(color)(color.green.bold);
},
when({type}) {
return type !== 'sqlite3'
}
when({ type }) {
return type !== 'sqlite3';
}
},
{
name: 'database',
type: 'input',
default(_ans) {
return args._[1] + '_dev';
},
{
name: 'projectType',
type: 'list',
message: Lang.getString(STR.PROJECT_TYPE), // '🚀 How do you want to run it\t:',
choices: ['Docker', 'New Node.js project', 'Existing Node.js project', 'Try XC Instant App (Without scaffolding code)'].map(t => ({
name: t,
value: t,
short: t.green.bold
})),
transformer(color) {
return chalkPipe(color)(color.green.bold);
},
when({type}) {
return type !== 'sqlite3'
}
message: Lang.getString(STR.DB_SCHEMA), // '👉 Enter database/schema name\t:',
transformer(color) {
return chalkPipe(color)(color.green.bold);
},
when({ type }) {
return type !== 'sqlite3';
}
},
{
name: 'apiType',
type: 'list',
message: Lang.getString(STR.DB_API), // '🚀 Enter API type to generate\t:',
choices: ['REST APIs', 'GRAPHQL APIs', 'gRPC APIs'].map(t => ({
name: t,
value: t,
short: t.green.bold
})),
transformer(color) {
return chalkPipe(color)(color.green.bold);
},
// {
// name: 'programmingLanguage',
// type: 'list',
// message: '🚀 Enter preferred programming language\t:',
// choices: ['Javascript', 'Typescript'].map(t => ({
// name: t,
// value: t,
// short: t.green.bold
// })),
// transformer(color) {
// return chalkPipe(color)(color.green.bold);
// },
// when({type}) {
// return type !== 'sqlite3'
// }
// }
])
when({ type }) {
return type !== 'sqlite3';
}
},
{
name: 'projectType',
type: 'list',
message: Lang.getString(STR.PROJECT_TYPE), // '🚀 How do you want to run it\t:',
choices: [
'Docker',
'New Node.js project',
'Existing Node.js project',
'Try XC Instant App (Without scaffolding code)'
].map(t => ({
name: t,
value: t,
short: t.green.bold
})),
transformer(color) {
return chalkPipe(color)(color.green.bold);
},
when({ type }) {
return type !== 'sqlite3';
}
}
// {
// name: 'programmingLanguage',
// type: 'list',
// message: '🚀 Enter preferred programming language\t:',
// choices: ['Javascript', 'Typescript'].map(t => ({
// name: t,
// value: t,
// short: t.green.bold
// })),
// transformer(color) {
// return chalkPipe(color)(color.green.bold);
// },
// when({type}) {
// return type !== 'sqlite3'
// }
// }
]);
// console.log(answers);
if (answers.type === 'sqlite3') {
console.log('Please use desktop app to create Sqlite project'.green.bold)
console.log('Please use desktop app to create Sqlite project'.green.bold);
process.exit(0);
}
/* if not valid retry getting right input */
if (!answers.database) {
console.log('\n\tWarning! Database name can NOT be empty. Retry.\n '.red.bold);
console.log(
'\n\tWarning! Database name can NOT be empty. Retry.\n '.red.bold
);
this.getNewProjectInput(args);
}
//
/* prepare the args */
// const url = `${answers.type}://${answers.host}:${answers.port}?u=${answers.username}&p=${answers.password}&d=${answers.database}&api=${apiTypeMapping[answers.projectType]}`;
// args._[0] = answers.projectType === 'REST APIs' ? 'gar' : 'gag';
@ -485,7 +538,6 @@ class NewMgr {
}
if (answers.projectType === 'mvc' && !answers.isForExisting) {
/* attach new project name to path and 'cd' to that folder */
args.folder = path.join(args.folder, args._[1]);
mkdirp.sync(args.folder);
@ -495,72 +547,73 @@ class NewMgr {
await promisify(download)('gitlab:xc-public/test10', args.folder);
const config = {
title: args._[1],
"version": "0.6",
"envs": {
"dev": {
"db": [
version: '0.6',
envs: {
dev: {
db: [
{
"client": answers.type,
"connection": {
"host": answers.host,
"port": answers.port,
"user": answers.username,
"password": answers.password,
"database": answers.database,
"multipleStatements": true
client: answers.type,
connection: {
host: answers.host,
port: answers.port,
user: answers.username,
password: answers.password,
database: answers.database,
multipleStatements: true
},
"meta": {
"tn": "xc_evolutions",
"dbAlias": "db",
"api": {
"type": answers.apiType,
"prefix": "",
"graphqlDepthLimit": 10
meta: {
tn: 'xc_evolutions',
dbAlias: 'db',
api: {
type: answers.apiType,
prefix: '',
graphqlDepthLimit: 10
},
"inflection": {
"tn": "none",
"cn": "none"
inflection: {
tn: 'none',
cn: 'none'
}
}
}
],
"apiClient": {
"data": []
apiClient: {
data: []
}
}
},
"workingEnv": "dev",
"seedsFolder": "seeds",
"queriesFolder": "queries",
"apisFolder": "apis",
"projectType": answers.apiType,
"type": "docker",
"language": "ts",
"apiClient": {
"data": []
workingEnv: 'dev',
seedsFolder: 'seeds',
queriesFolder: 'queries',
apisFolder: 'apis',
projectType: answers.apiType,
type: 'docker',
language: 'ts',
apiClient: {
data: []
},
"auth": {
"jwt": {
"secret": uuidv4(),
"dbAlias": "db"
auth: {
jwt: {
secret: uuidv4(),
dbAlias: 'db'
}
}, "meta": {
"db": {
"client": "sqlite3",
"connection": {
"filename": "xc.db"
},
meta: {
db: {
client: 'sqlite3',
connection: {
filename: 'xc.db'
}
}
}
}
};
fs.writeFileSync(path.join(args.folder, 'config.xc.json'), JSON.stringify(config, null, 2))
fs.writeFileSync(
path.join(args.folder, 'config.xc.json'),
JSON.stringify(config, null, 2)
);
await Util.runCmd(`npm install; npm run start;`);
} else if (answers.projectType === 'mvc') {
console.log(`
1. Install our npm package using following command
@ -568,7 +621,8 @@ class NewMgr {
2. Add the following code in your existing express project
\t${`const {Noco} = require("nocodb");
\t${
`const {Noco} = require("nocodb");
\tnew Noco({
title: "${args._[1]}",
@ -630,7 +684,8 @@ class NewMgr {
}
}
}
}).init().then(mw => app.use(mw))`.green}
}).init().then(mw => app.use(mw))`.green
}
@ -638,38 +693,33 @@ ${`Note: ${'app'.bold} - refers to your express server instance`}
`)
`);
} else if (answers.projectType === 'docker') {
const dbUrl = `${answers.type}://${answers.host}:${answers.port}?u=${answers.username}&p=${answers.password}&d=${answers.database}`;
// console.log(`
// You can create docker container using following command
//
// \t${`docker run -p 8080:8080 -p 8081:8081 -p 8082:8082 -d --name xc-instant --env DB_URL=${dbUrl} -d xgenecloud/xc:latest`.green}
//
//
// Then visit http://localhost:8080/xc to access the Dashboard
//
// `)
// console.log(`
// You can create docker container using following command
//
// \t${`docker run -p 8080:8080 -p 8081:8081 -p 8082:8082 -d --name xc-instant --env DB_URL=${dbUrl} -d xgenecloud/xc:latest`.green}
//
//
// Then visit http://localhost:8080/xc to access the Dashboard
//
// `)
const linuxHost = os.type() === 'Linux' ? '--net=host' : '';
await Util.runCmd(`docker run -p 8080:8080 -p 8081:8081 -p 8082:8082 ${linuxHost} --name xc-instant --env NC_DB_URL="${dbUrl}" xgenecloud/xc:latest`);
await Util.runCmd(
`docker run -p 8080:8080 -p 8081:8081 -p 8082:8082 ${linuxHost} --name xc-instant --env NC_DB_URL="${dbUrl}" xgenecloud/xc:latest`
);
}
// args.url.push(url);
//
// args.language = languageMapping[answers.programmingLanguage];
// return OldNewMgr.testConnection(args)
}
public static async testConnection({url}) {
public static async testConnection({ url }) {
for (const u of url) {
const parsedUrlData = URL.parse(u, true);
const queryParams = parsedUrlData.query;
@ -681,29 +731,30 @@ ${`Note: ${'app'.bold} - refers to your express server instance`}
port: +parsedUrlData.port,
user: queryParams.u,
password: queryParams.p,
database: client === 'pg' ? 'postgres' : (client === 'mssql' ? undefined : null)
database:
client === 'pg' ? 'postgres' : client === 'mssql' ? undefined : null
}
};
try {
const knex = require('knex')(config)
await knex.raw("SELECT 1+1 as data");
const knex = require('knex')(config);
await knex.raw('SELECT 1+1 as data');
} catch (e) {
console.log(`\n😩 Test connection failed for : ${url}\n`.red.bold)
console.log(`\n😩 Test connection failed for : ${url}\n`.red.bold);
return false;
}
}
return true;
}
public static async isPortOpen(host, port) {
try {
return await tcpPortUsed.check(+port, host)
return await tcpPortUsed.check(+port, host);
} catch (e) {
console.log(e)
console.log(`\n😩 ${host}:${port} is not reachable please check\n`.red.bold)
console.log(e);
console.log(
`\n😩 ${host}:${port} is not reachable please check\n`.red.bold
);
return true;
}
}
@ -715,4 +766,3 @@ ${`Note: ${'app'.bold} - refers to your express server instance`}
}
export default NewMgr;

306
packages/nc-cli/src/lib/mgr/OldNewMgr.ts

@ -6,7 +6,7 @@ import URL from 'url';
import('colors');
let tcpPortUsed = require('tcp-port-used');
const tcpPortUsed = require('tcp-port-used');
const dbDefaults = {
mysql: {
@ -36,22 +36,20 @@ const dbDefaults = {
username: 'sa',
password: '',
database: ''
},
}
};
const apiTypeMapping = {
'GRAPHQL APIs': 'graphql',
'REST APIs': 'rest',
'gRPC APIs': 'grpc'
}
};
const languageMapping = {
'Javascript': 'js',
'Typescript': 'ts',
}
Javascript: 'js',
Typescript: 'ts'
};
class OldNewMgr {
/**
*
* Does the below :
@ -64,161 +62,169 @@ class OldNewMgr {
* @returns {Promise<string|string|boolean|*>}
*/
public static async getNewProjectInput(args) {
if (args._.length < 2) {
const usage = '\n$ xc new project_name'.green.bold
console.log(`\n\nWarning! missing project name\n\nExample Usage:\n${usage}\n`.red.bold);
const usage = '\n$ xc new project_name'.green.bold;
console.log(
`\n\nWarning! missing project name\n\nExample Usage:\n${usage}\n`.red
.bold
);
return false;
}
/* Construct database URL from prompt */
const dbTypes = Object.keys(dbDefaults);
args.url = []
args.url = [];
const answers = await inquirer
.prompt([
{
name: 'type',
type: 'list',
message: '🔥 Choose SQL Database type\t:',
choices: dbTypes.map(t => ({
name: t,
value: t,
short: t.green.bold
})),
default: 'mysql',
transformer(color) {
return chalkPipe(color)(color.green.bold);
}
const answers = await inquirer.prompt([
{
name: 'type',
type: 'list',
message: '🔥 Choose SQL Database type\t:',
choices: dbTypes.map(t => ({
name: t,
value: t,
short: t.green.bold
})),
default: 'mysql',
transformer(color) {
return chalkPipe(color)(color.green.bold);
}
},
{
name: 'host',
type: 'input',
message: '👉 Enter database host name\t:',
default(ans) {
return dbDefaults[ans.type].host;
},
transformer(color) {
return chalkPipe(color)(color.green.bold);
},
when({ type }) {
return type !== 'sqlite3';
}
},
{
name: 'port',
type: 'number',
message: '👉 Enter database port number\t:',
default(ans) {
return dbDefaults[ans.type].port;
},
{
name: 'host',
type: 'input',
message: '👉 Enter database host name\t:',
default(ans) {
return dbDefaults[ans.type].host
},
transformer(color) {
return chalkPipe(color)(color.green.bold);
},
when({type}) {
return type !== 'sqlite3'
transformer(color) {
try {
return color.green.bold;
} catch (e) {
return color;
}
},
{
name: 'port',
type: 'number',
message: '👉 Enter database port number\t:',
default(ans) {
return dbDefaults[ans.type].port
},
transformer(color) {
try {
return color.green.bold;
} catch (e) {
return color
}
},
validate(port, answers) {
let done = this.async();
OldNewMgr.isPortOpen(answers.host, port).then(isOpen => {
validate(port, answers) {
const done = this.async();
OldNewMgr.isPortOpen(answers.host, port)
.then(isOpen => {
if (isOpen) {
done(null, true)
done(null, true);
} else {
// done('Port is not open')
console.log(`\n\n😩 ${answers.host}:${port} is not open please start the database if you haven't\n`.red.bold)
console.log(
`\n\n😩 ${answers.host}:${port} is not open please start the database if you haven't\n`
.red.bold
);
process.exit(0);
}
}).catch(done)
},
when({type}) {
return type !== 'sqlite3'
}
})
.catch(done);
},
{
name: 'username',
type: 'input',
message: '👉 Enter database username\t:',
default(ans) {
return dbDefaults[ans.type].username
},
transformer(color) {
return chalkPipe(color)(color.green.bold);
},
when({type}) {
return type !== 'sqlite3'
}
when({ type }) {
return type !== 'sqlite3';
}
},
{
name: 'username',
type: 'input',
message: '👉 Enter database username\t:',
default(ans) {
return dbDefaults[ans.type].username;
},
{
name: 'password',
type: 'input',
mask: true,
message: '🙈 Enter database password\t:',
transformer(color) {
return new Array(color.length).fill('*'.green.bold).join('')
},
when({type}) {
return type !== 'sqlite3'
}
transformer(color) {
return chalkPipe(color)(color.green.bold);
},
{
name: 'database',
type: 'input',
default(_ans) {
return args._[1] + '_dev';
},
message: '👉 Enter database/schema name\t:',
transformer(color) {
return chalkPipe(color)(color.green.bold);
},
when({type}) {
return type !== 'sqlite3'
}
when({ type }) {
return type !== 'sqlite3';
}
},
{
name: 'password',
type: 'input',
mask: true,
message: '🙈 Enter database password\t:',
transformer(color) {
return new Array(color.length).fill('*'.green.bold).join('');
},
{
name: 'projectType',
type: 'list',
message: '🚀 Enter API type to generate\t:',
choices: ['REST APIs', 'GRAPHQL APIs'].map(t => ({
name: t,
value: t,
short: t.green.bold
})),
transformer(color) {
return chalkPipe(color)(color.green.bold);
},
when({type}) {
return type !== 'sqlite3'
}
when({ type }) {
return type !== 'sqlite3';
}
},
{
name: 'database',
type: 'input',
default(_ans) {
return args._[1] + '_dev';
},
{
name: 'programmingLanguage',
type: 'list',
message: '🚀 Enter preferred programming language\t:',
choices: ['Javascript', 'Typescript'].map(t => ({
name: t,
value: t,
short: t.green.bold
})),
transformer(color) {
return chalkPipe(color)(color.green.bold);
},
when({type}) {
return type !== 'sqlite3'
}
message: '👉 Enter database/schema name\t:',
transformer(color) {
return chalkPipe(color)(color.green.bold);
},
when({ type }) {
return type !== 'sqlite3';
}
},
{
name: 'projectType',
type: 'list',
message: '🚀 Enter API type to generate\t:',
choices: ['REST APIs', 'GRAPHQL APIs'].map(t => ({
name: t,
value: t,
short: t.green.bold
})),
transformer(color) {
return chalkPipe(color)(color.green.bold);
},
when({ type }) {
return type !== 'sqlite3';
}
},
{
name: 'programmingLanguage',
type: 'list',
message: '🚀 Enter preferred programming language\t:',
choices: ['Javascript', 'Typescript'].map(t => ({
name: t,
value: t,
short: t.green.bold
})),
transformer(color) {
return chalkPipe(color)(color.green.bold);
},
when({ type }) {
return type !== 'sqlite3';
}
])
}
]);
// console.log(answers);
if (answers.type === 'sqlite3') {
console.log('Please use desktop app to create Sqlite project'.green.bold)
console.log('Please use desktop app to create Sqlite project'.green.bold);
process.exit(0);
}
/* if not valid retry getting right input */
if (!answers.database) {
console.log('\n\tWarning! Database name can NOT be empty. Retry.\n '.red.bold);
console.log(
'\n\tWarning! Database name can NOT be empty. Retry.\n '.red.bold
);
this.getNewProjectInput(args);
}
@ -229,7 +235,11 @@ class OldNewMgr {
// await Util.runCmd(`cd ${args.folder}`);
/* prepare the args */
const url = `${answers.type}://${answers.host}:${answers.port}?u=${answers.username}&p=${answers.password}&d=${answers.database}&api=${apiTypeMapping[answers.projectType]}`;
const url = `${answers.type}://${answers.host}:${answers.port}?u=${
answers.username
}&p=${answers.password}&d=${answers.database}&api=${
apiTypeMapping[answers.projectType]
}`;
args._[0] = answers.projectType === 'REST APIs' ? 'gar' : 'gag';
switch (answers.projectType) {
case 'REST APIs':
@ -249,13 +259,10 @@ class OldNewMgr {
args.language = languageMapping[answers.programmingLanguage];
return OldNewMgr.testConnection(args)
return OldNewMgr.testConnection(args);
}
public static async testConnection({url}) {
public static async testConnection({ url }) {
for (const u of url) {
const parsedUrlData = URL.parse(u, true);
const queryParams = parsedUrlData.query;
@ -267,34 +274,33 @@ class OldNewMgr {
port: +parsedUrlData.port,
user: queryParams.u,
password: queryParams.p,
database: client === 'pg' ? 'postgres' : (client === 'mssql' ? undefined : null)
database:
client === 'pg' ? 'postgres' : client === 'mssql' ? undefined : null
}
};
try {
const knex = require('knex')(config)
await knex.raw("SELECT 1+1 as data");
const knex = require('knex')(config);
await knex.raw('SELECT 1+1 as data');
} catch (e) {
console.log(`\n😩 Test connection failed for : ${url}\n`.red.bold)
console.log(`\n😩 Test connection failed for : ${url}\n`.red.bold);
return false;
}
}
return true;
}
public static async isPortOpen(host, port) {
try {
return await tcpPortUsed.check(+port, host)
return await tcpPortUsed.check(+port, host);
} catch (e) {
console.log(e)
console.log(`\n😩 ${host}:${port} is not reachable please check\n`.red.bold)
console.log(e);
console.log(
`\n😩 ${host}:${port} is not reachable please check\n`.red.bold
);
return true;
}
}
}
export default OldNewMgr;

534
packages/nc-cli/src/lib/mgr/PermissionsMgr.ts

@ -9,28 +9,29 @@ import Util from '../util/Util';
import Table from 'cli-table3';
class PermissionsMgr {
public static async set(args) {
if (Util.isProjectGraphql()) {
try {
if (args._.length < 4) {
console.warn('Invalid arguments for : xc permissions.set')
console.warn('Invalid arguments for : xc permissions.set');
return;
}
// @ts-ignore
let [_, models, users, ...resolvers] = args._;
models = models.split('.');
users = users.split('.');
/* get all policies */
const policiesPath = path.join(process.cwd(), 'server', PermissionsMgr.getPolicyPath(), '**', '*.policy.js');
glob.sync(policiesPath).forEach((file) => {
const policiesPath = path.join(
process.cwd(),
'server',
PermissionsMgr.getPolicyPath(),
'**',
'*.policy.js'
);
glob.sync(policiesPath).forEach(file => {
const modelName = path.basename(file).split('.')[0];
if (models.includes(modelName) || models[0] === '$') {
@ -40,73 +41,87 @@ class PermissionsMgr {
if (users[0] === '$') {
for (const [route, rolesObj] of Object.entries(filePermissions)) {
if (resolvers[0] === '$=1') {
const permObj = roles.reduce((obj, role) => {
obj[role] = true;
return obj;
}, {});
Object.assign(rolesObj, permObj)
console.log(`Setting Permissions for model:${modelName} roles:${roles.join(', ')} resolver: ${route}`);
Object.assign(rolesObj, permObj);
console.log(
`Setting Permissions for model:${modelName} roles:${roles.join(
', '
)} resolver: ${route}`
);
} else if (resolvers[0] === '$=0') {
const permObj = roles.reduce((obj, role) => {
obj[role] = false;
return obj;
}, {});
Object.assign(rolesObj, permObj)
console.log(`Setting Permissions for model:${modelName} roles:${roles.join(', ')} resolver: ${route}`);
Object.assign(rolesObj, permObj);
console.log(
`Setting Permissions for model:${modelName} roles:${roles.join(
', '
)} resolver: ${route}`
);
} else {
resolvers.forEach(permission => {
const permTuple = permission.split('=')
const permTuple = permission.split('=');
if (route === permTuple[0]) {
const permObj = roles.reduce((obj, role) => {
const val = !!(permTuple.length === 1 ? 1 : +permTuple[1] || 0);
const val = !!(permTuple.length === 1
? 1
: +permTuple[1] || 0);
obj[role] = val;
return obj;
}, {});
Object.assign(rolesObj, permObj)
console.log(`Setting Permissions for model:${modelName} roles:${roles.join(', ')} , resolver: ${route}`);
Object.assign(rolesObj, permObj);
console.log(
`Setting Permissions for model:${modelName} roles:${roles.join(
', '
)} , resolver: ${route}`
);
}
})
});
}
}
} else {
for (const [route, rolesObj] of Object.entries(filePermissions)) {
resolvers.forEach(permission => {
const permTuple = permission.split('=')
const permTuple = permission.split('=');
if (route === permTuple[0] || permTuple[0] === '$') {
const permObj = users.reduce((obj, role) => {
const val = !!(permTuple.length === 1 ? 1 : +permTuple[1] || 0);
const val = !!(permTuple.length === 1
? 1
: +permTuple[1] || 0);
obj[role] = val;
return obj;
}, {});
Object.assign(rolesObj, permObj)
console.log(`Setting Permissions for model:${modelName} roles:${users} , resolver: ${route}`);
Object.assign(rolesObj, permObj);
console.log(
`Setting Permissions for model:${modelName} roles:${users} , resolver: ${route}`
);
}
})
});
}
}
const policyFileContent = `module.exports = ${JSON.stringify(filePermissions, null, 2)};\n`;
fs.writeFileSync(file, policyFileContent)
const policyFileContent = `module.exports = ${JSON.stringify(
filePermissions,
null,
2
)};\n`;
fs.writeFileSync(file, policyFileContent);
}
});
} catch (e) {
console.error(`Error in xc permissions.set`, e);
}
} else {
try {
if (args._.length < 4) {
console.warn('Invalid arguments for : xc permissions.set')
console.warn('Invalid arguments for : xc permissions.set');
return;
}
@ -117,72 +132,102 @@ class PermissionsMgr {
users = users.split('.');
/* get all policies */
const policiesPath = path.join(process.cwd(), 'server', PermissionsMgr.getPolicyPath(), '**', '*.routes.js');
glob.sync(policiesPath).forEach((file) => {
const policiesPath = path.join(
process.cwd(),
'server',
PermissionsMgr.getPolicyPath(),
'**',
'*.routes.js'
);
glob.sync(policiesPath).forEach(file => {
const modelName = path.basename(file).split('.')[0];
if (models.includes(modelName) || models[0] === '$') {
const routesList: Route[] = require(file);
const roles = this.extractUniqueRoles(routesList);
if (users[0] === '$') {
for (const route of routesList) {
if (permissions[0] === '$=1') {
const permObj = roles.reduce((obj, role) => {
obj[role] = true;
return obj;
}, {});
Object.assign(route.acl, permObj)
console.log(`Setting Permissions for model:${modelName} roles:${roles.join(', ')} method: ${route.type}=true, route: ${route.path}`);
Object.assign(route.acl, permObj);
console.log(
`Setting Permissions for model:${modelName} roles:${roles.join(
', '
)} method: ${route.type}=true, route: ${route.path}`
);
} else if (permissions[0] === '$=0') {
const permObj = roles.reduce((obj, role) => {
obj[role] = false;
return obj;
}, {});
Object.assign(route.acl, permObj)
console.log(`Setting Permissions for model:${modelName} roles:${roles.join(', ')} method: ${route.type}=false, route: ${route.path}`);
Object.assign(route.acl, permObj);
console.log(
`Setting Permissions for model:${modelName} roles:${roles.join(
', '
)} method: ${route.type}=false, route: ${route.path}`
);
} else {
permissions.forEach(permission => {
const permTuple = permission.split('=')
const val = !!(permTuple.length === 1 ? 1 : +permTuple[1] || 0);
const permTuple = permission.split('=');
const val = !!(permTuple.length === 1
? 1
: +permTuple[1] || 0);
const permObj = roles.reduce((obj, role) => {
obj[role] = val;
return obj;
}, {});
if (route.type === permTuple[0]) {
Object.assign(route.acl, permObj)
console.log(`Setting Permissions for model:${modelName} roles:${roles.join(', ')} method: ${permTuple[0]}=${val}, route: ${route.path}`);
Object.assign(route.acl, permObj);
console.log(
`Setting Permissions for model:${modelName} roles:${roles.join(
', '
)} method: ${permTuple[0]}=${val}, route: ${route.path}`
);
}
})
});
}
}
} else {
for (const route of routesList) {
permissions.forEach(permission => {
const permTuple = permission.split('=')
const val = !!(permTuple.length === 1 ? 1 : +permTuple[1] || 0);
const permTuple = permission.split('=');
const val = !!(permTuple.length === 1
? 1
: +permTuple[1] || 0);
const permObj = users.reduce((obj, role) => {
obj[role] = val;
return obj;
}, {});
if (route.type === permTuple[0]) {
Object.assign(route.acl, permObj)
console.log(`Setting Permissions for model:${modelName} roles:${users.join(', ')} method: ${permTuple[0]}=${val}, route: ${route.path}`);
Object.assign(route.acl, permObj);
console.log(
`Setting Permissions for model:${modelName} roles:${users.join(
', '
)} method: ${permTuple[0]}=${val}, route: ${route.path}`
);
} else if (permTuple[0] === '*') {
Object.assign(route.acl, permObj)
console.log(`Setting Permissions for model:${modelName} roles:${users.join(', ')} method: ${route.type}=${val}, route: ${route.path}`);
Object.assign(route.acl, permObj);
console.log(
`Setting Permissions for model:${modelName} roles:${users.join(
', '
)} method: ${route.type}=${val}, route: ${route.path}`
);
}
})
});
}
}
const policyFileContent = `module.exports = ${JSON.stringify(routesList, null, 2)};\n`;
fs.writeFileSync(file, policyFileContent)
const policyFileContent = `module.exports = ${JSON.stringify(
routesList,
null,
2
)};\n`;
fs.writeFileSync(file, policyFileContent);
}
});
} catch (e) {
@ -192,27 +237,30 @@ class PermissionsMgr {
}
public static async get(args) {
if (Util.isProjectGraphql()) {
try {
if (args._.length < 2) {
console.warn('Invalid arguments for : xc permissions.get')
console.warn('Invalid arguments for : xc permissions.get');
return;
}
let {1: models} = args._;
let { 1: models } = args._;
models = models.split('.');
/* get all policies */
const policiesPath = path.join(process.cwd(), 'server', PermissionsMgr.getPolicyPath(), '**', '*.policy.js');
const policiesPath = path.join(
process.cwd(),
'server',
PermissionsMgr.getPolicyPath(),
'**',
'*.policy.js'
);
// instantiate
let rows: any[] = [];
let roles: any[] = [];
glob.sync(policiesPath).forEach((file) => {
glob.sync(policiesPath).forEach(file => {
// let filePermissions = require(file);
const modelName = path.basename(file).split('.')[0];
@ -220,25 +268,25 @@ class PermissionsMgr {
if (models.includes(modelName)) {
const filePermissions = require(file);
roles = this.extractUniqueGqlPolicyRoles(filePermissions);
rows.push([{
colSpan: roles.length + 1,
content: colors.green(file),
hAlign: 'center'
}])
rows.push([
{
colSpan: roles.length + 1,
content: colors.green(file),
hAlign: 'center'
}
]);
for (const [route, methods] of Object.entries(filePermissions)) {
const row: any[] = [{content: route, vAlign: 'center'}];
const row: any[] = [{ content: route, vAlign: 'center' }];
for (const role of roles) {
row.push(methods[role] ? colors.green('✔') : colors.red('x'));
}
rows.push(row)
rows.push(row);
}
}
})
});
const table = new Table({
head: ['Route', ...roles]
@ -246,111 +294,126 @@ class PermissionsMgr {
table.push(...rows);
console.log(table.toString());
} catch (e) {
console.error(`Error in xc permissions.get`, e);
}
} else {
try {
if (args._.length < 2) {
console.warn('Invalid arguments for : xc permissions.get')
console.warn('Invalid arguments for : xc permissions.get');
return;
}
let {1: models} = args._;
let { 1: models } = args._;
models = models.split('.');
/* get all policies */
const policiesPath = path.join(process.cwd(), 'server', PermissionsMgr.getPolicyPath(), '**', '*.routes.js');
const policiesPath = path.join(
process.cwd(),
'server',
PermissionsMgr.getPolicyPath(),
'**',
'*.routes.js'
);
// instantiate
const table = new Table({
head: ['Route', 'Role', 'GET', 'POST', 'PUT', 'DELETE', 'PATCH']
});
glob.sync(policiesPath)
glob
.sync(policiesPath)
.sort(this.sortFiles)
.forEach((file) => {
.forEach(file => {
const modelName = path.basename(file).split('.')[0];
if (models.includes(modelName)) {
const routesList: Route[] = require(file);
const groupedRoutes = this.groupRoutes(routesList);
// extract unique roles
const roles = this.extractUniqueRoles(routesList);
table.push([{
colSpan: 7,
content: colors.green(file),
hAlign: 'center'
}])
table.push([
{
colSpan: 7,
content: colors.green(file),
hAlign: 'center'
}
]);
for (const [routePath, methods] of Object.entries(groupedRoutes)) {
for (const [routePath, methods] of Object.entries(
groupedRoutes
)) {
let i = 0;
for (const role of roles) {
{
table.push([...(i++ ? [] : [{
content: routePath,
rowSpan: roles.length,
vAlign: 'center'
}]), role,
methods?.get?.acl?.[role] ? colors.green('✔') : colors.red('x'),
methods?.post?.acl?.[role] ? colors.green('✔') : colors.red('x'),
methods?.put?.acl?.[role] ? colors.green('✔') : colors.red('x'),
methods?.delete?.acl?.[role] ? colors.green('✔') : colors.red('x'),
methods?.patch?.acl?.[role] ? colors.green('✔') : colors.red('x'),
] as any)
table.push([
...(i++
? []
: [
{
content: routePath,
rowSpan: roles.length,
vAlign: 'center'
}
]),
role,
methods?.get?.acl?.[role]
? colors.green('✔')
: colors.red('x'),
methods?.post?.acl?.[role]
? colors.green('✔')
: colors.red('x'),
methods?.put?.acl?.[role]
? colors.green('✔')
: colors.red('x'),
methods?.delete?.acl?.[role]
? colors.green('✔')
: colors.red('x'),
methods?.patch?.acl?.[role]
? colors.green('✔')
: colors.red('x')
] as any);
}
}
}
}
})
});
console.log(table.toString());
} catch (e) {
console.error(`Error in xc permissions.get`, e);
}
}
}
public static async userAdd(args) {
if (Util.isProjectGraphql()) {
try {
if (args._.length < 2) {
console.warn('Invalid arguments for : xc permissions.userAdd')
console.warn('Invalid arguments for : xc permissions.userAdd');
return;
}
const {1: user} = args._;
const { 1: user } = args._;
/* get all policies */
const policiesPath = path.join(process.cwd(), 'server', PermissionsMgr.getPolicyPath(), '**', '*.policy.js');
glob.sync(policiesPath).forEach((file) => {
const policiesPath = path.join(
process.cwd(),
'server',
PermissionsMgr.getPolicyPath(),
'**',
'*.policy.js'
);
glob.sync(policiesPath).forEach(file => {
const modelName = path.basename(file).split('.')[0];
const filePermissions = require(file);
const roles = this.extractUniqueGqlPolicyRoles(filePermissions);
if (roles.includes(user)) {
console.warn(`${user} already exist in ${modelName} policy`);
return;
@ -360,42 +423,45 @@ class PermissionsMgr {
roles1[user] = true;
}
console.log(
`Adding new role permission for model:${modelName} roles:${user}`
);
console.log(`Adding new role permission for model:${modelName} roles:${user}`);
const policyFileContent = `module.exports = ${JSON.stringify(filePermissions, null, 2)};\n`;
fs.writeFileSync(file, policyFileContent)
const policyFileContent = `module.exports = ${JSON.stringify(
filePermissions,
null,
2
)};\n`;
fs.writeFileSync(file, policyFileContent);
});
} catch (e) {
console.error(`Error in xc permissions.user.add`, e);
}
} else {
try {
if (args._.length < 2) {
console.warn('Invalid arguments for : xc permissions.userAdd')
console.warn('Invalid arguments for : xc permissions.userAdd');
return;
}
const {1: user} = args._;
const { 1: user } = args._;
/* get all policies */
const policiesPath = path.join(process.cwd(), 'server', PermissionsMgr.getPolicyPath(), '**', '*.routes.js');
glob.sync(policiesPath).forEach((file) => {
const policiesPath = path.join(
process.cwd(),
'server',
PermissionsMgr.getPolicyPath(),
'**',
'*.routes.js'
);
glob.sync(policiesPath).forEach(file => {
const modelName = path.basename(file).split('.')[0];
const routes: Route[] = require(file);
const roles = this.extractUniqueRoles(routes);
if (roles.includes(user)) {
console.warn(`${user} already exist in ${modelName} policy`);
return;
@ -405,49 +471,49 @@ class PermissionsMgr {
route.acl[user] = true;
}
console.log(
`Adding new role permission for model:${modelName} roles:${user}`
);
console.log(`Adding new role permission for model:${modelName} roles:${user}`);
const policyFileContent = `module.exports = ${JSON.stringify(routes, null, 2)};\n`;
fs.writeFileSync(file, policyFileContent)
const policyFileContent = `module.exports = ${JSON.stringify(
routes,
null,
2
)};\n`;
fs.writeFileSync(file, policyFileContent);
});
} catch (e) {
console.error(`Error in xc permissions.user.add`, e);
}
}
}
public static async userDelete(args) {
if (Util.isProjectGraphql()) {
try {
if (args._.length < 2) {
console.warn('Invalid arguments for : xc permissions.userAdd')
console.warn('Invalid arguments for : xc permissions.userAdd');
return;
}
const {1: user} = args._;
const { 1: user } = args._;
/* get all policies */
const policiesPath = path.join(process.cwd(), 'server', PermissionsMgr.getPolicyPath(), '**', '*.policy.js');
glob.sync(policiesPath).forEach((file) => {
const policiesPath = path.join(
process.cwd(),
'server',
PermissionsMgr.getPolicyPath(),
'**',
'*.policy.js'
);
glob.sync(policiesPath).forEach(file => {
const modelName = path.basename(file).split('.')[0];
const filePermissions = require(file);
const roles = this.extractUniqueGqlPolicyRoles(filePermissions);
if (!roles.includes(user)) {
console.warn(`${user} not exist in ${modelName} policy`);
return;
@ -457,40 +523,44 @@ class PermissionsMgr {
delete roles1[user];
}
console.log(
`Deleting user permission for model:${modelName} roles:${user}`
);
console.log(`Deleting user permission for model:${modelName} roles:${user}`);
const policyFileContent = `module.exports = ${JSON.stringify(filePermissions, null, 2)};\n`;
fs.writeFileSync(file, policyFileContent)
const policyFileContent = `module.exports = ${JSON.stringify(
filePermissions,
null,
2
)};\n`;
fs.writeFileSync(file, policyFileContent);
});
} catch (e) {
console.error(`Error in xc permissions.user.delete`, e);
}
} else {
try {
if (args._.length < 2) {
console.warn('Invalid arguments for : xc permissions.userAdd')
console.warn('Invalid arguments for : xc permissions.userAdd');
return;
}
const {1: user} = args._;
const { 1: user } = args._;
/* get all policies */
const policiesPath = path.join(process.cwd(), 'server', PermissionsMgr.getPolicyPath(), '**', '*.routes.js');
glob.sync(policiesPath).forEach((file) => {
const policiesPath = path.join(
process.cwd(),
'server',
PermissionsMgr.getPolicyPath(),
'**',
'*.routes.js'
);
glob.sync(policiesPath).forEach(file => {
const modelName = path.basename(file).split('.')[0];
const routes: Route[] = require(file);
const roles = this.extractUniqueRoles(routes)
const roles = this.extractUniqueRoles(routes);
if (!roles.includes(user)) {
console.warn(`${user} not exist in ${modelName} policy`);
@ -501,15 +571,17 @@ class PermissionsMgr {
delete route.acl[user];
}
console.log(
`Deleting user permission for model:${modelName} roles:${user}`
);
console.log(`Deleting user permission for model:${modelName} roles:${user}`);
const policyFileContent = `module.exports = ${JSON.stringify(routes, null, 2)};\n`;
fs.writeFileSync(file, policyFileContent)
const policyFileContent = `module.exports = ${JSON.stringify(
routes,
null,
2
)};\n`;
fs.writeFileSync(file, policyFileContent);
});
} catch (e) {
console.error(`Error in xc permissions.user.delete`, e);
}
@ -517,29 +589,31 @@ class PermissionsMgr {
}
public static async userRename(args) {
if (Util.isProjectGraphql()) {
try {
if (args._.length < 3) {
console.warn('Invalid arguments for : xc permissions.userAdd')
console.warn('Invalid arguments for : xc permissions.userAdd');
return;
}
const {1: oldUser, 2: newUser} = args._;
const { 1: oldUser, 2: newUser } = args._;
/* get all policies */
const policiesPath = path.join(process.cwd(), 'server', PermissionsMgr.getPolicyPath(), '**', '*.policy.js');
glob.sync(policiesPath).forEach((file) => {
const policiesPath = path.join(
process.cwd(),
'server',
PermissionsMgr.getPolicyPath(),
'**',
'*.policy.js'
);
glob.sync(policiesPath).forEach(file => {
const modelName = path.basename(file).split('.')[0];
const filePermissions = require(file);
const roles = this.extractUniqueGqlPolicyRoles(filePermissions);
if (!roles.includes(oldUser)) {
console.warn(`${oldUser} not exist in ${modelName} policy`);
return;
@ -554,33 +628,40 @@ class PermissionsMgr {
delete roles1[oldUser];
}
console.log(`Renaming user permission ${oldUser} to ${newUser} for model:${modelName}`);
const policyFileContent = `module.exports = ${JSON.stringify(filePermissions, null, 2)};\n`;
fs.writeFileSync(file, policyFileContent)
console.log(
`Renaming user permission ${oldUser} to ${newUser} for model:${modelName}`
);
const policyFileContent = `module.exports = ${JSON.stringify(
filePermissions,
null,
2
)};\n`;
fs.writeFileSync(file, policyFileContent);
});
} catch (e) {
console.error(`Error in xc permissions.user.delete`, e);
}
} else {
try {
if (args._.length < 3) {
console.warn('Invalid arguments for : xc permissions.userAdd')
console.warn('Invalid arguments for : xc permissions.userAdd');
return;
}
const {1: oldUser, 2: newUser} = args._;
const { 1: oldUser, 2: newUser } = args._;
/* get all policies */
const policiesPath = path.join(process.cwd(), 'server', PermissionsMgr.getPolicyPath(), '**', '*.routes.js');
glob.sync(policiesPath).forEach((file) => {
const policiesPath = path.join(
process.cwd(),
'server',
PermissionsMgr.getPolicyPath(),
'**',
'*.routes.js'
);
glob.sync(policiesPath).forEach(file => {
const modelName = path.basename(file).split('.')[0];
const routes: Route[] = require(file);
const roles = this.extractUniqueRoles(routes);
@ -599,13 +680,16 @@ class PermissionsMgr {
delete route.acl[oldUser];
}
console.log(`Renaming user permission ${oldUser} to ${newUser} for model:${modelName}`);
const policyFileContent = `module.exports = ${JSON.stringify(routes, null, 2)};\n`;
fs.writeFileSync(file, policyFileContent)
console.log(
`Renaming user permission ${oldUser} to ${newUser} for model:${modelName}`
);
const policyFileContent = `module.exports = ${JSON.stringify(
routes,
null,
2
)};\n`;
fs.writeFileSync(file, policyFileContent);
});
} catch (e) {
console.error(`Error in xc permissions.user.delete`, e);
}
@ -613,8 +697,9 @@ class PermissionsMgr {
}
public static getPolicyPath() {
const projectConfig = jsonfile.readFileSync(path.join(process.cwd(), 'config.xc.json'));
const projectConfig = jsonfile.readFileSync(
path.join(process.cwd(), 'config.xc.json')
);
return projectConfig.meta.projectType === 'rest' ? 'routers' : 'resolvers';
}
@ -626,14 +711,11 @@ class PermissionsMgr {
private static extractUniqueRoles(routesList: Route[]) {
const roles = routesList
.flatMap(
route => Object.keys(route.acl)
)
.flatMap(route => Object.keys(route.acl))
.filter((v, i, arr) => arr.indexOf(v) === i);
return roles;
}
private static groupRoutes(routes: Route[]): GroupedRoutes {
const groupedRoutes: GroupedRoutes = {};
for (const route of routes) {
@ -644,19 +726,22 @@ class PermissionsMgr {
}
private static sortFiles(file1: string, file2: string): number {
return ((file1.indexOf('.bt.') > -1 ? 1 : 0) || (file1.indexOf('.hm.') > -1 ? 2 : 0))
- ((file2.indexOf('.bt.') > -1 ? 1 : 0) || (file2.indexOf('.hm.') > -1 ? 2 : 0));
return (
((file1.indexOf('.bt.') > -1 ? 1 : 0) ||
(file1.indexOf('.hm.') > -1 ? 2 : 0)) -
((file2.indexOf('.bt.') > -1 ? 1 : 0) ||
(file2.indexOf('.hm.') > -1 ? 2 : 0))
);
}
}
export default PermissionsMgr;
export interface Route {
type: string;
path: string;
acl: {
[key: string]: boolean
[key: string]: boolean;
};
}
@ -668,9 +753,8 @@ export interface GroupedRoutes {
type: string;
path: string;
acl: {
[key: string]: boolean
[key: string]: boolean;
};
}
}
};
};
}

555
packages/nc-cli/src/lib/mgr/PermissionsMgrJs.ts

@ -9,28 +9,29 @@ import Util from '../util/Util';
import Table from 'cli-table3';
class PermissionsMgr {
public static async set(args) {
if (Util.isProjectGraphql()) {
try {
if (args._.length < 4) {
console.warn('Invalid arguments for : xc permissions.set')
console.warn('Invalid arguments for : xc permissions.set');
return;
}
// @ts-ignore
let [_, models, users, ...resolvers] = args._;
models = models.split('.');
users = users.split('.');
/* get all policies */
const policiesPath = path.join(process.cwd(), 'server', PermissionsMgr.getPolicyPath(), '**', '*.policy.js');
glob.sync(policiesPath).forEach((file) => {
const policiesPath = path.join(
process.cwd(),
'server',
PermissionsMgr.getPolicyPath(),
'**',
'*.policy.js'
);
glob.sync(policiesPath).forEach(file => {
const modelName = path.basename(file).split('.')[0];
if (models.includes(modelName) || models[0] === '$') {
@ -42,80 +43,92 @@ class PermissionsMgr {
if (users[0] === '$') {
for (const [route, rolesObj] of Object.entries(filePermissions)) {
if (resolvers[0] === '$=1') {
const permObj = roles.reduce((obj, role) => {
obj[role] = true;
return obj;
}, {});
Object.assign(rolesObj, permObj)
console.log(`Setting Permissions for model:${modelName} roles:${roles.join(', ')} resolver: ${route}`);
Object.assign(rolesObj, permObj);
console.log(
`Setting Permissions for model:${modelName} roles:${roles.join(
', '
)} resolver: ${route}`
);
} else if (resolvers[0] === '$=0') {
const permObj = roles.reduce((obj, role) => {
obj[role] = false;
return obj;
}, {});
Object.assign(rolesObj, permObj)
console.log(`Setting Permissions for model:${modelName} roles:${roles.join(', ')} resolver: ${route}`);
Object.assign(rolesObj, permObj);
console.log(
`Setting Permissions for model:${modelName} roles:${roles.join(
', '
)} resolver: ${route}`
);
} else {
resolvers.forEach(permission => {
const permTuple = permission.split('=')
const permTuple = permission.split('=');
if (route === permTuple[0]) {
const permObj = roles.reduce((obj, role) => {
const val = !!(permTuple.length === 1 ? 1 : +permTuple[1] || 0);
const val = !!(permTuple.length === 1
? 1
: +permTuple[1] || 0);
obj[role] = val;
return obj;
}, {});
Object.assign(rolesObj, permObj)
console.log(`Setting Permissions for model:${modelName} roles:${roles.join(', ')} , resolver: ${route}`);
Object.assign(rolesObj, permObj);
console.log(
`Setting Permissions for model:${modelName} roles:${roles.join(
', '
)} , resolver: ${route}`
);
}
})
});
}
}
} else {
for (const [route, rolesObj] of Object.entries(filePermissions)) {
resolvers.forEach(permission => {
const permTuple = permission.split('=')
const permTuple = permission.split('=');
if (route === permTuple[0]) {
const permObj = roles.reduce((obj, role) => {
const val = !!(permTuple.length === 1 ? 1 : +permTuple[1] || 0);
const val = !!(permTuple.length === 1
? 1
: +permTuple[1] || 0);
obj[role] = val;
return obj;
}, {});
Object.assign(rolesObj, permObj)
console.log(`Setting Permissions for model:${modelName} roles:${roles.join(', ')} , resolver: ${route}`);
Object.assign(rolesObj, permObj);
console.log(
`Setting Permissions for model:${modelName} roles:${roles.join(
', '
)} , resolver: ${route}`
);
}
})
});
}
}
const policyFileContent = `module.exports.permissions = ${JSON.stringify(filePermissions, null, 2)};\n`;
fs.writeFileSync(file, policyFileContent)
const policyFileContent = `module.exports.permissions = ${JSON.stringify(
filePermissions,
null,
2
)};\n`;
fs.writeFileSync(file, policyFileContent);
}
});
} catch (e) {
console.error(`Error in xc permissions.set`, e);
}
} else {
try {
if (args._.length < 4) {
console.warn('Invalid arguments for : xc permissions.set')
console.warn('Invalid arguments for : xc permissions.set');
return;
}
// @ts-ignore
let [_, models, users, ...permissions] = args._;
@ -123,29 +136,28 @@ class PermissionsMgr {
users = users.split('.');
/* get all policies */
const policiesPath = path.join(process.cwd(), 'server', PermissionsMgr.getPolicyPath(), '**', '*.policy.js');
glob.sync(policiesPath).forEach((file) => {
const policiesPath = path.join(
process.cwd(),
'server',
PermissionsMgr.getPolicyPath(),
'**',
'*.policy.js'
);
glob.sync(policiesPath).forEach(file => {
const modelName = path.basename(file).split('.')[0];
if (models.includes(modelName) || models[0] === '$') {
const filePermissions = require(file).permissions;
if (users[0] === '$') {
const roles = Object.values(filePermissions)
.flatMap(
methods => Object.values(methods)
.flatMap(roles1 => Object.keys(roles1))
.flatMap(methods =>
Object.values(methods).flatMap(roles1 => Object.keys(roles1))
)
.filter((v, i, arr) => arr.indexOf(v) === i);
for (const [route, methods] of Object.entries(filePermissions)) {
if (permissions[0] === '$=1') {
const permObj = roles.reduce((obj, role) => {
obj[role] = true;
@ -153,8 +165,12 @@ class PermissionsMgr {
}, {});
for (const [method, rolesObj] of Object.entries(methods)) {
Object.assign(rolesObj, permObj)
console.log(`Setting Permissions for model:${modelName} roles:${roles.join(', ')} method: ${method}=true, route: ${route}`);
Object.assign(rolesObj, permObj);
console.log(
`Setting Permissions for model:${modelName} roles:${roles.join(
', '
)} method: ${method}=true, route: ${route}`
);
}
} else if (permissions[0] === '$=0') {
const permObj = roles.reduce((obj, role) => {
@ -162,59 +178,74 @@ class PermissionsMgr {
return obj;
}, {});
for (const [method, rolesObj] of Object.entries(methods)) {
Object.assign(rolesObj, permObj)
console.log(`Setting Permissions for model:${modelName} roles:${roles.join(', ')} method: ${method}=false, route: ${route}`);
Object.assign(rolesObj, permObj);
console.log(
`Setting Permissions for model:${modelName} roles:${roles.join(
', '
)} method: ${method}=false, route: ${route}`
);
}
} else {
permissions.forEach(permission => {
const permTuple = permission.split('=')
const val = !!(permTuple.length === 1 ? 1 : +permTuple[1] || 0);
const permTuple = permission.split('=');
const val = !!(permTuple.length === 1
? 1
: +permTuple[1] || 0);
const permObj = roles.reduce((obj, role) => {
obj[role] = val;
return obj;
}, {});
if (methods[permTuple[0]]) {
Object.assign(methods[permTuple[0]], permObj)
console.log(`Setting Permissions for model:${modelName} roles:${roles.join(', ')} method: ${permTuple[0]}=${val}, route: ${route}`);
Object.assign(methods[permTuple[0]], permObj);
console.log(
`Setting Permissions for model:${modelName} roles:${roles.join(
', '
)} method: ${permTuple[0]}=${val}, route: ${route}`
);
}
})
});
}
}
} else {
for (const [route, methods] of Object.entries(filePermissions)) {
permissions.forEach(permission => {
const permTuple = permission.split('=')
const val = !!(permTuple.length === 1 ? 1 : +permTuple[1] || 0);
const permTuple = permission.split('=');
const val = !!(permTuple.length === 1
? 1
: +permTuple[1] || 0);
const permObj = users.reduce((obj, role) => {
obj[role] = val;
return obj;
}, {});
if (methods[permTuple[0]]) {
Object.assign(methods[permTuple[0]], permObj)
console.log(`Setting Permissions for model:${modelName} roles:${users.join(', ')} method: ${permTuple[0]}=${val}, route: ${route}`);
Object.assign(methods[permTuple[0]], permObj);
console.log(
`Setting Permissions for model:${modelName} roles:${users.join(
', '
)} method: ${permTuple[0]}=${val}, route: ${route}`
);
} else if (permTuple[0] === '*') {
for (const [method, rolesObj] of Object.entries(methods)) {
Object.assign(rolesObj, permObj)
console.log(`Setting Permissions for model:${modelName} roles:${users.join(', ')} method: ${method}=${val}, route: ${route}`);
Object.assign(rolesObj, permObj);
console.log(
`Setting Permissions for model:${modelName} roles:${users.join(
', '
)} method: ${method}=${val}, route: ${route}`
);
}
}
})
});
}
}
const policyFileContent = `module.exports.permissions = ${JSON.stringify(filePermissions, null, 2)};\n`;
fs.writeFileSync(file, policyFileContent)
const policyFileContent = `module.exports.permissions = ${JSON.stringify(
filePermissions,
null,
2
)};\n`;
fs.writeFileSync(file, policyFileContent);
}
});
} catch (e) {
console.error(`Error in xc permissions.set`, e);
}
@ -222,27 +253,30 @@ class PermissionsMgr {
}
public static async get(args) {
if (Util.isProjectGraphql()) {
try {
if (args._.length < 2) {
console.warn('Invalid arguments for : xc permissions.get')
console.warn('Invalid arguments for : xc permissions.get');
return;
}
let {1: models} = args._;
let { 1: models } = args._;
models = models.split('.');
/* get all policies */
const policiesPath = path.join(process.cwd(), 'server', PermissionsMgr.getPolicyPath(), '**', '*.policy.js');
const policiesPath = path.join(
process.cwd(),
'server',
PermissionsMgr.getPolicyPath(),
'**',
'*.policy.js'
);
// instantiate
let rows: any[] = [];
let roles: any[] = [];
glob.sync(policiesPath).forEach((file) => {
glob.sync(policiesPath).forEach(file => {
// let filePermissions = require(file).permissions;
const modelName = path.basename(file).split('.')[0];
@ -250,28 +284,27 @@ class PermissionsMgr {
if (models.includes(modelName)) {
const filePermissions = require(file).permissions;
roles = Object.values(filePermissions)
.flatMap(
roles1 => Object.keys(roles1))
.flatMap(roles1 => Object.keys(roles1))
.filter((v, i, arr) => arr.indexOf(v) === i);
rows.push([{
colSpan: roles.length + 1,
content: colors.green(file),
hAlign: 'center'
}])
rows.push([
{
colSpan: roles.length + 1,
content: colors.green(file),
hAlign: 'center'
}
]);
for (const [route, methods] of Object.entries(filePermissions)) {
const row: any[] = [{content: route, vAlign: 'center'}];
const row: any[] = [{ content: route, vAlign: 'center' }];
for (const role of roles) {
row.push(methods[role] ? colors.green('✔') : colors.red('x'));
}
rows.push(row)
rows.push(row);
}
}
})
});
const table = new Table({
head: ['Route', ...roles]
@ -279,84 +312,97 @@ class PermissionsMgr {
table.push(...rows);
console.log(table.toString());
} catch (e) {
console.error(`Error in xc permissions.get`, e);
}
}
else {
} else {
try {
if (args._.length < 2) {
console.warn('Invalid arguments for : xc permissions.get')
console.warn('Invalid arguments for : xc permissions.get');
return;
}
let {1:models} = args._;
let { 1: models } = args._;
models = models.split('.');
/* get all policies */
const policiesPath = path.join(process.cwd(), 'server', PermissionsMgr.getPolicyPath(), '**', '*.policy.js');
const policiesPath = path.join(
process.cwd(),
'server',
PermissionsMgr.getPolicyPath(),
'**',
'*.policy.js'
);
// instantiate
const table = new Table({
head: ['Route', 'Role', 'GET', 'POST', 'PUT', 'DELETE', 'PATCH']
});
glob.sync(policiesPath).forEach((file) => {
glob.sync(policiesPath).forEach(file => {
const modelName = path.basename(file).split('.')[0];
if (models.includes(modelName)) {
if (models.includes(modelName)) {
const filePermissions: { readonly [key: string]: any } = require(file).permissions;
const filePermissions: {
readonly [key: string]: any;
} = require(file).permissions;
const roles = Object.values(filePermissions)
.flatMap(
methods => Object.values(methods)
.flatMap(roles1 => Object.keys(roles1))
.flatMap(methods =>
Object.values(methods).flatMap(roles1 => Object.keys(roles1))
)
.filter((v, i, arr) => arr.indexOf(v) === i);
table.push([{
colSpan: 7,
content: colors.green(file),
hAlign: 'center'
}])
table.push([
{
colSpan: 7,
content: colors.green(file),
hAlign: 'center'
}
]);
for (const [route, methods] of Object.entries(filePermissions)) {
let i = 0;
for (const role of roles) {
{
table.push([...(i++ ? [] : [{
content: route,
rowSpan: roles.length,
vAlign: 'center'
}]), role,
methods.get && methods.get[role] ? colors.green('✔') : colors.red('x'),
methods.post && methods.post[role] ? colors.green('✔') : colors.red('x'),
methods.put && methods.put[role] ? colors.green('✔') : colors.red('x'),
methods.delete && methods.delete[role] ? colors.green('✔') : colors.red('x'),
methods.patch && methods.patch[role] ? colors.green('✔') : colors.red('x'),
] as any)
table.push([
...(i++
? []
: [
{
content: route,
rowSpan: roles.length,
vAlign: 'center'
}
]),
role,
methods.get && methods.get[role]
? colors.green('✔')
: colors.red('x'),
methods.post && methods.post[role]
? colors.green('✔')
: colors.red('x'),
methods.put && methods.put[role]
? colors.green('✔')
: colors.red('x'),
methods.delete && methods.delete[role]
? colors.green('✔')
: colors.red('x'),
methods.patch && methods.patch[role]
? colors.green('✔')
: colors.red('x')
] as any);
}
}
}
}
// console.log(`Model : ${modelName} \n${JSON.stringify(filePermissions, 0, 2)} `)
}
})
});
console.log(table.toString());
} catch (e) {
console.error(`Error in xc permissions.get`, e);
}
@ -364,32 +410,33 @@ class PermissionsMgr {
}
public static async userAdd(args) {
if (Util.isProjectGraphql()) {
try {
if (args._.length < 2) {
console.warn('Invalid arguments for : xc permissions.userAdd')
console.warn('Invalid arguments for : xc permissions.userAdd');
return;
}
const {1: user} = args._;
const { 1: user } = args._;
/* get all policies */
const policiesPath = path.join(process.cwd(), 'server', PermissionsMgr.getPolicyPath(), '**', '*.policy.js');
glob.sync(policiesPath).forEach((file) => {
const policiesPath = path.join(
process.cwd(),
'server',
PermissionsMgr.getPolicyPath(),
'**',
'*.policy.js'
);
glob.sync(policiesPath).forEach(file => {
const modelName = path.basename(file).split('.')[0];
const filePermissions = require(file).permissions;
const roles = Object.values(filePermissions)
.flatMap(roles1 => Object.keys(roles1))
.filter((v, i, arr) => arr.indexOf(v) === i);
if (roles.includes(user)) {
console.warn(`${user} already exist in ${modelName} policy`);
return;
@ -399,47 +446,49 @@ class PermissionsMgr {
roles1[user] = true;
}
console.log(
`Adding new role permission for model:${modelName} roles:${user}`
);
console.log(`Adding new role permission for model:${modelName} roles:${user}`);
const policyFileContent = `module.exports.permissions = ${JSON.stringify(filePermissions, null, 2)};\n`;
fs.writeFileSync(file, policyFileContent)
const policyFileContent = `module.exports.permissions = ${JSON.stringify(
filePermissions,
null,
2
)};\n`;
fs.writeFileSync(file, policyFileContent);
});
} catch (e) {
console.error(`Error in xc permissions.user.add`, e);
}
} else {
try {
if (args._.length < 2) {
console.warn('Invalid arguments for : xc permissions.userAdd')
console.warn('Invalid arguments for : xc permissions.userAdd');
return;
}
const {1: user} = args._;
const { 1: user } = args._;
/* get all policies */
const policiesPath = path.join(process.cwd(), 'server', PermissionsMgr.getPolicyPath(), '**', '*.policy.js');
glob.sync(policiesPath).forEach((file) => {
const policiesPath = path.join(
process.cwd(),
'server',
PermissionsMgr.getPolicyPath(),
'**',
'*.policy.js'
);
glob.sync(policiesPath).forEach(file => {
const modelName = path.basename(file).split('.')[0];
const filePermissions = require(file).permissions;
const roles = Object.values(filePermissions)
.flatMap(
methods => Object.values(methods)
.flatMap(roles1 => Object.keys(roles1))
.flatMap(methods =>
Object.values(methods).flatMap(roles1 => Object.keys(roles1))
)
.filter((v, i, arr) => arr.indexOf(v) === i);
if (roles.includes(user)) {
console.warn(`${user} already exist in ${modelName} policy`);
return;
@ -451,50 +500,51 @@ class PermissionsMgr {
}
}
console.log(
`Adding new role permission for model:${modelName} roles:${user}`
);
console.log(`Adding new role permission for model:${modelName} roles:${user}`);
const policyFileContent = `module.exports.permissions = ${JSON.stringify(filePermissions, null, 2)};\n`;
fs.writeFileSync(file, policyFileContent)
const policyFileContent = `module.exports.permissions = ${JSON.stringify(
filePermissions,
null,
2
)};\n`;
fs.writeFileSync(file, policyFileContent);
});
} catch (e) {
console.error(`Error in xc permissions.user.add`, e);
}
}
}
public static async userDelete(args) {
if (Util.isProjectGraphql()) {
try {
if (args._.length < 2) {
console.warn('Invalid arguments for : xc permissions.userAdd')
console.warn('Invalid arguments for : xc permissions.userAdd');
return;
}
const {1: user} = args._;
const { 1: user } = args._;
/* get all policies */
const policiesPath = path.join(process.cwd(), 'server', PermissionsMgr.getPolicyPath(), '**', '*.policy.js');
glob.sync(policiesPath).forEach((file) => {
const policiesPath = path.join(
process.cwd(),
'server',
PermissionsMgr.getPolicyPath(),
'**',
'*.policy.js'
);
glob.sync(policiesPath).forEach(file => {
const modelName = path.basename(file).split('.')[0];
const filePermissions = require(file).permissions;
const roles = Object.values(filePermissions)
.flatMap(roles1 => Object.keys(roles1))
.filter((v, i, arr) => arr.indexOf(v) === i);
if (!roles.includes(user)) {
console.warn(`${user} not exist in ${modelName} policy`);
return;
@ -504,46 +554,49 @@ class PermissionsMgr {
delete roles1[user];
}
console.log(
`Deleting user permission for model:${modelName} roles:${user}`
);
console.log(`Deleting user permission for model:${modelName} roles:${user}`);
const policyFileContent = `module.exports.permissions = ${JSON.stringify(filePermissions, null, 2)};\n`;
fs.writeFileSync(file, policyFileContent)
const policyFileContent = `module.exports.permissions = ${JSON.stringify(
filePermissions,
null,
2
)};\n`;
fs.writeFileSync(file, policyFileContent);
});
} catch (e) {
console.error(`Error in xc permissions.user.delete`, e);
}
} else {
try {
if (args._.length < 2) {
console.warn('Invalid arguments for : xc permissions.userAdd')
console.warn('Invalid arguments for : xc permissions.userAdd');
return;
}
const {1: user} = args._;
const { 1: user } = args._;
/* get all policies */
const policiesPath = path.join(process.cwd(), 'server', PermissionsMgr.getPolicyPath(), '**', '*.policy.js');
glob.sync(policiesPath).forEach((file) => {
const policiesPath = path.join(
process.cwd(),
'server',
PermissionsMgr.getPolicyPath(),
'**',
'*.policy.js'
);
glob.sync(policiesPath).forEach(file => {
const modelName = path.basename(file).split('.')[0];
const filePermissions = require(file).permissions;
const roles = Object.values(filePermissions)
.flatMap(
methods => Object.values(methods)
.flatMap(roles1 => Object.keys(roles1))
.flatMap(methods =>
Object.values(methods).flatMap(roles1 => Object.keys(roles1))
)
.filter((v, i, arr) => arr.indexOf(v) === i);
if (!roles.includes(user)) {
console.warn(`${user} not exist in ${modelName} policy`);
return;
@ -555,15 +608,17 @@ class PermissionsMgr {
}
}
console.log(
`Deleting user permission for model:${modelName} roles:${user}`
);
console.log(`Deleting user permission for model:${modelName} roles:${user}`);
const policyFileContent = `module.exports.permissions = ${JSON.stringify(filePermissions, null, 2)};\n`;
fs.writeFileSync(file, policyFileContent)
const policyFileContent = `module.exports.permissions = ${JSON.stringify(
filePermissions,
null,
2
)};\n`;
fs.writeFileSync(file, policyFileContent);
});
} catch (e) {
console.error(`Error in xc permissions.user.delete`, e);
}
@ -571,31 +626,33 @@ class PermissionsMgr {
}
public static async userRename(args) {
if (Util.isProjectGraphql()) {
try {
if (args._.length < 3) {
console.warn('Invalid arguments for : xc permissions.userAdd')
console.warn('Invalid arguments for : xc permissions.userAdd');
return;
}
const {1: oldUser,2: newUser} = args._;
const { 1: oldUser, 2: newUser } = args._;
/* get all policies */
const policiesPath = path.join(process.cwd(), 'server', PermissionsMgr.getPolicyPath(), '**', '*.policy.js');
glob.sync(policiesPath).forEach((file) => {
const policiesPath = path.join(
process.cwd(),
'server',
PermissionsMgr.getPolicyPath(),
'**',
'*.policy.js'
);
glob.sync(policiesPath).forEach(file => {
const modelName = path.basename(file).split('.')[0];
const filePermissions = require(file).permissions;
const roles = Object.values(filePermissions)
.flatMap(roles1 => Object.keys(roles1))
.filter((v, i, arr) => arr.indexOf(v) === i);
if (!roles.includes(oldUser)) {
console.warn(`${oldUser} not exist in ${modelName} policy`);
return;
@ -610,43 +667,48 @@ class PermissionsMgr {
delete roles1[oldUser];
}
console.log(`Renaming user permission ${oldUser} to ${newUser} for model:${modelName}`);
const policyFileContent = `module.exports.permissions = ${JSON.stringify(filePermissions, null, 2)};\n`;
fs.writeFileSync(file, policyFileContent)
console.log(
`Renaming user permission ${oldUser} to ${newUser} for model:${modelName}`
);
const policyFileContent = `module.exports.permissions = ${JSON.stringify(
filePermissions,
null,
2
)};\n`;
fs.writeFileSync(file, policyFileContent);
});
} catch (e) {
console.error(`Error in xc permissions.user.delete`, e);
}
} else {
try {
if (args._.length < 3) {
console.warn('Invalid arguments for : xc permissions.userAdd')
console.warn('Invalid arguments for : xc permissions.userAdd');
return;
}
const {1: oldUser, 2:newUser} = args._;
const { 1: oldUser, 2: newUser } = args._;
/* get all policies */
const policiesPath = path.join(process.cwd(), 'server', PermissionsMgr.getPolicyPath(), '**', '*.policy.js');
glob.sync(policiesPath).forEach((file) => {
const policiesPath = path.join(
process.cwd(),
'server',
PermissionsMgr.getPolicyPath(),
'**',
'*.policy.js'
);
glob.sync(policiesPath).forEach(file => {
const modelName = path.basename(file).split('.')[0];
const filePermissions = require(file).permissions;
const roles = Object.values(filePermissions)
.flatMap(
methods => Object.values(methods)
.flatMap(roles1 => Object.keys(roles1))
.flatMap(methods =>
Object.values(methods).flatMap(roles1 => Object.keys(roles1))
)
.filter((v, i, arr) => arr.indexOf(v) === i);
if (!roles.includes(oldUser)) {
console.warn(`${oldUser} not exist in ${modelName} policy`);
return;
@ -663,27 +725,28 @@ class PermissionsMgr {
}
}
console.log(`Renaming user permission ${oldUser} to ${newUser} for model:${modelName}`);
const policyFileContent = `module.exports.permissions = ${JSON.stringify(filePermissions, null, 2)};\n`;
fs.writeFileSync(file, policyFileContent)
console.log(
`Renaming user permission ${oldUser} to ${newUser} for model:${modelName}`
);
const policyFileContent = `module.exports.permissions = ${JSON.stringify(
filePermissions,
null,
2
)};\n`;
fs.writeFileSync(file, policyFileContent);
});
} catch (e) {
console.error(`Error in xc permissions.user.delete`, e);
}
}
}
public static getPolicyPath() {
const projectConfig = jsonfile.readFileSync(path.join(process.cwd(), 'config.xc.json'));
const projectConfig = jsonfile.readFileSync(
path.join(process.cwd(), 'config.xc.json')
);
return projectConfig.meta.projectType === 'rest' ? 'routers' : 'resolvers';
}
}
export default PermissionsMgr;

93
packages/nc-cli/src/lib/mgr/SocialMgr.ts

@ -6,41 +6,34 @@ import Locales from '../util/Locales';
import socialShareRules from './cliRules.json';
import socialText from './SocialText';
class SocialMgr {
public static async share(args) {
try {
const shareUrl = await SocialMgr.getShareUrl({
text: 'A revolutionary API framework with a Desktop App.',
type: args.type,
url: 'https://NocoDB.com'
});
open(shareUrl, {wait: true});
open(shareUrl, { wait: true });
} catch (e) {
console.error(`Error in xc ${args.type}`, e);
}
}
public static async shareSocial(_args = {}) {
try {
const prompt: any = Locales.getPrompt();
const prompt:any = Locales.getPrompt();
const answer = await inquirer
.prompt([
{
choices: prompt.choices,
message: prompt.message,
name: 'media',
type: 'list'
}
])
const answer = await inquirer.prompt([
{
choices: prompt.choices,
message: prompt.message,
name: 'media',
type: 'list'
}
]);
switch (answer.media) {
case 'Next time':
break;
@ -52,10 +45,9 @@ class SocialMgr {
break;
case 'Github - ⭐ or 👀 repo':
open('https://github.com/NocoDB/NocoDB', {wait: true});
open('https://github.com/NocoDB/NocoDB', { wait: true });
break;
default:
const text = SocialMgr.getShareText(answer.media);
// const url = SocialMgr._getShareContentSuffix(answer.media);
@ -65,26 +57,21 @@ class SocialMgr {
url: 'https://NocoDB.com'
});
open(shareUrl, {wait: true});
open(shareUrl, { wait: true });
break;
}
} catch (e) {
console.error(`Error in xc share`, e);
}
}
public static getShareUrl({type, url, text}):any {
const encUrl = encodeURIComponent(url)
const encText = encodeURIComponent(text)
public static getShareUrl({ type, url, text }): any {
const encUrl = encodeURIComponent(url);
const encText = encodeURIComponent(text);
console.log(__dirname, process.cwd());
switch (type) {
case 'Twitter':
return `https://twitter.com/intent/tweet?url=${encUrl}&text=${encText}&hashtags=xgenecloud`;
break;
@ -134,36 +121,43 @@ class SocialMgr {
break;
case 'OKru':
return `https://connect.ok.ru/dk?st.cmd=WidgetSharePreview&st.shareUrl=${encUrl}`
return `https://connect.ok.ru/dk?st.cmd=WidgetSharePreview&st.shareUrl=${encUrl}`;
break;
case 'WeChat':
return `https://www.addtoany.com/add_to/wechat?linkurl=${encUrl}&linkname=${encText}`;
break;
}
}
public static setShareRules(key, value) {
socialShareRules[key] = value;
fs.writeFileSync(path.join(__dirname, 'cliRules.json'), JSON.stringify(socialShareRules));
fs.writeFileSync(
path.join(__dirname, 'cliRules.json'),
JSON.stringify(socialShareRules)
);
}
public static setCreatedApis(value) {
if (socialShareRules.dontPrompt) { return }
if (socialShareRules.dontPrompt) {
return;
}
socialShareRules.createdApis = value;
socialShareRules.prompt = value;
fs.writeFileSync(path.join(__dirname, 'cliRules.json'), JSON.stringify(socialShareRules));
fs.writeFileSync(
path.join(__dirname, 'cliRules.json'),
JSON.stringify(socialShareRules)
);
}
public static async showPrompt() {
try {
if (socialShareRules.createdApis && socialShareRules.prompt && !socialShareRules.dontPrompt) {
await SocialMgr.shareSocial()
if (
socialShareRules.createdApis &&
socialShareRules.prompt &&
!socialShareRules.dontPrompt
) {
await SocialMgr.shareSocial();
SocialMgr.setShareRules('prompt', false);
}
} catch (e) {
@ -171,15 +165,18 @@ class SocialMgr {
}
}
public static getShareText(socialMediaType) {
return SocialMgr._getShareContentPrefix(socialMediaType) +
SocialMgr._getShareContentMid(socialMediaType) +
SocialMgr._getShareContentSuffix(socialMediaType)
return (
SocialMgr._getShareContentPrefix(socialMediaType) +
SocialMgr._getShareContentMid(socialMediaType) +
SocialMgr._getShareContentSuffix(socialMediaType)
);
}
public static _getShareContentPrefix(_socialMediaType) {
return socialText.prefix[Math.floor(Math.random() * socialText.prefix.length)];
return socialText.prefix[
Math.floor(Math.random() * socialText.prefix.length)
];
}
public static _getShareContentMid(_socialMediaType) {
@ -187,12 +184,10 @@ class SocialMgr {
}
public static _getShareContentSuffix(_socialMediaType) {
return socialText.suffix[Math.floor(Math.random() * socialText.suffix.length)];
return socialText.suffix[
Math.floor(Math.random() * socialText.suffix.length)
];
}
}
export default SocialMgr;

19
packages/nc-cli/src/lib/mgr/SocialText.ts

@ -1,5 +1,7 @@
export default {
mid: ['\n@NocoDB - generates instant REST/GraphQL API on any database.\n+ Has GUI based schema migrations!\n+ Built in API-Client and terminal!\n+ Dark theme and much more!\n'],
mid: [
'\n@NocoDB - generates instant REST/GraphQL API on any database.\n+ Has GUI based schema migrations!\n+ Built in API-Client and terminal!\n+ Dark theme and much more!\n'
],
prefix: [
'Super slick!',
'Very handy!',
@ -64,7 +66,6 @@ export default {
'Woah, Extremely Interesting!',
'Woah, So useful!',
'Super slick API Framework!',
'Very handy API Framework!',
'Impressive API Framework!',
@ -86,17 +87,11 @@ export default {
'Extremely Interesting API Framework!',
'So useful API Framework',
'Cool Stuff!',
'Woha!',
'I\'m amazed by how well this works!',
'I\'m impressed by how well this works!',
"I'm amazed by how well this works!",
"I'm impressed by how well this works!"
],
suffix: [
'https://github.com/nocodb/nocodb',
'www.nocodb.com'
]
}
suffix: ['https://github.com/nocodb/nocodb', 'www.nocodb.com']
};

280
packages/nc-cli/src/lib/mgr/TryMgr.ts

@ -1,10 +1,10 @@
import chalkPipe from 'chalk-pipe';
import inquirer from 'inquirer';
import path from 'path';
import tcpPortUsed from 'tcp-port-used';
import URL from 'url';
import Util from "../util/Util";
import path from 'path';
import Lang, {STR} from "../util/Lang";
import Lang, { STR } from '../util/Lang';
import Util from '../util/Util';
import('colors');
@ -36,12 +36,10 @@ const dbDefaults = {
username: 'sa',
password: '',
database: ''
},
}
};
class TryMgr {
/**
*
* Does the below :
@ -57,139 +55,151 @@ class TryMgr {
let dbUrl;
if (args._[0] !== 't' && args._[0] !== 'try') {
if ( args._[1] === 'rest') {
if (args._[1] === 'rest') {
dbUrl = `sqlite3://sqlite3?d=${path.join(__dirname, 'sakila.db')}`;
} else if (args._[1] === 'gql') {
dbUrl = `sqlite3://sqlite3?d=${path.join(__dirname, 'sakila.db')}&api=graphql`;
dbUrl = `sqlite3://sqlite3?d=${path.join(
__dirname,
'sakila.db'
)}&api=graphql`;
}
} else {
/* Construct database URL from prompt */
const dbTypes = Object.keys(dbDefaults);
args.url = []
args.url = [];
const finalAnswers = await inquirer
.prompt([
{
name: 'type',
type: 'list',
message: Lang.getString(STR.DB_TYPE),// '🔥 Choose SQL Database type\t:',
choices: dbTypes.map(t => ({
name: t,
value: t,
short: t.green.bold
})),
default: 'mysql2',
transformer(color) {
return chalkPipe(color)(color.green.bold);
}
const finalAnswers = await inquirer.prompt([
{
name: 'type',
type: 'list',
message: Lang.getString(STR.DB_TYPE), // '🔥 Choose SQL Database type\t:',
choices: dbTypes.map(t => ({
name: t,
value: t,
short: t.green.bold
})),
default: 'mysql2',
transformer(color) {
return chalkPipe(color)(color.green.bold);
}
},
{
name: 'host',
type: 'input',
message: Lang.getString(STR.DB_HOST), // '👉 Enter database host name\t:',
default(ans) {
return dbDefaults[ans.type].host;
},
transformer(color) {
return chalkPipe(color)(color.green.bold);
},
when({ type }) {
return type !== 'sqlite3';
}
},
{
name: 'port',
type: 'number',
message: Lang.getString(STR.DB_PORT), // '👉 Enter database port number\t:',
default(ans) {
return dbDefaults[ans.type].port;
},
{
name: 'host',
type: 'input',
message: Lang.getString(STR.DB_HOST),// '👉 Enter database host name\t:',
default(ans) {
return dbDefaults[ans.type].host
},
transformer(color) {
return chalkPipe(color)(color.green.bold);
},
when({type}) {
return type !== 'sqlite3'
transformer(color) {
try {
return color.green.bold;
} catch (e) {
return color;
}
},
{
name: 'port',
type: 'number',
message: Lang.getString(STR.DB_PORT),// '👉 Enter database port number\t:',
default(ans) {
return dbDefaults[ans.type].port
},
transformer(color) {
try {
return color.green.bold;
} catch (e) {
return color
}
},
validate(port, answers) {
const done = this.async();
if (answers.host === 'host.docker.internal' || answers.host === 'docker.for.win.localhost') {
done(null, true)
} else {
TryMgr.isPortOpen(answers.host, port).then(isOpen => {
validate(port, answers) {
const done = this.async();
if (
answers.host === 'host.docker.internal' ||
answers.host === 'docker.for.win.localhost'
) {
done(null, true);
} else {
TryMgr.isPortOpen(answers.host, port)
.then(isOpen => {
if (isOpen) {
done(null, true)
done(null, true);
} else {
// done('Port is not open')
console.log(`\n\n😩 ${answers.host}:${port} is not open please start the database if you haven't\n`.red.bold)
console.log(
`\n\n😩 ${answers.host}:${port} is not open please start the database if you haven't\n`
.red.bold
);
process.exit(0);
}
}).catch(done)
}
},
when({type}) {
return type !== 'sqlite3'
})
.catch(done);
}
},
{
name: 'username',
type: 'input',
message: Lang.getString(STR.DB_USER), // '👉 Enter database username\t:',
default(ans) {
return dbDefaults[ans.type].username
},
transformer(color) {
return chalkPipe(color)(color.green.bold);
},
when({type}) {
return type !== 'sqlite3'
}
when({ type }) {
return type !== 'sqlite3';
}
},
{
name: 'username',
type: 'input',
message: Lang.getString(STR.DB_USER), // '👉 Enter database username\t:',
default(ans) {
return dbDefaults[ans.type].username;
},
{
name: 'password',
type: 'input',
mask: true,
message: Lang.getString(STR.DB_PASSWORD), // '🙈 Enter database password\t:',
transformer(color) {
return new Array(color.length).fill('*'.green.bold).join('')
},
when({type}) {
return type !== 'sqlite3'
}
transformer(color) {
return chalkPipe(color)(color.green.bold);
},
{
name: 'database',
type: 'input',
message: Lang.getString(STR.DB_SCHEMA), // '👉 Enter database/schema name\t:',
transformer(color) {
return chalkPipe(color)(color.green.bold);
},
when({type}) {
return type !== 'sqlite3'
}
when({ type }) {
return type !== 'sqlite3';
}
},
{
name: 'password',
type: 'input',
mask: true,
message: Lang.getString(STR.DB_PASSWORD), // '🙈 Enter database password\t:',
transformer(color) {
return new Array(color.length).fill('*'.green.bold).join('');
},
{
name: 'apiType',
type: 'list',
message: Lang.getString(STR.DB_API), // '🚀 Enter API type to generate\t:',
choices: ['REST APIs', 'GRAPHQL APIs', 'gRPC APIs'].map(t => ({
name: t,
value: t,
short: t.green.bold
})),
transformer(color) {
return chalkPipe(color)(color.green.bold);
},
when({type}) {
return type !== 'sqlite3'
}
when({ type }) {
return type !== 'sqlite3';
}
},
{
name: 'database',
type: 'input',
message: Lang.getString(STR.DB_SCHEMA), // '👉 Enter database/schema name\t:',
transformer(color) {
return chalkPipe(color)(color.green.bold);
},
when({ type }) {
return type !== 'sqlite3';
}
},
{
name: 'apiType',
type: 'list',
message: Lang.getString(STR.DB_API), // '🚀 Enter API type to generate\t:',
choices: ['REST APIs', 'GRAPHQL APIs', 'gRPC APIs'].map(t => ({
name: t,
value: t,
short: t.green.bold
})),
transformer(color) {
return chalkPipe(color)(color.green.bold);
},
])
when({ type }) {
return type !== 'sqlite3';
}
}
]);
// console.log(finalAnswers);
if (finalAnswers.type === 'sqlite3') {
console.log('Please use desktop app to create Sqlite project'.green.bold)
console.log(
'Please use desktop app to create Sqlite project'.green.bold
);
process.exit(0);
}
@ -200,7 +210,6 @@ class TryMgr {
}*/
//
/* prepare the args */
// const url = `${finalAnswers.type}://${finalAnswers.host}:${finalAnswers.port}?u=${finalAnswers.username}&p=${finalAnswers.password}&d=${finalAnswers.database}&api=${apiTypeMapping[finalAnswers.projectType]}`;
// args._[0] = finalAnswers.projectType === 'REST APIs' ? 'gar' : 'gag';
@ -218,16 +227,19 @@ class TryMgr {
finalAnswers.apiType = 'rest';
break;
}
dbUrl = `${finalAnswers.type}://${finalAnswers.host}:${finalAnswers.port}?u=${finalAnswers.username}&p=${finalAnswers.password}&d=${finalAnswers.database}&api=${finalAnswers.apiType}`
dbUrl = `${finalAnswers.type}://${finalAnswers.host}:${finalAnswers.port}?u=${finalAnswers.username}&p=${finalAnswers.password}&d=${finalAnswers.database}&api=${finalAnswers.apiType}`;
}
// await Util.runCmd(`cd ${__dirname};echo "const {XcTry} = require('xc-instant'); process.env.NC_DB_URL='${finalAnswers.dbUrl}'; XcTry().then(() => console.log('App started'));" | node`);
await Util.runCmd(`echo "const {XcTry} = require('xc-instant'); XcTry('${dbUrl}').then(() => console.log('App started'));" | NODE_PATH=${path.join(__dirname, '..', 'node_modules')} node`);
await Util.runCmd(
`echo "const {XcTry} = require('xc-instant'); XcTry('${dbUrl}').then(() => console.log('App started'));" | NODE_PATH=${path.join(
__dirname,
'..',
'node_modules'
)} node`
);
}
public static async testConnection({url}) {
public static async testConnection({ url }) {
for (const u of url) {
const parsedUrlData = URL.parse(u, true);
const queryParams = parsedUrlData.query;
@ -235,37 +247,41 @@ class TryMgr {
const config = {
client,
connection: {
database: client === 'pg' ? 'postgres' : (client === 'mssql' ? undefined : null),
database:
client === 'pg'
? 'postgres'
: client === 'mssql'
? undefined
: null,
host: parsedUrlData.hostname,
password: queryParams.p,
port: +parsedUrlData.port,
user: queryParams.u,
user: queryParams.u
}
};
try {
const knex = require('knex')(config)
await knex.raw("SELECT 1+1 as data");
const knex = require('knex')(config);
await knex.raw('SELECT 1+1 as data');
} catch (e) {
console.log(`\n😩 Test connection failed for : ${url}\n`.red.bold)
console.log(`\n😩 Test connection failed for : ${url}\n`.red.bold);
return false;
}
}
return true;
}
public static async isPortOpen(host, port) {
try {
return await tcpPortUsed.check(+port, host)
return await tcpPortUsed.check(+port, host);
} catch (e) {
console.log(e)
console.log(`\n😩 ${host}:${port} is not reachable please check\n`.red.bold)
console.log(e);
console.log(
`\n😩 ${host}:${port} is not reachable please check\n`.red.bold
);
return true;
}
}
}
export default TryMgr;

79
packages/nc-cli/src/lib/mgr/XcInstantMgr.ts

@ -11,11 +11,14 @@ import('colors');
const PROGRESS_WIDTH = 30;
class AppMgr {
public static async install(args) {
try {
const spinner = ora({text: 'Downloading Desktop App from Github..'.green.bold(), spinner: 'dots2', color: 'green'}).start();
const {src, dest} = await AppMgr.getDownloadLink(args);
const spinner = ora({
text: 'Downloading Desktop App from Github..'.green.bold(),
spinner: 'dots2',
color: 'green'
}).start();
const { src, dest } = await AppMgr.getDownloadLink(args);
console.log(`\t${src}`);
@ -23,20 +26,25 @@ class AppMgr {
// console.log(progress)
// Report download progress
const p = PROGRESS_WIDTH * progress.percent;
spinner.text = `Downloading Desktop App now..\n[${
Array.from({length: PROGRESS_WIDTH}, (_, i) => i <= p ? '=' : ' ').join('')
}] ${(progress.transferred / (1024 * 1024)).toFixed(2)}MB/${(progress.total / (1024 * 1024)).toFixed(2)}MB\n`.green.bold()
spinner.text = `Downloading Desktop App now..\n[${Array.from(
{ length: PROGRESS_WIDTH },
(_, i) => (i <= p ? '=' : ' ')
).join('')}] ${(progress.transferred / (1024 * 1024)).toFixed(2)}MB/${(
progress.total /
(1024 * 1024)
).toFixed(2)}MB\n`.green.bold();
});
// spinner.prefixText = '';
spinner.succeed(`Installable downloaded successfully at ./${dest}`.green.bold());
spinner.succeed(
`Installable downloaded successfully at ./${dest}`.green.bold()
);
console.log(`\nInstallable will open automatically now.`.green.bold);
console.log(`If not, please install it manually.`.green.bold);
if (os.type() === 'Windows_NT') {
// open(dest, {wait: true, app: 'explorer.exe'})
} else {
open(dest, {wait: true});
open(dest, { wait: true });
}
} catch (e) {
console.error(`Error in xc app.install`, e);
}
@ -45,7 +53,9 @@ class AppMgr {
public static async open(args) {
try {
const runCommand = AppMgr.getOpenCommand(args);
if (!runCommand) { return }
if (!runCommand) {
return;
}
if (shell.exec(runCommand).code !== 0) {
shell.echo(`\n\nError running command internally`.red);
shell.echo(`\nExiting...`.red);
@ -56,20 +66,27 @@ class AppMgr {
}
}
public static async getDownloadLink(args):Promise<any> {
public static async getDownloadLink(args): Promise<any> {
try {
let src;
let dest;
const urls:any = {};
const urls: any = {};
const res = await axios.get('https://api.github.com/repos/xgenecloud/xc-desktop-app/releases?page=1')
const res = await axios.get(
'https://api.github.com/repos/xgenecloud/xc-desktop-app/releases?page=1'
);
let status = 0;
for (let i = 0; i < res.data.length && status !== 15; i++) {
const assets = res.data[i].assets;
for (const {name, browser_download_url} of assets) {
switch (name.split('.').pop().toLowerCase()) {
for (const { name, browser_download_url } of assets) {
switch (
name
.split('.')
.pop()
.toLowerCase()
) {
case 'dmg':
urls.dmg = urls.dmg || browser_download_url;
status = status | 1;
@ -92,22 +109,24 @@ class AppMgr {
switch (os.type()) {
case 'Linux':
const linuxInfo = osInfo({mode: 'sync'});
if (args.debian) { src = urls.deb; }
else if (args.rpm) { src = urls.rpm; }
else {
const linuxInfo = osInfo({ mode: 'sync' });
if (args.debian) {
src = urls.deb;
} else if (args.rpm) {
src = urls.rpm;
} else {
switch (linuxInfo.id) {
case 'ubuntu':
case 'raspberry':
src = urls.deb
src = urls.deb;
break;
case 'fedora':
src = urls.rpm
src = urls.rpm;
break;
default:
src = urls.rpm
src = urls.rpm;
}
}
}
break;
case 'Darwin':
src = urls.dmg;
@ -120,22 +139,22 @@ class AppMgr {
}
dest = src.split('/').pop();
return {src, dest}
return { src, dest };
} catch (e) {
console.log(e)
console.log(e);
}
}
public static getOpenCommand(_args):any {
public static getOpenCommand(_args): any {
switch (os.type()) {
case 'Linux':
return 'xgenecloud'
return 'xgenecloud';
break;
case 'Darwin':
return 'open -a xgenecloud'
return 'open -a xgenecloud';
break;
case 'Windows_NT':
console.info('Open xgenecloud desktop app from Windows start menu')
console.info('Open xgenecloud desktop app from Windows start menu');
break;
default:
@ -144,6 +163,4 @@ class AppMgr {
}
}
export default AppMgr;

55
packages/nc-cli/src/lib/prompts/Menu.ts

@ -3,33 +3,26 @@
*/
'use strict';
import inquirer from 'inquirer';
import inquirer from 'inquirer';
class RunOrDownload {
public static async prepareCmd(ipc, args) {
args._[0] = '';
const answers = await inquirer.prompt([
{
choices: [
'gen',
'add',
'show',
'run',
],
choices: ['gen', 'add', 'show', 'run'],
message: 'What do you want to do?',
name: 'action',
type: 'rawlist'
}]);
}
]);
args._[0] = answers.action;
switch (answers.action) {
case 'gen':
await this.handleGen(ipc,args)
await this.handleGen(ipc, args);
break;
case 'add':
@ -40,13 +33,10 @@ class RunOrDownload {
case 'run':
break;
}
}
public static async handleGen(_ipc,args) {
public static async handleGen(_ipc, args) {
const a1 = await inquirer.prompt([
{
choices: [
@ -59,57 +49,42 @@ class RunOrDownload {
'resolver',
'type',
'schema',
'apis',
'apis'
],
message: 'What do you want to generate ?',
name: 'action',
pageSize: 9,
type: 'rawlist'
}]);
}
]);
args._[0] += `:${a1.action}`;
switch (a1.action) {
case 'apis':
const a2 = await inquirer.prompt([
{
choices: [
'rest',
'graphql'
],
choices: ['rest', 'graphql'],
message: 'Which apis you want to use?',
name: 'action',
type: 'rawlist'
}]);
}
]);
args._[0] += `:${a2.action}`;
break;
}
}
// tslint:disable-next-line:no-empty
public static async handleAdd() {
}
public static async handleAdd() {}
// tslint:disable-next-line:no-empty
public static async handleShow() {
}
public static async handleShow() {}
// tslint:disable-next-line:no-empty
public static async handleRun() {
}
public static async handleRun() {}
}
export default RunOrDownload;

32
packages/nc-cli/src/lib/prompts/RunOrDownload.ts

@ -3,40 +3,30 @@
*/
'use strict';
import inquirer from "inquirer";
import inquirer from 'inquirer';
class RunOrDownload {
public static async handle(_args) {
const answers = await inquirer.prompt([
{
choices: [
'Open the app!',
'Download it for FREE'
],
message: 'Your XGENE desktop app is not open - do you want to ?',
name: 'action',
type: 'rawlist'
}
]);
{
choices: ['Open the app!', 'Download it for FREE'],
message: 'Your XGENE desktop app is not open - do you want to ?',
name: 'action',
type: 'rawlist'
}
]);
switch (answers.action) {
case 'Open app!':
break;
case 'Download it for FREE':
console.log('wget(https://xgene.cloud/download?latest=true) to Downloads');
console.log(
'wget(https://xgene.cloud/download?latest=true) to Downloads'
);
break;
}
}
}
export default RunOrDownload;

31
packages/nc-cli/src/lib/util/Lang.ts

@ -3,15 +3,16 @@ import english from './english.json';
import translated from './translated.json';
/* Converted from : https://smodin.me/translate-one-text-into-multiple-languages
* Enter database host name || Choose SQL Database type || Enter database username || Enter database password || Enter database port number || Enter database/schema name || Enter API type to generate || How do you want to run it
* */
* Enter database host name || Choose SQL Database type || Enter database username || Enter database password || Enter database port number || Enter database/schema name || Enter API type to generate || How do you want to run it
* */
const formattedTranslate: any = {};
for (const {symbol, text} of [english, ...translated].sort((a, b) => a.symbol.localeCompare(b.symbol))) {
formattedTranslate [symbol] = text.split(/\s*\|\|\s*/);
for (const { symbol, text } of [english, ...translated].sort((a, b) =>
a.symbol.localeCompare(b.symbol)
)) {
formattedTranslate[symbol] = text.split(/\s*\|\|\s*/);
}
const dummy: any = new Date();
const offset: any = -dummy.getTimezoneOffset();
const locale: string = offset === 330 ? 'en-IN' : osLocale.sync();
@ -29,14 +30,10 @@ enum STR {
PROJECT_TYPE
}
class Lang {
// @ts-ignore
public static getString(str: STR) {
switch (locale) {
case 'en':
case 'en-GB':
case 'en-AU':
@ -45,7 +42,7 @@ class Lang {
case 'en-US':
default:
return `${SMILEY_PREFIX[str]} ${formattedTranslate?.en?.[str]}\t:`;
case 'zh':
case 'zh-Hans':
case 'zh-CN':
@ -78,7 +75,7 @@ class Lang {
case 'es-US':
case 'es-VE':
return `${SMILEY_PREFIX[str]} ${formattedTranslate?.es?.[str]}\t:`;
case 'fi':
case 'fi-FI':
return `${SMILEY_PREFIX[str]} ${formattedTranslate?.fi?.[str]}\t:`;
@ -89,7 +86,7 @@ class Lang {
case 'fr-BE':
case 'fr-CH':
return `${SMILEY_PREFIX[str]} ${formattedTranslate?.fr?.[str]}\t:`;
case 'it':
case 'it-IT':
return `${SMILEY_PREFIX[str]} ${formattedTranslate?.it?.[str]}\t:`;
@ -97,7 +94,7 @@ class Lang {
case 'ja':
case 'ja-JP':
return `${SMILEY_PREFIX[str]} ${formattedTranslate?.ja?.[str]}\t:`;
case 'ko':
case 'ko-KR':
return `${SMILEY_PREFIX[str]} ${formattedTranslate?.ko?.[str]}\t:`;
@ -121,7 +118,6 @@ class Lang {
case 'sv-SE':
return `${SMILEY_PREFIX[str]} ${formattedTranslate?.sv?.[str]}\t:`;
case 'th':
case 'th-TH':
return `${SMILEY_PREFIX[str]} ${formattedTranslate?.th?.[str]}\t:`;
@ -142,13 +138,8 @@ class Lang {
case 'vi-VN':
return `${SMILEY_PREFIX[str]} ${formattedTranslate?.vi?.[str]}\t:`;
}
}
}
export default Lang;
export {
STR
};
export { STR };

347
packages/nc-cli/src/lib/util/Locales.ts

@ -1,9 +1,7 @@
import osLocale from 'os-locale';
class Locales {
public static getPrompt() {
const x = new Date();
const offset = -x.getTimezoneOffset();
@ -11,7 +9,6 @@ class Locales {
const locale = offset === 330 ? 'en-IN' : osLocale.sync();
switch (locale) {
case 'en':
case 'en-GB':
case 'en-AU':
@ -20,7 +17,8 @@ class Locales {
case 'en-US':
default:
prompt = {
choices: ['Twitter',
choices: [
'Twitter',
'Github - ⭐ or 👀 repo',
'Linkedin',
'Facebook',
@ -29,10 +27,12 @@ class Locales {
'Reddit',
'Next time',
'Please dont ask me',
'- - - - - - - -'],
language: "English",
message: '\n\n👋 Hello! 😀 \n\n🔥 Loving XgenCloud? 🔥\n\n🙏 Please mention a word about us to your friends & followers. 🙏\n\n'.green
}
'- - - - - - - -'
],
language: 'English',
message: '\n\n👋 Hello! 😀 \n\n🔥 Loving XgenCloud? 🔥\n\n🙏 Please mention a word about us to your friends & followers. 🙏\n\n'
.green
};
break;
case 'zh':
@ -47,17 +47,18 @@ class Locales {
'WeChat',
'Github - ⭐ or 👀 repo',
'豆瓣', // douban
'新浪微博',// weibo
'新浪微博', // weibo
'Renren',
'Line',
'Telegram',
'Next time',
'Please dont ask me',
'- - - - - - - -'],
language: "Chinese",
message: '\n\n👋 你好! 😀 \n\n🔥 Loving XgenCloud? 🔥\n\n🙏 Please mention a word about us to your friends & followers. 🙏\n\n'.green
}
'- - - - - - - -'
],
language: 'Chinese',
message: '\n\n👋 你好! 😀 \n\n🔥 Loving XgenCloud? 🔥\n\n🙏 Please mention a word about us to your friends & followers. 🙏\n\n'
.green
};
break;
case 'en-IN':
@ -71,14 +72,14 @@ class Locales {
'Telegram',
'Next time',
'Please dont ask me',
'- - - - - - - -'],
language: "English (India)",
message: '\n\n👋 Hello / नमस / ನ ಮ ಸ ರ / ന മ സ / வணககம! 😀 \n\n🔥 Loving XgenCloud? 🔥\n\n🙏 Please mention a word about us to your friends & followers. 🙏\n\n'.green
}
'- - - - - - - -'
],
language: 'English (India)',
message: '\n\n👋 Hello / नमस / ನ ಮ ಸ ರ / ന മ സ / வணககம! 😀 \n\n🔥 Loving XgenCloud? 🔥\n\n🙏 Please mention a word about us to your friends & followers. 🙏\n\n'
.green
};
break;
case 'de':
case 'de-DE':
case 'de-CH':
@ -94,18 +95,19 @@ class Locales {
'Telegram',
'Next time',
'Please dont ask me',
'- - - - - - - -'],
language: "German",
message: '\n\n👋 Hallo! 😀 \n\n🔥 Loving XgenCloud? 🔥\n\n🙏 Please mention a word about us to your friends & followers. 🙏\n\n'.green
}
'- - - - - - - -'
],
language: 'German',
message: '\n\n👋 Hallo! 😀 \n\n🔥 Loving XgenCloud? 🔥\n\n🙏 Please mention a word about us to your friends & followers. 🙏\n\n'
.green
};
break;
case 'el':
case 'el-GR':
prompt = {
choices: ['Twitter',
choices: [
'Twitter',
'Github - ⭐ or 👀 repo',
'Linkedin',
// 'Reddit',
@ -114,11 +116,12 @@ class Locales {
'Telegram',
'Next time',
'Please dont ask me',
'- - - - - - - -'],
language: "Greek",
message: '\n\n👋 Γειά σου! 😀 \n\n🔥 Loving XgenCloud? 🔥\n\n🙏 Please mention a word about us to your friends & followers. 🙏\n\n'.green
}
'- - - - - - - -'
],
language: 'Greek',
message: '\n\n👋 Γειά σου! 😀 \n\n🔥 Loving XgenCloud? 🔥\n\n🙏 Please mention a word about us to your friends & followers. 🙏\n\n'
.green
};
break;
case 'es':
@ -134,7 +137,8 @@ class Locales {
case 'es-US':
case 'es-VE':
prompt = {
choices: ['Twitter',
choices: [
'Twitter',
'Github - ⭐ or 👀 repo',
'Linkedin',
// 'Reddit',
@ -143,17 +147,19 @@ class Locales {
'Telegram',
'Next time',
'Please dont ask me',
'- - - - - - - -'],
language: "Spanish",
message: '\n\n👋 Hola! 😀 \n\n🔥 Loving XgenCloud? 🔥\n\n🙏 Please mention a word about us to your friends & followers. 🙏\n\n'.green
}
'- - - - - - - -'
],
language: 'Spanish',
message: '\n\n👋 Hola! 😀 \n\n🔥 Loving XgenCloud? 🔥\n\n🙏 Please mention a word about us to your friends & followers. 🙏\n\n'
.green
};
break;
case 'fa':
case 'fa-IR':
prompt = {
choices: ['Twitter',
choices: [
'Twitter',
'Github - ⭐ or 👀 repo',
'Linkedin',
// 'Reddit',
@ -162,17 +168,19 @@ class Locales {
'Telegram',
'Next time',
'Please dont ask me',
'- - - - - - - -'],
language: "Persian",
message: '\n\n👋 سلام! 😀 \n\n🔥 Loving XgenCloud? 🔥\n\n🙏 Please mention a word about us to your friends & followers. 🙏\n\n'.green
}
'- - - - - - - -'
],
language: 'Persian',
message: '\n\n👋 سلام! 😀 \n\n🔥 Loving XgenCloud? 🔥\n\n🙏 Please mention a word about us to your friends & followers. 🙏\n\n'
.green
};
break;
case 'fi':
case 'fi-FI':
prompt = {
choices: ['Twitter',
choices: [
'Twitter',
'Github - ⭐ or 👀 repo',
'Linkedin',
// 'Reddit',
@ -181,22 +189,22 @@ class Locales {
'Telegram',
'Next time',
'Please dont ask me',
'- - - - - - - -'],
language: "Finnish",
message: '\n\n👋 سلام! 😀 \n\n🔥 Loving XgenCloud? 🔥\n\n🙏 Please mention a word about us to your friends & followers. 🙏\n\n'.green
}
'- - - - - - - -'
],
language: 'Finnish',
message: '\n\n👋 سلام! 😀 \n\n🔥 Loving XgenCloud? 🔥\n\n🙏 Please mention a word about us to your friends & followers. 🙏\n\n'
.green
};
break;
case 'fr':
case 'fr-CA':
case 'fr-FR':
case 'fr-BE':
case 'fr-CH':
prompt = {
choices: ['Twitter',
choices: [
'Twitter',
'Github - ⭐ or 👀 repo',
'Linkedin',
// 'Reddit',
@ -205,17 +213,19 @@ class Locales {
'Telegram',
'Next time',
'Please dont ask me',
'- - - - - - - -'],
language: "French",
message: '\n\n👋 Bonjour! 😀 \n\n🔥 Loving XgenCloud? 🔥\n\n🙏 Please mention a word about us to your friends & followers. 🙏\n\n'.green
}
'- - - - - - - -'
],
language: 'French',
message: '\n\n👋 Bonjour! 😀 \n\n🔥 Loving XgenCloud? 🔥\n\n🙏 Please mention a word about us to your friends & followers. 🙏\n\n'
.green
};
break;
case 'ga':
case 'ga-IE':
prompt = {
choices: ['Twitter',
choices: [
'Twitter',
'Github - ⭐ or 👀 repo',
'Linkedin',
// 'Reddit',
@ -224,17 +234,19 @@ class Locales {
'Telegram',
'Next time',
'Please dont ask me',
'- - - - - - - -'],
language: "Irish",
message: '\n\n👋 Dia dhuit! 😀 \n\n🔥 Loving XgenCloud? 🔥\n\n🙏 Please mention a word about us to your friends & followers. 🙏\n\n'.green
}
'- - - - - - - -'
],
language: 'Irish',
message: '\n\n👋 Dia dhuit! 😀 \n\n🔥 Loving XgenCloud? 🔥\n\n🙏 Please mention a word about us to your friends & followers. 🙏\n\n'
.green
};
break;
case 'he':
case 'he-IL':
prompt = {
choices: ['Twitter',
choices: [
'Twitter',
'Github - ⭐ or 👀 repo',
'Linkedin',
// 'Reddit',
@ -243,17 +255,19 @@ class Locales {
'Telegram',
'Next time',
'Please dont ask me',
'- - - - - - - -'],
language: "Hebrew",
message: '\n\n👋 שלום! 😀 \n\n🔥 Loving XgenCloud? 🔥\n\n🙏 Please mention a word about us to your friends & followers. 🙏\n\n'.green
}
'- - - - - - - -'
],
language: 'Hebrew',
message: '\n\n👋 שלום! 😀 \n\n🔥 Loving XgenCloud? 🔥\n\n🙏 Please mention a word about us to your friends & followers. 🙏\n\n'
.green
};
break;
case 'it':
case 'it-IT':
prompt = {
choices: ['Twitter',
choices: [
'Twitter',
'Github - ⭐ or 👀 repo',
'Linkedin',
// 'Reddit',
@ -262,18 +276,19 @@ class Locales {
'Telegram',
'Next time',
'Please dont ask me',
'- - - - - - - -'],
language: "Italian",
message: '\n\n👋 Ciao! 😀 \n\n🔥 Loving XgenCloud? 🔥\n\n🙏 Please mention a word about us to your friends & followers. 🙏\n\n'.green
}
'- - - - - - - -'
],
language: 'Italian',
message: '\n\n👋 Ciao! 😀 \n\n🔥 Loving XgenCloud? 🔥\n\n🙏 Please mention a word about us to your friends & followers. 🙏\n\n'
.green
};
break;
case 'ja':
case 'ja-JP':
prompt = {
choices: ['Twitter',
choices: [
'Twitter',
'Github - ⭐ or 👀 repo',
'Line',
'Linkedin',
@ -284,17 +299,19 @@ class Locales {
'Telegram',
'Next time',
'Please dont ask me',
'- - - - - - - -'],
language: "Japanese",
message: '\n\n👋 こんにちは! 😀 \n\n🔥 Loving XgenCloud? 🔥\n\n🙏 Please mention a word about us to your friends & followers. 🙏\n\n'.green
}
'- - - - - - - -'
],
language: 'Japanese',
message: '\n\n👋 こんにちは! 😀 \n\n🔥 Loving XgenCloud? 🔥\n\n🙏 Please mention a word about us to your friends & followers. 🙏\n\n'
.green
};
break;
case 'ko':
case 'ko-KR':
prompt = {
choices: ['Twitter',
choices: [
'Twitter',
'Github - ⭐ or 👀 repo',
'Line',
'Linkedin',
@ -303,20 +320,22 @@ class Locales {
'WhatsApp',
'WeChat',
'豆瓣', // douban
'新浪微博',// weibo
'新浪微博', // weibo
'Telegram',
'Next time',
'Please dont ask me',
'- - - - - - - -'],
language: "Korean",
message: '\n\n👋 여보세요! 😀 \n\n🔥 Loving XgenCloud? 🔥\n\n🙏 Please mention a word about us to your friends & followers. 🙏\n\n'.green
}
'- - - - - - - -'
],
language: 'Korean',
message: '\n\n👋 여보세요! 😀 \n\n🔥 Loving XgenCloud? 🔥\n\n🙏 Please mention a word about us to your friends & followers. 🙏\n\n'
.green
};
break;
case 'mn-MN':
prompt = {
choices: ['Twitter',
choices: [
'Twitter',
'Github - ⭐ or 👀 repo',
'Linkedin',
// 'Reddit',
@ -324,20 +343,21 @@ class Locales {
'WhatsApp',
'Next time',
'Please dont ask me',
'- - - - - - - -'],
language: "Mongolian",
message: '\n\n👋 Сайн уу! 😀 \n\n🔥 Loving XgenCloud? 🔥\n\n🙏 Please mention a word about us to your friends & followers. 🙏\n\n'.green
}
'- - - - - - - -'
],
language: 'Mongolian',
message: '\n\n👋 Сайн уу! 😀 \n\n🔥 Loving XgenCloud? 🔥\n\n🙏 Please mention a word about us to your friends & followers. 🙏\n\n'
.green
};
break;
case 'nl':
case 'nl-BE':
case 'nl-NL':
case 'nn-NO':
prompt = {
choices: ['Twitter',
choices: [
'Twitter',
'Github - ⭐ or 👀 repo',
'Linkedin',
// 'Reddit',
@ -345,19 +365,20 @@ class Locales {
'WhatsApp',
'Next time',
'Please dont ask me',
'- - - - - - - -'],
language: "Dutch",
message: '\n\n👋 Hallo! 😀 \n\n🔥 Loving XgenCloud? 🔥\n\n🙏 Please mention a word about us to your friends & followers. 🙏\n\n'.green
}
'- - - - - - - -'
],
language: 'Dutch',
message: '\n\n👋 Hallo! 😀 \n\n🔥 Loving XgenCloud? 🔥\n\n🙏 Please mention a word about us to your friends & followers. 🙏\n\n'
.green
};
break;
case 'pt':
case 'pt-BR':
case 'pt-PT':
prompt = {
choices: ['Twitter',
choices: [
'Twitter',
'Github - ⭐ or 👀 repo',
'Linkedin',
// 'Reddit',
@ -365,17 +386,19 @@ class Locales {
'WhatsApp',
'Next time',
'Please dont ask me',
'- - - - - - - -'],
language: "Portuguese",
message: '\n\n👋 Olá! 😀 \n\n🔥 Loving XgenCloud? 🔥\n\n🙏 Please mention a word about us to your friends & followers. 🙏\n\n'.green
}
'- - - - - - - -'
],
language: 'Portuguese',
message: '\n\n👋 Olá! 😀 \n\n🔥 Loving XgenCloud? 🔥\n\n🙏 Please mention a word about us to your friends & followers. 🙏\n\n'
.green
};
break;
case 'ru':
case 'ru-RU':
prompt = {
choices: ['Twitter',
choices: [
'Twitter',
'Github - ⭐ or 👀 repo',
'OKru',
'Telegram',
@ -386,18 +409,19 @@ class Locales {
'WhatsApp',
'Next time',
'Please dont ask me',
'- - - - - - - -'],
language: "Russian",
message: '\n\n👋 Здравствуйте! 😀 \n\n🔥 Loving XgenCloud? 🔥\n\n🙏 Please mention a word about us to your friends & followers. 🙏\n\n'.green
}
'- - - - - - - -'
],
language: 'Russian',
message: '\n\n👋 Здравствуйте! 😀 \n\n🔥 Loving XgenCloud? 🔥\n\n🙏 Please mention a word about us to your friends & followers. 🙏\n\n'
.green
};
break;
case 'sv':
case 'sv-SE':
prompt = {
choices: ['Twitter',
choices: [
'Twitter',
'Github - ⭐ or 👀 repo',
'Linkedin',
// 'Reddit',
@ -405,18 +429,19 @@ class Locales {
'WhatsApp',
'WeChat',
'Please dont ask me',
'- - - - - - - -'],
language: "Swedish",
message: '\n\n👋 Hej! 😀 \n\n🔥 Loving XgenCloud? 🔥\n\n🙏 Please mention a word about us to your friends & followers. 🙏\n\n'.green
}
'- - - - - - - -'
],
language: 'Swedish',
message: '\n\n👋 Hej! 😀 \n\n🔥 Loving XgenCloud? 🔥\n\n🙏 Please mention a word about us to your friends & followers. 🙏\n\n'
.green
};
break;
case 'th':
case 'th-TH':
prompt = {
choices: ['Twitter',
choices: [
'Twitter',
'Github - ⭐ or 👀 repo',
'Linkedin',
// 'Reddit',
@ -425,17 +450,19 @@ class Locales {
'Telegram',
'Next time',
'Please dont ask me',
'- - - - - - - -'],
language: "Thai",
message: '\n\n👋 สวสด! 😀 \n\n🔥 Loving XgenCloud? 🔥\n\n🙏 Please mention a word about us to your friends & followers. 🙏\n\n'.green
}
'- - - - - - - -'
],
language: 'Thai',
message: '\n\n👋 สวสด! 😀 \n\n🔥 Loving XgenCloud? 🔥\n\n🙏 Please mention a word about us to your friends & followers. 🙏\n\n'
.green
};
break;
case 'tl':
case 'tl-PH':
prompt = {
choices: ['Twitter',
choices: [
'Twitter',
'Github - ⭐ or 👀 repo',
'Linkedin',
// 'Reddit',
@ -444,18 +471,19 @@ class Locales {
'WeChat',
'Telegram',
'Please dont ask me',
'- - - - - - - -'],
language: "Filipino",
message: '\n\n👋 Kamusta! 😀 \n\n🔥 Loving XgenCloud? 🔥\n\n🙏 Please mention a word about us to your friends & followers. 🙏\n\n'.green
}
'- - - - - - - -'
],
language: 'Filipino',
message: '\n\n👋 Kamusta! 😀 \n\n🔥 Loving XgenCloud? 🔥\n\n🙏 Please mention a word about us to your friends & followers. 🙏\n\n'
.green
};
break;
case 'tr':
case 'tr-TR':
prompt = {
choices: ['Twitter',
choices: [
'Twitter',
'Github - ⭐ or 👀 repo',
'Linkedin',
// 'Reddit',
@ -463,17 +491,19 @@ class Locales {
'WhatsApp',
'Telegram',
'Please dont ask me',
'- - - - - - - -'],
language: "Turkish",
message: '\n\n👋 Merhaba! 😀 \n\n🔥 Loving XgenCloud? 🔥\n\n🙏 Please mention a word about us to your friends & followers. 🙏\n\n'.green
}
'- - - - - - - -'
],
language: 'Turkish',
message: '\n\n👋 Merhaba! 😀 \n\n🔥 Loving XgenCloud? 🔥\n\n🙏 Please mention a word about us to your friends & followers. 🙏\n\n'
.green
};
break;
case 'uk':
case 'uk-UA':
prompt = {
choices: ['Twitter',
choices: [
'Twitter',
'Github - ⭐ or 👀 repo',
'OKru',
// 'Reddit',
@ -485,17 +515,19 @@ class Locales {
'Wykop',
'Next time',
'Please dont ask me',
'- - - - - - - -'],
language: "Ukrainian",
message: '\n\n👋 Здравствуйте! 😀 \n\n🔥 Loving XgenCloud? 🔥\n\n🙏 Please mention a word about us to your friends & followers. 🙏\n\n'.green
}
'- - - - - - - -'
],
language: 'Ukrainian',
message: '\n\n👋 Здравствуйте! 😀 \n\n🔥 Loving XgenCloud? 🔥\n\n🙏 Please mention a word about us to your friends & followers. 🙏\n\n'
.green
};
break;
case 'vi':
case 'vi-VN':
prompt = {
choices: ['Twitter',
choices: [
'Twitter',
'Github - ⭐ or 👀 repo',
'Linkedin',
// 'Reddit',
@ -504,20 +536,17 @@ class Locales {
'WeChat',
'Telegram',
'Please dont ask me',
'- - - - - - - -'],
language: "Vietnamese",
message: '\n\n👋 xin chào! 😀 \n\n🔥 Loving XgenCloud? 🔥\n\n🙏 Please mention a word about us to your friends & followers. 🙏\n\n'.green
}
'- - - - - - - -'
],
language: 'Vietnamese',
message: '\n\n👋 xin chào! 😀 \n\n🔥 Loving XgenCloud? 🔥\n\n🙏 Please mention a word about us to your friends & followers. 🙏\n\n'
.green
};
break;
}
return prompt;
}
}
export default Locales;

301
packages/nc-cli/src/lib/util/Util.ts

@ -2,19 +2,23 @@ import path from 'path';
import shell from 'shelljs';
class Util {
public static getShortVersion(args) {
const shortVersion = JSON.parse(JSON.stringify(args));
if (shortVersion._.length) {
shortVersion._[0] = shortVersion._[0].split('.').map(a => a[0]).join('')
shortVersion._[0] = shortVersion._[0]
.split('.')
.map(a => a[0])
.join('');
}
return shortVersion;
}
public static isProjectGraphql() {
const currentProjectJson = require(path.join(process.cwd(), 'config.xc.json'))
const currentProjectJson = require(path.join(
process.cwd(),
'config.xc.json'
));
return currentProjectJson.meta.projectType.toLowerCase() === 'graphql';
}
@ -34,7 +38,9 @@ Commands:
public static manNew() {
return `
${'COMMAND : '.bold}
${'xc new'.bold} - Creates new projects and creates APIs instantly for database inputted.
${
'xc new'.bold
} - Creates new projects and creates APIs instantly for database inputted.
${'SYNOPSIS : '.bold}
${'xc new'.bold} ${'<projectName>'.bold}
@ -54,7 +60,7 @@ ${'VARIATIONS :'.bold}
- Takes in database credentials and API type as input
- Database can be new or existing database
- Creates a new folder by name 'airbnb'
`
`;
}
public static manDocker() {
@ -77,13 +83,15 @@ ${'VARIATIONS :'.bold}
- Database can be new or existing database
- Scaffolds REST/GraphQL/gRPC APIs for the database specified
- These database can be already existing or new databases.
`
`;
}
public static manGenApisRest() {
return `
${'COMMAND : '.bold}
${'xc gen.apis.graphql'.bold} - generates REST APIs for an existing/new databases of a project.
${
'xc gen.apis.graphql'.bold
} - generates REST APIs for an existing/new databases of a project.
${'SYNOPSIS : '.bold}
${'xc gen.apis.rest'.bold} [${'-u'.bold} DatabaseURL(s)]
@ -92,38 +100,56 @@ ${'VARIATIONS :'.bold}
The following variations are available:
${'<>'.bold} If ${'no'.bold} option is passed, this generates REST APIs for databases current project
${'<>'.bold} If ${
'no'.bold
} option is passed, this generates REST APIs for databases current project
that are within project file config.xc.json
${'-u'.bold} ${'<Database URLs>'.bold} Creates a new project for an existing/new database
${'-u'.bold} ${
'<Database URLs>'.bold
} Creates a new project for an existing/new database
For mysql : mysql://localhost:3306?u=root&p=password&d=ecommerce
For pg : pg://localhost:5432?u=postgres&p=password&d=ecommerce
For mssql : mssql://localhost:1433?u=sa&p=Password123.&d=ecommerce
${'Examples with notes : '.bold}
${'xc gen.apis.rest -u mysql://localhost:3306?u=root&p=password&d=ecommerce'.bold}
${
'xc gen.apis.rest -u mysql://localhost:3306?u=root&p=password&d=ecommerce'
.bold
}
- Generates REST apis for a mysql database 'ecommerce'
- Uses current directory as project name
- If database exists - REST APIs will be created for the tables within it.
- If database doesnt exist - it will be created.
${'xc gen.apis.rest -u pg://localhost:5432?u=postgres&p=password&d=ecommerce'.bold}
${
'xc gen.apis.rest -u pg://localhost:5432?u=postgres&p=password&d=ecommerce'
.bold
}
- Generates REST apis for a postgres database 'ecommerce'
${'xc gen.apis.rest -u mssql://localhost:1433?u=sa&p=Password123.&d=ecommerce'.bold}
${
'xc gen.apis.rest -u mssql://localhost:1433?u=sa&p=Password123.&d=ecommerce'
.bold
}
- Generates REST apis for a mssql database 'ecommerce'
${`xc gen.apis.rest -u mysql://localhost:3306?u=root&p=password&d=ecommerce
-u pg://localhost:5432?u=postgres&p=password&d=crm`.bold}
${
`xc gen.apis.rest -u mysql://localhost:3306?u=root&p=password&d=ecommerce
-u pg://localhost:5432?u=postgres&p=password&d=crm`
.bold
}
- Generates REST apis for multiple databases 'ecommerce' & 'crm'.
- These database can be already existing or new databases.
`
`;
}
public static manGenApisGraphql() {
return `
${'COMMAND : '.bold}
${'xc gen.apis.graphql'.bold} - generates GraphQL APIs for an existing/new databases of a project.
${
'xc gen.apis.graphql'.bold
} - generates GraphQL APIs for an existing/new databases of a project.
${'SYNOPSIS : '.bold}
${'xc gen.apis.graphql'.bold} [${'-u'.bold} DatabaseURL(s)]
@ -132,56 +158,84 @@ ${'VARIATIONS :'.bold}
The following variations are available:
${'<>'.bold} If ${'no'.bold} option is passed, this generates GraphQL APIs for databases current project
${'<>'.bold} If ${
'no'.bold
} option is passed, this generates GraphQL APIs for databases current project
that are within project file config.xc.json
${'-u'.bold} ${'<Database URLs>'.bold} Creates a new project for an existing/new database
${'-u'.bold} ${
'<Database URLs>'.bold
} Creates a new project for an existing/new database
For mysql : mysql://localhost:3306?u=root&p=password&d=ecommerce
For pg : pg://localhost:5432?u=postgres&p=password&d=ecommerce
For mssql : mssql://localhost:1433?u=sa&p=Password123.&d=ecommerce
${'Examples with notes : '.bold}
${'xc gen.apis.graphql -u mysql://localhost:3306?u=root&p=password&d=ecommerce'.bold}
${
'xc gen.apis.graphql -u mysql://localhost:3306?u=root&p=password&d=ecommerce'
.bold
}
- Generates GraphQL apis for a mysql database 'ecommerce'
- Uses current directory as project name
- If database exists - GraphQL APIs will be created for the tables within it.
- If database doesnt exist - it will be created.
${'xc gen.apis.graphql -u pg://localhost:5432?u=postgres&p=password&d=ecommerce'.bold}
${
'xc gen.apis.graphql -u pg://localhost:5432?u=postgres&p=password&d=ecommerce'
.bold
}
- Generates GraphQL apis for a postgres database 'ecommerce'
${'xc gen.apis.graphql -u mssql://localhost:1433?u=sa&p=Password123.&d=ecommerce'.bold}
${
'xc gen.apis.graphql -u mssql://localhost:1433?u=sa&p=Password123.&d=ecommerce'
.bold
}
- Generates GraphQL apis for a mssql database 'ecommerce'
${`xc gen.apis.graphql -u mysql://localhost:3306?u=root&p=password&d=ecommerce
-u pg://localhost:5432?u=postgres&p=password&d=crm`.bold}
${
`xc gen.apis.graphql -u mysql://localhost:3306?u=root&p=password&d=ecommerce
-u pg://localhost:5432?u=postgres&p=password&d=crm`
.bold
}
- Generates GraphQL apis for multiple databases 'ecommerce' & 'crm'.
- These database can be already existing or new databases.
`
`;
}
public static manGenModule() {
return `
${'COMMAND : '.bold}
${'xc gen.module'.bold} - Creates a table and scaffolds the respective module files
${
'xc gen.module'.bold
} - Creates a table and scaffolds the respective module files
In REST project - (router, service, middleware, policy, model, meta)
In GraphQL project - (resolver, service, middleware, policy, model, meta)
${'SYNOPSIS : '.bold}
${'xc gen.module'.bold} ${'module(s)'.bold} [--nomodel] [--router] [--service] [--dbAlias]
${'xc gen.module'.bold} ${
'module(s)'.bold
} [--nomodel] [--router] [--service] [--dbAlias]
${'OPTIONS :'.bold}
The following options are available:
${'--nomodel'.bold} Scaffolds module without creating table and model, meta files.
${
'--nomodel'.bold
} Scaffolds module without creating table and model, meta files.
For mysql : mysql://localhost:3306?u=root&p=password&d=ecommerce
For pg : pg://localhost:5432?u=postgres&p=password&d=ecommerce
For mssql : mssql://localhost:1433?u=sa&p=Password123.&d=ecommerce
${'--dbAlias'.bold} Defaults to 'db'(primary) database if not provided to create the table
${'--router'.bold} Will create router with model - service file will be skipped //todo
${'--service'.bold} Will create service with model - router file will be skipped //todo
${
'--dbAlias'.bold
} Defaults to 'db'(primary) database if not provided to create the table
${
'--router'.bold
} Will create router with model - service file will be skipped //todo
${
'--service'.bold
} Will create service with model - router file will be skipped //todo
${'VARIATIONS :'.bold}
@ -206,13 +260,15 @@ ${'VARIATIONS :'.bold}
- All folder/files in respective components will be created in parent table of primary table
`
`;
}
public static manDbMigrateInit() {
return `
${'COMMAND : '.bold}
${'xc db.migrate.init'.bold} - Initialises a database migration project freshly - only necessary files are created
${
'xc db.migrate.init'.bold
} - Initialises a database migration project freshly - only necessary files are created
- This is a legacy command and will not be required in developer flow
- Instead use ${'xc new'.bold}
- After running this command - edit config.xc.json and run xc db.migrate.sync
@ -228,23 +284,29 @@ ${'VARIATIONS :'.bold}
${'xc db.migrate.init --type mysql'.bold}
- Creates migration project of type mysql
- xc db.migrate.sync has to be run after command
`
`;
}
public static manDbMigrateSync() {
return `
${'COMMAND : '.bold}
${'xc db.migrate.sync'.bold} - Initialises migrations in the databases of project
${
'xc db.migrate.sync'.bold
} - Initialises migrations in the databases of project
- Creates _evolutions table for database if it doesn't exists
${'SYNOPSIS : '.bold}
${'xc db.migrate.sync'.bold} [${'--env'.bold} <environment>] [${'--dbAlias'.bold} <databaseAlias>]
${'xc db.migrate.sync'.bold} [${'--env'.bold} <environment>] [${
'--dbAlias'.bold
} <databaseAlias>]
${'OPTIONS :'.bold}
The following options are available:
${'--env'.bold} Defaults to 'dev' environment if not provided
${'--dbAlias'.bold} If not provided all databases within environment are initialised
${
'--dbAlias'.bold
} If not provided all databases within environment are initialised
${'VARIATIONS :'.bold}
@ -259,7 +321,7 @@ ${'VARIATIONS :'.bold}
${'xc db.migrate.sync --env production --dbAlias secondary'.bold}
- Initialises migration for 'db2'(secondary) database within 'production' environment
`
`;
}
public static manDbMigrateList() {
@ -268,7 +330,9 @@ ${'COMMAND : '.bold}
${'xc db.migrate.list'.bold} - Lists all the migrations
${'SYNOPSIS : '.bold}
${'xc db.migrate.list'.bold} [${'--env'.bold} <environment>] [${'--dbAlias'.bold} <databaseAlias>]
${'xc db.migrate.list'.bold} [${'--env'.bold} <environment>] [${
'--dbAlias'.bold
} <databaseAlias>]
${'OPTIONS :'.bold}
@ -290,16 +354,20 @@ ${'VARIATIONS :'.bold}
${'xc db.migrate.list --env production --dbAlias secondary'.bold}
- Lists all migrations within 'production' environment and 'db2'(secondary) database
`
`;
}
public static manDbMigrateCreate() {
return `
${'COMMAND : '.bold}
${'xc db.migrate.create'.bold} - Creates an empty migration for environment and dbAlias
${
'xc db.migrate.create'.bold
} - Creates an empty migration for environment and dbAlias
${'SYNOPSIS : '.bold}
${'xc db.migrate.create'.bold} [${'--env'.bold} <environment>] [${'--dbAlias'.bold} <databaseAlias>]
${'xc db.migrate.create'.bold} [${'--env'.bold} <environment>] [${
'--dbAlias'.bold
} <databaseAlias>]
${'OPTIONS :'.bold}
@ -320,7 +388,7 @@ ${'VARIATIONS :'.bold}
${'xc db.migrate.create --env production --dbAlias secondary'.bold}
- Creates a migration within 'production' environment and 'db2'(secondary) database
`
`;
}
public static manDbMigrateUp() {
@ -329,7 +397,11 @@ ${'COMMAND : '.bold}
${'xc db.migrate.up'.bold} - Applies all pending migrations
${'SYNOPSIS : '.bold}
${'xc db.migrate.up'.bold} [${'--env'.bold} <environment>] [${'--dbAlias'.bold} <databaseAlias>] \n\t\t\t[${'--steps'.bold} <number>] [${'--file'.bold} <number>]
${'xc db.migrate.up'.bold} [${'--env'.bold} <environment>] [${
'--dbAlias'.bold
} <databaseAlias>] \n\t\t\t[${'--steps'.bold} <number>] [${
'--file'.bold
} <number>]
${'OPTIONS :'.bold}
@ -353,18 +425,26 @@ ${'VARIATIONS :'.bold}
${'xc db.migrate.up --env production --steps 1'.bold}
- Applies one pending migrations in 'production' environment
${'xc db.migrate.up --env production --dbAlias secondary --steps 1'.bold}
${
'xc db.migrate.up --env production --dbAlias secondary --steps 1'.bold
}
- Applies one pending migrations in 'production' environment for 'db2'(secondary) database
`
`;
}
public static manDbMigrateDown() {
return `
${'COMMAND : '.bold}
${'xc db.migrate.down'.bold} - Reverses all migrations or by steps or by till the filename
${
'xc db.migrate.down'.bold
} - Reverses all migrations or by steps or by till the filename
${'SYNOPSIS : '.bold}
${'xc db.migrate.down'.bold} [${'--env'.bold} <environment>] [${'--dbAlias'.bold} <databaseAlias>] \n\t\t\t[${'--steps'.bold} <number>] [${'--file'.bold} <number>]
${'xc db.migrate.down'.bold} [${'--env'.bold} <environment>] [${
'--dbAlias'.bold
} <databaseAlias>] \n\t\t\t[${'--steps'.bold} <number>] [${
'--file'.bold
} <number>]
${'OPTIONS :'.bold}
@ -388,23 +468,29 @@ ${'VARIATIONS :'.bold}
${'xc db.migrate.down --env production --steps 1'.bold}
- Reverses one applied migrations in 'production' environment
${'xc db.migrate.down --env production --dbAlias secondary --steps 1'.bold}
${
'xc db.migrate.down --env production --dbAlias secondary --steps 1'
.bold
}
- Reverses one applied migrations in 'production' environment for 'db2'(secondary) database
`
`;
}
public static manDbMigrateTerm() {
return `
${'COMMAND : '.bold}
${'xc db.migrate.term'.bold} - Deprecated. Terminates all databases in environment.
`
${
'xc db.migrate.term'.bold
} - Deprecated. Terminates all databases in environment.
`;
}
public static manComponentAdd() {
return `
${'COMMAND : '.bold}
${'xc component.add'.bold} - Adds a new component in server/components directory by taking user input
${
'xc component.add'.bold
} - Adds a new component in server/components directory by taking user input
on where to place the component in initialisation order.
${'SYNOPSIS : '.bold}
@ -427,13 +513,15 @@ ${'VARIATIONS :'.bold}
${'Examples with notes : '.bold}
${'xc component.add cache'.bold}
- Adds a cache component
`
`;
}
public static manAppInstall() {
return `
${'COMMAND : '.bold}
${'xc app.install'.bold} - Download and starts xgenecloud desktop application installation
${
'xc app.install'.bold
} - Download and starts xgenecloud desktop application installation
${'SYNOPSIS : '.bold}
${'xc app.install'.bold}
@ -449,13 +537,15 @@ ${'VARIATIONS :'.bold}
${'Examples with notes : '.bold}
${'xc app.install'.bold}
`
`;
}
public static manAppOpen() {
return `
${'COMMAND : '.bold}
${'xc app.open'.bold} - Opens the xgenecloud desktop application (mac and linux only)
${
'xc app.open'.bold
} - Opens the xgenecloud desktop application (mac and linux only)
${'SYNOPSIS : '.bold}
${'xc app.open'.bold}
@ -471,10 +561,9 @@ ${'VARIATIONS :'.bold}
${'Examples with notes : '.bold}
${'xc app.open'.bold}
`
`;
}
public static manPermissionsSet() {
return `
${'COMMAND : '.bold}
@ -482,17 +571,27 @@ ${'COMMAND : '.bold}
${'SYNOPSIS : '.bold}
# For REST API project
${'xc permissions.set'.bold} [${'model(s)'.bold} | $] [${'userType(s)'.bold} | $] [${'read|write)'.bold} = 1 | 0]
${'xc permissions.set'.bold} [${'model(s)'.bold} | $] [${
'userType(s)'.bold
} | $] [${'read|write)'.bold} = 1 | 0]
# For GraphQL API project
${'xc permissions.set'.bold} [${'model(s)'.bold} | $] [${'userType(s)'.bold} | $] [${'read|write|resolverFunction)'.bold} = 1 | 0]
${'xc permissions.set'.bold} [${'model(s)'.bold} | $] [${
'userType(s)'.bold
} | $] [${'read|write|resolverFunction)'.bold} = 1 | 0]
${'ARGS :'.bold}
The following are arguments to function:
${'model(s)'.bold} Model name | Multiple models with dot seperated | $ - means all models
${'userType(s)'.bold}User role name | Multiple user role names with dot separated | $ - means all user models
${'permissions(s)'.bold}Permissions - read | write | get | post | put | delete | patch | resolverFunc | $ - means all permissions
${
'model(s)'.bold
} Model name | Multiple models with dot seperated | $ - means all models
${
'userType(s)'.bold
}User role name | Multiple user role names with dot separated | $ - means all user models
${
'permissions(s)'.bold
}Permissions - read | write | get | post | put | delete | patch | resolverFunc | $ - means all permissions
${'VARIATIONS :'.bold}
None
@ -509,7 +608,7 @@ ${'VARIATIONS :'.bold}
${'xc permissions.set $ $ read=1 write=1'.bold}
- For 'all' models 'all' user types SET 'read' and 'write' permission
`
`;
}
// todo
@ -536,10 +635,9 @@ ${'VARIATIONS :'.bold}
${'Examples with notes : '.bold}
${'xc permissions.get blog'.bold}
- Get all permissions of blog model `
- Get all permissions of blog model `;
}
public static manPermissionsUserAdd() {
return `
${'COMMAND : '.bold}
@ -564,10 +662,9 @@ ${'VARIATIONS :'.bold}
${'xc permissions.role.add manager'.bold}
- Adds user role 'manager' to all the models
`
`;
}
public static manPermissionsUserDelete() {
return `
${'COMMAND : '.bold}
@ -590,10 +687,9 @@ ${'VARIATIONS :'.bold}
${'xc permissions.role.delete manager'.bold}
- deletes user role 'manager' from all the models
`
`;
}
public static manPermissionsUserRename() {
return `
${'COMMAND : '.bold}
@ -617,23 +713,28 @@ ${'VARIATIONS :'.bold}
${'xc permissions.role.rename manager StaffManager'.bold}
- Renames user role from 'manager' to 'StaffManager' in all the models
`
`;
}
public static manProjectMetaExport() {
return `
${'COMMAND : '.bold}
${'xc meta.export'.bold} - Exports all meta table data to project meta directory
${
'xc meta.export'.bold
} - Exports all meta table data to project meta directory
${'SYNOPSIS : '.bold}
${'xc meta.export'.bold} ${'--env'.bold} <environment> [${'--dbAlias'.bold} <databaseAlias>]
${'xc meta.export'.bold} ${'--env'.bold} <environment> [${
'--dbAlias'.bold
} <databaseAlias>]
${'OPTIONS :'.bold}
The following options are available:
${'--env'.bold} Environment name to be exported
${'--dbAlias'.bold} dbAlias of database connection. If not provided then it will export metadata for all connections in the environment
${
'--dbAlias'.bold
} dbAlias of database connection. If not provided then it will export metadata for all connections in the environment
${'VARIATIONS :'.bold}
@ -645,8 +746,7 @@ ${'VARIATIONS :'.bold}
${'xc meta.export --env production --dbAlias db2'.bold}
- Exports metadata for 'db2' database in 'production' environment
`
`;
}
public static manProjectMetaReset() {
@ -655,13 +755,17 @@ ${'COMMAND : '.bold}
${'xc meta.reset'.bold} - Clears all meta table data
${'SYNOPSIS : '.bold}
${'xc meta.reset'.bold} ${'--env'.bold} <environment> [${'--dbAlias'.bold} <databaseAlias>]
${'xc meta.reset'.bold} ${'--env'.bold} <environment> [${
'--dbAlias'.bold
} <databaseAlias>]
${'OPTIONS :'.bold}
The following options are available:
${'--env'.bold} Environment name to be reset
${'--dbAlias'.bold} dbAlias of database connection. If not provided then it will clear metadata for all connections in the environment
${
'--dbAlias'.bold
} dbAlias of database connection. If not provided then it will clear metadata for all connections in the environment
${'VARIATIONS :'.bold}
@ -673,23 +777,28 @@ ${'VARIATIONS :'.bold}
${'xc meta.reset --env production --dbAlias db2'.bold}
- Clears metadata for 'db2' database in 'production' environment
`
`;
}
public static manProjectMetaImport() {
return `
${'COMMAND : '.bold}
${'xc meta.import'.bold} - Imports data from project meta folder to meta tables
${
'xc meta.import'.bold
} - Imports data from project meta folder to meta tables
${'SYNOPSIS : '.bold}
${'xc meta.import'.bold} ${'--env'.bold} <environment> [${'--dbAlias'.bold} <databaseAlias>]
${'xc meta.import'.bold} ${'--env'.bold} <environment> [${
'--dbAlias'.bold
} <databaseAlias>]
${'OPTIONS :'.bold}
The following options are available:
${'--env'.bold} Environment name to be imported
${'--dbAlias'.bold} dbAlias of database connection. If not provided then it will import metadata to all connections in the environment
${
'--dbAlias'.bold
} dbAlias of database connection. If not provided then it will import metadata to all connections in the environment
${'VARIATIONS :'.bold}
@ -701,18 +810,13 @@ ${'VARIATIONS :'.bold}
${'xc meta.import --env production --dbAlias db2'.bold}
- Imports metadata for 'db2' database in 'production' environment
`
`;
}
public static showHelpForCommand(args) {
try {
switch (args._[1]) {
case 'new' :
case 'new':
console.log(Util.manNew());
break;
@ -870,14 +974,12 @@ ${'VARIATIONS :'.bold}
//
// /**************** END : Docker ****************/
default:
break;
}
} catch (e) {
throw e;
}
}
public static async runCmd(str) {
@ -891,24 +993,17 @@ ${'VARIATIONS :'.bold}
public static escapeShellArg(cmd) {
return '"' + cmd.replace(/(["'$`\\])/g, '\\$1') + '"';
};
}
public async play(sound) {
switch (sound) {
case -1:
break;
case 'fun':
break;
}
}
}
export default Util;

5
packages/nc-cli/src/lib/util/config.ts

@ -1,4 +1,3 @@
export default {
port: 23917,
}
port: 23917
};

661
packages/nc-gui/LICENSE

@ -0,0 +1,661 @@
GNU AFFERO GENERAL PUBLIC LICENSE
Version 3, 19 November 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU Affero General Public License is a free, copyleft license for
software and other kinds of works, specifically designed to ensure
cooperation with the community in the case of network server software.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
our General Public Licenses are intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
Developers that use our General Public Licenses protect your rights
with two steps: (1) assert copyright on the software, and (2) offer
you this License which gives you legal permission to copy, distribute
and/or modify the software.
A secondary benefit of defending all users' freedom is that
improvements made in alternate versions of the program, if they
receive widespread use, become available for other developers to
incorporate. Many developers of free software are heartened and
encouraged by the resulting cooperation. However, in the case of
software used on network servers, this result may fail to come about.
The GNU General Public License permits making a modified version and
letting the public access it on a server without ever releasing its
source code to the public.
The GNU Affero General Public License is designed specifically to
ensure that, in such cases, the modified source code becomes available
to the community. It requires the operator of a network server to
provide the source code of the modified version running there to the
users of that server. Therefore, public use of a modified version, on
a publicly accessible server, gives the public access to the source
code of the modified version.
An older license, called the Affero General Public License and
published by Affero, was designed to accomplish similar goals. This is
a different license, not a version of the Affero GPL, but Affero has
released a new version of the Affero GPL which permits relicensing under
this license.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU Affero General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Remote Network Interaction; Use with the GNU General Public License.
Notwithstanding any other provision of this License, if you modify the
Program, your modified version must prominently offer all users
interacting with it remotely through a computer network (if your version
supports such interaction) an opportunity to receive the Corresponding
Source of your version by providing access to the Corresponding Source
from a network server at no charge, through some standard or customary
means of facilitating copying of software. This Corresponding Source
shall include the Corresponding Source for any work covered by version 3
of the GNU General Public License that is incorporated pursuant to the
following paragraph.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the work with which it is combined will remain governed by version
3 of the GNU General Public License.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU Affero General Public License from time to time. Such new versions
will be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU Affero General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU Affero General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU Affero General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published
by the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If your software can interact with users remotely through a computer
network, you should also make sure that it provides a way for users to
get its source. For example, if your program is a web application, its
interface could display a "Source" link that leads users to an archive
of the code. There are many ways you could offer source, and different
solutions will be better for different programs; see section 13 for the
specific requirements.
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU AGPL, see
<http://www.gnu.org/licenses/>.

644
packages/nc-gui/package-lock.json generated

@ -4,7 +4,9 @@
"requires": true,
"packages": {
"": {
"name": "nc-gui",
"hasInstallScript": true,
"license": "AGPL-3.0-or-later",
"dependencies": {
"@ckpack/vue-color": "^1.2.0",
"@vue-flow/additional-components": "^1.1.0",
@ -20,7 +22,6 @@
"file-saver": "^2.0.5",
"httpsnippet": "^2.0.0",
"jsep": "^1.3.6",
"json-schema-traverse": "^1.0.0",
"just-clone": "^6.1.1",
"jwt-decode": "^3.1.2",
"locale-codes": "^1.3.1",
@ -57,9 +58,7 @@
"@intlify/vite-plugin-vue-i18n": "^6.0.1",
"@nuxt/image-edge": "^1.0.0-27657146.da85542",
"@types/axios": "^0.14.0",
"@types/d3": "^7.4.0",
"@types/dagre": "^0.7.48",
"@types/file-saver": "^2.0.5",
"@types/papaparse": "^5.3.2",
"@types/sortablejs": "^1.13.0",
"@types/tinycolor2": "^1.4.3",
@ -87,38 +86,24 @@
},
"../nocodb-sdk": {
"version": "0.98.3",
"license": "MIT",
"license": "AGPL-3.0-or-later",
"dependencies": {
"axios": "^0.21.1",
"jsep": "^1.3.6"
},
"devDependencies": {
"@ava/typescript": "^1.1.1",
"@istanbuljs/nyc-config-typescript": "^1.0.1",
"@typescript-eslint/eslint-plugin": "^4.0.1",
"@typescript-eslint/parser": "^4.0.1",
"ava": "^3.12.1",
"codecov": "^3.5.0",
"cspell": "^4.1.0",
"cz-conventional-changelog": "^3.3.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",
"gh-pages": "^3.1.0",
"npm-run-all": "^4.1.5",
"nyc": "^15.1.0",
"open-cli": "^7.1.0",
"prettier": "^2.1.1",
"standard-version": "^9.0.0",
"ts-node": "^9.0.0",
"typedoc": "^0.23.16",
"typescript": "^4.0.2"
},
"engines": {
"node": ">=10"
}
},
"node_modules/@ampproject/remapping": {
@ -1094,9 +1079,9 @@
}
},
"node_modules/@iconify-json/bi": {
"version": "1.1.6",
"resolved": "https://registry.npmjs.org/@iconify-json/bi/-/bi-1.1.6.tgz",
"integrity": "sha512-q80o/IJN/mEwhzQG/LjmpA4S5Zk3XzHegmhseWEvu6XF/N3pc8d7a1Fv/PVE2kij06J6ugb8DTdt30BCt5Dplw==",
"version": "1.1.8",
"resolved": "https://registry.npmjs.org/@iconify-json/bi/-/bi-1.1.8.tgz",
"integrity": "sha512-aUmRT4iKjpz9fRF2/6d2JcMd7Lz6Fwn4rQnMZy8rhAw3CCBKPRpcbSW3tf+O1K4+oVe/+gV2FqO50ZZiWsjaEw==",
"dev": true,
"dependencies": {
"@iconify/types": "*"
@ -1130,45 +1115,45 @@
}
},
"node_modules/@iconify-json/ic": {
"version": "1.1.7",
"resolved": "https://registry.npmjs.org/@iconify-json/ic/-/ic-1.1.7.tgz",
"integrity": "sha512-CYwkhja02SZoevezNHSqM7d1lpsRJxKt9fzvn3MpRxI8s2v3LNmhGiD/bTq3uFgqQMRPp+OnD+OOjHrMo7ah1g==",
"version": "1.1.9",
"resolved": "https://registry.npmjs.org/@iconify-json/ic/-/ic-1.1.9.tgz",
"integrity": "sha512-yRHx4AnNNf5kpWVnNMaeXGYnLmaR2tkGsjSc//FaI7LhljUaDkiawUvmnYbjh6M61O78EeEoNk8HgYJVqb+y8A==",
"dev": true,
"dependencies": {
"@iconify/types": "*"
}
},
"node_modules/@iconify-json/logos": {
"version": "1.1.14",
"resolved": "https://registry.npmjs.org/@iconify-json/logos/-/logos-1.1.14.tgz",
"integrity": "sha512-SvSxKubQbP/7Wdb3loShUeRGv82ejkNo5gjzvJzQeauntuU4aZjDrx0mnkhFZgNYd3li/mxvzPn79Xc5SGVliw==",
"version": "1.1.18",
"resolved": "https://registry.npmjs.org/@iconify-json/logos/-/logos-1.1.18.tgz",
"integrity": "sha512-Ra8BV3fJhE/5omYOY2UlDhgggyxxzMTppGH3n9EfFYh9Rpx4+HtE6zp7s+i3glYOqs2Me5HNcDEOkU63kcHqvg==",
"dev": true,
"dependencies": {
"@iconify/types": "*"
}
},
"node_modules/@iconify-json/lucide": {
"version": "1.1.38",
"resolved": "https://registry.npmjs.org/@iconify-json/lucide/-/lucide-1.1.38.tgz",
"integrity": "sha512-0sDKnWign8yc3ndWczI4QliSMUi/AUngwlufprDJlR7feXILzpEfp5yyYlfPRE7gQrup6ey8dMX1vDaT8bet/g==",
"version": "1.1.49",
"resolved": "https://registry.npmjs.org/@iconify-json/lucide/-/lucide-1.1.49.tgz",
"integrity": "sha512-Pjy0AyHW8nxEGjrS4Jnzz6Imua/6F/07k8dPQQnnSjzIBCtVt605LMeq5Tn8ECI+YwQqTvlXEMFQDn87ZPDtNA==",
"dev": true,
"dependencies": {
"@iconify/types": "*"
}
},
"node_modules/@iconify-json/material-symbols": {
"version": "1.1.8",
"resolved": "https://registry.npmjs.org/@iconify-json/material-symbols/-/material-symbols-1.1.8.tgz",
"integrity": "sha512-RJlqCJJjntQQzTe+nbv1/aTMkEtrkGO30CYOAdSIhxyIox32IGHQqvySTXYjAOMwpQrmwbCHwnJjxDTLc6kISw==",
"version": "1.1.21",
"resolved": "https://registry.npmjs.org/@iconify-json/material-symbols/-/material-symbols-1.1.21.tgz",
"integrity": "sha512-mWG7AA/O6MHK4R4uUdUG1+bXmusSfkh+66mOJ387QSMJtQWsH0l+TtlAdK3FhLvXCPnFXQ8yi1J8M2CUTo6VPg==",
"dev": true,
"dependencies": {
"@iconify/types": "*"
}
},
"node_modules/@iconify-json/mdi": {
"version": "1.1.25",
"resolved": "https://registry.npmjs.org/@iconify-json/mdi/-/mdi-1.1.25.tgz",
"integrity": "sha512-AABK/uILIYlXDcFoOvwiuAD5SI+TyiTYqvQ88Q5lScUnWUrcW9oTtqS5Cb/vX07Va76iZLwMzzvydNSVfI7jIg==",
"version": "1.1.34",
"resolved": "https://registry.npmjs.org/@iconify-json/mdi/-/mdi-1.1.34.tgz",
"integrity": "sha512-Jle/BrVmaKMMPVitsO3lbJ8VpXUVCAhfMFAMo0VoxLDX8ZiKiQyVDHXPug9wGaXYb9mrFZE4UWVK63Cjx8L3rQ==",
"dev": true,
"dependencies": {
"@iconify/types": "*"
@ -2933,259 +2918,6 @@
"@types/node": "*"
}
},
"node_modules/@types/d3": {
"version": "7.4.0",
"resolved": "https://registry.npmjs.org/@types/d3/-/d3-7.4.0.tgz",
"integrity": "sha512-jIfNVK0ZlxcuRDKtRS/SypEyOQ6UHaFQBKv032X45VvxSJ6Yi5G9behy9h6tNTHTDGh5Vq+KbmBjUWLgY4meCA==",
"dev": true,
"dependencies": {
"@types/d3-array": "*",
"@types/d3-axis": "*",
"@types/d3-brush": "*",
"@types/d3-chord": "*",
"@types/d3-color": "*",
"@types/d3-contour": "*",
"@types/d3-delaunay": "*",
"@types/d3-dispatch": "*",
"@types/d3-drag": "*",
"@types/d3-dsv": "*",
"@types/d3-ease": "*",
"@types/d3-fetch": "*",
"@types/d3-force": "*",
"@types/d3-format": "*",
"@types/d3-geo": "*",
"@types/d3-hierarchy": "*",
"@types/d3-interpolate": "*",
"@types/d3-path": "*",
"@types/d3-polygon": "*",
"@types/d3-quadtree": "*",
"@types/d3-random": "*",
"@types/d3-scale": "*",
"@types/d3-scale-chromatic": "*",
"@types/d3-selection": "*",
"@types/d3-shape": "*",
"@types/d3-time": "*",
"@types/d3-time-format": "*",
"@types/d3-timer": "*",
"@types/d3-transition": "*",
"@types/d3-zoom": "*"
}
},
"node_modules/@types/d3-array": {
"version": "3.0.3",
"resolved": "https://registry.npmjs.org/@types/d3-array/-/d3-array-3.0.3.tgz",
"integrity": "sha512-Reoy+pKnvsksN0lQUlcH6dOGjRZ/3WRwXR//m+/8lt1BXeI4xyaUZoqULNjyXXRuh0Mj4LNpkCvhUpQlY3X5xQ==",
"dev": true
},
"node_modules/@types/d3-axis": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/@types/d3-axis/-/d3-axis-3.0.1.tgz",
"integrity": "sha512-zji/iIbdd49g9WN0aIsGcwcTBUkgLsCSwB+uH+LPVDAiKWENMtI3cJEWt+7/YYwelMoZmbBfzA3qCdrZ2XFNnw==",
"dev": true,
"dependencies": {
"@types/d3-selection": "*"
}
},
"node_modules/@types/d3-brush": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/@types/d3-brush/-/d3-brush-3.0.1.tgz",
"integrity": "sha512-B532DozsiTuQMHu2YChdZU0qsFJSio3Q6jmBYGYNp3gMDzBmuFFgPt9qKA4VYuLZMp4qc6eX7IUFUEsvHiXZAw==",
"dev": true,
"dependencies": {
"@types/d3-selection": "*"
}
},
"node_modules/@types/d3-chord": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/@types/d3-chord/-/d3-chord-3.0.1.tgz",
"integrity": "sha512-eQfcxIHrg7V++W8Qxn6QkqBNBokyhdWSAS73AbkbMzvLQmVVBviknoz2SRS/ZJdIOmhcmmdCRE/NFOm28Z1AMw==",
"dev": true
},
"node_modules/@types/d3-color": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/@types/d3-color/-/d3-color-3.1.0.tgz",
"integrity": "sha512-HKuicPHJuvPgCD+np6Se9MQvS6OCbJmOjGvylzMJRlDwUXjKTTXs6Pwgk79O09Vj/ho3u1ofXnhFOaEWWPrlwA==",
"dev": true
},
"node_modules/@types/d3-contour": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/@types/d3-contour/-/d3-contour-3.0.1.tgz",
"integrity": "sha512-C3zfBrhHZvrpAAK3YXqLWVAGo87A4SvJ83Q/zVJ8rFWJdKejUnDYaWZPkA8K84kb2vDA/g90LTQAz7etXcgoQQ==",
"dev": true,
"dependencies": {
"@types/d3-array": "*",
"@types/geojson": "*"
}
},
"node_modules/@types/d3-delaunay": {
"version": "6.0.1",
"resolved": "https://registry.npmjs.org/@types/d3-delaunay/-/d3-delaunay-6.0.1.tgz",
"integrity": "sha512-tLxQ2sfT0p6sxdG75c6f/ekqxjyYR0+LwPrsO1mbC9YDBzPJhs2HbJJRrn8Ez1DBoHRo2yx7YEATI+8V1nGMnQ==",
"dev": true
},
"node_modules/@types/d3-dispatch": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/@types/d3-dispatch/-/d3-dispatch-3.0.1.tgz",
"integrity": "sha512-NhxMn3bAkqhjoxabVJWKryhnZXXYYVQxaBnbANu0O94+O/nX9qSjrA1P1jbAQJxJf+VC72TxDX/YJcKue5bRqw==",
"dev": true
},
"node_modules/@types/d3-drag": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/@types/d3-drag/-/d3-drag-3.0.1.tgz",
"integrity": "sha512-o1Va7bLwwk6h03+nSM8dpaGEYnoIG19P0lKqlic8Un36ymh9NSkNFX1yiXMKNMx8rJ0Kfnn2eovuFaL6Jvj0zA==",
"dev": true,
"dependencies": {
"@types/d3-selection": "*"
}
},
"node_modules/@types/d3-dsv": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/@types/d3-dsv/-/d3-dsv-3.0.0.tgz",
"integrity": "sha512-o0/7RlMl9p5n6FQDptuJVMxDf/7EDEv2SYEO/CwdG2tr1hTfUVi0Iavkk2ax+VpaQ/1jVhpnj5rq1nj8vwhn2A==",
"dev": true
},
"node_modules/@types/d3-ease": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/@types/d3-ease/-/d3-ease-3.0.0.tgz",
"integrity": "sha512-aMo4eaAOijJjA6uU+GIeW018dvy9+oH5Y2VPPzjjfxevvGQ/oRDs+tfYC9b50Q4BygRR8yE2QCLsrT0WtAVseA==",
"dev": true
},
"node_modules/@types/d3-fetch": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/@types/d3-fetch/-/d3-fetch-3.0.1.tgz",
"integrity": "sha512-toZJNOwrOIqz7Oh6Q7l2zkaNfXkfR7mFSJvGvlD/Ciq/+SQ39d5gynHJZ/0fjt83ec3WL7+u3ssqIijQtBISsw==",
"dev": true,
"dependencies": {
"@types/d3-dsv": "*"
}
},
"node_modules/@types/d3-force": {
"version": "3.0.3",
"resolved": "https://registry.npmjs.org/@types/d3-force/-/d3-force-3.0.3.tgz",
"integrity": "sha512-z8GteGVfkWJMKsx6hwC3SiTSLspL98VNpmvLpEFJQpZPq6xpA1I8HNBDNSpukfK0Vb0l64zGFhzunLgEAcBWSA==",
"dev": true
},
"node_modules/@types/d3-format": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/@types/d3-format/-/d3-format-3.0.1.tgz",
"integrity": "sha512-5KY70ifCCzorkLuIkDe0Z9YTf9RR2CjBX1iaJG+rgM/cPP+sO+q9YdQ9WdhQcgPj1EQiJ2/0+yUkkziTG6Lubg==",
"dev": true
},
"node_modules/@types/d3-geo": {
"version": "3.0.2",
"resolved": "https://registry.npmjs.org/@types/d3-geo/-/d3-geo-3.0.2.tgz",
"integrity": "sha512-DbqK7MLYA8LpyHQfv6Klz0426bQEf7bRTvhMy44sNGVyZoWn//B0c+Qbeg8Osi2Obdc9BLLXYAKpyWege2/7LQ==",
"dev": true,
"dependencies": {
"@types/geojson": "*"
}
},
"node_modules/@types/d3-hierarchy": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/@types/d3-hierarchy/-/d3-hierarchy-3.1.0.tgz",
"integrity": "sha512-g+sey7qrCa3UbsQlMZZBOHROkFqx7KZKvUpRzI/tAp/8erZWpYq7FgNKvYwebi2LaEiVs1klhUfd3WCThxmmWQ==",
"dev": true
},
"node_modules/@types/d3-interpolate": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/@types/d3-interpolate/-/d3-interpolate-3.0.1.tgz",
"integrity": "sha512-jx5leotSeac3jr0RePOH1KdR9rISG91QIE4Q2PYTu4OymLTZfA3SrnURSLzKH48HmXVUru50b8nje4E79oQSQw==",
"dev": true,
"dependencies": {
"@types/d3-color": "*"
}
},
"node_modules/@types/d3-path": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/@types/d3-path/-/d3-path-3.0.0.tgz",
"integrity": "sha512-0g/A+mZXgFkQxN3HniRDbXMN79K3CdTpLsevj+PXiTcb2hVyvkZUBg37StmgCQkaD84cUJ4uaDAWq7UJOQy2Tg==",
"dev": true
},
"node_modules/@types/d3-polygon": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/@types/d3-polygon/-/d3-polygon-3.0.0.tgz",
"integrity": "sha512-D49z4DyzTKXM0sGKVqiTDTYr+DHg/uxsiWDAkNrwXYuiZVd9o9wXZIo+YsHkifOiyBkmSWlEngHCQme54/hnHw==",
"dev": true
},
"node_modules/@types/d3-quadtree": {
"version": "3.0.2",
"resolved": "https://registry.npmjs.org/@types/d3-quadtree/-/d3-quadtree-3.0.2.tgz",
"integrity": "sha512-QNcK8Jguvc8lU+4OfeNx+qnVy7c0VrDJ+CCVFS9srBo2GL9Y18CnIxBdTF3v38flrGy5s1YggcoAiu6s4fLQIw==",
"dev": true
},
"node_modules/@types/d3-random": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/@types/d3-random/-/d3-random-3.0.1.tgz",
"integrity": "sha512-IIE6YTekGczpLYo/HehAy3JGF1ty7+usI97LqraNa8IiDur+L44d0VOjAvFQWJVdZOJHukUJw+ZdZBlgeUsHOQ==",
"dev": true
},
"node_modules/@types/d3-scale": {
"version": "4.0.2",
"resolved": "https://registry.npmjs.org/@types/d3-scale/-/d3-scale-4.0.2.tgz",
"integrity": "sha512-Yk4htunhPAwN0XGlIwArRomOjdoBFXC3+kCxK2Ubg7I9shQlVSJy/pG/Ht5ASN+gdMIalpk8TJ5xV74jFsetLA==",
"dev": true,
"dependencies": {
"@types/d3-time": "*"
}
},
"node_modules/@types/d3-scale-chromatic": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/@types/d3-scale-chromatic/-/d3-scale-chromatic-3.0.0.tgz",
"integrity": "sha512-dsoJGEIShosKVRBZB0Vo3C8nqSDqVGujJU6tPznsBJxNJNwMF8utmS83nvCBKQYPpjCzaaHcrf66iTRpZosLPw==",
"dev": true
},
"node_modules/@types/d3-selection": {
"version": "3.0.3",
"resolved": "https://registry.npmjs.org/@types/d3-selection/-/d3-selection-3.0.3.tgz",
"integrity": "sha512-Mw5cf6nlW1MlefpD9zrshZ+DAWL4IQ5LnWfRheW6xwsdaWOb6IRRu2H7XPAQcyXEx1D7XQWgdoKR83ui1/HlEA==",
"dev": true
},
"node_modules/@types/d3-shape": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/@types/d3-shape/-/d3-shape-3.1.0.tgz",
"integrity": "sha512-jYIYxFFA9vrJ8Hd4Se83YI6XF+gzDL1aC5DCsldai4XYYiVNdhtpGbA/GM6iyQ8ayhSp3a148LY34hy7A4TxZA==",
"dev": true,
"dependencies": {
"@types/d3-path": "*"
}
},
"node_modules/@types/d3-time": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/@types/d3-time/-/d3-time-3.0.0.tgz",
"integrity": "sha512-sZLCdHvBUcNby1cB6Fd3ZBrABbjz3v1Vm90nysCQ6Vt7vd6e/h9Lt7SiJUoEX0l4Dzc7P5llKyhqSi1ycSf1Hg==",
"dev": true
},
"node_modules/@types/d3-time-format": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/@types/d3-time-format/-/d3-time-format-4.0.0.tgz",
"integrity": "sha512-yjfBUe6DJBsDin2BMIulhSHmr5qNR5Pxs17+oW4DoVPyVIXZ+m6bs7j1UVKP08Emv6jRmYrYqxYzO63mQxy1rw==",
"dev": true
},
"node_modules/@types/d3-timer": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/@types/d3-timer/-/d3-timer-3.0.0.tgz",
"integrity": "sha512-HNB/9GHqu7Fo8AQiugyJbv6ZxYz58wef0esl4Mv828w1ZKpAshw/uFWVDUcIB9KKFeFKoxS3cHY07FFgtTRZ1g==",
"dev": true
},
"node_modules/@types/d3-transition": {
"version": "3.0.2",
"resolved": "https://registry.npmjs.org/@types/d3-transition/-/d3-transition-3.0.2.tgz",
"integrity": "sha512-jo5o/Rf+/u6uerJ/963Dc39NI16FQzqwOc54bwvksGAdVfvDrqDpVeq95bEvPtBwLCVZutAEyAtmSyEMxN7vxQ==",
"dev": true,
"dependencies": {
"@types/d3-selection": "*"
}
},
"node_modules/@types/d3-zoom": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/@types/d3-zoom/-/d3-zoom-3.0.1.tgz",
"integrity": "sha512-7s5L9TjfqIYQmQQEUcpMAcBOahem7TRoSO/+Gkz02GbMVuULiZzjF2BOdw291dbO2aNon4m2OdFsRGaCq2caLQ==",
"dev": true,
"dependencies": {
"@types/d3-interpolate": "*",
"@types/d3-selection": "*"
}
},
"node_modules/@types/dagre": {
"version": "0.7.48",
"resolved": "https://registry.npmjs.org/@types/dagre/-/dagre-0.7.48.tgz",
@ -3222,12 +2954,6 @@
"integrity": "sha512-CuPgU6f3eT/XgKKPqKd/gLZV1Xmvf1a2R5POBOGQa6uv82xpls89HU5zKeVoyR8XzHd1RGNOlQlvUe3CFkjWNQ==",
"dev": true
},
"node_modules/@types/file-saver": {
"version": "2.0.5",
"resolved": "https://registry.npmjs.org/@types/file-saver/-/file-saver-2.0.5.tgz",
"integrity": "sha512-zv9kNf3keYegP5oThGLaPk8E081DFDuwfqjtiTzm6PoxChdJ1raSuADf2YGCVIyrSynLrgc8JWv296s7Q7pQSQ==",
"dev": true
},
"node_modules/@types/form-data": {
"version": "0.0.33",
"resolved": "https://registry.npmjs.org/@types/form-data/-/form-data-0.0.33.tgz",
@ -3237,12 +2963,6 @@
"@types/node": "*"
}
},
"node_modules/@types/geojson": {
"version": "7946.0.10",
"resolved": "https://registry.npmjs.org/@types/geojson/-/geojson-7946.0.10.tgz",
"integrity": "sha512-Nmh0K3iWQJzniTuPRcJn5hxXkfB1T1pgB89SBig5PlJQU5yocazeu4jATJlaA0GYFKWMqDdvYemoSnF2pXgLVA==",
"dev": true
},
"node_modules/@types/json-schema": {
"version": "7.0.11",
"resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.11.tgz",
@ -10465,11 +10185,6 @@
"integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==",
"dev": true
},
"node_modules/json-schema-traverse": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz",
"integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug=="
},
"node_modules/json-stable-stringify-without-jsonify": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz",
@ -17703,9 +17418,9 @@
}
},
"@iconify-json/bi": {
"version": "1.1.6",
"resolved": "https://registry.npmjs.org/@iconify-json/bi/-/bi-1.1.6.tgz",
"integrity": "sha512-q80o/IJN/mEwhzQG/LjmpA4S5Zk3XzHegmhseWEvu6XF/N3pc8d7a1Fv/PVE2kij06J6ugb8DTdt30BCt5Dplw==",
"version": "1.1.8",
"resolved": "https://registry.npmjs.org/@iconify-json/bi/-/bi-1.1.8.tgz",
"integrity": "sha512-aUmRT4iKjpz9fRF2/6d2JcMd7Lz6Fwn4rQnMZy8rhAw3CCBKPRpcbSW3tf+O1K4+oVe/+gV2FqO50ZZiWsjaEw==",
"dev": true,
"requires": {
"@iconify/types": "*"
@ -17739,45 +17454,45 @@
}
},
"@iconify-json/ic": {
"version": "1.1.7",
"resolved": "https://registry.npmjs.org/@iconify-json/ic/-/ic-1.1.7.tgz",
"integrity": "sha512-CYwkhja02SZoevezNHSqM7d1lpsRJxKt9fzvn3MpRxI8s2v3LNmhGiD/bTq3uFgqQMRPp+OnD+OOjHrMo7ah1g==",
"version": "1.1.9",
"resolved": "https://registry.npmjs.org/@iconify-json/ic/-/ic-1.1.9.tgz",
"integrity": "sha512-yRHx4AnNNf5kpWVnNMaeXGYnLmaR2tkGsjSc//FaI7LhljUaDkiawUvmnYbjh6M61O78EeEoNk8HgYJVqb+y8A==",
"dev": true,
"requires": {
"@iconify/types": "*"
}
},
"@iconify-json/logos": {
"version": "1.1.14",
"resolved": "https://registry.npmjs.org/@iconify-json/logos/-/logos-1.1.14.tgz",
"integrity": "sha512-SvSxKubQbP/7Wdb3loShUeRGv82ejkNo5gjzvJzQeauntuU4aZjDrx0mnkhFZgNYd3li/mxvzPn79Xc5SGVliw==",
"version": "1.1.18",
"resolved": "https://registry.npmjs.org/@iconify-json/logos/-/logos-1.1.18.tgz",
"integrity": "sha512-Ra8BV3fJhE/5omYOY2UlDhgggyxxzMTppGH3n9EfFYh9Rpx4+HtE6zp7s+i3glYOqs2Me5HNcDEOkU63kcHqvg==",
"dev": true,
"requires": {
"@iconify/types": "*"
}
},
"@iconify-json/lucide": {
"version": "1.1.38",
"resolved": "https://registry.npmjs.org/@iconify-json/lucide/-/lucide-1.1.38.tgz",
"integrity": "sha512-0sDKnWign8yc3ndWczI4QliSMUi/AUngwlufprDJlR7feXILzpEfp5yyYlfPRE7gQrup6ey8dMX1vDaT8bet/g==",
"version": "1.1.49",
"resolved": "https://registry.npmjs.org/@iconify-json/lucide/-/lucide-1.1.49.tgz",
"integrity": "sha512-Pjy0AyHW8nxEGjrS4Jnzz6Imua/6F/07k8dPQQnnSjzIBCtVt605LMeq5Tn8ECI+YwQqTvlXEMFQDn87ZPDtNA==",
"dev": true,
"requires": {
"@iconify/types": "*"
}
},
"@iconify-json/material-symbols": {
"version": "1.1.8",
"resolved": "https://registry.npmjs.org/@iconify-json/material-symbols/-/material-symbols-1.1.8.tgz",
"integrity": "sha512-RJlqCJJjntQQzTe+nbv1/aTMkEtrkGO30CYOAdSIhxyIox32IGHQqvySTXYjAOMwpQrmwbCHwnJjxDTLc6kISw==",
"version": "1.1.21",
"resolved": "https://registry.npmjs.org/@iconify-json/material-symbols/-/material-symbols-1.1.21.tgz",
"integrity": "sha512-mWG7AA/O6MHK4R4uUdUG1+bXmusSfkh+66mOJ387QSMJtQWsH0l+TtlAdK3FhLvXCPnFXQ8yi1J8M2CUTo6VPg==",
"dev": true,
"requires": {
"@iconify/types": "*"
}
},
"@iconify-json/mdi": {
"version": "1.1.25",
"resolved": "https://registry.npmjs.org/@iconify-json/mdi/-/mdi-1.1.25.tgz",
"integrity": "sha512-AABK/uILIYlXDcFoOvwiuAD5SI+TyiTYqvQ88Q5lScUnWUrcW9oTtqS5Cb/vX07Va76iZLwMzzvydNSVfI7jIg==",
"version": "1.1.34",
"resolved": "https://registry.npmjs.org/@iconify-json/mdi/-/mdi-1.1.34.tgz",
"integrity": "sha512-Jle/BrVmaKMMPVitsO3lbJ8VpXUVCAhfMFAMo0VoxLDX8ZiKiQyVDHXPug9wGaXYb9mrFZE4UWVK63Cjx8L3rQ==",
"dev": true,
"requires": {
"@iconify/types": "*"
@ -19062,259 +18777,6 @@
"@types/node": "*"
}
},
"@types/d3": {
"version": "7.4.0",
"resolved": "https://registry.npmjs.org/@types/d3/-/d3-7.4.0.tgz",
"integrity": "sha512-jIfNVK0ZlxcuRDKtRS/SypEyOQ6UHaFQBKv032X45VvxSJ6Yi5G9behy9h6tNTHTDGh5Vq+KbmBjUWLgY4meCA==",
"dev": true,
"requires": {
"@types/d3-array": "*",
"@types/d3-axis": "*",
"@types/d3-brush": "*",
"@types/d3-chord": "*",
"@types/d3-color": "*",
"@types/d3-contour": "*",
"@types/d3-delaunay": "*",
"@types/d3-dispatch": "*",
"@types/d3-drag": "*",
"@types/d3-dsv": "*",
"@types/d3-ease": "*",
"@types/d3-fetch": "*",
"@types/d3-force": "*",
"@types/d3-format": "*",
"@types/d3-geo": "*",
"@types/d3-hierarchy": "*",
"@types/d3-interpolate": "*",
"@types/d3-path": "*",
"@types/d3-polygon": "*",
"@types/d3-quadtree": "*",
"@types/d3-random": "*",
"@types/d3-scale": "*",
"@types/d3-scale-chromatic": "*",
"@types/d3-selection": "*",
"@types/d3-shape": "*",
"@types/d3-time": "*",
"@types/d3-time-format": "*",
"@types/d3-timer": "*",
"@types/d3-transition": "*",
"@types/d3-zoom": "*"
}
},
"@types/d3-array": {
"version": "3.0.3",
"resolved": "https://registry.npmjs.org/@types/d3-array/-/d3-array-3.0.3.tgz",
"integrity": "sha512-Reoy+pKnvsksN0lQUlcH6dOGjRZ/3WRwXR//m+/8lt1BXeI4xyaUZoqULNjyXXRuh0Mj4LNpkCvhUpQlY3X5xQ==",
"dev": true
},
"@types/d3-axis": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/@types/d3-axis/-/d3-axis-3.0.1.tgz",
"integrity": "sha512-zji/iIbdd49g9WN0aIsGcwcTBUkgLsCSwB+uH+LPVDAiKWENMtI3cJEWt+7/YYwelMoZmbBfzA3qCdrZ2XFNnw==",
"dev": true,
"requires": {
"@types/d3-selection": "*"
}
},
"@types/d3-brush": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/@types/d3-brush/-/d3-brush-3.0.1.tgz",
"integrity": "sha512-B532DozsiTuQMHu2YChdZU0qsFJSio3Q6jmBYGYNp3gMDzBmuFFgPt9qKA4VYuLZMp4qc6eX7IUFUEsvHiXZAw==",
"dev": true,
"requires": {
"@types/d3-selection": "*"
}
},
"@types/d3-chord": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/@types/d3-chord/-/d3-chord-3.0.1.tgz",
"integrity": "sha512-eQfcxIHrg7V++W8Qxn6QkqBNBokyhdWSAS73AbkbMzvLQmVVBviknoz2SRS/ZJdIOmhcmmdCRE/NFOm28Z1AMw==",
"dev": true
},
"@types/d3-color": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/@types/d3-color/-/d3-color-3.1.0.tgz",
"integrity": "sha512-HKuicPHJuvPgCD+np6Se9MQvS6OCbJmOjGvylzMJRlDwUXjKTTXs6Pwgk79O09Vj/ho3u1ofXnhFOaEWWPrlwA==",
"dev": true
},
"@types/d3-contour": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/@types/d3-contour/-/d3-contour-3.0.1.tgz",
"integrity": "sha512-C3zfBrhHZvrpAAK3YXqLWVAGo87A4SvJ83Q/zVJ8rFWJdKejUnDYaWZPkA8K84kb2vDA/g90LTQAz7etXcgoQQ==",
"dev": true,
"requires": {
"@types/d3-array": "*",
"@types/geojson": "*"
}
},
"@types/d3-delaunay": {
"version": "6.0.1",
"resolved": "https://registry.npmjs.org/@types/d3-delaunay/-/d3-delaunay-6.0.1.tgz",
"integrity": "sha512-tLxQ2sfT0p6sxdG75c6f/ekqxjyYR0+LwPrsO1mbC9YDBzPJhs2HbJJRrn8Ez1DBoHRo2yx7YEATI+8V1nGMnQ==",
"dev": true
},
"@types/d3-dispatch": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/@types/d3-dispatch/-/d3-dispatch-3.0.1.tgz",
"integrity": "sha512-NhxMn3bAkqhjoxabVJWKryhnZXXYYVQxaBnbANu0O94+O/nX9qSjrA1P1jbAQJxJf+VC72TxDX/YJcKue5bRqw==",
"dev": true
},
"@types/d3-drag": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/@types/d3-drag/-/d3-drag-3.0.1.tgz",
"integrity": "sha512-o1Va7bLwwk6h03+nSM8dpaGEYnoIG19P0lKqlic8Un36ymh9NSkNFX1yiXMKNMx8rJ0Kfnn2eovuFaL6Jvj0zA==",
"dev": true,
"requires": {
"@types/d3-selection": "*"
}
},
"@types/d3-dsv": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/@types/d3-dsv/-/d3-dsv-3.0.0.tgz",
"integrity": "sha512-o0/7RlMl9p5n6FQDptuJVMxDf/7EDEv2SYEO/CwdG2tr1hTfUVi0Iavkk2ax+VpaQ/1jVhpnj5rq1nj8vwhn2A==",
"dev": true
},
"@types/d3-ease": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/@types/d3-ease/-/d3-ease-3.0.0.tgz",
"integrity": "sha512-aMo4eaAOijJjA6uU+GIeW018dvy9+oH5Y2VPPzjjfxevvGQ/oRDs+tfYC9b50Q4BygRR8yE2QCLsrT0WtAVseA==",
"dev": true
},
"@types/d3-fetch": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/@types/d3-fetch/-/d3-fetch-3.0.1.tgz",
"integrity": "sha512-toZJNOwrOIqz7Oh6Q7l2zkaNfXkfR7mFSJvGvlD/Ciq/+SQ39d5gynHJZ/0fjt83ec3WL7+u3ssqIijQtBISsw==",
"dev": true,
"requires": {
"@types/d3-dsv": "*"
}
},
"@types/d3-force": {
"version": "3.0.3",
"resolved": "https://registry.npmjs.org/@types/d3-force/-/d3-force-3.0.3.tgz",
"integrity": "sha512-z8GteGVfkWJMKsx6hwC3SiTSLspL98VNpmvLpEFJQpZPq6xpA1I8HNBDNSpukfK0Vb0l64zGFhzunLgEAcBWSA==",
"dev": true
},
"@types/d3-format": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/@types/d3-format/-/d3-format-3.0.1.tgz",
"integrity": "sha512-5KY70ifCCzorkLuIkDe0Z9YTf9RR2CjBX1iaJG+rgM/cPP+sO+q9YdQ9WdhQcgPj1EQiJ2/0+yUkkziTG6Lubg==",
"dev": true
},
"@types/d3-geo": {
"version": "3.0.2",
"resolved": "https://registry.npmjs.org/@types/d3-geo/-/d3-geo-3.0.2.tgz",
"integrity": "sha512-DbqK7MLYA8LpyHQfv6Klz0426bQEf7bRTvhMy44sNGVyZoWn//B0c+Qbeg8Osi2Obdc9BLLXYAKpyWege2/7LQ==",
"dev": true,
"requires": {
"@types/geojson": "*"
}
},
"@types/d3-hierarchy": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/@types/d3-hierarchy/-/d3-hierarchy-3.1.0.tgz",
"integrity": "sha512-g+sey7qrCa3UbsQlMZZBOHROkFqx7KZKvUpRzI/tAp/8erZWpYq7FgNKvYwebi2LaEiVs1klhUfd3WCThxmmWQ==",
"dev": true
},
"@types/d3-interpolate": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/@types/d3-interpolate/-/d3-interpolate-3.0.1.tgz",
"integrity": "sha512-jx5leotSeac3jr0RePOH1KdR9rISG91QIE4Q2PYTu4OymLTZfA3SrnURSLzKH48HmXVUru50b8nje4E79oQSQw==",
"dev": true,
"requires": {
"@types/d3-color": "*"
}
},
"@types/d3-path": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/@types/d3-path/-/d3-path-3.0.0.tgz",
"integrity": "sha512-0g/A+mZXgFkQxN3HniRDbXMN79K3CdTpLsevj+PXiTcb2hVyvkZUBg37StmgCQkaD84cUJ4uaDAWq7UJOQy2Tg==",
"dev": true
},
"@types/d3-polygon": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/@types/d3-polygon/-/d3-polygon-3.0.0.tgz",
"integrity": "sha512-D49z4DyzTKXM0sGKVqiTDTYr+DHg/uxsiWDAkNrwXYuiZVd9o9wXZIo+YsHkifOiyBkmSWlEngHCQme54/hnHw==",
"dev": true
},
"@types/d3-quadtree": {
"version": "3.0.2",
"resolved": "https://registry.npmjs.org/@types/d3-quadtree/-/d3-quadtree-3.0.2.tgz",
"integrity": "sha512-QNcK8Jguvc8lU+4OfeNx+qnVy7c0VrDJ+CCVFS9srBo2GL9Y18CnIxBdTF3v38flrGy5s1YggcoAiu6s4fLQIw==",
"dev": true
},
"@types/d3-random": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/@types/d3-random/-/d3-random-3.0.1.tgz",
"integrity": "sha512-IIE6YTekGczpLYo/HehAy3JGF1ty7+usI97LqraNa8IiDur+L44d0VOjAvFQWJVdZOJHukUJw+ZdZBlgeUsHOQ==",
"dev": true
},
"@types/d3-scale": {
"version": "4.0.2",
"resolved": "https://registry.npmjs.org/@types/d3-scale/-/d3-scale-4.0.2.tgz",
"integrity": "sha512-Yk4htunhPAwN0XGlIwArRomOjdoBFXC3+kCxK2Ubg7I9shQlVSJy/pG/Ht5ASN+gdMIalpk8TJ5xV74jFsetLA==",
"dev": true,
"requires": {
"@types/d3-time": "*"
}
},
"@types/d3-scale-chromatic": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/@types/d3-scale-chromatic/-/d3-scale-chromatic-3.0.0.tgz",
"integrity": "sha512-dsoJGEIShosKVRBZB0Vo3C8nqSDqVGujJU6tPznsBJxNJNwMF8utmS83nvCBKQYPpjCzaaHcrf66iTRpZosLPw==",
"dev": true
},
"@types/d3-selection": {
"version": "3.0.3",
"resolved": "https://registry.npmjs.org/@types/d3-selection/-/d3-selection-3.0.3.tgz",
"integrity": "sha512-Mw5cf6nlW1MlefpD9zrshZ+DAWL4IQ5LnWfRheW6xwsdaWOb6IRRu2H7XPAQcyXEx1D7XQWgdoKR83ui1/HlEA==",
"dev": true
},
"@types/d3-shape": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/@types/d3-shape/-/d3-shape-3.1.0.tgz",
"integrity": "sha512-jYIYxFFA9vrJ8Hd4Se83YI6XF+gzDL1aC5DCsldai4XYYiVNdhtpGbA/GM6iyQ8ayhSp3a148LY34hy7A4TxZA==",
"dev": true,
"requires": {
"@types/d3-path": "*"
}
},
"@types/d3-time": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/@types/d3-time/-/d3-time-3.0.0.tgz",
"integrity": "sha512-sZLCdHvBUcNby1cB6Fd3ZBrABbjz3v1Vm90nysCQ6Vt7vd6e/h9Lt7SiJUoEX0l4Dzc7P5llKyhqSi1ycSf1Hg==",
"dev": true
},
"@types/d3-time-format": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/@types/d3-time-format/-/d3-time-format-4.0.0.tgz",
"integrity": "sha512-yjfBUe6DJBsDin2BMIulhSHmr5qNR5Pxs17+oW4DoVPyVIXZ+m6bs7j1UVKP08Emv6jRmYrYqxYzO63mQxy1rw==",
"dev": true
},
"@types/d3-timer": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/@types/d3-timer/-/d3-timer-3.0.0.tgz",
"integrity": "sha512-HNB/9GHqu7Fo8AQiugyJbv6ZxYz58wef0esl4Mv828w1ZKpAshw/uFWVDUcIB9KKFeFKoxS3cHY07FFgtTRZ1g==",
"dev": true
},
"@types/d3-transition": {
"version": "3.0.2",
"resolved": "https://registry.npmjs.org/@types/d3-transition/-/d3-transition-3.0.2.tgz",
"integrity": "sha512-jo5o/Rf+/u6uerJ/963Dc39NI16FQzqwOc54bwvksGAdVfvDrqDpVeq95bEvPtBwLCVZutAEyAtmSyEMxN7vxQ==",
"dev": true,
"requires": {
"@types/d3-selection": "*"
}
},
"@types/d3-zoom": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/@types/d3-zoom/-/d3-zoom-3.0.1.tgz",
"integrity": "sha512-7s5L9TjfqIYQmQQEUcpMAcBOahem7TRoSO/+Gkz02GbMVuULiZzjF2BOdw291dbO2aNon4m2OdFsRGaCq2caLQ==",
"dev": true,
"requires": {
"@types/d3-interpolate": "*",
"@types/d3-selection": "*"
}
},
"@types/dagre": {
"version": "0.7.48",
"resolved": "https://registry.npmjs.org/@types/dagre/-/dagre-0.7.48.tgz",
@ -19351,12 +18813,6 @@
"integrity": "sha512-CuPgU6f3eT/XgKKPqKd/gLZV1Xmvf1a2R5POBOGQa6uv82xpls89HU5zKeVoyR8XzHd1RGNOlQlvUe3CFkjWNQ==",
"dev": true
},
"@types/file-saver": {
"version": "2.0.5",
"resolved": "https://registry.npmjs.org/@types/file-saver/-/file-saver-2.0.5.tgz",
"integrity": "sha512-zv9kNf3keYegP5oThGLaPk8E081DFDuwfqjtiTzm6PoxChdJ1raSuADf2YGCVIyrSynLrgc8JWv296s7Q7pQSQ==",
"dev": true
},
"@types/form-data": {
"version": "0.0.33",
"resolved": "https://registry.npmjs.org/@types/form-data/-/form-data-0.0.33.tgz",
@ -19366,12 +18822,6 @@
"@types/node": "*"
}
},
"@types/geojson": {
"version": "7946.0.10",
"resolved": "https://registry.npmjs.org/@types/geojson/-/geojson-7946.0.10.tgz",
"integrity": "sha512-Nmh0K3iWQJzniTuPRcJn5hxXkfB1T1pgB89SBig5PlJQU5yocazeu4jATJlaA0GYFKWMqDdvYemoSnF2pXgLVA==",
"dev": true
},
"@types/json-schema": {
"version": "7.0.11",
"resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.11.tgz",
@ -24597,11 +24047,6 @@
"integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==",
"dev": true
},
"json-schema-traverse": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz",
"integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug=="
},
"json-stable-stringify-without-jsonify": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz",
@ -25608,30 +25053,19 @@
"nocodb-sdk": {
"version": "file:../nocodb-sdk",
"requires": {
"@ava/typescript": "^1.1.1",
"@istanbuljs/nyc-config-typescript": "^1.0.1",
"@typescript-eslint/eslint-plugin": "^4.0.1",
"@typescript-eslint/parser": "^4.0.1",
"ava": "^3.12.1",
"axios": "^0.21.1",
"codecov": "^3.5.0",
"cspell": "^4.1.0",
"cz-conventional-changelog": "^3.3.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",
"gh-pages": "^3.1.0",
"jsep": "^1.3.6",
"npm-run-all": "^4.1.5",
"nyc": "^15.1.0",
"open-cli": "^7.1.0",
"prettier": "^2.1.1",
"standard-version": "^9.0.0",
"ts-node": "^9.0.0",
"typedoc": "^0.23.16",
"typescript": "^4.0.2"
}
},

18
packages/nc-gui/package.json

@ -1,5 +1,20 @@
{
"name": "nc-gui",
"description": "NocoDB Frontend",
"private": true,
"author": {
"name": "NocoDB",
"url": "https://nocodb.com/"
},
"homepage": "https://github.com/nocodb/nocodb",
"repository": {
"type": "git",
"url": "https://github.com/nocodb/nocodb.git"
},
"bugs": {
"url": "https://github.com/nocodb/nocodb/issues"
},
"license": "AGPL-3.0-or-later",
"web-types": "web-types.json",
"scripts": {
"build": "nuxi build",
@ -29,7 +44,6 @@
"file-saver": "^2.0.5",
"httpsnippet": "^2.0.0",
"jsep": "^1.3.6",
"json-schema-traverse": "^1.0.0",
"just-clone": "^6.1.1",
"jwt-decode": "^3.1.2",
"locale-codes": "^1.3.1",
@ -66,9 +80,7 @@
"@intlify/vite-plugin-vue-i18n": "^6.0.1",
"@nuxt/image-edge": "^1.0.0-27657146.da85542",
"@types/axios": "^0.14.0",
"@types/d3": "^7.4.0",
"@types/dagre": "^0.7.48",
"@types/file-saver": "^2.0.5",
"@types/papaparse": "^5.3.2",
"@types/sortablejs": "^1.13.0",
"@types/tinycolor2": "^1.4.3",

661
packages/nc-lib-gui/LICENSE

@ -0,0 +1,661 @@
GNU AFFERO GENERAL PUBLIC LICENSE
Version 3, 19 November 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU Affero General Public License is a free, copyleft license for
software and other kinds of works, specifically designed to ensure
cooperation with the community in the case of network server software.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
our General Public Licenses are intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
Developers that use our General Public Licenses protect your rights
with two steps: (1) assert copyright on the software, and (2) offer
you this License which gives you legal permission to copy, distribute
and/or modify the software.
A secondary benefit of defending all users' freedom is that
improvements made in alternate versions of the program, if they
receive widespread use, become available for other developers to
incorporate. Many developers of free software are heartened and
encouraged by the resulting cooperation. However, in the case of
software used on network servers, this result may fail to come about.
The GNU General Public License permits making a modified version and
letting the public access it on a server without ever releasing its
source code to the public.
The GNU Affero General Public License is designed specifically to
ensure that, in such cases, the modified source code becomes available
to the community. It requires the operator of a network server to
provide the source code of the modified version running there to the
users of that server. Therefore, public use of a modified version, on
a publicly accessible server, gives the public access to the source
code of the modified version.
An older license, called the Affero General Public License and
published by Affero, was designed to accomplish similar goals. This is
a different license, not a version of the Affero GPL, but Affero has
released a new version of the Affero GPL which permits relicensing under
this license.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU Affero General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Remote Network Interaction; Use with the GNU General Public License.
Notwithstanding any other provision of this License, if you modify the
Program, your modified version must prominently offer all users
interacting with it remotely through a computer network (if your version
supports such interaction) an opportunity to receive the Corresponding
Source of your version by providing access to the Corresponding Source
from a network server at no charge, through some standard or customary
means of facilitating copying of software. This Corresponding Source
shall include the Corresponding Source for any work covered by version 3
of the GNU General Public License that is incorporated pursuant to the
following paragraph.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the work with which it is combined will remain governed by version
3 of the GNU General Public License.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU Affero General Public License from time to time. Such new versions
will be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU Affero General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU Affero General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU Affero General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published
by the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If your software can interact with users remotely through a computer
network, you should also make sure that it provides a way for users to
get its source. For example, if your program is a web application, its
interface could display a "Source" link that leads users to an archive
of the code. There are many ways you could offer source, and different
solutions will be better for different programs; see section 13 for the
specific requirements.
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU AGPL, see
<http://www.gnu.org/licenses/>.

9
packages/nc-lib-gui/__tests__/xc-tool-web.test.js

@ -1,9 +0,0 @@
'use strict';
const xcToolWeb = require('..');
describe('xc-tool-web', () => {
it('needs tests');
});

11
packages/nc-lib-gui/lib/XcLibGui.js

@ -1,19 +1,14 @@
const express = require('express');
const path = require('path');
class XcLibGui {
static expressMiddleware(dashboardPath) {
const router = express.Router();
// Express will serve up production assets i.e. main.js
// express will serve up production assets i.e. main.js
// dist will be generated from the build in `nc-gui`. See `build:copy` command in `nc-gui`.
router.use(dashboardPath, express.static(path.join(__dirname, 'dist')));
return router;
}
}
module.exports = XcLibGui;
module.exports = XcLibGui;

1
packages/nc-lib-gui/license.txt

@ -1 +0,0 @@

222
packages/nc-lib-gui/package-lock.json generated

@ -9,12 +9,7 @@
"version": "0.98.3",
"license": "AGPL-3.0-or-later",
"dependencies": {
"axios": "^1.1.3",
"body-parser": "^1.19.0",
"dayjs": "^1.10.4",
"express": "^4.17.1",
"serve-static": "^1.15.0",
"vuedraggable": "^2.24.3"
"express": "^4.17.1"
}
},
"node_modules/accepts": {
@ -34,25 +29,10 @@
"resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz",
"integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg=="
},
"node_modules/asynckit": {
"version": "0.4.0",
"resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz",
"integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q=="
},
"node_modules/axios": {
"version": "1.1.3",
"resolved": "https://registry.npmjs.org/axios/-/axios-1.1.3.tgz",
"integrity": "sha512-00tXVRwKx/FZr/IDVFt4C+f9FYairX517WoGCL6dpOntqLkZofjhu43F/Xl44UOpqa+9sLFDrG/XAnFsUYgkDA==",
"dependencies": {
"follow-redirects": "^1.15.0",
"form-data": "^4.0.0",
"proxy-from-env": "^1.1.0"
}
},
"node_modules/body-parser": {
"version": "1.20.0",
"resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.0.tgz",
"integrity": "sha512-DfJ+q6EPcGKZD1QWUjSpqp+Q7bDQTsQIF4zfUAtZ6qk+H/3/QRhg9CEp39ss+/T2vw0+HaidC0ecJj/DRLIaKg==",
"version": "1.20.1",
"resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.1.tgz",
"integrity": "sha512-jWi7abTbYwajOytWCQc37VulmWiRae5RyTpaCyDcS5/lMdtwSz5lOpDE67srw/HYe35f1z3fDQw+3txg7gNtWw==",
"dependencies": {
"bytes": "3.1.2",
"content-type": "~1.0.4",
@ -62,7 +42,7 @@
"http-errors": "2.0.0",
"iconv-lite": "0.4.24",
"on-finished": "2.4.1",
"qs": "6.10.3",
"qs": "6.11.0",
"raw-body": "2.5.1",
"type-is": "~1.6.18",
"unpipe": "1.0.0"
@ -92,17 +72,6 @@
"url": "https://github.com/sponsors/ljharb"
}
},
"node_modules/combined-stream": {
"version": "1.0.8",
"resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz",
"integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==",
"dependencies": {
"delayed-stream": "~1.0.0"
},
"engines": {
"node": ">= 0.8"
}
},
"node_modules/content-disposition": {
"version": "0.5.4",
"resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz",
@ -135,11 +104,6 @@
"resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz",
"integrity": "sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ=="
},
"node_modules/dayjs": {
"version": "1.11.5",
"resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.11.5.tgz",
"integrity": "sha512-CAdX5Q3YW3Gclyo5Vpqkgpj8fSdLQcRuzfX6mC6Phy0nfJ0eGYOeS7m4mt2plDWLAtA4TqTakvbboHvUxfe4iA=="
},
"node_modules/debug": {
"version": "2.6.9",
"resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
@ -148,14 +112,6 @@
"ms": "2.0.0"
}
},
"node_modules/delayed-stream": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz",
"integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==",
"engines": {
"node": ">=0.4.0"
}
},
"node_modules/depd": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz",
@ -200,13 +156,13 @@
}
},
"node_modules/express": {
"version": "4.18.1",
"resolved": "https://registry.npmjs.org/express/-/express-4.18.1.tgz",
"integrity": "sha512-zZBcOX9TfehHQhtupq57OF8lFZ3UZi08Y97dwFCkD8p9d/d2Y3M+ykKcwaMDEL+4qyUolgBDX6AblpR3fL212Q==",
"version": "4.18.2",
"resolved": "https://registry.npmjs.org/express/-/express-4.18.2.tgz",
"integrity": "sha512-5/PsL6iGPdfQ/lKM1UuielYgv3BUoJfz1aUwU9vHZ+J7gyvwdQXFEBIEIaxeGf0GIcreATNyBExtalisDbuMqQ==",
"dependencies": {
"accepts": "~1.3.8",
"array-flatten": "1.1.1",
"body-parser": "1.20.0",
"body-parser": "1.20.1",
"content-disposition": "0.5.4",
"content-type": "~1.0.4",
"cookie": "0.5.0",
@ -225,7 +181,7 @@
"parseurl": "~1.3.3",
"path-to-regexp": "0.1.7",
"proxy-addr": "~2.0.7",
"qs": "6.10.3",
"qs": "6.11.0",
"range-parser": "~1.2.1",
"safe-buffer": "5.2.1",
"send": "0.18.0",
@ -257,38 +213,6 @@
"node": ">= 0.8"
}
},
"node_modules/follow-redirects": {
"version": "1.15.2",
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.2.tgz",
"integrity": "sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA==",
"funding": [
{
"type": "individual",
"url": "https://github.com/sponsors/RubenVerborgh"
}
],
"engines": {
"node": ">=4.0"
},
"peerDependenciesMeta": {
"debug": {
"optional": true
}
}
},
"node_modules/form-data": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz",
"integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==",
"dependencies": {
"asynckit": "^0.4.0",
"combined-stream": "^1.0.8",
"mime-types": "^2.1.12"
},
"engines": {
"node": ">= 6"
}
},
"node_modules/forwarded": {
"version": "0.2.0",
"resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz",
@ -311,9 +235,9 @@
"integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A=="
},
"node_modules/get-intrinsic": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.2.tgz",
"integrity": "sha512-Jfm3OyCxHh9DJyc28qGk+JmfkpO41A4XkneDSujN9MDXrm4oDKdHvndhZ2dN94+ERNfkYJWDclW6k2L/ZGHjXA==",
"version": "1.1.3",
"resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.3.tgz",
"integrity": "sha512-QJVz1Tj7MS099PevUG5jvnt9tSkXN8K14dxQlikJuPt4uD9hHAHjLyLBiLR5zELelBdD9QNRAXZzsJx0WaDL9A==",
"dependencies": {
"function-bind": "^1.1.1",
"has": "^1.0.3",
@ -492,15 +416,10 @@
"node": ">= 0.10"
}
},
"node_modules/proxy-from-env": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz",
"integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg=="
},
"node_modules/qs": {
"version": "6.10.3",
"resolved": "https://registry.npmjs.org/qs/-/qs-6.10.3.tgz",
"integrity": "sha512-wr7M2E0OFRfIfJZjKGieI8lBKb7fRCH4Fv5KNPEs7gJ8jadvotdsS08PzOKR7opXhZ/Xkjtt3WF9g38drmyRqQ==",
"version": "6.11.0",
"resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz",
"integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==",
"dependencies": {
"side-channel": "^1.0.4"
},
@ -617,11 +536,6 @@
"url": "https://github.com/sponsors/ljharb"
}
},
"node_modules/sortablejs": {
"version": "1.10.2",
"resolved": "https://registry.npmjs.org/sortablejs/-/sortablejs-1.10.2.tgz",
"integrity": "sha512-YkPGufevysvfwn5rfdlGyrGjt7/CRHwvRPogD/lC+TnvcN29jDpCifKP+rBqf+LRldfXSTh+0CGLcSg0VIxq3A=="
},
"node_modules/statuses": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz",
@ -673,14 +587,6 @@
"engines": {
"node": ">= 0.8"
}
},
"node_modules/vuedraggable": {
"version": "2.24.3",
"resolved": "https://registry.npmjs.org/vuedraggable/-/vuedraggable-2.24.3.tgz",
"integrity": "sha512-6/HDXi92GzB+Hcs9fC6PAAozK1RLt1ewPTLjK0anTYguXLAeySDmcnqE8IC0xa7shvSzRjQXq3/+dsZ7ETGF3g==",
"dependencies": {
"sortablejs": "1.10.2"
}
}
},
"dependencies": {
@ -698,25 +604,10 @@
"resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz",
"integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg=="
},
"asynckit": {
"version": "0.4.0",
"resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz",
"integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q=="
},
"axios": {
"version": "1.1.3",
"resolved": "https://registry.npmjs.org/axios/-/axios-1.1.3.tgz",
"integrity": "sha512-00tXVRwKx/FZr/IDVFt4C+f9FYairX517WoGCL6dpOntqLkZofjhu43F/Xl44UOpqa+9sLFDrG/XAnFsUYgkDA==",
"requires": {
"follow-redirects": "^1.15.0",
"form-data": "^4.0.0",
"proxy-from-env": "^1.1.0"
}
},
"body-parser": {
"version": "1.20.0",
"resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.0.tgz",
"integrity": "sha512-DfJ+q6EPcGKZD1QWUjSpqp+Q7bDQTsQIF4zfUAtZ6qk+H/3/QRhg9CEp39ss+/T2vw0+HaidC0ecJj/DRLIaKg==",
"version": "1.20.1",
"resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.1.tgz",
"integrity": "sha512-jWi7abTbYwajOytWCQc37VulmWiRae5RyTpaCyDcS5/lMdtwSz5lOpDE67srw/HYe35f1z3fDQw+3txg7gNtWw==",
"requires": {
"bytes": "3.1.2",
"content-type": "~1.0.4",
@ -726,7 +617,7 @@
"http-errors": "2.0.0",
"iconv-lite": "0.4.24",
"on-finished": "2.4.1",
"qs": "6.10.3",
"qs": "6.11.0",
"raw-body": "2.5.1",
"type-is": "~1.6.18",
"unpipe": "1.0.0"
@ -746,14 +637,6 @@
"get-intrinsic": "^1.0.2"
}
},
"combined-stream": {
"version": "1.0.8",
"resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz",
"integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==",
"requires": {
"delayed-stream": "~1.0.0"
}
},
"content-disposition": {
"version": "0.5.4",
"resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz",
@ -777,11 +660,6 @@
"resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz",
"integrity": "sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ=="
},
"dayjs": {
"version": "1.11.5",
"resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.11.5.tgz",
"integrity": "sha512-CAdX5Q3YW3Gclyo5Vpqkgpj8fSdLQcRuzfX6mC6Phy0nfJ0eGYOeS7m4mt2plDWLAtA4TqTakvbboHvUxfe4iA=="
},
"debug": {
"version": "2.6.9",
"resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
@ -790,11 +668,6 @@
"ms": "2.0.0"
}
},
"delayed-stream": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz",
"integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ=="
},
"depd": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz",
@ -826,13 +699,13 @@
"integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg=="
},
"express": {
"version": "4.18.1",
"resolved": "https://registry.npmjs.org/express/-/express-4.18.1.tgz",
"integrity": "sha512-zZBcOX9TfehHQhtupq57OF8lFZ3UZi08Y97dwFCkD8p9d/d2Y3M+ykKcwaMDEL+4qyUolgBDX6AblpR3fL212Q==",
"version": "4.18.2",
"resolved": "https://registry.npmjs.org/express/-/express-4.18.2.tgz",
"integrity": "sha512-5/PsL6iGPdfQ/lKM1UuielYgv3BUoJfz1aUwU9vHZ+J7gyvwdQXFEBIEIaxeGf0GIcreATNyBExtalisDbuMqQ==",
"requires": {
"accepts": "~1.3.8",
"array-flatten": "1.1.1",
"body-parser": "1.20.0",
"body-parser": "1.20.1",
"content-disposition": "0.5.4",
"content-type": "~1.0.4",
"cookie": "0.5.0",
@ -851,7 +724,7 @@
"parseurl": "~1.3.3",
"path-to-regexp": "0.1.7",
"proxy-addr": "~2.0.7",
"qs": "6.10.3",
"qs": "6.11.0",
"range-parser": "~1.2.1",
"safe-buffer": "5.2.1",
"send": "0.18.0",
@ -877,21 +750,6 @@
"unpipe": "~1.0.0"
}
},
"follow-redirects": {
"version": "1.15.2",
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.2.tgz",
"integrity": "sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA=="
},
"form-data": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz",
"integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==",
"requires": {
"asynckit": "^0.4.0",
"combined-stream": "^1.0.8",
"mime-types": "^2.1.12"
}
},
"forwarded": {
"version": "0.2.0",
"resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz",
@ -908,9 +766,9 @@
"integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A=="
},
"get-intrinsic": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.2.tgz",
"integrity": "sha512-Jfm3OyCxHh9DJyc28qGk+JmfkpO41A4XkneDSujN9MDXrm4oDKdHvndhZ2dN94+ERNfkYJWDclW6k2L/ZGHjXA==",
"version": "1.1.3",
"resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.3.tgz",
"integrity": "sha512-QJVz1Tj7MS099PevUG5jvnt9tSkXN8K14dxQlikJuPt4uD9hHAHjLyLBiLR5zELelBdD9QNRAXZzsJx0WaDL9A==",
"requires": {
"function-bind": "^1.1.1",
"has": "^1.0.3",
@ -1035,15 +893,10 @@
"ipaddr.js": "1.9.1"
}
},
"proxy-from-env": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz",
"integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg=="
},
"qs": {
"version": "6.10.3",
"resolved": "https://registry.npmjs.org/qs/-/qs-6.10.3.tgz",
"integrity": "sha512-wr7M2E0OFRfIfJZjKGieI8lBKb7fRCH4Fv5KNPEs7gJ8jadvotdsS08PzOKR7opXhZ/Xkjtt3WF9g38drmyRqQ==",
"version": "6.11.0",
"resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz",
"integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==",
"requires": {
"side-channel": "^1.0.4"
}
@ -1127,11 +980,6 @@
"object-inspect": "^1.9.0"
}
},
"sortablejs": {
"version": "1.10.2",
"resolved": "https://registry.npmjs.org/sortablejs/-/sortablejs-1.10.2.tgz",
"integrity": "sha512-YkPGufevysvfwn5rfdlGyrGjt7/CRHwvRPogD/lC+TnvcN29jDpCifKP+rBqf+LRldfXSTh+0CGLcSg0VIxq3A=="
},
"statuses": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz",
@ -1165,14 +1013,6 @@
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz",
"integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg=="
},
"vuedraggable": {
"version": "2.24.3",
"resolved": "https://registry.npmjs.org/vuedraggable/-/vuedraggable-2.24.3.tgz",
"integrity": "sha512-6/HDXi92GzB+Hcs9fC6PAAozK1RLt1ewPTLjK0anTYguXLAeySDmcnqE8IC0xa7shvSzRjQXq3/+dsZ7ETGF3g==",
"requires": {
"sortablejs": "1.10.2"
}
}
}
}

7
packages/nc-lib-gui/package.json

@ -27,11 +27,6 @@
"url": "https://github.com/nocodb/nocodb/issues"
},
"dependencies": {
"axios": "^1.1.3",
"body-parser": "^1.19.0",
"dayjs": "^1.10.4",
"express": "^4.17.1",
"serve-static": "^1.15.0",
"vuedraggable": "^2.24.3"
"express": "^4.17.1"
}
}

64
packages/nc-plugin/.circleci/config.yml

@ -1,64 +0,0 @@
# https://circleci.com/docs/2.0/language-javascript/
version: 2
jobs:
'node-10':
docker:
- image: circleci/node:10
steps:
- checkout
# Download and cache dependencies
- restore_cache:
keys:
- v1-dependencies-{{ checksum "package.json" }}
# fallback to using the latest cache if no exact match is found
- v1-dependencies-
- run: npm install
- save_cache:
paths:
- node_modules
key: v1-dependencies-{{ checksum "package.json" }}
- run: npm test
- run: npm run cov:send
- run: npm run cov:check
'node-12':
docker:
- image: circleci/node:12
steps:
- checkout
- restore_cache:
keys:
- v1-dependencies-{{ checksum "package.json" }}
- v1-dependencies-
- run: npm install
- save_cache:
paths:
- node_modules
key: v1-dependencies-{{ checksum "package.json" }}
- run: npm test
- run: npm run cov:send
- run: npm run cov:check
'node-latest':
docker:
- image: circleci/node:latest
steps:
- checkout
- restore_cache:
keys:
- v1-dependencies-{{ checksum "package.json" }}
- v1-dependencies-
- run: npm install
- save_cache:
paths:
- node_modules
key: v1-dependencies-{{ checksum "package.json" }}
- run: npm test
- run: npm run cov:send
- run: npm run cov:check
workflows:
version: 2
build:
jobs:
- 'node-10'
- 'node-12'
- 'node-latest'

3
packages/nc-plugin/.github/CONTRIBUTING.md

@ -1,3 +0,0 @@
# Example Contributing Guidelines
This is an example of GitHub's contributing guidelines file. Check out GitHub's [CONTRIBUTING.md help center article](https://help.github.com/articles/setting-guidelines-for-repository-contributors/) for more information.

9
packages/nc-plugin/.github/ISSUE_TEMPLATE.md

@ -1,9 +0,0 @@
- **I'm submitting a ...**
[ ] bug report
[ ] feature request
[ ] question about the decisions made in the repository
[ ] question about how to use this project
- **Summary**
- **Other information** (e.g. detailed explanation, stack traces, related issues, suggestions how to fix, links for us to have context, eg. StackOverflow, personal fork, etc.)

7
packages/nc-plugin/.github/PULL_REQUEST_TEMPLATE.md

@ -1,7 +0,0 @@
- **What kind of change does this PR introduce?** (Bug fix, feature, docs update, ...)
- **What is the current behavior?** (You can also link to an open issue here)
- **What is the new behavior (if this is a feature change)?**
- **Other information**:

8
packages/nc-plugin/.vscode/extensions.json vendored

@ -1,8 +0,0 @@
{
"recommendations": [
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode",
"eamodio.gitlens",
"streetsidesoftware.code-spell-checker",
]
}

29
packages/nc-plugin/.vscode/launch.json vendored

@ -1,29 +0,0 @@
{
"version": "0.2.0",
"configurations": [
// To debug, make sure a *.spec.ts file is active in the editor, then run a configuration
{
"type": "node",
"request": "launch",
"name": "Debug Active Spec",
"runtimeExecutable": "${workspaceFolder}/node_modules/.bin/ava",
"runtimeArgs": ["debug", "--break", "--serial", "${file}"],
"port": 9229,
"outputCapture": "std",
"skipFiles": ["<node_internals>/**/*.js"],
"preLaunchTask": "npm: build"
// "smartStep": true
},
{
// Use this one if you're already running `yarn watch`
"type": "node",
"request": "launch",
"name": "Debug Active Spec (no build)",
"runtimeExecutable": "${workspaceFolder}/node_modules/.bin/ava",
"runtimeArgs": ["debug", "--break", "--serial", "${file}"],
"port": 9229,
"outputCapture": "std",
"skipFiles": ["<node_internals>/**/*.js"]
// "smartStep": true
}]
}

7
packages/nc-plugin/.vscode/settings.json vendored

@ -1,7 +0,0 @@
{
"cSpell.userWords": [], // only use words from .cspell.json
"cSpell.enabled": true,
"editor.formatOnSave": true,
"typescript.tsdk": "node_modules/typescript/lib",
"typescript.enablePromptUseWorkspaceTsdk": true
}

682
packages/nc-plugin/LICENSE

@ -1,21 +1,661 @@
MIT License
Copyright (c) 2019 “pranavxc”
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
GNU AFFERO GENERAL PUBLIC LICENSE
Version 3, 19 November 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU Affero General Public License is a free, copyleft license for
software and other kinds of works, specifically designed to ensure
cooperation with the community in the case of network server software.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
our General Public Licenses are intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
Developers that use our General Public Licenses protect your rights
with two steps: (1) assert copyright on the software, and (2) offer
you this License which gives you legal permission to copy, distribute
and/or modify the software.
A secondary benefit of defending all users' freedom is that
improvements made in alternate versions of the program, if they
receive widespread use, become available for other developers to
incorporate. Many developers of free software are heartened and
encouraged by the resulting cooperation. However, in the case of
software used on network servers, this result may fail to come about.
The GNU General Public License permits making a modified version and
letting the public access it on a server without ever releasing its
source code to the public.
The GNU Affero General Public License is designed specifically to
ensure that, in such cases, the modified source code becomes available
to the community. It requires the operator of a network server to
provide the source code of the modified version running there to the
users of that server. Therefore, public use of a modified version, on
a publicly accessible server, gives the public access to the source
code of the modified version.
An older license, called the Affero General Public License and
published by Affero, was designed to accomplish similar goals. This is
a different license, not a version of the Affero GPL, but Affero has
released a new version of the Affero GPL which permits relicensing under
this license.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU Affero General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Remote Network Interaction; Use with the GNU General Public License.
Notwithstanding any other provision of this License, if you modify the
Program, your modified version must prominently offer all users
interacting with it remotely through a computer network (if your version
supports such interaction) an opportunity to receive the Corresponding
Source of your version by providing access to the Corresponding Source
from a network server at no charge, through some standard or customary
means of facilitating copying of software. This Corresponding Source
shall include the Corresponding Source for any work covered by version 3
of the GNU General Public License that is incorporated pursuant to the
following paragraph.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the work with which it is combined will remain governed by version
3 of the GNU General Public License.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU Affero General Public License from time to time. Such new versions
will be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU Affero General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU Affero General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU Affero General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published
by the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If your software can interact with users remotely through a computer
network, you should also make sure that it provides a way for users to
get its source. For example, if your program is a web application, its
interface could display a "Source" link that leads users to an archive
of the code. There are many ways you could offer source, and different
solutions will be better for different programs; see section 13 for the
specific requirements.
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU AGPL, see
<http://www.gnu.org/licenses/>.

51
packages/nc-plugin/package-lock.json generated

@ -7,15 +7,12 @@
"": {
"name": "nc-plugin",
"version": "0.1.3",
"license": "MIT",
"license": "AGPL-3.0-or-later",
"dependencies": {
"@bitauth/libauth": "^1.17.1",
"nc-common": "0.0.6"
},
"devDependencies": {
"@ava/typescript": "^1.1.1",
"@istanbuljs/nyc-config-typescript": "^1.0.1",
"@types/node": "^14.14.37",
"@typescript-eslint/eslint-plugin": "^4.0.1",
"@typescript-eslint/parser": "^4.0.1",
"ava": "^3.12.1",
@ -41,18 +38,6 @@
"node": ">=10"
}
},
"node_modules/@ava/typescript": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/@ava/typescript/-/typescript-1.1.1.tgz",
"integrity": "sha512-KbLUAe2cWXK63WLK6LnOJonjwEDU/8MNXCOA1ooX/YFZgKRmeAD1kZu+2K0ks5fnOCEcckNQAooyBNGdZUmMQA==",
"dev": true,
"dependencies": {
"escape-string-regexp": "^2.0.0"
},
"engines": {
"node": ">=10.18.0 <11 || >=12.14.0 <13 || >=13.5.0"
}
},
"node_modules/@babel/code-frame": {
"version": "7.12.13",
"resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.13.tgz",
@ -432,14 +417,6 @@
"to-fast-properties": "^2.0.0"
}
},
"node_modules/@bitauth/libauth": {
"version": "1.18.1",
"resolved": "https://registry.npmjs.org/@bitauth/libauth/-/libauth-1.18.1.tgz",
"integrity": "sha512-s7evdGbdGAnGkv7xt6mCbcWTTNvburc1Z9EX/8JKwcRLqofjDs7VAEz+RP3a8OGEo4MWFV6Ydqu/BeJjIA7Kdg==",
"engines": {
"node": ">=8.9"
}
},
"node_modules/@commitlint/execute-rule": {
"version": "12.1.1",
"resolved": "https://registry.npmjs.org/@commitlint/execute-rule/-/execute-rule-12.1.1.tgz",
@ -922,12 +899,6 @@
"integrity": "sha512-jhuKLIRrhvCPLqwPcx6INqmKeiA5EWrsCOPhrlFSrbrmU4ZMPjj5Ul/oLCMDO98XRUIwVm78xICz4EPCektzeQ==",
"dev": true
},
"node_modules/@types/node": {
"version": "14.14.37",
"resolved": "https://registry.npmjs.org/@types/node/-/node-14.14.37.tgz",
"integrity": "sha512-XYmBiy+ohOR4Lh5jE379fV2IU+6Jn4g5qASinhitfyO71b/sCo6MKsMLF5tc7Zf2CE8hViVQyYSobJNke8OvUw==",
"dev": true
},
"node_modules/@types/normalize-package-data": {
"version": "2.4.0",
"resolved": "https://registry.npmjs.org/@types/normalize-package-data/-/normalize-package-data-2.4.0.tgz",
@ -12296,15 +12267,6 @@
}
},
"dependencies": {
"@ava/typescript": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/@ava/typescript/-/typescript-1.1.1.tgz",
"integrity": "sha512-KbLUAe2cWXK63WLK6LnOJonjwEDU/8MNXCOA1ooX/YFZgKRmeAD1kZu+2K0ks5fnOCEcckNQAooyBNGdZUmMQA==",
"dev": true,
"requires": {
"escape-string-regexp": "^2.0.0"
}
},
"@babel/code-frame": {
"version": "7.12.13",
"resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.13.tgz",
@ -12642,11 +12604,6 @@
"to-fast-properties": "^2.0.0"
}
},
"@bitauth/libauth": {
"version": "1.18.1",
"resolved": "https://registry.npmjs.org/@bitauth/libauth/-/libauth-1.18.1.tgz",
"integrity": "sha512-s7evdGbdGAnGkv7xt6mCbcWTTNvburc1Z9EX/8JKwcRLqofjDs7VAEz+RP3a8OGEo4MWFV6Ydqu/BeJjIA7Kdg=="
},
"@commitlint/execute-rule": {
"version": "12.1.1",
"resolved": "https://registry.npmjs.org/@commitlint/execute-rule/-/execute-rule-12.1.1.tgz",
@ -13061,12 +13018,6 @@
"integrity": "sha512-jhuKLIRrhvCPLqwPcx6INqmKeiA5EWrsCOPhrlFSrbrmU4ZMPjj5Ul/oLCMDO98XRUIwVm78xICz4EPCektzeQ==",
"dev": true
},
"@types/node": {
"version": "14.14.37",
"resolved": "https://registry.npmjs.org/@types/node/-/node-14.14.37.tgz",
"integrity": "sha512-XYmBiy+ohOR4Lh5jE379fV2IU+6Jn4g5qASinhitfyO71b/sCo6MKsMLF5tc7Zf2CE8hViVQyYSobJNke8OvUw==",
"dev": true
},
"@types/normalize-package-data": {
"version": "2.4.0",
"resolved": "https://registry.npmjs.org/@types/normalize-package-data/-/normalize-package-data-2.4.0.tgz",

21
packages/nc-plugin/package.json

@ -1,12 +1,24 @@
{
"name": "nc-plugin",
"version": "0.1.3",
"description": "Xgene plugin template",
"description": "NocoDB Plugin Template",
"private": true,
"author": {
"name": "NocoDB Inc",
"url": "https://nocodb.com/"
},
"homepage": "https://github.com/nocodb/nocodb",
"license": "AGPL-3.0-or-later",
"repository": {
"type": "git",
"url": "https://github.com/nocodb/nocodb.git"
},
"bugs": {
"url": "https://github.com/nocodb/nocodb/issues"
},
"main": "build/main/index.js",
"typings": "build/main/index.d.ts",
"module": "build/module/index.js",
"repository": "https://github.com/pranavxc/xc-plugin-template",
"license": "MIT",
"keywords": [],
"scripts": {
"build": "run-p build:*",
@ -42,13 +54,10 @@
"node": ">=10"
},
"dependencies": {
"@bitauth/libauth": "^1.17.1",
"nc-common": "0.0.6"
},
"devDependencies": {
"@ava/typescript": "^1.1.1",
"@istanbuljs/nyc-config-typescript": "^1.0.1",
"@types/node": "^14.14.37",
"@typescript-eslint/eslint-plugin": "^4.0.1",
"@typescript-eslint/parser": "^4.0.1",
"ava": "^3.12.1",

14
packages/nc-plugin/src/index.ts

@ -1,13 +1,13 @@
import IEmailAdapter, { XcEmail } from './lib/IEmailAdapter';
import IStorageAdapter, { XcFile } from './lib/IStorageAdapter';
import IStorageAdapterV2 from './lib/IStorageAdapterV2';
import IWebhookNotificationAdapter from './lib/IWebhookNotificationAdapter';
import XcEmailPlugin from './lib/XcEmailPlugin';
import XcPlugin from './lib/XcPlugin';
import XcPluginConfig from './lib/XcPluginConfig';
import XcPluginHooks from './lib/XcPluginHooks';
import XcPluginMigration from './lib/XcPluginMigration';
import XcStoragePlugin from './lib/XcStoragePlugin';
import XcEmailPlugin from './lib/XcEmailPlugin';
import IStorageAdapter, {XcFile} from './lib/IStorageAdapter';
import IStorageAdapterV2 from './lib/IStorageAdapterV2';
import IEmailAdapter, {XcEmail} from './lib/IEmailAdapter';
import IWebhookNotificationAdapter from './lib/IWebhookNotificationAdapter';
import XcWebhookNotificationPlugin from './lib/XcWebhookNotificationPlugin';
export {
@ -23,5 +23,5 @@ export {
XcEmail,
IWebhookNotificationAdapter,
XcWebhookNotificationPlugin,
IStorageAdapterV2
}
IStorageAdapterV2,
};

21
packages/nc-plugin/src/lib/IEmailAdapter.ts

@ -1,20 +1,15 @@
export default interface IEmailAdapter {
init(): Promise<any>
mailSend(mail:XcEmail): Promise<any>
test(email): Promise<boolean>
init(): Promise<any>;
mailSend(mail: XcEmail): Promise<any>;
test(email): Promise<boolean>;
}
interface XcEmail {
// from?:string;
to:string;
subject:string;
html?:string;
text?:string;
}
export {
XcEmail
to: string;
subject: string;
html?: string;
text?: string;
}
export { XcEmail };

17
packages/nc-plugin/src/lib/IStorageAdapter.ts

@ -1,12 +1,11 @@
export default interface IStorageAdapter {
init(): Promise<any>
fileCreate(destPath: string, file: XcFile): Promise<any>
fileDelete(filePath: string): Promise<any>
fileRead(filePath: string): Promise<any>
test(): Promise<boolean>
init(): Promise<any>;
fileCreate(destPath: string, file: XcFile): Promise<any>;
fileDelete(filePath: string): Promise<any>;
fileRead(filePath: string): Promise<any>;
test(): Promise<boolean>;
}
interface XcFile {
originalname: string;
path: string;
@ -14,8 +13,4 @@ interface XcFile {
size: number | string;
}
export {
XcFile
}
export { XcFile };

9
packages/nc-plugin/src/lib/IStorageAdapterV2.ts

@ -1,10 +1,13 @@
import IStorageAdapter from "./IStorageAdapter";
import IStorageAdapter from './IStorageAdapter';
export default interface IStorageAdapterV2 extends IStorageAdapter {
fileCreateByUrl(destPath: string, url: string, fileMeta?: FileMeta): Promise<any>
fileCreateByUrl(
destPath: string,
url: string,
fileMeta?: FileMeta
): Promise<any>;
}
interface FileMeta {
fileName?: string;
mimetype?: string;

16
packages/nc-plugin/src/lib/IWebhookNotificationAdapter.ts

@ -1,10 +1,10 @@
export default interface IWebhookNotificationAdapter {
init(): Promise<any>
sendMessage(content: string, webhooks: Array<{
webhook_url: string
}>): Promise<any>;
init(): Promise<any>;
sendMessage(
content: string,
webhooks: Array<{
webhook_url: string;
}>
): Promise<any>;
}

11
packages/nc-plugin/src/lib/XcEmailPlugin.ts

@ -1,11 +1,8 @@
import XcPlugin from "./XcPlugin";
import IEmailAdapter from "./IEmailAdapter";
abstract class XcEmailPlugin extends XcPlugin{
abstract getAdapter():IEmailAdapter
import IEmailAdapter from './IEmailAdapter';
import XcPlugin from './XcPlugin';
abstract class XcEmailPlugin extends XcPlugin {
abstract getAdapter(): IEmailAdapter;
}
export default XcEmailPlugin;

16
packages/nc-plugin/src/lib/XcPlugin.ts

@ -1,24 +1,20 @@
import XcPluginHooks from "./XcPluginHooks";
import XcPluginHooks from './XcPluginHooks';
abstract class XcPlugin extends XcPluginHooks{
abstract class XcPlugin extends XcPluginHooks {
protected readonly app: any;
public readonly config: any;
protected readonly app:any;
public readonly config:any;
constructor(app:any, config:any) {
constructor(app: any, config: any) {
super();
this.app = app;
this.config = config;
}
abstract init(config:any):Promise<any>;
abstract init(config: any): Promise<any>;
// public getHooks(): XcPluginHooks{
// return null;
// }
}
export default XcPlugin;

13
packages/nc-plugin/src/lib/XcPluginConfig.ts

@ -1,6 +1,7 @@
import XcPlugin from "./XcPlugin";
import XcPluginMigration from "./XcPluginMigration";
import {XcForm} from "nc-common";
import { XcForm } from 'nc-common';
import XcPlugin from './XcPlugin';
import XcPluginMigration from './XcPluginMigration';
export default interface XcPluginConfig {
title: string;
@ -11,7 +12,7 @@ export default interface XcPluginConfig {
category?: string;
permissions?: string[];
inputs?: XcForm;
price?:string;
price?: string;
builder: Constructor<any>;
migrations?: XcPluginMigration[];
msgOnInstall?: string;
@ -19,5 +20,5 @@ export default interface XcPluginConfig {
}
type Constructor<T extends XcPlugin> = {
new(...args: any[]): T;
}
new (...args: any[]): T;
};

21
packages/nc-plugin/src/lib/XcPluginHooks.ts

@ -1,24 +1,13 @@
/* eslint-disable @typescript-eslint/no-empty-function */
abstract class XcPluginHooks {
public async appStart(): Promise<any> {}
public async appStart(): Promise<any> {
public async projectStart(): Promise<any> {}
}
public async projectStop(): Promise<any> {}
public async projectStart(): Promise<any> {
public async projectDelete(): Promise<any> {}
}
public async projectStop(): Promise<any> {
}
public async projectDelete(): Promise<any> {
}
public async syncMigrations(): Promise<any> {
}
public async syncMigrations(): Promise<any> {}
}
export default XcPluginHooks;

5
packages/nc-plugin/src/lib/XcPluginMigration.ts

@ -1,10 +1,7 @@
abstract class XcPluginMigration {
public abstract up(): Promise<any>;
public abstract down(): Promise<any>;
}
export default XcPluginMigration
export default XcPluginMigration;

9
packages/nc-plugin/src/lib/XcStoragePlugin.ts

@ -1,11 +1,8 @@
import XcPlugin from "./XcPlugin";
import IStorageAdapter from "./IStorageAdapter";
import IStorageAdapter from './IStorageAdapter';
import XcPlugin from './XcPlugin';
abstract class XcStoragePlugin extends XcPlugin {
abstract getAdapter(): IStorageAdapter
abstract getAdapter(): IStorageAdapter;
}
export default XcStoragePlugin;

10
packages/nc-plugin/src/lib/XcWebhookNotificationPlugin.ts

@ -1,11 +1,9 @@
import XcPlugin from "./XcPlugin";
import {IWebhookNotificationAdapter} from "../index";
import { IWebhookNotificationAdapter } from '../index';
abstract class XcStoragePlugin extends XcPlugin {
abstract getAdapter(): IWebhookNotificationAdapter
import XcPlugin from './XcPlugin';
abstract class XcStoragePlugin extends XcPlugin {
abstract getAdapter(): IWebhookNotificationAdapter;
}
export default XcStoragePlugin;

682
packages/noco-docs/LICENSE

@ -1,21 +1,661 @@
MIT License
Copyright (c) 2021 nocodb
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
GNU AFFERO GENERAL PUBLIC LICENSE
Version 3, 19 November 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU Affero General Public License is a free, copyleft license for
software and other kinds of works, specifically designed to ensure
cooperation with the community in the case of network server software.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
our General Public Licenses are intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
Developers that use our General Public Licenses protect your rights
with two steps: (1) assert copyright on the software, and (2) offer
you this License which gives you legal permission to copy, distribute
and/or modify the software.
A secondary benefit of defending all users' freedom is that
improvements made in alternate versions of the program, if they
receive widespread use, become available for other developers to
incorporate. Many developers of free software are heartened and
encouraged by the resulting cooperation. However, in the case of
software used on network servers, this result may fail to come about.
The GNU General Public License permits making a modified version and
letting the public access it on a server without ever releasing its
source code to the public.
The GNU Affero General Public License is designed specifically to
ensure that, in such cases, the modified source code becomes available
to the community. It requires the operator of a network server to
provide the source code of the modified version running there to the
users of that server. Therefore, public use of a modified version, on
a publicly accessible server, gives the public access to the source
code of the modified version.
An older license, called the Affero General Public License and
published by Affero, was designed to accomplish similar goals. This is
a different license, not a version of the Affero GPL, but Affero has
released a new version of the Affero GPL which permits relicensing under
this license.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU Affero General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Remote Network Interaction; Use with the GNU General Public License.
Notwithstanding any other provision of this License, if you modify the
Program, your modified version must prominently offer all users
interacting with it remotely through a computer network (if your version
supports such interaction) an opportunity to receive the Corresponding
Source of your version by providing access to the Corresponding Source
from a network server at no charge, through some standard or customary
means of facilitating copying of software. This Corresponding Source
shall include the Corresponding Source for any work covered by version 3
of the GNU General Public License that is incorporated pursuant to the
following paragraph.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the work with which it is combined will remain governed by version
3 of the GNU General Public License.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU Affero General Public License from time to time. Such new versions
will be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU Affero General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU Affero General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU Affero General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published
by the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If your software can interact with users remotely through a computer
network, you should also make sure that it provides a way for users to
get its source. For example, if your program is a web application, its
interface could display a "Source" link that leads users to an archive
of the code. There are many ways you could offer source, and different
solutions will be better for different programs; see section 13 for the
specific requirements.
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU AGPL, see
<http://www.gnu.org/licenses/>.

6
packages/noco-docs/content/en/engineering/testing.md

@ -210,7 +210,7 @@ First 3 suites, each have 4 test category
# install dependencies(cypress)
npm install
# start MySQL database using docker compose
docker-compose -f ./scripts/docker-compose-cypress.yml up
docker-compose -f ./scripts/cypress/docker-compose-cypress.yml up
# Run backend api using following command
npm run start:xcdb-api:cache
@ -234,7 +234,7 @@ npm run cypress:open
# install dependencies(cypress)
npm install
# start MySQL database using docker compose
docker-compose -f ./scripts/docker-compose-cypress.yml up
docker-compose -f ./scripts/cypress/docker-compose-cypress.yml up
# Run backend api using following command
npm run start:api:cache
@ -282,7 +282,7 @@ npm run cypress:open
# install dependencies(cypress)
npm install
# start MySQL database using docker compose
docker-compose -f ./scripts/docker-compose-cypress.yml up
docker-compose -f ./scripts/cypress/docker-compose-cypress.yml up
# copy existing xcdb (v0.91.7) database to ./packages/nocodb/
cp ./scripts/cypress/fixtures/quickTest/noco_0_91_7.db ./packages/nocodb/noco.db

4
packages/noco-docs/content/en/getting-started/installation.md

@ -452,6 +452,10 @@ npm start
</details>
### FreeBSD / FreeNAS / TrueNAS Jail
See [here](https://gist.github.com/Zamana/e9281d736f9e9ce5882c6f4b140a590e) provided by [C. R. Zamana](https://github.com/Zamana).
## Production Setup
It is mandatory to configure `NC_DB` environment variables for production usecases.

83
packages/noco-docs/package-lock.json generated

@ -7,7 +7,7 @@
"": {
"name": "noco-docs",
"version": "1.0.0",
"license": "MIT",
"license": "AGPL-3.0-or-later",
"dependencies": {
"@nuxt/content-theme-docs": "0.7.2",
"nuxt": "^2.15.2"
@ -18092,49 +18092,6 @@
}
}
},
"@jridgewell/gen-mapping": {
"version": "0.3.2",
"resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.2.tgz",
"integrity": "sha512-mh65xKQAzI6iBcFzwv28KVWSmCkdRBWoOh+bYQGW3+6OZvbbN3TqMGo5hqYxQniRcH9F2VZIoJCm4pa3BPDK/A==",
"requires": {
"@jridgewell/set-array": "^1.0.1",
"@jridgewell/sourcemap-codec": "^1.4.10",
"@jridgewell/trace-mapping": "^0.3.9"
}
},
"@jridgewell/resolve-uri": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.0.tgz",
"integrity": "sha512-F2msla3tad+Mfht5cJq7LSXcdudKTWCVYUgw6pLFOOHSTtZlj6SWNYAp+AhuqLmWdBO2X5hPrLcu8cVP8fy28w=="
},
"@jridgewell/set-array": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.1.2.tgz",
"integrity": "sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw=="
},
"@jridgewell/source-map": {
"version": "0.3.2",
"resolved": "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.2.tgz",
"integrity": "sha512-m7O9o2uR8k2ObDysZYzdfhb08VuEml5oWGiosa1VdaPZ/A6QyPkAJuwN0Q1lhULOf6B7MtQmHENS743hWtCrgw==",
"requires": {
"@jridgewell/gen-mapping": "^0.3.0",
"@jridgewell/trace-mapping": "^0.3.9"
}
},
"@jridgewell/sourcemap-codec": {
"version": "1.4.14",
"resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.14.tgz",
"integrity": "sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw=="
},
"@jridgewell/trace-mapping": {
"version": "0.3.14",
"resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.14.tgz",
"integrity": "sha512-bJWEfQ9lPTvm3SneWwRFVLzrh6nhjwqw7TUFFBEMzwvg7t7PCDenf2lDwqo4NQXzdpgBXyFgDWnQA+2vkruksQ==",
"requires": {
"@jridgewell/resolve-uri": "^3.0.3",
"@jridgewell/sourcemap-codec": "^1.4.10"
}
},
"@koa/router": {
"version": "9.4.0",
"resolved": "https://registry.npmjs.org/@koa/router/-/router-9.4.0.tgz",
@ -28363,9 +28320,9 @@
}
},
"terser": {
"version": "4.8.1",
"resolved": "https://registry.npmjs.org/terser/-/terser-4.8.1.tgz",
"integrity": "sha512-4GnLC0x667eJG0ewJTa6z/yXrbLGv80D9Ru6HIpCQmO+Q4PfEtBFi0ObSckqwL6VyQv/7ENJieXHo2ANmdQwgw==",
"version": "4.8.0",
"resolved": "https://registry.npmjs.org/terser/-/terser-4.8.0.tgz",
"integrity": "sha512-EAPipTNeWsb/3wLPeup1tVPaXfIaU68xMnVdPafIL1TV05OhASArYyIfFvnvJCNrR2NIOvDVNNTFRa+Re2MWyw==",
"requires": {
"commander": "^2.20.0",
"source-map": "~0.6.1",
@ -28388,11 +28345,6 @@
"webpack-sources": "^1.4.3"
},
"dependencies": {
"acorn": {
"version": "8.7.1",
"resolved": "https://registry.npmjs.org/acorn/-/acorn-8.7.1.tgz",
"integrity": "sha512-Xx54uLJQZ19lKygFXOWsscKUbsBZW0CPykPhVQdhIeIwrbPmJzqeASDInc8nKBnp/JT6igTs82qPXz069H8I/A=="
},
"p-limit": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz",
@ -28401,24 +28353,21 @@
"yocto-queue": "^0.1.0"
}
},
"source-map-support": {
"version": "0.5.21",
"resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz",
"integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==",
"requires": {
"buffer-from": "^1.0.0",
"source-map": "^0.6.0"
}
},
"terser": {
"version": "5.14.2",
"resolved": "https://registry.npmjs.org/terser/-/terser-5.14.2.tgz",
"integrity": "sha512-oL0rGeM/WFQCUd0y2QrWxYnq7tfSuKBiqTjRPWrRgB46WD/kiwHwF8T23z78H6Q6kGCuuHcPB+KULHRdxvVGQA==",
"version": "5.7.1",
"resolved": "https://registry.npmjs.org/terser/-/terser-5.7.1.tgz",
"integrity": "sha512-b3e+d5JbHAe/JSjwsC3Zn55wsBIM7AsHLjKxT31kGCldgbpFePaFo+PiddtO6uwRZWRw7sPXmAN8dTW61xmnSg==",
"requires": {
"@jridgewell/source-map": "^0.3.2",
"acorn": "^8.5.0",
"commander": "^2.20.0",
"source-map-support": "~0.5.20"
"source-map": "~0.7.2",
"source-map-support": "~0.5.19"
},
"dependencies": {
"source-map": {
"version": "0.7.3",
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.3.tgz",
"integrity": "sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ=="
}
}
}
}

15
packages/noco-docs/package.json

@ -1,7 +1,20 @@
{
"name": "noco-docs",
"version": "1.0.0",
"license": "MIT",
"private": true,
"author": {
"name": "NocoDB Inc",
"url": "https://nocodb.com/"
},
"homepage": "https://github.com/nocodb/nocodb",
"license": "AGPL-3.0-or-later",
"repository": {
"type": "git",
"url": "https://github.com/nocodb/nocodb.git"
},
"bugs": {
"url": "https://github.com/nocodb/nocodb/issues"
},
"scripts": {
"dev": "nuxt",
"build": "nuxt build",

23
packages/noco-i18n/.gitignore vendored

@ -1,23 +0,0 @@
.DS_Store
node_modules
/dist
# local env files
.env.local
.env.*.local
# Log files
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
# Editor directories and files
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?

21
packages/noco-i18n/LICENSE

@ -1,21 +0,0 @@
MIT License
Copyright (c) 2021 nocodb
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

62
packages/noco-i18n/README.md

@ -1,62 +0,0 @@
# NocoDB : i18n Contribution Guide
We 've made it simple to accept new translations
1. Our i18n translations are in google spreadsheet
- Make a [copy of it](https://docs.google.com/spreadsheets/d/1kGp92yLwhs1l7lwwgeor3oN1dFl7JZWuQOa4WSeZ0TE/edit?usp=sharing). ( file > make a copy )
- Create a shareable link from your spreadsheet. ( share > get link > change to anyone with link )
2. Make necessary changes for the required language column (eg. fr)
3. Download the sheet as .csv file ( file > download > csv )
4. Visit [https://i18n.nocodb.com/](https://i18n.nocodb.com/)
5. Upload the CSV file (from step 3).
6. Select the language for which you are translating (same as in step 2)
https://i18n.nocodb.com will
- Automatically copy the translated values to clipboard.
- Automatically show the respective file to open and edit in our github. Example: [fr.json](https://github.com/nocodb/nocodb/edit/master/packages/nc-gui/lang/fr.json).
- Github will ask you to fork the repo - please do so if you haven't forked the repository and then paste the values from clipboard to the file. Alternatively you can just paste the updated JSON value to corresponding files
7. Submit PR with a link to your spreadsheet (from step 1)
- - - -
### Sample screenshot of https://i18n.nocodb.com
![image](https://user-images.githubusercontent.com/35857179/136654196-162a316c-adde-431b-8316-139168298278.png)
- - - -
# Development setup
You need vue cli in order to start the application
```
npm install -g @vue/cli
```
## Project setup
```
npm install
```
### Compiles and hot-reloads for development
```
npm run serve
```
### Compiles and minifies for production
```
npm run build
```
### Lints and fixes files
```
npm run lint
```

5
packages/noco-i18n/babel.config.js

@ -1,5 +0,0 @@
module.exports = {
presets: [
'@vue/cli-plugin-babel/preset'
]
}

12222
packages/noco-i18n/package-lock.json generated

File diff suppressed because it is too large Load Diff

45
packages/noco-i18n/package.json

@ -1,45 +0,0 @@
{
"name": "noco-i18n",
"version": "1.0.0",
"license": "MIT",
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"generate": "vue-cli-service build",
"lint": "vue-cli-service lint"
},
"dependencies": {
"core-js": "^3.6.5",
"csv-parser": "^3.0.0",
"papaparse": "^5.3.1",
"vue": "^3.0.0"
},
"devDependencies": {
"@vue/cli-plugin-babel": "~4.5.0",
"@vue/cli-plugin-eslint": "~4.5.0",
"@vue/cli-service": "~4.5.0",
"@vue/compiler-sfc": "^3.0.0",
"babel-eslint": "^10.1.0",
"eslint": "^6.7.2",
"eslint-plugin-vue": "^7.0.0"
},
"eslintConfig": {
"root": true,
"env": {
"node": true
},
"extends": [
"plugin:vue/vue3-essential",
"eslint:recommended"
],
"parserOptions": {
"parser": "babel-eslint"
},
"rules": {}
},
"browserslist": [
"> 1%",
"last 2 versions",
"not dead"
]
}

BIN
packages/noco-i18n/public/favicon.ico

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

17
packages/noco-i18n/public/index.html

@ -1,17 +0,0 @@
<!DOCTYPE html>
<html lang="">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<title><%= htmlWebpackPlugin.options.title %></title>
</head>
<body>
<noscript>
<strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
</noscript>
<div id="app"></div>
<!-- built files will be auto injected -->
</body>
</html>

26
packages/noco-i18n/src/App.vue

@ -1,26 +0,0 @@
<template>
<img alt="Vue logo" src="./assets/logo.png">
<Landing />
</template>
<script>
import Landing from './components/Landing.vue'
export default {
name: 'App',
components: {
Landing
}
}
</script>
<style>
#app {
font-family: Avenir, Helvetica, Arial, sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
text-align: center;
color: #2c3e50;
margin-top: 60px;
}
</style>

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save