underpost 2.7.93 → 2.7.94

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.
package/bin/index.js CHANGED
@@ -19,7 +19,7 @@ const globalBinFolder = `${shellExec(`npm root -g`, {
19
19
 
20
20
  const program = new Command();
21
21
 
22
- const version = '2.7.93';
22
+ const version = '2.7.94';
23
23
 
24
24
  program.name('underpost').description(`underpost.net ci/cd cli ${version}`).version(version);
25
25
 
@@ -58,7 +58,7 @@ services:
58
58
  cpus: '0.25'
59
59
  memory: 20M
60
60
  labels: # labels in Compose file instead of Dockerfile
61
- engine.version: '2.7.93'
61
+ engine.version: '2.7.94'
62
62
  networks:
63
63
  - load-balancer
64
64
 
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "type": "module",
3
3
  "main": "src/index.js",
4
4
  "name": "underpost",
5
- "version": "2.7.93",
5
+ "version": "2.7.94",
6
6
  "description": "pwa api rest template",
7
7
  "scripts": {
8
8
  "start": "env-cmd -f .env.production node --max-old-space-size=8192 src/server",
@@ -9,11 +9,9 @@ const CoreService = {
9
9
  /** @type {import('./core.model.js').CoreModel} */
10
10
  const Core = DataBaseProvider.instance[`${options.host}${options.path}`].mongoose.models.Core;
11
11
  if (req.path.startsWith('/sh')) {
12
- shellExec(req.body.sh, { stdout: true, async: true });
13
- return {
14
- status: 'success',
15
- message: 'Command "' + req.body.sh + '" running',
16
- };
12
+ if (req.body.print) return shellExec(req.body.sh, { stdout: true });
13
+ shellExec(req.body.sh, { async: true });
14
+ return 'Command "' + req.body.sh + '" running';
17
15
  }
18
16
  return await new Core(req.body).save();
19
17
  },
@@ -79,7 +79,7 @@ const Docs = {
79
79
  icon: html`<i class="fa-brands fa-osi"></i>`,
80
80
  text: 'Source Docs',
81
81
  url: function () {
82
- return `${getProxyPath()}docs/engine/2.7.93`;
82
+ return `${getProxyPath()}docs/engine/2.7.94`;
83
83
  },
84
84
  },
85
85
  {
@@ -1535,7 +1535,7 @@ const Modal = {
1535
1535
  Responsive.Event['h-ui-hide-' + idModal] = () => {
1536
1536
  setTimeout(() => {
1537
1537
  if (!s(`.${idModal}`) || !s(`.main-body-btn-ui-close`)) return;
1538
- if (s(`.btn-restore-${idModal}`).style.display !== 'none') {
1538
+ if (s(`.btn-restore-${idModal}`) && s(`.btn-restore-${idModal}`).style.display !== 'none') {
1539
1539
  s(`.${idModal}`).style.height = s(`.main-body-btn-ui-close`).classList.contains('hide')
1540
1540
  ? `${window.innerHeight}px`
1541
1541
  : `${
@@ -1543,10 +1543,10 @@ const Modal = {
1543
1543
  (options.heightTopBar ? options.heightTopBar : heightDefaultTopBar) -
1544
1544
  (options.heightBottomBar ? options.heightBottomBar : heightDefaultBottomBar)
1545
1545
  }px`;
1546
- s(`.${idModal}`).style.top = s(`.main-body-btn-ui-close`).classList.contains('hide')
1547
- ? `0px`
1548
- : `${options.heightTopBar ? options.heightTopBar : heightDefaultTopBar}px`;
1549
1546
  }
1547
+ s(`.${idModal}`).style.top = s(`.main-body-btn-ui-close`).classList.contains('hide')
1548
+ ? `0px`
1549
+ : `${options.heightTopBar ? options.heightTopBar : heightDefaultTopBar}px`;
1550
1550
  });
1551
1551
  };
1552
1552
  Responsive.Event['h-ui-hide-' + idModal]();
@@ -1,4 +1,5 @@
1
1
  import { borderChar } from './Css.js';
2
+ import { Modal } from './Modal.js';
2
3
  import { append, s } from './VanillaJs.js';
3
4
 
4
5
  const Scroll = {
@@ -17,7 +18,7 @@ const Scroll = {
17
18
  scrollHandler: async function () {
18
19
  for (const selector in Scroll.data) await Scroll.data[selector].callback(Scroll.getScrollPosition(selector));
19
20
  },
20
- addEvent: function (selector = '', callback = () => {}) {
21
+ addEvent: function (selector = '', callback = (position = 0) => {}) {
21
22
  Scroll.data[selector].callback = callback;
22
23
  },
23
24
  removeEvent: function (selector) {
@@ -30,6 +31,13 @@ const Scroll = {
30
31
  behavior: options.behavior || 'smooth',
31
32
  });
32
33
  },
34
+ topRefreshEvents: {},
35
+ addTopRefreshEvent: function (options = { id: '', callback: () => {}, condition: () => {} }) {
36
+ this.topRefreshEvents[options.id] = options;
37
+ },
38
+ removeTopRefreshEvent: function (id = '') {
39
+ delete this.topRefreshEvents[id];
40
+ },
33
41
  pullTopRefresh: function () {
34
42
  append(
35
43
  'body',
@@ -68,6 +76,15 @@ const Scroll = {
68
76
  });
69
77
 
70
78
  document.addEventListener('touchmove', (e) => {
79
+ if (
80
+ !Object.keys(Scroll.topRefreshEvents).find((event) => Scroll.topRefreshEvents[event].condition()) ||
81
+ (!s(`.btn-bar-center-icon-close`).classList.contains('hide') &&
82
+ !s(
83
+ `.btn-icon-menu-mode-${Modal.Data['modal-menu'].options.mode !== 'slide-menu-right' ? 'left' : 'right'}`,
84
+ ).classList.contains('hide'))
85
+ )
86
+ return;
87
+
71
88
  const touchY = e.touches[0].clientY;
72
89
  const touchDiff = touchY - touchstartY;
73
90
 
@@ -87,11 +104,26 @@ const Scroll = {
87
104
  // console.warn('touchend');
88
105
  s(`.pull-refresh-icon-container`).style.top = '-60px';
89
106
  if (reload) {
90
- location.reload();
91
- // console.warn('reload');
107
+ for (const event of Object.keys(Scroll.topRefreshEvents))
108
+ if (Scroll.topRefreshEvents[event].condition()) Scroll.topRefreshEvents[event].callback();
92
109
  }
93
110
  reload = false;
94
111
  });
112
+ Scroll.addTopRefreshEvent({
113
+ id: 'main-body',
114
+ callback: () => {
115
+ location.reload();
116
+ },
117
+ condition: () => {
118
+ return (
119
+ s('.main-body') &&
120
+ s('.main-body').scrollTop === 0 &&
121
+ !Object.keys(Modal.Data).find(
122
+ (idModal) => !['modal-menu', 'main-body', 'bottom-bar', 'main-body-top'].includes(idModal),
123
+ )
124
+ );
125
+ },
126
+ });
95
127
  },
96
128
  };
97
129
 
@@ -106,6 +106,10 @@ const TranslateCore = {
106
106
  en: 'Enter your WhatsApp number, including your country code.',
107
107
  es: 'Número de WhatsApp, recuerda colocar el código de tu país',
108
108
  };
109
+ Translate.Data['¿'] = {
110
+ en: '',
111
+ es: '¿',
112
+ };
109
113
  Translate.Data['color-copy'] = { es: 'color copiado en el portapapeles', en: 'color copied to clipboard' };
110
114
  Translate.Data['pallet-colors'] = { en: 'pallet colors', es: 'paleta de colores' };
111
115
  Translate.Data['fullscreen'] = { en: 'Fullscreen', es: 'Pantalla completa' };
@@ -109,6 +109,6 @@ SrrComponent = ({ ttiLoadTimeLimit }) => {
109
109
  const CacheControl = ${CacheControl};
110
110
  CacheControl({ ttiLoadTimeLimit: ${ttiLoadTimeLimit ? ttiLoadTimeLimit : 1000 * 70 * 1} });
111
111
  </script>
112
- <div class="clean-cache-container">v2.7.93</div>
112
+ <div class="clean-cache-container">v2.7.94</div>
113
113
  `;
114
114
  };
@@ -97,7 +97,7 @@ const saveRuntimeRouter = async () => {
97
97
  port: networkRouter[_host][_path].port,
98
98
  apis: networkRouter[_host][_path].apis,
99
99
  };
100
- const instance = await Instance.findOne({ deployId: body.deployId, port: body.port });
100
+ const instance = await Instance.findOne({ deployId: body.deployId, host: _host, path: _path });
101
101
  if (instance) {
102
102
  await Instance.findByIdAndUpdate(instance._id, body);
103
103
  } else {