@opengis/bi 1.2.0 → 1.2.2

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 (74) hide show
  1. package/dist/bi.js +1 -1
  2. package/dist/bi.umd.cjs +42 -42
  3. package/dist/import-file-D8jh74Dz.js +3543 -0
  4. package/dist/{vs-funnel-bar-C_TceUrc.js → vs-funnel-bar-T330oJNS.js} +3 -3
  5. package/dist/{vs-list-DyhLUIPb.js → vs-list-DeHF_Oaf.js} +109 -109
  6. package/dist/{vs-map-BtQJNN4L.js → vs-map-Skt608pM.js} +8 -8
  7. package/dist/{vs-map-cluster-BbPUosvt.js → vs-map-cluster-BRUiY_90.js} +21 -21
  8. package/dist/{vs-number-D2GkU586.js → vs-number-Dd_21nn-.js} +3 -3
  9. package/dist/{vs-table-D_Yn9QqB.js → vs-table-BwC29Zyc.js} +6 -6
  10. package/dist/{vs-text-BivVd6cY.js → vs-text-DEJjWxDu.js} +32 -39
  11. package/package.json +77 -76
  12. package/plugin.js +22 -0
  13. package/server/helpers/mdToHTML.js +17 -0
  14. package/server/migrations/bi.dataset.sql +46 -0
  15. package/server/migrations/bi.sql +112 -0
  16. package/server/plugins/docs.js +48 -0
  17. package/server/plugins/hook.js +89 -0
  18. package/server/plugins/vite.js +69 -0
  19. package/server/routes/dashboard/controllers/dashboard.import.js +103 -0
  20. package/server/routes/dashboard/controllers/dashboard.js +157 -0
  21. package/server/routes/dashboard/controllers/dashboard.list.js +40 -0
  22. package/server/routes/dashboard/controllers/utils/yaml.js +11 -0
  23. package/server/routes/dashboard/index.mjs +26 -0
  24. package/server/routes/data/controllers/data.js +230 -0
  25. package/server/routes/data/controllers/util/chartSQL.js +49 -0
  26. package/server/routes/data/controllers/util/normalizeData.js +65 -0
  27. package/server/routes/data/index.mjs +32 -0
  28. package/server/routes/dataset/controllers/bi.dataset.list.js +29 -0
  29. package/server/routes/dataset/controllers/bi.db.list.js +19 -0
  30. package/server/routes/dataset/controllers/comment.js +55 -0
  31. package/server/routes/dataset/controllers/createDatasetPost.js +134 -0
  32. package/server/routes/dataset/controllers/data.js +149 -0
  33. package/server/routes/dataset/controllers/dbTablePreview.js +58 -0
  34. package/server/routes/dataset/controllers/dbTables.js +34 -0
  35. package/server/routes/dataset/controllers/delete.js +40 -0
  36. package/server/routes/dataset/controllers/deleteDataset.js +52 -0
  37. package/server/routes/dataset/controllers/editDataset.js +90 -0
  38. package/server/routes/dataset/controllers/export.js +214 -0
  39. package/server/routes/dataset/controllers/form.js +99 -0
  40. package/server/routes/dataset/controllers/format.js +46 -0
  41. package/server/routes/dataset/controllers/insert.js +47 -0
  42. package/server/routes/dataset/controllers/table.js +68 -0
  43. package/server/routes/dataset/controllers/update.js +43 -0
  44. package/server/routes/dataset/index.mjs +132 -0
  45. package/server/routes/dataset/utils/convertJSONToCSV.js +17 -0
  46. package/server/routes/dataset/utils/convertJSONToXls.js +47 -0
  47. package/server/routes/dataset/utils/createTableQuery.js +59 -0
  48. package/server/routes/dataset/utils/datasetForms.js +1 -0
  49. package/server/routes/dataset/utils/descriptionList.js +46 -0
  50. package/server/routes/dataset/utils/downloadRemoteFile.js +58 -0
  51. package/server/routes/dataset/utils/executeQuery.js +46 -0
  52. package/server/routes/dataset/utils/getLayersData.js +107 -0
  53. package/server/routes/dataset/utils/getTableData.js +47 -0
  54. package/server/routes/dataset/utils/insertDataQuery.js +12 -0
  55. package/server/routes/dataset/utils/metaFormat.js +24 -0
  56. package/server/routes/edit/controllers/dashboard.add.js +36 -0
  57. package/server/routes/edit/controllers/dashboard.delete.js +39 -0
  58. package/server/routes/edit/controllers/dashboard.edit.js +61 -0
  59. package/server/routes/edit/controllers/widget.add.js +78 -0
  60. package/server/routes/edit/controllers/widget.del.js +58 -0
  61. package/server/routes/edit/controllers/widget.edit.js +106 -0
  62. package/server/routes/edit/index.mjs +33 -0
  63. package/server/routes/map/controllers/cluster.js +125 -0
  64. package/server/routes/map/controllers/clusterVtile.js +166 -0
  65. package/server/routes/map/controllers/geojson.js +127 -0
  66. package/server/routes/map/controllers/heatmap.js +118 -0
  67. package/server/routes/map/controllers/map.js +69 -0
  68. package/server/routes/map/controllers/utils/downloadClusterData.js +45 -0
  69. package/server/routes/map/controllers/vtile.js +183 -0
  70. package/server/routes/map/index.mjs +32 -0
  71. package/server/templates/page/login.html +59 -0
  72. package/server/utils/getWidget.js +117 -0
  73. package/utils.js +12 -0
  74. package/dist/import-file-Bx4xpxVb.js +0 -3493
