@opengis/bi 1.0.11 → 1.0.13

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 (76) hide show
  1. package/dist/assets/charts/bar.png +0 -0
  2. package/dist/assets/charts/funnel.png +0 -0
  3. package/dist/assets/charts/no_data.jpg +0 -0
  4. package/dist/assets/charts/number.png +0 -0
  5. package/dist/assets/charts/pie.png +0 -0
  6. package/dist/assets/charts/progress.png +0 -0
  7. package/dist/assets/charts/stat.png +0 -0
  8. package/dist/assets/images/bar.png +0 -0
  9. package/dist/assets/images/funnel.png +0 -0
  10. package/dist/assets/images/no_data.jpg +0 -0
  11. package/dist/assets/images/number.png +0 -0
  12. package/dist/assets/images/pie.png +0 -0
  13. package/dist/assets/images/progress.png +0 -0
  14. package/dist/assets/images/stat.png +0 -0
  15. package/dist/bi.js +1 -1
  16. package/dist/bi.umd.cjs +722 -113
  17. package/dist/{import-file-D6RYWvi_.js → import-file-1T7kpSzt.js} +43137 -43183
  18. package/dist/map-component-mixin-BLM9iEWA.js +18712 -0
  19. package/dist/style.css +1 -1
  20. package/dist/vs-calendar-WiK1hcHS.js +96 -0
  21. package/dist/vs-funnel-bar-CpPbYZ0_.js +92 -0
  22. package/dist/vs-heatmap-BG4eIROH.js +83 -0
  23. package/dist/vs-map-BRk6Fmks.js +66 -0
  24. package/dist/vs-map-cluster-Dfe9INqE.js +103 -0
  25. package/dist/vs-number-CJq-vi95.js +39 -0
  26. package/dist/{vs-text-UyIWGqQO.js → vs-text-DcrAdQ40.js} +60 -60
  27. package/package.json +11 -6
  28. package/server/migrations/bi.sql +27 -0
  29. package/server/plugins/hook.js +86 -0
  30. package/server/plugins/vite.js +7 -4
  31. package/server/routes/dashboard/controllers/dashboard.js +24 -4
  32. package/server/routes/data/controllers/data.js +48 -52
  33. package/server/routes/data/controllers/util/chartSQL.js +8 -7
  34. package/server/routes/data/controllers/util/normalizeData.js +22 -9
  35. package/server/routes/edit/controllers/dashboard.add.js +5 -1
  36. package/server/routes/edit/controllers/dashboard.edit.js +5 -1
  37. package/server/routes/edit/controllers/widget.add.js +23 -7
  38. package/server/routes/edit/controllers/widget.del.js +1 -1
  39. package/server/routes/edit/controllers/widget.edit.js +8 -5
  40. package/server/routes/map/controllers/cluster.js +75 -0
  41. package/server/routes/map/controllers/clusterVtile.js +143 -0
  42. package/server/routes/map/controllers/geojson.js +9 -23
  43. package/server/routes/map/controllers/map.js +57 -0
  44. package/server/routes/map/controllers/vtile.js +25 -32
  45. package/server/routes/map/index.mjs +7 -4
  46. package/server/utils/getWidget.js +56 -0
  47. package/utils.js +11 -0
  48. package/dist/vs-number-DKF5ptAP.js +0 -34
  49. package/server/templates/dashboard/erobota/bar_area.yml +0 -17
  50. package/server/templates/dashboard/erobota/bar_culture.yml +0 -18
  51. package/server/templates/dashboard/erobota/bar_grand.yml +0 -18
  52. package/server/templates/dashboard/erobota/count_grand.yml +0 -8
  53. package/server/templates/dashboard/erobota/index.yml +0 -47
  54. package/server/templates/dashboard/erobota/list_culture.yml +0 -12
  55. package/server/templates/dashboard/erobota/list_grant.yml +0 -12
  56. package/server/templates/dashboard/erobota/map.yml +0 -4
  57. package/server/templates/dashboard/erobota/pie_area.yml +0 -17
  58. package/server/templates/dashboard/erobota/pie_grant.yml +0 -17
  59. package/server/templates/dashboard/erobota/total_area.yml +0 -9
  60. package/server/templates/dashboard/erobota/total_grand.yml +0 -9
  61. package/server/templates/dashboard/sales/index.yml +0 -40
  62. package/server/templates/dashboard/sales/quarterly_revenue.yml +0 -19
  63. package/server/templates/dashboard/sales/quarterly_revenue_by_product_line.yml +0 -19
  64. package/server/templates/dashboard/sales/total_products_sold.yml +0 -9
  65. package/server/templates/dashboard/sales/total_products_sold_by_product_line.yml +0 -12
  66. package/server/templates/dashboard/sales/total_revenue.yml +0 -8
  67. package/server/templates/dashboard/sales/total_revenue_by_product_line.yml +0 -17
  68. package/server/templates/dashboard/sales/vehicle_sales_info.md +0 -17
  69. package/server/templates/dashboard/test3/index.yml +0 -29
  70. package/server/templates/dashboard/test3/quarterly_revenue.yml +0 -19
  71. package/server/templates/dashboard/test3/widget1.yml +0 -8
  72. package/server/templates/pt/vehicle_sales.md +0 -17
  73. package/server/templates/table/demo.cleaned_sales_data.table.json +0 -104
  74. package/server/templates/table/test.dataset.table.json +0 -16
  75. package/server/templates/widget/product_line.yml +0 -20
  76. package/server/templates/widget/test_vtile.yml +0 -7
