@opengis/bi 1.0.13 → 1.0.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. package/README.md +50 -52
  2. package/config.js +12 -12
  3. package/dist/bi.js +1 -1
  4. package/dist/bi.umd.cjs +120 -134
  5. package/dist/{import-file-1T7kpSzt.js → import-file-CRC0sYYT.js} +11974 -11522
  6. package/dist/{map-component-mixin-BLM9iEWA.js → map-component-mixin-BCtWEvzv.js} +4830 -3150
  7. package/dist/style.css +1 -1
  8. package/dist/vs-calendar-5ot79n0N.js +110 -0
  9. package/dist/vs-funnel-bar-CLo6gXI_.js +105 -0
  10. package/dist/vs-heatmap-DHGA8dRk.js +97 -0
  11. package/dist/{vs-map-cluster-Dfe9INqE.js → vs-map-cluster-CNgX6JVF.js} +28 -25
  12. package/dist/vs-map-pIn5wS4G.js +74 -0
  13. package/dist/vs-number-DYfok8VU.js +55 -0
  14. package/dist/{vs-text-DcrAdQ40.js → vs-text-Dckykz09.js} +19 -13
  15. package/package.json +107 -72
  16. package/plugin.js +14 -13
  17. package/server/migrations/bi.dataset.sql +26 -0
  18. package/server/migrations/bi.sql +93 -27
  19. package/server/plugins/docs.js +48 -47
  20. package/server/plugins/hook.js +89 -86
  21. package/server/plugins/vite.js +69 -55
  22. package/server/routes/dashboard/controllers/dashboard.delete.js +38 -35
  23. package/server/routes/dashboard/controllers/dashboard.js +118 -80
  24. package/server/routes/dashboard/controllers/dashboard.list.js +30 -39
  25. package/server/routes/dashboard/controllers/utils/yaml.js +11 -12
  26. package/server/routes/dashboard/index.mjs +25 -24
  27. package/server/routes/data/controllers/data.js +168 -97
  28. package/server/routes/data/controllers/util/chartSQL.js +42 -25
  29. package/server/routes/data/controllers/util/normalizeData.js +59 -34
  30. package/server/routes/data/index.mjs +29 -26
  31. package/server/routes/dataset/controllers/bi.dataset.demo.add.js +97 -0
  32. package/server/routes/dataset/controllers/bi.dataset.import.js +67 -0
  33. package/server/routes/dataset/controllers/util/create.table.js +22 -0
  34. package/server/routes/dataset/controllers/util/prepare.data.js +49 -0
  35. package/server/routes/dataset/index.mjs +19 -0
  36. package/server/routes/db/controllers/dbTablePreview.js +63 -0
  37. package/server/routes/db/controllers/dbTables.js +36 -0
  38. package/server/routes/db/index.mjs +17 -0
  39. package/server/routes/edit/controllers/dashboard.add.js +26 -23
  40. package/server/routes/edit/controllers/dashboard.edit.js +46 -37
  41. package/server/routes/edit/controllers/widget.add.js +75 -49
  42. package/server/routes/edit/controllers/widget.del.js +69 -63
  43. package/server/routes/edit/controllers/widget.edit.js +52 -82
  44. package/server/routes/edit/index.mjs +31 -27
  45. package/server/routes/map/controllers/cluster.js +109 -75
  46. package/server/routes/map/controllers/clusterVtile.js +166 -143
  47. package/server/routes/map/controllers/geojson.js +127 -101
  48. package/server/routes/map/controllers/map.js +60 -57
  49. package/server/routes/map/controllers/utils/downloadClusterData.js +43 -0
  50. package/server/routes/map/controllers/vtile.js +183 -161
  51. package/server/routes/map/index.mjs +25 -25
  52. package/server/utils/getWidget.js +85 -56
  53. package/utils.js +12 -11
  54. package/dist/vs-calendar-WiK1hcHS.js +0 -96
  55. package/dist/vs-funnel-bar-CpPbYZ0_.js +0 -92
  56. package/dist/vs-heatmap-BG4eIROH.js +0 -83
  57. package/dist/vs-map-BRk6Fmks.js +0 -66
  58. package/dist/vs-number-CJq-vi95.js +0 -39
@@ -1,9 +1,9 @@
1
1
  var ge = Object.defineProperty;