@@ -1,8 +1,8 @@
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
3
  var k = (c, e, t) => ke(c, typeof e != "symbol" ? e + "" : e, t);
4
- import { _ as de, c as xe } from "./import-file-Bx4xpxVb.js";
5
- import { openBlock as V, createElementBlock as J, createCommentVNode as be } from "vue";
4
+ import { _ as de, c as xe } from "./import-file-D8jh74Dz.js";
5
+ import { createElementBlock as V, openBlock as J, createCommentVNode as be } from "vue";
6
6
  function Q() {
7
7
  return {
8
8
  async: !1,
@@ -81,15 +81,8 @@ function _(c, e, t) {
81
81
  if (n === 0)
82
82
  return "";
83
83
  let s = 0;
84
- for (; s < n; ) {
85
- const i = c.charAt(n - s - 1);
86
- if (i === e && !t)
87
- s++;
88
- else if (i !== e && t)
89
- s++;
90
- else
91
- break;
92
- }
84
+ for (; s < n && c.charAt(n - s - 1) === e; )
85
+ s++;
93
86
  return c.slice(0, n - s);
94
87
  }
95
88
  function Te(c, e) {
@@ -142,7 +135,7 @@ function ze(c, e) {
142
135
  }).join(`
143
136
  `);
144
137
  }
145
- class v {
138
+ class q {
146
139
  // set by the lexer
147
140
  constructor(e) {
148
141
  k(this, "options");
@@ -289,7 +282,7 @@ ${p}` : p;
289
282
  `, 1)[0], x = !p.trim(), d = 0;
290
283
  if (this.options.pedantic ? (d = 2, a = p.trimStart()) : x ? d = t[1].length + 1 : (d = t[2].search(/[^ ]/), d = d > 4 ? 1 : d, a = p.slice(d), d += t[1].length), x && /^[ \t]*$/.test(g) && (h += g + `
291
284
  `, e = e.substring(g.length + 1), o = !0), !o) {
292
- const Z = new RegExp(`^ {0,${Math.min(3, d - 1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`), W = new RegExp(`^ {0,${Math.min(3, d - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`), X = new RegExp(`^ {0,${Math.min(3, d - 1)}}(?:\`\`\`|~~~)`), G = new RegExp(`^ {0,${Math.min(3, d - 1)}}#`), fe = new RegExp(`^ {0,${Math.min(3, d - 1)}}<[a-z].*>`, "i");
285
+ const Z = new RegExp(`^ {0,${Math.min(3, d - 1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`), W = new RegExp(`^ {0,${Math.min(3, d - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`), X = new RegExp(`^ {0,${Math.min(3, d - 1)}}(?:\`\`\`|~~~)`), G = new RegExp(`^ {0,${Math.min(3, d - 1)}}#`), fe = new RegExp(`^ {0,${Math.min(3, d - 1)}}<(?:[a-z].*>|!--)`, "i");
293
286
  for (; e; ) {
294
287
  const M = e.split(`
295
288
  `, 1)[0];
@@ -619,25 +612,25 @@ ${p}` : p;
619
612
  }
620
613
  }
621
614
  }
622
- const Re = /^(?:[ \t]*(?:\n|$))+/, _e = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/, Ie = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, E = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, Se = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, le = /(?:[*+-]|\d{1,9}[.)])/, oe = f(/^(?!bull |blockCode|fences|blockquote|heading|html)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html))+?)\n {0,3}(=+|-+) *(?:\n+|$)/).replace(/bull/g, le).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).getRegex(), j = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/, Ae = /^[^\n]+/, O = /(?!\s*\])(?:\\.|[^\[\]\\])+/, Ee = f(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", O).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), Le = f(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g, le).getRegex(), P = "address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul", H = /<!--(?:-?>|[\s\S]*?(?:-->|$))/, qe = f("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))", "i").replace("comment", H).replace("tag", P).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), ae = f(j).replace("hr", E).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("|table", "").replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", P).getRegex(), ve = f(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", ae).getRegex(), N = {
623
- blockquote: ve,
615
+ const Re = /^(?:[ \t]*(?:\n|$))+/, _e = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/, Ie = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, E = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, Se = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, le = /(?:[*+-]|\d{1,9}[.)])/, oe = f(/^(?!bull |blockCode|fences|blockquote|heading|html)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html))+?)\n {0,3}(=+|-+) *(?:\n+|$)/).replace(/bull/g, le).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).getRegex(), j = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/, Ae = /^[^\n]+/, O = /(?!\s*\])(?:\\.|[^\[\]\\])+/, Ee = f(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", O).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), Le = f(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g, le).getRegex(), P = "address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul", H = /<!--(?:-?>|[\s\S]*?(?:-->|$))/, ve = f("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))", "i").replace("comment", H).replace("tag", P).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), ae = f(j).replace("hr", E).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("|table", "").replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", P).getRegex(), qe = f(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", ae).getRegex(), N = {
616
+ blockquote: qe,
624
617
  code: _e,
625
618
  def: Ee,
626
619
  fences: Ie,
627
620
  heading: Se,
628
621
  hr: E,
629
- html: qe,
622
+ html: ve,
630
623
  lheading: oe,
631
624
  list: Le,
632
625
  newline: Re,
633
626
  paragraph: ae,
634
627
  table: S,
635
628
  text: Ae
636
- }, ne = f("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", E).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("blockquote", " {0,3}>").replace("code", "(?: {4}| {0,3} )[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", P).getRegex(), Be = {
629
+ }, ne = f("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", E).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("blockquote", " {0,3}>").replace("code", "(?: {4}| {0,3} )[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", P).getRegex(), Ce = {
637
630
  ...N,
638
631
  table: ne,
639
632
  paragraph: f(j).replace("hr", E).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", ne).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", P).getRegex()
640
- }, Ce = {
633
+ }, Be = {
641
634
  ...N,
642
635
  html: f(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment", H).replace(/tag/g, "(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),
643
636
  def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,
@@ -647,7 +640,7 @@ const Re = /^(?:[ \t]*(?:\n|$))+/, _e = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*
647
640
  lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,
648
641
  paragraph: f(j).replace("hr", E).replace("heading", ` *#{1,6} *[^
649
642
  ]`).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(), 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 = {
643
+ }, 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(), C = /(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/, We = f(/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/).replace("label", C).replace("href", /<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), pe = f(/^!?\[(label)\]\[(ref)\]/).replace("label", C).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
644
  _backpedal: S,
652
645
  // only used for GFM url
653
646
  anyPunctuation: He,
@@ -670,23 +663,23 @@ const Re = /^(?:[ \t]*(?:\n|$))+/, _e = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*
670
663
  url: S
671
664
  }, Ge = {
672
665
  ...U,
673
- link: f(/^!?\[(label)\]\((.*?)\)/).replace("label", B).getRegex(),
674
- reflink: f(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", B).getRegex()
666
+ link: f(/^!?\[(label)\]\((.*?)\)/).replace("label", C).getRegex(),
667
+ reflink: f(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", C).getRegex()
675
668
  }, D = {
676
669
  ...U,
677
670
  escape: f(ce).replace("])", "~|])").getRegex(),
678
671
  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(),
679
672
  _backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,
680
- del: /^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,
673
+ del: /^(~~?)(?=[^\s~])((?:\\.|[^\\])*?(?:\\.|[^\s~\\]))\1(?=[^~]|$)/,
681
674
  text: /^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/
682
675
  }, Ve = {
683
676
  ...D,
684
677
  br: f(he).replace("{2,}", "*").getRegex(),
685
678
  text: f(D.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex()
686
- }, q = {
679
+ }, v = {
687
680
  normal: N,
688
- gfm: Be,
689
- pedantic: Ce
681
+ gfm: Ce,
682
+ pedantic: Be
690
683
  }, I = {
691
684
  normal: U,
692
685
  gfm: D,
@@ -700,23 +693,23 @@ class w {
700
693
  k(this, "state");
701
694
  k(this, "tokenizer");
702
695
  k(this, "inlineQueue");
703
- this.tokens = [], this.tokens.links = /* @__PURE__ */ Object.create(null), this.options = e || z, this.options.tokenizer = this.options.tokenizer || new v(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = {
696
+ this.tokens = [], this.tokens.links = /* @__PURE__ */ Object.create(null), this.options = e || z, this.options.tokenizer = this.options.tokenizer || new q(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = {
704
697
  inLink: !1,
705
698
  inRawBlock: !1,
706
699
  top: !0
707
700
  };
708
701
  const t = {
709
- block: q.normal,
702
+ block: v.normal,
710
703
  inline: I.normal
711
704
  };
712
- this.options.pedantic ? (t.block = q.pedantic, t.inline = I.pedantic) : this.options.gfm && (t.block = q.gfm, this.options.breaks ? t.inline = I.breaks : t.inline = I.gfm), this.tokenizer.rules = t;
705
+ this.options.pedantic ? (t.block = v.pedantic, t.inline = I.pedantic) : this.options.gfm && (t.block = v.gfm, this.options.breaks ? t.inline = I.breaks : t.inline = I.gfm), this.tokenizer.rules = t;
713
706
  }
714
707
  /**
715
708
  * Expose Rules
716
709
  */
717
710
  static get rules() {
718
711
  return {
719
- block: q,
712
+ block: v,
720
713
  inline: I
721
714
  };
722
715
  }
@@ -916,7 +909,7 @@ class w {
916
909
  return t;
917
910
  }
918
911
  }
919
- class C {
912
+ class B {
920
913
  // set by the parser
921
914
  constructor(e) {
922
915
  k(this, "options");
@@ -1084,7 +1077,7 @@ class y {
1084
1077
  k(this, "options");
1085
1078
  k(this, "renderer");
1086
1079
  k(this, "textRenderer");
1087
- this.options = e || z, this.options.renderer = this.options.renderer || new C(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new F();
1080
+ this.options = e || z, this.options.renderer = this.options.renderer || new B(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new F();
1088
1081
  }
1089
1082
  /**
1090
1083
  * Static Parse Method
@@ -1290,10 +1283,10 @@ class Je {
1290
1283
  k(this, "parse", this.parseMarkdown(!0));
1291
1284
  k(this, "parseInline", this.parseMarkdown(!1));
1292
1285
  k(this, "Parser", y);
1293
- k(this, "Renderer", C);
1286
+ k(this, "Renderer", B);
1294
1287
  k(this, "TextRenderer", F);
1295
1288
  k(this, "Lexer", w);
1296
- k(this, "Tokenizer", v);
1289
+ k(this, "Tokenizer", q);
1297
1290
  k(this, "Hooks", A);
1298
1291
  this.use(...e);
1299
1292
  }
@@ -1351,7 +1344,7 @@ class Je {
1351
1344
  }
1352
1345
  "childTokens" in i && i.childTokens && (t.childTokens[i.name] = i.childTokens);
1353
1346
  }), s.extensions = t), n.renderer) {
1354
- const i = this.defaults.renderer || new C(this.defaults);
1347
+ const i = this.defaults.renderer || new B(this.defaults);
1355
1348
  for (const r in n.renderer) {
1356
1349
  if (!(r in i))
1357
1350
  throw new Error(`renderer '${r}' does not exist`);
@@ -1366,7 +1359,7 @@ class Je {
1366
1359
  s.renderer = i;
1367
1360
  }
1368
1361
  if (n.tokenizer) {
1369
- const i = this.defaults.tokenizer || new v(this.defaults);
1362
+ const i = this.defaults.tokenizer || new q(this.defaults);
1370
1363
  for (const r in n.tokenizer) {
1371
1364
  if (!(r in i))
1372
1365
  throw new Error(`tokenizer '${r}' does not exist`);
@@ -1474,11 +1467,11 @@ u.walkTokens = function(c, e) {
1474
1467
  u.parseInline = T.parseInline;
1475
1468
  u.Parser = y;
1476
1469
  u.parser = y.parse;
1477
- u.Renderer = C;
1470
+ u.Renderer = B;
1478
1471
  u.TextRenderer = F;
1479
1472
  u.Lexer = w;
1480
1473
  u.lexer = w.lex;
1481
- u.Tokenizer = v;
1474
+ u.Tokenizer = q;
1482
1475
  u.Hooks = A;
1483
1476
  u.parse = u;
1484
1477
  u.options;
@@ -1512,11 +1505,11 @@ const Ke = {
1512
1505
  }
1513
1506
  }, Ye = ["id"], et = ["innerHTML"];
1514
1507
  function tt(c, e, t, n, s, i) {
1515
- return V(), J("div", {
1508
+ return J(), V("div", {
1516
1509
  id: s.uniqueID,
1517
1510
  class: "relative select-auto h-full rounded-xl text-[12px] box-border bg-white custom-scrollbar text-widget"
1518
1511
  }, [
1519
- s.markedText ? (V(), J("div", {
1512
+ s.markedText ? (J(), V("div", {
1520
1513
  key: 0,
1521
1514
  innerHTML: s.markedText
1522
1515
  }, null, 8, et)) : be("", !0)
package/package.json CHANGED
@@ -1,77 +1,78 @@
1
- {
2
- "name": "@opengis/bi",
3
- "version": "1.2.0",
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
- ],
11
- "scripts": {
12
- "prepublishOnly": "npm run build",
13
- "debug": "node --watch-path=server server",
14
- "dev": "vite",
15
- "type-check": "vue-tsc --noEmit",
16
- "build": "vite build",
17
- "build-app": "cross-env APP=true vite build",
18
- "lint": "eslint .",
19
- "format": "prettier --write .",
20
- "test": "node --test",
21
- "test21": "node --test ./test/plugins/*",
22
- "start": "node server.js",
23
- "prod": "cross-env NODE_ENV=production npm run start",
24
- "docs:i": "npm install --prefix ./docs",
25
- "docs:dev": "npm run --prefix ./docs docs:dev",
26
- "docs:build": "npm run --prefix ./docs docs:build",
27
- "docs:preview": "npm run --prefix ./docs docs:preview",
28
- "adduser": "node script/adduser.js"
29
- },
30
- "keywords": [
31
- "bi",
32
- "data visualization",
33
- "chart",
34
- "opengis",
35
- "vue",
36
- "fastify"
37
- ],
38
- "author": "Softpro",
39
- "license": "ISC",
40
- "dependencies": {},
41
- "devDependencies": {
42
- "@highlightjs/vue-plugin": "github:highlightjs/vue-plugin",
43
- "@jspreadsheet-ce/vue": "^5.0.0",
44
- "@mapbox/sphericalmercator": "^1.2.0",
45
- "@opengis/fastify-auth": "1.1.1",
46
- "@opengis/fastify-table": "1.4.29",
47
- "@opengis/v3-core": "^0.3.93",
48
- "@opengis/v3-filter": "^0.0.71",
49
- "@turf/turf": "^7.1.0",
50
- "axios": "^1.3.1",
51
- "cross-env": "^7.0.3",
52
- "echarts": "^5.5.1",
53
- "highlight.js": "^11.10.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
- "vue3-ace-editor": "^2.2.4",
60
- "@eslint/eslintrc": "^3.1.0",
61
- "@eslint/js": "^9.12.0",
62
- "@types/echarts": "^4.9.22",
63
- "@types/node": "^22.7.5",
64
- "@typescript-eslint/eslint-plugin": "^6.21.0",
65
- "@vitejs/plugin-vue": "^5.1.4",
66
- "eslint": "^8.57.1",
67
- "eslint-config-airbnb-base": "^15.0.0",
68
- "eslint-config-prettier": "^9.1.0",
69
- "eslint-plugin-vue": "^9.29.0",
70
- "globals": "^15.10.0",
71
- "prettier": "^3.3.3",
72
- "sass-embedded": "1.89.2",
73
- "typescript": "^5.4.5",
74
- "typescript-eslint": "~8.8.1",
75
- "vue-tsc": "^2.1.6"
76
- }
1
+ {
2
+ "name": "@opengis/bi",
3
+ "version": "1.2.2",
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
+ ],
14
+ "scripts": {
15
+ "prepublishOnly": "npm run build",
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": "NODE_ENV=production npm run start",
27
+ "docs:i": "npm install --prefix ./docs",
28
+ "docs:dev": "npm run --prefix ./docs docs:dev",
29
+ "docs:build": "npm run --prefix ./docs docs:build",
30
+ "docs:preview": "npm run --prefix ./docs docs:preview",
31
+ "adduser": "node script/adduser.js"
32
+ },
33
+ "keywords": [
34
+ "bi",
35
+ "data visualization",
36
+ "chart",
37
+ "opengis",
38
+ "vue",
39
+ "fastify"
40
+ ],
41
+ "author": "Softpro",
42
+ "license": "ISC",
43
+ "dependencies": {
44
+ "@mapbox/sphericalmercator": "^1.2.0"
45
+ },
46
+ "devDependencies": {
47
+ "@highlightjs/vue-plugin": "github:highlightjs/vue-plugin",
48
+ "@jspreadsheet-ce/vue": "^5.0.0",
49
+ "@opengis/fastify-table": "^2.0.33",
50
+ "@opengis/v3-core": "^0.3.93",
51
+ "@opengis/v3-filter": "^0.0.71",
52
+ "cross-env": "^10.1.0",
53
+ "@turf/turf": "^7.1.0",
54
+ "axios": "^1.3.1",
55
+ "echarts": "^5.5.1",
56
+ "highlight.js": "^11.10.0",
57
+ "marked": "^14.1.2",
58
+ "vite": "^5.1.5",
59
+ "vue": "^3.4.27",
60
+ "vue-router": "^4.4.3",
61
+ "@eslint/eslintrc": "^3.1.0",
62
+ "@eslint/js": "^9.12.0",
63
+ "@types/echarts": "^4.9.22",
64
+ "@types/node": "^22.7.5",
65
+ "@typescript-eslint/eslint-plugin": "^6.21.0",
66
+ "@vitejs/plugin-vue": "^5.1.4",
67
+ "eslint": "^8.57.1",
68
+ "eslint-config-airbnb-base": "^15.0.0",
69
+ "eslint-config-prettier": "^9.1.0",
70
+ "eslint-plugin-vue": "^9.29.0",
71
+ "globals": "^15.10.0",
72
+ "prettier": "^3.3.3",
73
+ "sass-embedded": "1.89.2",
74
+ "typescript": "^5.4.5",
75
+ "typescript-eslint": "~8.8.1",
76
+ "vue-tsc": "^2.1.6"
77
+ }
77
78
  }
package/plugin.js ADDED
@@ -0,0 +1,22 @@
1
+ import fp from 'fastify-plugin';
2
+ // import path from 'node:path';
3
+ // import { fileURLToPath } from 'url';
4
+
5
+ //import { config, addTemplateDir, execMigrations } from '@opengis/fastify-table/utils.js';
6
+
7
+ //const fileName = fileURLToPath(import.meta.url);
8
+ // const dirName = path.dirname(fileName);
9
+
10
+ async function plugin(fastify, opt) {
11
+ fastify.register(import('./server/routes/dashboard/index.mjs'), opt);
12
+ fastify.register(import('./server/routes/dataset/index.mjs'), opt);
13
+
14
+ fastify.register(import('./server/routes/data/index.mjs'), opt);
15
+ fastify.register(import('./server/routes/edit/index.mjs'), opt);
16
+ fastify.register(import('./server/routes/map/index.mjs'), opt);
17
+ // config.templates?.forEach(el => addTemplateDir(el));
18
+
19
+ // const dir = path.join(dirName, 'server/migrations');
20
+ // execMigrations(dir).catch(err => console.log(err));
21
+ }
22
+ export default fp(plugin);
@@ -0,0 +1,17 @@
1
+ import md from 'markdown-it';
2
+
3
+ const md1 = md({ html: true });
4
+
5
+ /**
6
+ * Перетворення з файла readme.md до формату HTML.
7
+ * Потрабно вставити в хелпер шлях до файла або текст readme.md і за допомогою бібліотеки markdown-it перетвориться в HTML.
8
+
9
+ * @returns {String} Returns HTML
10
+ */
11
+ export default function mdToHTML(data, options) {
12
+ // auto detect HTML or MD
13
+ // const result = md().render(data);
14
+ if (!data) return 'empty data';
15
+ const result = md1.render(data);
16
+ return result;
17
+ };
@@ -0,0 +1,46 @@
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 db text;
12
+ alter table bi.dataset add column if not exists source_type text;
13
+ alter table bi.dataset add column if not exists file_path text;
14
+ alter table bi.dataset add column if not exists table_name text;
15
+
16
+ alter table bi.dataset add column if not exists sql_list json;
17
+ alter table bi.dataset add column if not exists column_list json;
18
+
19
+ alter table bi.dataset add column if not exists uid text;
20
+ alter table bi.dataset add column if not exists editor_id text;
21
+ alter table bi.dataset add column if not exists editor_date timestamp without time zone;
22
+ alter table bi.dataset add column if not exists cdate timestamp without time zone;
23
+ alter table bi.dataset alter column cdate set DEFAULT (now())::timestamp without time zone;
24
+ ALTER TABLE bi.dataset add column if not exists filter_list json;
25
+ ALTER TABLE bi.dataset add column if not exists dataset_file_path text;
26
+ ALTER TABLE bi.dataset add column if not exists files json;
27
+ ALTER TABLE bi.dataset add column if not exists style json;
28
+ ALTER TABLE bi.dataset add column if not exists data_source json;
29
+ ALTER TABLE bi.dataset add column if not exists setting json;
30
+ ALTER TABLE bi.dataset add column if not exists geom geometry;
31
+ ALTER TABLE bi.dataset add column if not exists pk text;
32
+ ALTER TABLE bi.dataset add column if not exists query text;
33
+ ALTER TABLE bi.dataset add column if not exists form_setting json;
34
+ ALTER TABLE bi.dataset add column if not exists access_level text;
35
+ ALTER TABLE bi.dataset add column if not exists export_columns text[];
36
+ ALTER TABLE bi.dataset add column if not exists dashboard_list text[];
37
+
38
+ alter table bi.dataset add CONSTRAINT bi_dataset_id_pkey PRIMARY KEY (dataset_id);
39
+
40
+ COMMENT ON TABLE bi.dataset IS 'Набори даних';
41
+
42
+ COMMENT ON COLUMN bi.dataset.dataset_id IS 'PK';
43
+ COMMENT ON COLUMN bi.dataset.name IS 'Назва';
44
+ COMMENT ON COLUMN bi.dataset.file_path IS 'Шлях до імпортованого файлу';
45
+ COMMENT ON COLUMN bi.dataset.table_name IS 'Таблиця';
46
+
@@ -0,0 +1,112 @@
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
+ alter table bi.dashboard add column if not exists words text;
21
+ alter table bi.dashboard add column if not exists public boolean;
22
+ alter table bi.dashboard add column if not exists db text;
23
+ alter table bi.dashboard add column if not exists uid text;
24
+ alter table bi.dashboard add column if not exists cdate timestamp without time zone;
25
+ alter table bi.dashboard add column if not exists source text;
26
+
27
+ alter table bi.dashboard add CONSTRAINT dashboard_id_pkey PRIMARY KEY (dashboard_id);
28
+
29
+ COMMENT ON TABLE bi.dashboard IS 'Дашборди';
30
+ COMMENT ON COLUMN bi.dashboard.dashboard_id IS 'PK';
31
+ COMMENT ON COLUMN bi.dashboard.title IS 'Заголовок';
32
+ COMMENT ON COLUMN bi.dashboard.description IS 'Опис';
33
+ COMMENT ON COLUMN bi.dashboard.widgets IS 'Віджети';
34
+ COMMENT ON COLUMN bi.dashboard.table_name IS 'Назва таблиці';
35
+ COMMENT ON COLUMN bi.dashboard.style IS 'Стилі';
36
+ COMMENT ON COLUMN bi.dashboard.name IS 'Назва';
37
+ COMMENT ON COLUMN bi.dashboard.panels IS 'Панелі віджетів';
38
+ COMMENT ON COLUMN bi.dashboard.grid IS 'Сітка';
39
+ COMMENT ON COLUMN bi.dashboard.filters IS 'Фільтри';
40
+ COMMENT ON COLUMN bi.dashboard.words IS 'Ключові слова';
41
+ COMMENT ON COLUMN bi.dashboard.public IS 'Публічний доступ';
42
+ COMMENT ON COLUMN bi.dashboard.db IS 'БД';
43
+ COMMENT ON COLUMN bi.dashboard.uid IS 'User ID';
44
+ COMMENT ON COLUMN bi.dashboard.cdate IS 'Creation date';
45
+ COMMENT ON COLUMN bi.dashboard.source IS 'Джерело (file)';
46
+
47
+ CREATE TABLE if not exists bi.widget ();
48
+ alter table bi.widget drop constraint if exists widget_id_pk;
49
+ alter table bi.widget drop constraint if exists widget_id_fkey;
50
+
51
+ alter table bi.widget add column if not exists widget_id text;
52
+ alter table bi.widget alter column widget_id set not null;
53
+ alter table bi.widget alter column widget_id set default next_id();
54
+ alter table bi.widget add column if not exists type text;
55
+ alter table bi.widget add column if not exists title text;
56
+ alter table bi.widget add column if not exists style json;
57
+ alter table bi.widget add column if not exists data json;
58
+ alter table bi.widget add column if not exists table_name text;
59
+ alter table bi.widget add column if not exists dashboard_id text;
60
+ alter table bi.widget add column if not exists name text;
61
+ alter table bi.widget add column if not exists x text;
62
+ alter table bi.widget add column if not exists col numeric;
63
+ alter table bi.widget add column if not exists metrics text;
64
+ alter table bi.widget add column if not exists yml text;
65
+ alter table bi.widget add column if not exists query text;
66
+ alter table bi.widget add column if not exists cls text;
67
+
68
+ alter table bi.widget add CONSTRAINT widget_id_pk PRIMARY KEY (widget_id);
69
+ alter table bi.widget add CONSTRAINT widget_id_fkey FOREIGN KEY (dashboard_id) REFERENCES bi.dashboard (dashboard_id);
70
+
71
+ COMMENT ON TABLE bi.widget IS 'Віджети';
72
+ COMMENT ON COLUMN bi.widget.widget_id IS 'PK';
73
+ COMMENT ON COLUMN bi.widget.type IS 'Тип';
74
+ COMMENT ON COLUMN bi.widget.title IS 'Назва';
75
+ COMMENT ON COLUMN bi.widget.style IS 'Стилі';
76
+ COMMENT ON COLUMN bi.widget.yml IS 'Yml';
77
+ COMMENT ON COLUMN bi.widget.query IS 'Запит до таблиці';
78
+ COMMENT ON COLUMN bi.widget.x IS 'Колонка для осі метрик';
79
+ COMMENT ON COLUMN bi.widget.cls IS 'Класифікатор метрик';
80
+ COMMENT ON COLUMN bi.widget.yml IS 'Yml';
81
+ COMMENT ON COLUMN bi.widget.data IS 'Дані';
82
+ COMMENT ON COLUMN bi.widget.table_name IS 'Назва таблиці';
83
+ COMMENT ON COLUMN bi.widget.dashboard_id IS 'Ідентифікатор дашборду';
84
+
85
+ create table if not exists bi.cluster();
86
+ alter table bi.cluster drop constraint if exists bi_cluster_cluster_id_pkey;
87
+ alter table bi.cluster drop constraint if exists bi_cluster_title_type_unique;
88
+
89
+ alter table bi.cluster add column if not exists cluster_id text;
90
+ alter table bi.cluster alter column cluster_id set not null;
91
+ alter table bi.cluster alter column cluster_id set default next_id();
92
+
93
+ alter table bi.cluster alter column cluster_id set default next_id();
94
+ ALTER TABLE bi.cluster ADD COLUMN IF NOT EXISTS title text;
95
+ ALTER TABLE bi.cluster ADD COLUMN IF NOT EXISTS type text;
96
+ ALTER TABLE bi.cluster ADD COLUMN IF NOT EXISTS codifier text;
97
+ ALTER TABLE bi.cluster ADD COLUMN IF NOT EXISTS geom geometry(MultiPolygon,4326);
98
+
99
+ ALTER TABLE bi.cluster ADD COLUMN IF NOT EXISTS uid text;
100
+ ALTER TABLE bi.cluster ADD COLUMN IF NOT EXISTS files json;
101
+ ALTER TABLE bi.cluster ADD COLUMN IF NOT EXISTS cdate timestamp without time zone;
102
+ alter table bi.cluster alter column cdate set DEFAULT (now())::timestamp without time zone;
103
+ ALTER TABLE bi.cluster ADD COLUMN IF NOT EXISTS editor_id text;
104
+ ALTER TABLE bi.cluster ADD COLUMN IF NOT EXISTS editor_date timestamp without time zone;
105
+
106
+ ALTER TABLE bi.cluster ADD CONSTRAINT bi_cluster_cluster_id_pkey PRIMARY KEY (cluster_id);
107
+ ALTER TABLE bi.cluster ADD CONSTRAINT bi_cluster_title_type_unique UNIQUE(title, type);
108
+
109
+ comment on table bi.cluster is 'Дані для побудови cluster віджетів';
110
+
111
+ comment on column bi.cluster.title is 'Назва';
112
+ comment on column bi.cluster.type is 'Тип кластеру';