@@ -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
3
  var k = (c, e, t) => ke(c, typeof e != "symbol" ? e + "" : e, t);
4
- import { openBlock as V, createElementBlock as J, createCommentVNode as de } from "vue";
5
- import { _ as xe } from "./import-file-D6RYWvi_.js";
6
- function j() {
4
+ import { _ as de, c as xe } from "./import-file-1T7kpSzt.js";
5
+ import { openBlock as V, createElementBlock as J, createCommentVNode as be } from "vue";
6
+ function D() {
7
7
  return {
8
8
  async: !1,
9
9
  breaks: !1,
@@ -17,33 +17,33 @@ function j() {
17
17
  walkTokens: null
18
18
  };
19
19
  }
20
- let z = j();
20
+ let z = D();
21
21
  function se(c) {
22
22
  z = c;
23
23
  }
24
- const ie = /[&<>"']/, be = new RegExp(ie.source, "g"), re = /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/, me = new RegExp(re.source, "g"), we = {
24
+ const ie = /[&<>"']/, me = new RegExp(ie.source, "g"), re = /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/, we = new RegExp(re.source, "g"), ye = {
25
25
  "&": "&amp;",
26
26
  "<": "&lt;",
27
27
  ">": "&gt;",
28
28
  '"': "&quot;",
29
29
  "'": "&#39;"
30
- }, K = (c) => we[c];
30
+ }, K = (c) => ye[c];
31
31
  function b(c, e) {
32
32
  if (e) {
33
33
  if (ie.test(c))
34
- return c.replace(be, K);
34
+ return c.replace(me, K);
35
35
  } else if (re.test(c))
36
- return c.replace(me, K);
36
+ return c.replace(we, K);
37
37
  return c;
38
38
  }
39
- const ye = /(^|[^\[])\^/g;
39
+ const $e = /(^|[^\[])\^/g;
40
40
  function f(c, e) {
41
41
  let t = typeof c == "string" ? c : c.source;
42
42
  e = e || "";
43
43
  const n = {
44
44
  replace: (s, i) => {
45
45
  let r = typeof i == "string" ? i : i.source;
46
- return r = r.replace(ye, "$1"), t = t.replace(s, r), n;
46
+ return r = r.replace($e, "$1"), t = t.replace(s, r), n;
47
47
  },
48
48
  getRegex: () => new RegExp(t, e)
49
49
  };
@@ -92,7 +92,7 @@ function _(c, e, t) {
92
92
  }
93
93
  return c.slice(0, n - s);
94
94
  }
95
- function $e(c, e) {
95
+ function Te(c, e) {
96
96
  if (c.indexOf(e[1]) === -1)
97
97
  return -1;
98
98
  let t = 0;
@@ -127,7 +127,7 @@ function te(c, e, t, n) {
127
127
  text: b(r)
128
128
  };
129
129
  }
130
- function Te(c, e) {
130
+ function ze(c, e) {
131
131
  const t = c.match(/^(\s+)(?:```)/);
132
132
  if (t === null)
133
133
  return e;
@@ -175,7 +175,7 @@ class q {
175
175
  fences(e) {
176
176
  const t = this.rules.block.fences.exec(e);
177
177
  if (t) {
178
- const n = t[0], s = Te(n, t[3] || "");
178
+ const n = t[0], s = ze(n, t[3] || "");
179
179
  return {
180
180
  type: "code",
181
181
  raw: n,
@@ -455,7 +455,7 @@ ${p}` : p;
455
455
  if ((n.length - r.length) % 2 === 0)
456
456
  return;
457
457
  } else {
458
- const r = $e(t[2], "()");
458
+ const r = Te(t[2], "()");
459
459
  if (r > -1) {
460
460
  const o = (t[0].indexOf("!") === 0 ? 5 : 4) + t[1].length + r;
461
461
  t[2] = t[2].substring(0, r), t[0] = t[0].substring(0, o).trim(), t[3] = "";
@@ -619,25 +619,25 @@ ${p}` : p;
619
619
  }
620
620
  }
621
621
  }
622
- const ze = /^(?:[ \t]*(?:\n|$))+/, Re = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/, _e = /^ {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(), D = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/, Ie = /^[^\n]+/, O = /(?!\s*\])(?:\\.|[^\[\]\\])+/, Ae = f(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", O).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), Ee = 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]*?(?:-->|$))/, Le = 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(D).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,
624
- code: Re,
625
- def: Ae,
626
- fences: _e,
627
- heading: Se,
622
+ const Re = /^(?:[ \t]*(?:\n|$))+/, _e = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/, Se = /^ {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+|$)/, Ie = /^ {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 = {
623
+ blockquote: qe,
624
+ code: _e,
625
+ def: Ee,
626
+ fences: Se,
627
+ heading: Ie,
628
628
  hr: E,
629
- html: Le,
629
+ html: ve,
630
630
  lheading: oe,
631
- list: Ee,
632
- newline: ze,
631
+ list: Le,
632
+ newline: Re,
633
633
  paragraph: ae,
634
634
  table: I,
635
- text: Ie
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(), qe = {
635
+ 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 = {
637
637
  ...N,
638
638
  table: ne,
639
- paragraph: f(D).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
- }, Be = {
639
+ 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 = {
641
641
  ...N,
642
642
  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
643
  def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,
@@ -645,30 +645,30 @@ const ze = /^(?:[ \t]*(?:\n|$))+/, Re = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*
645
645
  fences: I,
646
646
  // fences not supported
647
647
  lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,
648
- paragraph: f(D).replace("hr", E).replace("heading", ` *#{1,6} *[^
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 = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, Ce = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, he = /^( {2,}|\\)\n(?!\s*$)/, Pe = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, L = "\\p{P}\\p{S}", Ze = f(/^((?![*_])[\spunctuation])/, "u").replace(/punctuation/g, L).getRegex(), Me = /\[[^[\]]*?\]\([^\(\)]*?\)|`[^`]*?`|<[^<>]*?>/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(), De = f("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\\s]|$)|[^punct\\s](_+)(?!_)(?=[punct\\s]|$)|(?!_)[punct\\s](_+)(?=[^punct\\s])|[\\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])", "gu").replace(/punct/g, L).getRegex(), Oe = f(/\\([punct])/, "gu").replace(/punct/g, L).getRegex(), He = 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(), Ne = f(H).replace("(?:-->|$)", "-->").getRegex(), Ue = 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", Ne).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), B = /(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/, Fe = 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(), We = 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(), 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 = {
651
651
  _backpedal: I,
652
652
  // only used for GFM url
653
- anyPunctuation: Oe,
654
- autolink: He,
655
- blockSkip: Me,
653
+ anyPunctuation: He,
654
+ autolink: Ne,
655
+ blockSkip: Qe,
656
656
  br: he,
657
- code: Ce,
657
+ code: Pe,
658
658
  del: I,
659
- emStrongLDelim: Qe,
659
+ emStrongLDelim: De,
660
660
  emStrongRDelimAst: je,
661
- emStrongRDelimUnd: De,
661
+ emStrongRDelimUnd: Oe,
662
662
  escape: ce,
663
- link: Fe,
663
+ link: We,
664
664
  nolink: ue,
665
- punctuation: Ze,
665
+ punctuation: Me,
666
666
  reflink: pe,
667
- reflinkSearch: We,
668
- tag: Ue,
669
- text: Pe,
667
+ reflinkSearch: Xe,
668
+ tag: Fe,
669
+ text: Ze,
670
670
  url: I
671
- }, Xe = {
671
+ }, Ge = {
672
672
  ...U,
673
673
  link: f(/^!?\[(label)\]\((.*?)\)/).replace("label", B).getRegex(),
674
674
  reflink: f(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", B).getRegex()
@@ -679,19 +679,19 @@ const ze = /^(?:[ \t]*(?:\n|$))+/, Re = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*
679
679
  _backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,
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
- }, Ge = {
682
+ }, Ve = {
683
683
  ...Q,
684
684
  br: f(he).replace("{2,}", "*").getRegex(),
685
685
  text: f(Q.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex()
686
686
  }, v = {
687
687
  normal: N,
688
- gfm: qe,
689
- pedantic: Be
688
+ gfm: Be,
689
+ pedantic: Ce
690
690
  }, S = {
691
691
  normal: U,
692
692
  gfm: Q,
693
- breaks: Ge,
694
- pedantic: Xe
693
+ breaks: Ve,
694
+ pedantic: Ge
695
695
  };
696
696
  class w {
697
697
  constructor(e) {
@@ -1283,9 +1283,9 @@ k(A, "passThroughHooks", /* @__PURE__ */ new Set([
1283
1283
  "postprocess",
1284
1284
  "processAllTokens"
1285
1285
  ]));
1286
- class Ve {
1286
+ class Je {
1287
1287
  constructor(...e) {
1288
- k(this, "defaults", j());
1288
+ k(this, "defaults", D());
1289
1289
  k(this, "options", this.setOptions);
1290
1290
  k(this, "parse", this.parseMarkdown(!0));
1291
1291
  k(this, "parseInline", this.parseMarkdown(!1));
@@ -1456,14 +1456,14 @@ Please report this to https://github.com/markedjs/marked.`, e) {
1456
1456
  };
1457
1457
  }
1458
1458
  }
1459
- const T = new Ve();
1459
+ const T = new Je();
1460
1460
  function u(c, e) {
1461
1461
  return T.parse(c, e);
1462
1462
  }
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 = j;
1466
+ u.getDefaults = D;
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;
@@ -1488,30 +1488,30 @@ u.walkTokens;
1488
1488
  u.parseInline;
1489
1489
  y.parse;
1490
1490
  w.lex;
1491
- const Je = {
1492
- props: ["source"],
1491
+ const Ke = {
1492
+ mixins: [xe],
1493
1493
  data() {
1494
1494
  return {
1495
1495
  markedText: null
1496
1496
  };
1497
1497
  },
1498
- mounted() {
1498
+ async mounted() {
1499
1499
  try {
1500
- this.markedText = u(this.source);
1500
+ await this.getData(), this.markedText = u(this.sourceData);
1501
1501
  } catch (c) {
1502
1502
  console.error(c);
1503
1503
  }
1504
1504
  }
1505
- }, Ke = { class: "relative select-auto h-full py-4 rounded-xl p-4 box-border bg-white custom-scrollbar" }, Ye = ["innerHTML"];
1506
- function et(c, e, t, n, s, i) {
1507
- return V(), J("div", Ke, [
1505
+ }, Ye = { class: "relative select-auto h-full py-4 rounded-xl p-4 box-border bg-white custom-scrollbar" }, et = ["innerHTML"];
1506
+ function tt(c, e, t, n, s, i) {
1507
+ return V(), J("div", Ye, [
1508
1508
  s.markedText ? (V(), J("div", {
1509
1509
  key: 0,
1510
1510
  innerHTML: s.markedText
1511
- }, null, 8, Ye)) : de("", !0)
1511
+ }, null, 8, et)) : be("", !0)
1512
1512
  ]);
1513
1513
  }
1514
- const it = /* @__PURE__ */ xe(Je, [["render", et]]);
1514
+ const rt = /* @__PURE__ */ de(Ke, [["render", tt]]);
1515
1515
  export {
1516
- it as default
1516
+ rt as default
1517
1517
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opengis/bi",
3
- "version": "1.0.11",
3
+ "version": "1.0.13",
4
4
  "description": "BI data visualization module",
5
5
  "main": "dist/bi.js",
6
6
  "browser": "dist/bi.umd.cjs",
@@ -9,6 +9,7 @@
9
9
  "dist/*",
10
10
  "server/*",
11
11
  "plugin.js",
12
+ "utils.js",
12
13
  "config.js"
13
14
  ],
14
15
  "scripts": {
@@ -19,7 +20,7 @@
19
20
  "lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore",
20
21
  "test": "node --test",
21
22
  "test21": "node --test ./test/plugins/*",
22
- "start": "node --watch-path=server server.js",
23
+ "start": "node server.js",
23
24
  "prod": "cross-env NODE_ENV=production npm run start",
24
25
  "docs:local": "cross-env docs=local vitepress build docs",
25
26
  "docs:dev": "vitepress dev docs",
@@ -28,7 +29,8 @@
28
29
  "docs-dev:local": "cross-env docs=local vitepress build docs-dev",
29
30
  "docs-dev:dev": "vitepress dev docs-dev",
30
31
  "docs-dev:build": "vitepress build docs-dev",
31
- "docs-dev:preview": "vitepress preview docs-dev"
32
+ "docs-dev:preview": "vitepress preview docs-dev",
33
+ "adduser": "node script/adduser.js"
32
34
  },
33
35
  "keywords": [],
34
36
  "author": "Softpro",
@@ -36,10 +38,12 @@
36
38
  "dependencies": {
37
39
  "@grpc/grpc-js": "^1.9.13",
38
40
  "@grpc/proto-loader": "^0.6.9",
39
- "carto": "^0.16.3",
40
41
  "@mapbox/sphericalmercator": "^1.2.0",
41
- "@opengis/fastify-table": "^1.1.14",
42
- "@opengis/v3-core": "^0.1.97",
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",
43
47
  "axios": "^1.3.1",
44
48
  "cross-env": "^7.0.3",
45
49
  "d3-format": "^3.1.0",
@@ -47,6 +51,7 @@
47
51
  "fastify": "^4.26.1",
48
52
  "fastify-plugin": "^4.0.0",
49
53
  "js-yaml": "^4.1.0",
54
+ "maplibre-gl": "^4.7.1",
50
55
  "marked": "^14.1.2",
51
56
  "vite": "^5.1.5",
52
57
  "vue": "^3.4.27",
@@ -0,0 +1,27 @@
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 'Тип кластеру';
@@ -0,0 +1,86 @@
1
+ import fp from 'fastify-plugin';
2
+ import fs from 'fs';
3
+
4
+
5
+ // the use of fastify-plugin is required to be able
6
+ // to export the decorators to the outer scope
7
+
8
+ async function plugin(fastify) {
9
+
10
+
11
+
12
+
13
+ // preSerialization
14
+ fastify.addHook('preSerialization', async (req, reply, payload) => {
15
+ if (!req.session?.passport?.user?.uid) {
16
+ // return reply.redirect('/login');
17
+ }
18
+ if (req.url.includes('/suggest/') && !req.query.json) {
19
+ return payload?.data;
20
+ }
21
+ if (payload.redirect) {
22
+ return reply.redirect(payload.redirect);
23
+ }
24
+ if (reply.sent) {
25
+ return null;
26
+ }
27
+
28
+ if (payload.status) {
29
+ reply.status(payload.status);
30
+ }
31
+ /*if (payload.headers) {
32
+ reply.headers(payload.headers);
33
+ }*/
34
+ if (payload.buffer) {
35
+ return payload.buffer;
36
+ }
37
+ if (payload.file) {
38
+ // const buffer = await readFile(payload.file);
39
+ // return reply.send(buffer);
40
+ const stream = fs.createReadStream(payload.file);
41
+ return stream;
42
+ // return reply.send(stream);
43
+ }
44
+
45
+ if (payload.message) {
46
+ return payload.message;
47
+ }
48
+ return payload;
49
+ });
50
+
51
+ // preValidation
52
+ fastify.addHook('preValidation', async (req) => {
53
+ const parseRawBody = ['POST', 'PUT'].includes(req.method) && req.body && typeof req.body === 'string'
54
+ && req.body.trim(/\r\n/g).startsWith('{')
55
+ && req.body.trim(/\r\n/g).endsWith('}');
56
+ if (parseRawBody) {
57
+ try {
58
+ req.body = JSON.parse(req.body || '{}');
59
+ }
60
+ catch (err) {
61
+ // throw new Error('invalid body');
62
+ // return { error: 'invalid body', status: 400 };
63
+ }
64
+ }
65
+ });
66
+
67
+ // allow upload file
68
+ const kIsMultipart = Symbol.for('[FastifyMultipart.isMultipart]');
69
+ fastify.addContentTypeParser('multipart', (request, _, done) => {
70
+ request[kIsMultipart] = true;
71
+ done(null);
72
+ });
73
+
74
+ // parse Body
75
+ function contentParser(req, body, done) {
76
+ const parseBody = decodeURIComponent(body.toString()).split('&').reduce((acc, el) => {
77
+ const [key, val] = el.split('=');
78
+ return { ...acc, [key]: val };
79
+ }, {});
80
+ done(null, parseBody);
81
+ }
82
+
83
+ fastify.addContentTypeParser('application/x-www-form-urlencoded', { parseAs: 'buffer' }, contentParser);
84
+ }
85
+
86
+ export default fp(plugin);
@@ -1,6 +1,7 @@
1
1
  import fs from 'fs';
2
2
  import path from 'path';
3
-
3
+ import config from '../../config.js';
4
+ const { disableAuth } = config;
4
5
  const isProduction = process.env.NODE_ENV === 'production';
5
6
 
6
7
  async function plugin(fastify) {
@@ -34,9 +35,10 @@ async function plugin(fastify) {
34
35
 
35
36
  // From Build
36
37
  fastify.get('*', async (req, reply) => {
37
-
38
+ // console.log(disableAuth)
39
+ if (!req.user && !disableAuth) return reply.redirect('/login');
38
40
  const stream = fs.createReadStream('dist/index.html');
39
- return reply.type('text/html').send(stream);
41
+ return reply.headers({ 'Cache-Control': 'public, no-cache' }).type('text/html').send(stream);
40
42
  });
41
43
  fastify.get('/assets/:file', async (req, reply) => {
42
44
  const stream = fs.createReadStream(`dist/assets/${req.params.file}`);
@@ -45,7 +47,8 @@ async function plugin(fastify) {
45
47
  '.js': 'text/javascript', '.css': 'text/css', '.woff2': 'application/font-woff', '.png': 'image/png',
46
48
  }[ext];
47
49
  //reply.cacheControl('max-age', '1d');
48
- return reply.headers({ 'Cache-Control': 'public, max-age=3600' }).type(mime).send(stream);
50
+ return mime ? reply.headers({ 'Cache-Control': 'public, max-age=3600' }).type(mime).send(stream) : stream;
51
+
49
52
  });
50
53
  }
51
54
 
@@ -4,7 +4,7 @@ import { existsSync, readFileSync, readdirSync } from 'fs';
4
4
  import pgClients from '@opengis/fastify-table/pg/pgClients.js';
5
5
  import getTemplatePath from '@opengis/fastify-table/table/controllers/utils/getTemplatePath.js';
6
6
  import { getTemplate } from '@opengis/fastify-table/utils.js';
7
-
7
+ import { getPGAsync } from '@opengis/fastify-table/utils.js';
8
8
 
9
9
  export default async function data({
10
10
  pg = pgClients.client, params = {},
@@ -45,14 +45,34 @@ export default async function data({
45
45
  return { message: 'not found ' + id, status: 404 };
46
46
  }
47
47
 
48
+ if (index?.filters?.filter((el) => el?.type === 'Check')?.length) {
49
+ await Promise.all(index.filters.filter((el) => el?.type === 'Check' && el?.data).map(async (el) => {
50
+ const options = await getTemplate('cls', el.data);
51
+ Object.assign(el, { options });
52
+ }));
53
+ }
54
+
48
55
 
49
56
  const data = index;
50
57
  data.type = 'file';
51
58
  const { table } = data?.data || { table: data?.table_name };
52
59
  // console.log(fileData)
53
- const widgets = fileData.filter(el => el[0] !== 'index.yml').map(el => el[1].data ? ({ name: el[0].split('.')[0], type: el[1].type, text: el[1].text, style: el[1].style, data: el[1].data }) : { name: el[0].split('.')[0], text: el[1] });
54
-
55
- const { fields = [] } = table ? await pg.query(`select * from ${table} limit 1`) : {};
60
+ const widgets = fileData
61
+ .filter((el) => el[0] !== 'index.yml')
62
+ .map((el) =>
63
+ el[1].data
64
+ ? {
65
+ name: el[0].split('.')[0],
66
+ type: el[1].type,
67
+ title: el[1].title,
68
+ style: el[1].style,
69
+ data: el[1].data
70
+ }
71
+ : { name: el[0].split('.')[0], title: el[1] }
72
+ );
73
+ const pg1 = data.db ? await getPGAsync(data.db) : pg
74
+
75
+ const { fields = [] } = table ? await pg1.query(`select * from ${table} limit 1`) : {};
56
76
 
57
77
  const columns = fields.map(({ name, dataTypeID }) => ({ name, type: pg.pgType?.[dataTypeID] }));
58
78