2
2
  var ke = (c, e, t) => e in c ? ge(c, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : c[e] = t;
3
- var k = (c, e, t) => ke(c, typeof e != "symbol" ? e + "" : e, t);
4
- import { _ as de, c as xe } from "./import-file-1T7kpSzt.js";
3
+ var k = (c, e, t) => (ke(c, typeof e != "symbol" ? e + "" : e, t), t);
4
+ import { _ as de, c as xe } from "./import-file-CRC0sYYT.js";
5
5
  import { openBlock as V, createElementBlock as J, createCommentVNode as be } from "vue";
6
- function D() {
6
+ function Q() {
7
7
  return {
8
8
  async: !1,
9
9
  breaks: !1,
@@ -17,7 +17,7 @@ function D() {
17
17
  walkTokens: null
18
18
  };
19
19
  }
20
- let z = D();
20
+ let z = Q();
21
21
  function se(c) {
22
22
  z = c;
23
23
  }
@@ -647,16 +647,16 @@ const Re = /^(?:[ \t]*(?:\n|$))+/, _e = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*
647
647
  lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,
648
648
  paragraph: f(j).replace("hr", E).replace("heading", ` *#{1,6} *[^
649
649
  ]`).replace("lheading", oe).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex()
650
- }, ce = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, Pe = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, he = /^( {2,}|\\)\n(?!\s*$)/, Ze = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, L = "\\p{P}\\p{S}", Me = f(/^((?![*_])[\spunctuation])/, "u").replace(/punctuation/g, L).getRegex(), Qe = /\[[^[\]]*?\]\([^\(\)]*?\)|`[^`]*?`|<[^<>]*?>/g, De = f(/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/, "u").replace(/punct/g, L).getRegex(), je = f("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)[punct](\\*+)(?=[\\s]|$)|[^punct\\s](\\*+)(?!\\*)(?=[punct\\s]|$)|(?!\\*)[punct\\s](\\*+)(?=[^punct\\s])|[\\s](\\*+)(?!\\*)(?=[punct])|(?!\\*)[punct](\\*+)(?!\\*)(?=[punct])|[^punct\\s](\\*+)(?=[^punct\\s])", "gu").replace(/punct/g, L).getRegex(), Oe = f("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\\s]|$)|[^punct\\s](_+)(?!_)(?=[punct\\s]|$)|(?!_)[punct\\s](_+)(?=[^punct\\s])|[\\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])", "gu").replace(/punct/g, L).getRegex(), He = f(/\\([punct])/, "gu").replace(/punct/g, L).getRegex(), Ne = f(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme", /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email", /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(), Ue = f(H).replace("(?:-->|$)", "-->").getRegex(), Fe = f("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment", Ue).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), B = /(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/, We = f(/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/).replace("label", B).replace("href", /<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), pe = f(/^!?\[(label)\]\[(ref)\]/).replace("label", B).replace("ref", O).getRegex(), ue = f(/^!?\[(ref)\](?:\[\])?/).replace("ref", O).getRegex(), Xe = f("reflink|nolink(?!\\()", "g").replace("reflink", pe).replace("nolink", ue).getRegex(), U = {
650
+ }, ce = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, Pe = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, he = /^( {2,}|\\)\n(?!\s*$)/, Ze = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, L = "\\p{P}\\p{S}", Me = f(/^((?![*_])[\spunctuation])/, "u").replace(/punctuation/g, L).getRegex(), De = /\[[^[\]]*?\]\([^\(\)]*?\)|`[^`]*?`|<[^<>]*?>/g, Qe = f(/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/, "u").replace(/punct/g, L).getRegex(), je = f("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)[punct](\\*+)(?=[\\s]|$)|[^punct\\s](\\*+)(?!\\*)(?=[punct\\s]|$)|(?!\\*)[punct\\s](\\*+)(?=[^punct\\s])|[\\s](\\*+)(?!\\*)(?=[punct])|(?!\\*)[punct](\\*+)(?!\\*)(?=[punct])|[^punct\\s](\\*+)(?=[^punct\\s])", "gu").replace(/punct/g, L).getRegex(), Oe = f("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\\s]|$)|[^punct\\s](_+)(?!_)(?=[punct\\s]|$)|(?!_)[punct\\s](_+)(?=[^punct\\s])|[\\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])", "gu").replace(/punct/g, L).getRegex(), He = f(/\\([punct])/, "gu").replace(/punct/g, L).getRegex(), Ne = f(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme", /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email", /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(), Ue = f(H).replace("(?:-->|$)", "-->").getRegex(), Fe = f("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment", Ue).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), B = /(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/, We = f(/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/).replace("label", B).replace("href", /<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), pe = f(/^!?\[(label)\]\[(ref)\]/).replace("label", B).replace("ref", O).getRegex(), ue = f(/^!?\[(ref)\](?:\[\])?/).replace("ref", O).getRegex(), Xe = f("reflink|nolink(?!\\()", "g").replace("reflink", pe).replace("nolink", ue).getRegex(), U = {
651
651
  _backpedal: I,
652
652
  // only used for GFM url
653
653
  anyPunctuation: He,
654
654
  autolink: Ne,
655
- blockSkip: Qe,
655
+ blockSkip: De,
656
656
  br: he,
657
657
  code: Pe,
658
658
  del: I,
659
- emStrongLDelim: De,
659
+ emStrongLDelim: Qe,
660
660
  emStrongRDelimAst: je,
661
661
  emStrongRDelimUnd: Oe,
662
662
  escape: ce,
@@ -672,7 +672,7 @@ const Re = /^(?:[ \t]*(?:\n|$))+/, _e = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*
672
672
  ...U,
673
673
  link: f(/^!?\[(label)\]\((.*?)\)/).replace("label", B).getRegex(),
674
674
  reflink: f(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", B).getRegex()
675
- }, Q = {
675
+ }, D = {
676
676
  ...U,
677
677
  escape: f(ce).replace("])", "~|])").getRegex(),
678
678
  url: f(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/, "i").replace("email", /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),
@@ -680,16 +680,16 @@ const Re = /^(?:[ \t]*(?:\n|$))+/, _e = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*
680
680
  del: /^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,
681
681
  text: /^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/
682
682
  }, Ve = {
683
- ...Q,
683
+ ...D,
684
684
  br: f(he).replace("{2,}", "*").getRegex(),
685
- text: f(Q.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex()
685
+ text: f(D.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex()
686
686
  }, v = {
687
687
  normal: N,
688
688
  gfm: Be,
689
689
  pedantic: Ce
690
690
  }, S = {
691
691
  normal: U,
692
- gfm: Q,
692
+ gfm: D,
693
693
  breaks: Ve,
694
694
  pedantic: Ge
695
695
  };
@@ -1285,7 +1285,7 @@ k(A, "passThroughHooks", /* @__PURE__ */ new Set([
1285
1285
  ]));
1286
1286
  class Je {
1287
1287
  constructor(...e) {
1288
- k(this, "defaults", D());
1288
+ k(this, "defaults", Q());
1289
1289
  k(this, "options", this.setOptions);
1290
1290
  k(this, "parse", this.parseMarkdown(!0));
1291
1291
  k(this, "parseInline", this.parseMarkdown(!1));
@@ -1463,7 +1463,7 @@ function u(c, e) {
1463
1463
  u.options = u.setOptions = function(c) {
1464
1464
  return T.setOptions(c), u.defaults = T.defaults, se(u.defaults), u;
1465
1465
  };
1466
- u.getDefaults = D;
1466
+ u.getDefaults = Q;
1467
1467
  u.defaults = z;
1468
1468
  u.use = function(...c) {
1469
1469
  return T.use(...c), u.defaults = T.defaults, se(u.defaults), u;
@@ -1489,6 +1489,7 @@ u.parseInline;
1489
1489
  y.parse;
1490
1490
  w.lex;
1491
1491
  const Ke = {
1492
+ name: "VsText",
1492
1493
  mixins: [xe],
1493
1494
  data() {
1494
1495
  return {
@@ -1501,6 +1502,11 @@ const Ke = {
1501
1502
  } catch (c) {
1502
1503
  console.error(c);
1503
1504
  }
1505
+ },
1506
+ methods: {
1507
+ onChangedData() {
1508
+ return null;
1509
+ }
1504
1510
  }
1505
1511
  }, Ye = { class: "relative select-auto h-full py-4 rounded-xl p-4 box-border bg-white custom-scrollbar" }, et = ["innerHTML"];
1506
1512
  function tt(c, e, t, n, s, i) {
package/package.json CHANGED
@@ -1,72 +1,107 @@
1
- {
2
- "name": "@opengis/bi",
3
- "version": "1.0.13",
4
- "description": "BI data visualization module",
5
- "main": "dist/bi.js",
6
- "browser": "dist/bi.umd.cjs",
7
- "type": "module",
8
- "files": [
9
- "dist/*",
10
- "server/*",
11
- "plugin.js",
12
- "utils.js",
13
- "config.js"
14
- ],
15
- "scripts": {
16
- "debug": "node --watch-path=server server",
17
- "dev": "vite",
18
- "build": "vite build",
19
- "build-app": "cross-env APP=true vite build",
20
- "lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore",
21
- "test": "node --test",
22
- "test21": "node --test ./test/plugins/*",
23
- "start": "node server.js",
24
- "prod": "cross-env NODE_ENV=production npm run start",
25
- "docs:local": "cross-env docs=local vitepress build docs",
26
- "docs:dev": "vitepress dev docs",
27
- "docs:build": "vitepress build docs",
28
- "docs:preview": "vitepress preview docs",
29
- "docs-dev:local": "cross-env docs=local vitepress build docs-dev",
30
- "docs-dev:dev": "vitepress dev docs-dev",
31
- "docs-dev:build": "vitepress build docs-dev",
32
- "docs-dev:preview": "vitepress preview docs-dev",
33
- "adduser": "node script/adduser.js"
34
- },
35
- "keywords": [],
36
- "author": "Softpro",
37
- "license": "ISC",
38
- "dependencies": {
39
- "@grpc/grpc-js": "^1.9.13",
40
- "@grpc/proto-loader": "^0.6.9",
41
- "@mapbox/sphericalmercator": "^1.2.0",
42
- "@opengis/fastify-auth": "^1.0.35",
43
- "@opengis/fastify-table": "^1.1.24",
44
- "@opengis/v3-core": "^0.1.103",
45
- "@opengis/v3-filter": "^0.0.31",
46
- "@turf/turf": "^7.1.0",
47
- "axios": "^1.3.1",
48
- "cross-env": "^7.0.3",
49
- "d3-format": "^3.1.0",
50
- "echarts": "^5.5.1",
51
- "fastify": "^4.26.1",
52
- "fastify-plugin": "^4.0.0",
53
- "js-yaml": "^4.1.0",
54
- "maplibre-gl": "^4.7.1",
55
- "marked": "^14.1.2",
56
- "vite": "^5.1.5",
57
- "vue": "^3.4.27",
58
- "vue-router": "^4.4.3"
59
- },
60
- "devDependencies": {
61
- "eslint": "^8.49.0",
62
- "eslint-config-airbnb": "^19.0.4",
63
- "eslint-plugin-vue": "^9.17.0",
64
- "prettier": "^3.0.3",
65
- "sass": "^1.77.0",
66
- "typescript": "~5.4.0",
67
- "vitepress": "^1.1.4",
68
- "vitepress-plugin-mermaid": "^2.0.16",
69
- "vitepress-plugin-tabs": "^0.5.0",
70
- "vitepress-sidebar": "^1.22.0"
71
- }
72
- }
1
+ {
2
+ "name": "@opengis/bi",
3
+ "version": "1.0.15",
4
+ "description": "BI data visualization module",
5
+ "main": "dist/bi.js",
6
+ "browser": "dist/bi.umd.cjs",
7
+ "type": "module",
8
+ "files": [
9
+ "dist/*",
10
+ "server/*",
11
+ "plugin.js",
12
+ "utils.js",
13
+ "config.js"
14
+ ],
15
+ "scripts": {
16
+ "debug": "node --watch-path=server server",
17
+ "dev": "vite",
18
+ "type-check": "vue-tsc --noEmit",
19
+ "build": "vite build",
20
+ "build-app": "cross-env APP=true vite build",
21
+ "lint": "eslint .",
22
+ "format": "prettier --write .",
23
+ "test": "node --test",
24
+ "test21": "node --test ./test/plugins/*",
25
+ "start": "node server.js",
26
+ "prod": "cross-env NODE_ENV=production npm run start",
27
+ "docs:local": "cross-env docs=local vitepress build docs",
28
+ "docs:dev": "vitepress dev docs",
29
+ "docs:build": "vitepress build docs",
30
+ "docs:preview": "vitepress preview docs",
31
+ "docs-dev:local": "cross-env docs=local vitepress build docs-dev",
32
+ "docs-dev:dev": "vitepress dev docs-dev",
33
+ "docs-dev:build": "vitepress build docs-dev",
34
+ "docs-dev:preview": "vitepress preview docs-dev",
35
+ "adduser": "node script/adduser.js",
36
+ "prepare": "husky",
37
+ "commit": "cz --no-verify"
38
+ },
39
+ "keywords": [],
40
+ "author": "Softpro",
41
+ "license": "ISC",
42
+ "dependencies": {
43
+ "@grpc/grpc-js": "^1.9.13",
44
+ "@grpc/proto-loader": "^0.6.9",
45
+ "@highlightjs/vue-plugin": "github:highlightjs/vue-plugin",
46
+ "@mapbox/sphericalmercator": "^1.2.0",
47
+ "@opengis/fastify-auth": "^1.0.50",
48
+ "@opengis/fastify-file": "^1.0.29",
49
+ "@opengis/fastify-table": "^1.1.72",
50
+ "@opengis/v3-core": "^0.1.103",
51
+ "@opengis/v3-filter": "^0.0.39",
52
+ "@turf/turf": "^7.1.0",
53
+ "@vueuse/core": "^11.1.0",
54
+ "ace-builds": "^1.36.2",
55
+ "axios": "^1.3.1",
56
+ "cross-env": "^7.0.3",
57
+ "d3-format": "^3.1.0",
58
+ "echarts": "^5.5.1",
59
+ "fastify": "^4.26.1",
60
+ "fastify-plugin": "^4.0.0",
61
+ "highlight.js": "^11.10.0",
62
+ "js-yaml": "^4.1.0",
63
+ "maplibre-gl": "^4.7.1",
64
+ "marked": "^14.1.2",
65
+ "pinia": "^2.2.4",
66
+ "vite": "^5.1.5",
67
+ "vue": "^3.4.27",
68
+ "vue-router": "^4.4.3",
69
+ "vue3-ace-editor": "^2.2.4"
70
+ },
71
+ "devDependencies": {
72
+ "@commitlint/cli": "^19.5.0",
73
+ "@commitlint/config-conventional": "^19.5.0",
74
+ "@eslint/eslintrc": "^3.1.0",
75
+ "@eslint/js": "^9.12.0",
76
+ "@types/echarts": "^4.9.22",
77
+ "@types/node": "^22.7.5",
78
+ "@typescript-eslint/eslint-plugin": "^6.21.0",
79
+ "@typescript-eslint/parser": "^8.8.1",
80
+ "@vitejs/plugin-vue": "^5.1.4",
81
+ "commitizen": "^4.3.1",
82
+ "eslint": "^8.57.1",
83
+ "eslint-config-airbnb-base": "^15.0.0",
84
+ "eslint-config-prettier": "^9.1.0",
85
+ "eslint-define-config": "^2.1.0",
86
+ "eslint-plugin-import": "^2.31.0",
87
+ "eslint-plugin-prettier": "^5.2.1",
88
+ "eslint-plugin-promise": "^6.6.0",
89
+ "eslint-plugin-vue": "^9.29.0",
90
+ "globals": "^15.10.0",
91
+ "husky": "^9.1.6",
92
+ "prettier": "^3.3.3",
93
+ "sass": "^1.77.0",
94
+ "typescript": "^5.4.5",
95
+ "typescript-eslint": "~8.8.1",
96
+ "vitepress": "^1.1.4",
97
+ "vitepress-plugin-mermaid": "^2.0.16",
98
+ "vitepress-plugin-tabs": "^0.5.0",
99
+ "vitepress-sidebar": "^1.22.0",
100
+ "vue-tsc": "^2.1.6"
101
+ },
102
+ "config": {
103
+ "commitizen": {
104
+ "path": "cz-conventional-changelog"
105
+ }
106
+ }
107
+ }
package/plugin.js CHANGED
@@ -1,13 +1,14 @@
1
- import fp from 'fastify-plugin';
2
- import config from './config.js';
3
- config.prefix = config.prefix || '/api'
4
- async function plugin(fastify, opts = config) {
5
-
6
- // API
7
- fastify.register(import('./server/routes/dashboard/index.mjs'), config);
8
- fastify.register(import('./server/routes/data/index.mjs'), config);
9
- fastify.register(import('./server/routes/edit/index.mjs'), config);
10
-
11
- }
12
-
13
- export default fp(plugin)
1
+ import fp from 'fastify-plugin';
2
+ import config from './config.js';
3
+
4
+ config.prefix = config.prefix || '/api';
5
+ async function plugin(fastify, opts = config) {
6
+ // API
7
+ fastify.register(import('./server/routes/dashboard/index.mjs'), config);
8
+ fastify.register(import('./server/routes/dataset/index.mjs'), config);
9
+ fastify.register(import('./server/routes/db/index.mjs'), config);
10
+ fastify.register(import('./server/routes/data/index.mjs'), config);
11
+ fastify.register(import('./server/routes/edit/index.mjs'), config);
12
+ }
13
+
14
+ export default fp(plugin);
@@ -0,0 +1,26 @@
1
+ create schema if not exists bi;
2
+
3
+ CREATE TABLE if not exists bi.dataset ();
4
+ alter table bi.dataset drop constraint if exists bi_dataset_id_pkey cascade;
5
+
6
+ alter table bi.dataset add column if not exists dataset_id text;
7
+ alter table bi.dataset alter column dataset_id set not null;
8
+ alter table bi.dataset alter column dataset_id set default next_id();
9
+
10
+ alter table bi.dataset add column if not exists name text;
11
+ alter table bi.dataset add column if not exists file_path text;
12
+ alter table bi.dataset add column if not exists table_name text;
13
+ alter table bi.dataset add column if not exists uid text;
14
+ alter table bi.dataset add column if not exists editor_id text;
15
+ alter table bi.dataset add column if not exists editor_date timestamp without time zone;
16
+ alter table bi.dataset add column if not exists cdate timestamp without time zone;
17
+ alter table bi.dataset alter column cdate set DEFAULT (now())::timestamp without time zone;
18
+
19
+ alter table bi.dataset add CONSTRAINT bi_dataset_id_pkey PRIMARY KEY (dataset_id);
20
+
21
+ COMMENT ON TABLE bi.dataset IS 'Набори даних';
22
+
23
+ COMMENT ON COLUMN bi.dataset.dataset_id IS 'PK';
24
+ COMMENT ON COLUMN bi.dataset.name IS 'Назва';
25
+ COMMENT ON COLUMN bi.dataset.file_path IS 'Шлях до імпортованого файлу';
26
+ COMMENT ON COLUMN bi.dataset.table_name IS 'Таблиця';
@@ -1,27 +1,93 @@
1
- create table if not exists bi.cluster();
2
- alter table bi.cluster drop constraint if exists bi_cluster_cluster_id_pkey;
3
- alter table bi.cluster drop constraint if exists bi_cluster_title_type_unique;
4
-
5
- alter table bi.cluster add column if not exists cluster_id text;
6
- alter table bi.cluster alter column cluster_id set not null;
7
- alter table bi.cluster alter column cluster_id set default next_id();
8
-
9
- alter table bi.cluster alter column cluster_id set default next_id();
10
- ALTER TABLE bi.cluster ADD COLUMN IF NOT EXISTS title text;
11
- ALTER TABLE bi.cluster ADD COLUMN IF NOT EXISTS type text;
12
- ALTER TABLE bi.cluster ADD COLUMN IF NOT EXISTS geom geometry(MultiPolygon,4326);
13
-
14
- ALTER TABLE bi.cluster ADD COLUMN IF NOT EXISTS uid text;
15
- ALTER TABLE bi.cluster ADD COLUMN IF NOT EXISTS files json;
16
- ALTER TABLE bi.cluster ADD COLUMN IF NOT EXISTS cdate timestamp without time zone;
17
- alter table bi.cluster alter column cdate set DEFAULT (now())::timestamp without time zone;
18
- ALTER TABLE bi.cluster ADD COLUMN IF NOT EXISTS editor_id text;
19
- ALTER TABLE bi.cluster ADD COLUMN IF NOT EXISTS editor_date timestamp without time zone;
20
-
21
- ALTER TABLE bi.cluster ADD CONSTRAINT bi_cluster_cluster_id_pkey PRIMARY KEY (cluster_id);
22
- ALTER TABLE bi.cluster ADD CONSTRAINT bi_cluster_title_type_unique UNIQUE(title, type);
23
-
24
- comment on table bi.cluster is 'Дані для побудови cluster віджетів';
25
-
26
- comment on column bi.cluster.title is 'Назва';
27
- comment on column bi.cluster.type is 'Тип кластеру';
1
+ create schema if not exists bi;
2
+
3
+ CREATE TABLE if not exists bi.dashboard ();
4
+ alter table bi.dashboard drop constraint if exists dashboard_id_pkey cascade;
5
+
6
+ alter table bi.dashboard add column if not exists dashboard_id text;
7
+ alter table bi.dashboard alter column dashboard_id set not null;
8
+ alter table bi.dashboard alter column dashboard_id set default next_id();
9
+
10
+ alter table bi.dashboard add column if not exists title text;
11
+ alter table bi.dashboard add column if not exists description text;
12
+ alter table bi.dashboard add column if not exists widgets json;
13
+ alter table bi.dashboard add column if not exists table_name text;
14
+ alter table bi.dashboard add column if not exists style json;
15
+ alter table bi.dashboard add column if not exists name text;
16
+ alter table bi.dashboard alter column name set not null;
17
+ alter table bi.dashboard add column if not exists panels json;
18
+ alter table bi.dashboard add column if not exists grid json;
19
+ alter table bi.dashboard add column if not exists filters json;
20
+
21
+ alter table bi.dashboard add CONSTRAINT dashboard_id_pkey PRIMARY KEY (dashboard_id);
22
+
23
+ COMMENT ON TABLE bi.dashboard IS 'Дашборди';
24
+ COMMENT ON COLUMN bi.dashboard.dashboard_id IS 'PK';
25
+ COMMENT ON COLUMN bi.dashboard.title IS 'Заголовок';
26
+ COMMENT ON COLUMN bi.dashboard.description IS 'Опис';
27
+ COMMENT ON COLUMN bi.dashboard.widgets IS 'Віджети';
28
+ COMMENT ON COLUMN bi.dashboard.table_name IS 'Назва таблиці';
29
+ COMMENT ON COLUMN bi.dashboard.style IS 'Стилі';
30
+ COMMENT ON COLUMN bi.dashboard.name IS 'Назва';
31
+ COMMENT ON COLUMN bi.dashboard.panels IS 'Панелі віджетів';
32
+ COMMENT ON COLUMN bi.dashboard.grid IS 'Сітка';
33
+ COMMENT ON COLUMN bi.dashboard.filters IS 'Фільтри';
34
+
35
+ CREATE TABLE if not exists bi.widget ();
36
+ alter table bi.widget drop constraint if exists widget_id_pk;
37
+ alter table bi.widget drop constraint if exists widget_id_fkey;
38
+
39
+ alter table bi.widget add column if not exists widget_id text;
40
+ alter table bi.widget alter column widget_id set not null;
41
+ alter table bi.widget alter column widget_id set default next_id();
42
+ alter table bi.widget add column if not exists type text;
43
+ alter table bi.widget add column if not exists title text;
44
+ alter table bi.widget add column if not exists style json;
45
+ alter table bi.widget add column if not exists data json;
46
+ alter table bi.widget add column if not exists table_name text;
47
+ alter table bi.widget add column if not exists dashboard_id text;
48
+ alter table bi.widget add column if not exists name text;
49
+ alter table bi.widget add column if not exists x text;
50
+ alter table bi.widget add column if not exists col numeric;
51
+ alter table bi.widget add column if not exists metrics text;
52
+ alter table bi.widget add column if not exists yml text;
53
+
54
+ alter table bi.widget add CONSTRAINT widget_id_pk PRIMARY KEY (widget_id);
55
+ alter table bi.widget add CONSTRAINT widget_id_fkey FOREIGN KEY (dashboard_id) REFERENCES bi.dashboard (dashboard_id);
56
+
57
+ COMMENT ON TABLE bi.widget IS 'Віджети';
58
+ COMMENT ON COLUMN bi.widget.widget_id IS 'PK';
59
+ COMMENT ON COLUMN bi.widget.type IS 'Тип';
60
+ COMMENT ON COLUMN bi.widget.title IS 'Назва';
61
+ COMMENT ON COLUMN bi.widget.style IS 'Стилі';
62
+ COMMENT ON COLUMN bi.widget.yml IS 'Yml';
63
+ COMMENT ON COLUMN bi.widget.data IS 'Дані';
64
+ COMMENT ON COLUMN bi.widget.table_name IS 'Назва таблиці';
65
+ COMMENT ON COLUMN bi.widget.dashboard_id IS 'Ідентифікатор дашборду';
66
+
67
+ create table if not exists bi.cluster();
68
+ alter table bi.cluster drop constraint if exists bi_cluster_cluster_id_pkey;
69
+ alter table bi.cluster drop constraint if exists bi_cluster_title_type_unique;
70
+
71
+ alter table bi.cluster add column if not exists cluster_id text;
72
+ alter table bi.cluster alter column cluster_id set not null;
73
+ alter table bi.cluster alter column cluster_id set default next_id();
74
+
75
+ alter table bi.cluster alter column cluster_id set default next_id();
76
+ ALTER TABLE bi.cluster ADD COLUMN IF NOT EXISTS title text;
77
+ ALTER TABLE bi.cluster ADD COLUMN IF NOT EXISTS type text;
78
+ ALTER TABLE bi.cluster ADD COLUMN IF NOT EXISTS geom geometry(MultiPolygon,4326);
79
+
80
+ ALTER TABLE bi.cluster ADD COLUMN IF NOT EXISTS uid text;
81
+ ALTER TABLE bi.cluster ADD COLUMN IF NOT EXISTS files json;
82
+ ALTER TABLE bi.cluster ADD COLUMN IF NOT EXISTS cdate timestamp without time zone;
83
+ alter table bi.cluster alter column cdate set DEFAULT (now())::timestamp without time zone;
84
+ ALTER TABLE bi.cluster ADD COLUMN IF NOT EXISTS editor_id text;
85
+ ALTER TABLE bi.cluster ADD COLUMN IF NOT EXISTS editor_date timestamp without time zone;
86
+
87
+ ALTER TABLE bi.cluster ADD CONSTRAINT bi_cluster_cluster_id_pkey PRIMARY KEY (cluster_id);
88
+ ALTER TABLE bi.cluster ADD CONSTRAINT bi_cluster_title_type_unique UNIQUE(title, type);
89
+
90
+ comment on table bi.cluster is 'Дані для побудови cluster віджетів';
91
+
92
+ comment on column bi.cluster.title is 'Назва';
93
+ comment on column bi.cluster.type is 'Тип кластеру';
@@ -1,47 +1,48 @@
1
- 'use strict'
2
-
3
- import path, { dirname } from 'path';
4
- import { fileURLToPath } from 'url';
5
- import fs from 'fs';
6
-
7
- const dir = dirname(fileURLToPath(import.meta.url));
8
- const root = `${dir}/../../`;
9
-
10
- async function plugin(fastify, opts) {
11
- fastify.get('/docs-dev*', async (req, reply) => {
12
- if (!fs.existsSync(path.join(root, 'docs-dev/.vitepress/dist/'))) {
13
- return reply.status(404).send('docs not exists');
14
- }
15
-
16
- const { params } = req;
17
- const url = params['*'];
18
-
19
- const filePath = url && url[url.length - 1] !== '/' ? path.join(root, 'docs-dev/.vitepress/dist/', url) : path.join(root, 'docs-dev/.vitepress/dist/', url, 'index.html');
20
-
21
- if (!fs.existsSync(filePath)) {
22
- return reply.status(404).send('File not found');
23
- }
24
-
25
- const ext = path.extname(filePath);
26
- const mime = {
27
- '.js': 'text/javascript',
28
- '.css': 'text/css',
29
- '.woff2': 'application/font-woff',
30
- '.png': 'image/png',
31
- '.svg': 'image/svg+xml',
32
- '.jpg': 'image/jpg',
33
- '.html': 'text/html',
34
- '.json': 'application/json',
35
- '.pdf': 'application/pdf'
36
- }[ext];
37
-
38
- const stream = fs.createReadStream(filePath);
39
- stream.on('error', (err) => {
40
- reply.status(500).send('Error reading file');
41
- });
42
-
43
- return mime ? reply.type(mime).send(stream) : reply.send(stream);
44
- });
45
- }
46
-
47
- export default plugin;
1
+ import path, { dirname } from 'path';
2
+ import { fileURLToPath } from 'url';
3
+ import fs from 'fs';
4
+
5
+ const dir = dirname(fileURLToPath(import.meta.url));
6
+ const root = `${dir}/../../`;
7
+
8
+ async function plugin(fastify, opts) {
9
+ fastify.get('/docs-dev*', async (req, reply) => {
10
+ if (!fs.existsSync(path.join(root, 'docs-dev/.vitepress/dist/'))) {
11
+ return reply.status(404).send('docs not exists');
12
+ }
13
+
14
+ const { params } = req;
15
+ const url = params['*'];
16
+
17
+ const filePath =
18
+ url && url[url.length - 1] !== '/'
19
+ ? path.join(root, 'docs-dev/.vitepress/dist/', url)
20
+ : path.join(root, 'docs-dev/.vitepress/dist/', url, 'index.html');
21
+
22
+ if (!fs.existsSync(filePath)) {
23
+ return reply.status(404).send('File not found');
24
+ }
25
+
26
+ const ext = path.extname(filePath);
27
+ const mime = {
28
+ '.js': 'text/javascript',
29
+ '.css': 'text/css',
30
+ '.woff2': 'application/font-woff',
31
+ '.png': 'image/png',
32
+ '.svg': 'image/svg+xml',
33
+ '.jpg': 'image/jpg',
34
+ '.html': 'text/html',
35
+ '.json': 'application/json',
36
+ '.pdf': 'application/pdf',
37
+ }[ext];
38
+
39
+ const stream = fs.createReadStream(filePath);
40
+ stream.on('error', (err) => {
41
+ reply.status(500).send('Error reading file');
42
+ });
43
+
44
+ return mime ? reply.type(mime).send(stream) : reply.send(stream);
45
+ });
46
+ }
47
+
48
+ export default plugin;