underpost 2.8.86 → 2.8.88

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 (116) hide show
  1. package/.env.development +39 -2
  2. package/.env.production +42 -2
  3. package/.env.test +39 -2
  4. package/.github/workflows/ghpkg.ci.yml +1 -1
  5. package/.github/workflows/npmpkg.ci.yml +1 -1
  6. package/.github/workflows/pwa-microservices-template-page.cd.yml +6 -5
  7. package/.github/workflows/pwa-microservices-template-test.ci.yml +1 -1
  8. package/.github/workflows/release.cd.yml +3 -3
  9. package/README.md +76 -2
  10. package/bin/build.js +5 -0
  11. package/bin/deploy.js +93 -27
  12. package/bin/file.js +8 -4
  13. package/bin/util.js +1 -56
  14. package/cli.md +16 -5
  15. package/conf.js +33 -7
  16. package/manifests/deployment/dd-default-development/deployment.yaml +2 -2
  17. package/manifests/deployment/dd-test-development/deployment.yaml +174 -0
  18. package/manifests/deployment/dd-test-development/proxy.yaml +51 -0
  19. package/manifests/deployment/mongo-express/deployment.yaml +12 -12
  20. package/manifests/maas/nvim.sh +91 -0
  21. package/package.json +8 -15
  22. package/src/api/core/core.router.js +2 -1
  23. package/src/api/default/default.controller.js +6 -1
  24. package/src/api/default/default.router.js +6 -2
  25. package/src/api/default/default.service.js +10 -1
  26. package/src/api/document/document.controller.js +66 -0
  27. package/src/api/document/document.model.js +51 -0
  28. package/src/api/document/document.router.js +24 -0
  29. package/src/api/document/document.service.js +125 -0
  30. package/src/api/file/file.controller.js +15 -1
  31. package/src/api/file/file.router.js +2 -1
  32. package/src/api/file/file.service.js +28 -8
  33. package/src/api/test/test.router.js +1 -1
  34. package/src/api/user/postman_collection.json +216 -0
  35. package/src/api/user/user.controller.js +25 -60
  36. package/src/api/user/user.model.js +29 -7
  37. package/src/api/user/user.router.js +40 -8
  38. package/src/api/user/user.service.js +86 -35
  39. package/src/cli/baremetal.js +33 -3
  40. package/src/cli/cloud-init.js +11 -0
  41. package/src/cli/cluster.js +4 -23
  42. package/src/cli/cron.js +0 -1
  43. package/src/cli/db.js +0 -19
  44. package/src/cli/deploy.js +67 -52
  45. package/src/cli/fs.js +1 -0
  46. package/src/cli/index.js +9 -1
  47. package/src/cli/lxd.js +7 -0
  48. package/src/cli/repository.js +44 -6
  49. package/src/cli/run.js +56 -9
  50. package/src/cli/ssh.js +20 -6
  51. package/src/client/Default.index.js +42 -1
  52. package/src/client/components/core/Account.js +10 -2
  53. package/src/client/components/core/AgGrid.js +30 -8
  54. package/src/client/components/core/Auth.js +99 -56
  55. package/src/client/components/core/BtnIcon.js +3 -2
  56. package/src/client/components/core/CalendarCore.js +2 -3
  57. package/src/client/components/core/CommonJs.js +1 -2
  58. package/src/client/components/core/Content.js +15 -12
  59. package/src/client/components/core/Css.js +2 -1
  60. package/src/client/components/core/CssCore.js +18 -1
  61. package/src/client/components/core/Docs.js +5 -5
  62. package/src/client/components/core/FileExplorer.js +3 -3
  63. package/src/client/components/core/FullScreen.js +19 -28
  64. package/src/client/components/core/Input.js +22 -16
  65. package/src/client/components/core/JoyStick.js +2 -2
  66. package/src/client/components/core/LoadingAnimation.js +2 -2
  67. package/src/client/components/core/LogIn.js +16 -23
  68. package/src/client/components/core/LogOut.js +5 -1
  69. package/src/client/components/core/Logger.js +4 -1
  70. package/src/client/components/core/Modal.js +102 -87
  71. package/src/client/components/core/ObjectLayerEngine.js +229 -4
  72. package/src/client/components/core/ObjectLayerEngineModal.js +442 -0
  73. package/src/client/components/core/Pagination.js +207 -0
  74. package/src/client/components/core/Panel.js +10 -10
  75. package/src/client/components/core/PanelForm.js +130 -33
  76. package/src/client/components/core/Recover.js +2 -2
  77. package/src/client/components/core/Router.js +210 -34
  78. package/src/client/components/core/SignUp.js +1 -2
  79. package/src/client/components/core/Stream.js +1 -1
  80. package/src/client/components/core/ToggleSwitch.js +15 -1
  81. package/src/client/components/core/VanillaJs.js +3 -84
  82. package/src/client/components/core/Worker.js +2 -2
  83. package/src/client/components/default/LogInDefault.js +0 -6
  84. package/src/client/components/default/LogOutDefault.js +0 -16
  85. package/src/client/components/default/MenuDefault.js +97 -44
  86. package/src/client/components/default/RoutesDefault.js +5 -2
  87. package/src/client/public/default/assets/mailer/api-user-default-avatar.png +0 -0
  88. package/src/client/services/core/core.service.js +8 -20
  89. package/src/client/services/default/default.management.js +115 -18
  90. package/src/client/services/default/default.service.js +13 -4
  91. package/src/client/services/document/document.service.js +97 -0
  92. package/src/client/services/file/file.service.js +2 -0
  93. package/src/client/services/test/test.service.js +3 -0
  94. package/src/client/services/user/user.management.js +6 -0
  95. package/src/client/services/user/user.service.js +15 -4
  96. package/src/client/ssr/Render.js +1 -1
  97. package/src/client/ssr/head/DefaultScripts.js +3 -0
  98. package/src/client/ssr/head/Seo.js +1 -0
  99. package/src/index.js +24 -2
  100. package/src/runtime/lampp/Lampp.js +89 -2
  101. package/src/runtime/xampp/Xampp.js +48 -1
  102. package/src/server/auth.js +519 -155
  103. package/src/server/backup.js +2 -2
  104. package/src/server/client-build-docs.js +1 -1
  105. package/src/server/client-build.js +4 -12
  106. package/src/server/client-icons.js +6 -78
  107. package/src/server/conf.js +144 -141
  108. package/src/server/process.js +2 -1
  109. package/src/server/proxy.js +1 -1
  110. package/src/server/runtime.js +136 -288
  111. package/src/server/ssl.js +1 -2
  112. package/src/server/ssr.js +85 -0
  113. package/src/server/start.js +4 -4
  114. package/src/server/valkey.js +2 -1
  115. package/test/api.test.js +3 -2
  116. package/bin/cyberia0.js +0 -78
@@ -67,7 +67,7 @@ const ToggleSwitch = {
67
67
 
68
68
  if (options.type === 'checkbox') {
69
69
  }
70
- return html`
70
+ const htmlRender = html`
71
71
  ${options?.displayMode === 'checkbox'
72
72
  ? html`<div class="${options?.containerClass ? options.containerClass : 'inl box-content-border'} ${id}">
73
73
  <div class="in ${id}-content toggle-switch-content-checkbox">
@@ -81,6 +81,20 @@ const ToggleSwitch = {
81
81
  </div>`}
82
82
  <input type="checkbox" class="${id}-checkbox" style="display: none" />
83
83
  `;
84
+ if (options.wrapper) {
85
+ setTimeout(() => (s(`.toggle-form-container-${id}`).onclick = () => ToggleSwitch.Tokens[`${id}`].click()));
86
+ return html`
87
+ <div class="in toggle-form-container toggle-form-container-${id} hover">
88
+ <div class="fl ">
89
+ <div class="in fll" style="width: 70%">
90
+ <div class="in">${options.wrapperLabel}</div>
91
+ </div>
92
+ <div class="in fll" style="width: 30%">${htmlRender}</div>
93
+ </div>
94
+ </div>
95
+ `;
96
+ }
97
+ return htmlRender;
84
98
  },
85
99
  };
86
100
 
@@ -132,72 +132,6 @@ const copyData = (data) =>
132
132
  */
133
133
  const pasteData = () => new Promise((resolve) => navigator.clipboard.readText().then((clipText) => resolve(clipText)));
134
134
 
135
- /**
136
- * The setPath function in JavaScript updates the browser's history with a new path, state, and title.
137
- * @param path - The `path` parameter is a string that represents the URL path where you want to
138
- * navigate or update in the browser history. It is the first parameter in the `setPath` function and
139
- * has a default value of `'/'`.
140
- * @param stateStorage - The `stateStorage` parameter in the `setPath` function is an object that
141
- * represents the state object associated with the new history entry. It is used to store data related
142
- * to the state of the application when navigating to a new path using `history.pushState()`. This data
143
- * can be accessed later
144
- * @param title - The `title` parameter in the `setPath` function is a string that represents the
145
- * title of the new history entry. It is used as the title of the new history entry in the browser's
146
- * history.
147
- * @memberof VanillaJS
148
- */
149
- const setPath = (path = '/', stateStorage = {}, title = '') => {
150
- if (!path) path = '/';
151
-
152
- const [inputPath, inputSearch] = `${path}`.split('?');
153
-
154
- let sanitizedPath = (inputPath[0] !== '/' ? `/${inputPath}` : inputPath)
155
- .trim()
156
- .replaceAll('//', '/')
157
- .replaceAll(`\\`, '/');
158
-
159
- if (sanitizedPath.length > 1 && sanitizedPath[sanitizedPath.length - 1] === '/')
160
- sanitizedPath = sanitizedPath.slice(0, -1);
161
-
162
- if (window.location.pathname === sanitizedPath && (!inputSearch || inputSearch === location.search)) {
163
- console.warn('Prevent overwriting same path', {
164
- inputPath: inputPath,
165
- inputSearch: inputSearch,
166
- sanitizedPath: sanitizedPath,
167
- currentLocationSearch: location.search,
168
- currentLocationHash: location.hash,
169
- });
170
- return;
171
- }
172
- console.warn('Set path', {
173
- inputPath: inputPath,
174
- inputSearch: inputSearch,
175
- sanitizedPath: sanitizedPath,
176
- currentLocationSearch: location.search,
177
- currentLocationHash: location.hash,
178
- });
179
- return history.pushState(
180
- stateStorage,
181
- title,
182
- `${sanitizedPath}${inputSearch ? `?${inputSearch}` : ''}${location.hash ?? ''}`,
183
- );
184
- };
185
-
186
- /**
187
- * The function `getQueryParams` extracts query parameters from the current URL and returns them as an
188
- * object.
189
- * @returns An object containing the query parameters from the current URL is being returned.
190
- * @memberof VanillaJS
191
- */
192
- const getQueryParams = () => {
193
- const params = new URLSearchParams(window.location.search);
194
- let queries = {};
195
- for (const param of params) {
196
- queries[param[0]] = param[1];
197
- }
198
- return queries;
199
- };
200
-
201
135
  /**
202
136
  * The `preHTML` function in JavaScript replaces special characters like &, <, and > with their
203
137
  * corresponding HTML entities.
@@ -375,21 +309,6 @@ const getBlobFromUint8ArrayFile = (data = [[]], mimetype = 'application/octet-st
375
309
  return new Blob([new Uint8Array(data)], { type: mimetype });
376
310
  };
377
311
 
378
- // Router
379
- /**
380
- * The function `getProxyPath` returns a proxy path based on the current location pathname.
381
- * @returns The `getProxyPath` function returns the path based on the current location. If the first
382
- * segment of the pathname is not empty, it returns `/<first-segment>/`, otherwise it returns `/`. If
383
- * the `window.Routes` object exists and the path is not `/` and the path without the trailing slash is
384
- * a key in the `window.Routes` object, it returns `/`.
385
- * @memberof VanillaJS
386
- */
387
- const getProxyPath = () => {
388
- let path = location.pathname.split('/')[1] ? `/${location.pathname.split('/')[1]}/` : '/';
389
- if (window.Routes && path !== '/' && path.slice(0, -1) in window.Routes()) path = '/';
390
- return path;
391
- };
392
-
393
312
  /**
394
313
  * The function `isNavigator` checks if the user agent string contains a specified name.
395
314
  * @param name - The `name` parameter is a string that represents the name of a browser or device to
@@ -470,6 +389,8 @@ function hexToRgbA(hex) {
470
389
  throw new Error('Invalid Hex');
471
390
  }
472
391
 
392
+ const htmlStrSanitize = (str) => (str ? str.replace(/<\/?[^>]+(>|$)/g, '').trim() : '');
393
+
473
394
  export {
474
395
  s,
475
396
  htmls,
@@ -478,8 +399,6 @@ export {
478
399
  sa,
479
400
  copyData,
480
401
  pasteData,
481
- setPath,
482
- getQueryParams,
483
402
  preHTML,
484
403
  disableOptionsClick,
485
404
  checkFullScreen,
@@ -488,7 +407,6 @@ export {
488
407
  getResponsiveData,
489
408
  isElement,
490
409
  downloadFile,
491
- getProxyPath,
492
410
  getRawContentFile,
493
411
  getBlobFromUint8ArrayFile,
494
412
  isNavigator,
@@ -500,4 +418,5 @@ export {
500
418
  getDataFromInputFile,
501
419
  getLang,
502
420
  hexToRgbA,
421
+ htmlStrSanitize,
503
422
  };
@@ -5,8 +5,8 @@ import { LoadingAnimation } from './LoadingAnimation.js';
5
5
  import { loggerFactory } from './Logger.js';
6
6
  import { LoadRouter } from './Router.js';
7
7
  import { Translate } from './Translate.js';
8
- import { getProxyPath, htmls, s } from './VanillaJs.js';
9
-
8
+ import { s } from './VanillaJs.js';
9
+ import { getProxyPath } from './Router.js';
10
10
  const logger = loggerFactory(import.meta);
11
11
 
12
12
  const Worker = {
@@ -1,17 +1,11 @@
1
- import { UserService } from '../../services/user/user.service.js';
2
1
  import { Auth } from '../core/Auth.js';
3
2
  import { LogIn } from '../core/LogIn.js';
4
- import { s } from '../core/VanillaJs.js';
5
3
  import { ElementsDefault } from './ElementsDefault.js';
6
4
 
7
5
  const LogInDefault = async function () {
8
6
  LogIn.Event['LogInDefault'] = async (options) => {
9
7
  const { token, user } = options;
10
8
  ElementsDefault.Data.user.main.model.user = user;
11
- s(`.main-btn-log-in`).style.display = 'none';
12
- s(`.main-btn-sign-up`).style.display = 'none';
13
- s(`.main-btn-log-out`).style.display = null;
14
- s(`.main-btn-account`).style.display = null;
15
9
  };
16
10
  const { user } = await Auth.sessionIn();
17
11
  ElementsDefault.Data.user.main.model.user = user;
@@ -1,25 +1,9 @@
1
- import { Auth } from '../core/Auth.js';
2
1
  import { LogOut } from '../core/LogOut.js';
3
- import { NotificationManager } from '../core/NotificationManager.js';
4
- import { Translate } from '../core/Translate.js';
5
- import { s } from '../core/VanillaJs.js';
6
2
  import { ElementsDefault } from './ElementsDefault.js';
7
3
 
8
4
  const LogOutDefault = async function () {
9
5
  LogOut.Event['LogOutDefault'] = async (result = { user: { _id: '' } }) => {
10
6
  ElementsDefault.Data.user.main.model.user = result.user;
11
-
12
- s(`.main-btn-log-out`).style.display = 'none';
13
- s(`.main-btn-account`).style.display = 'none';
14
- s(`.main-btn-log-in`).style.display = null;
15
- s(`.main-btn-sign-up`).style.display = null;
16
- if (s(`.modal-log-out`)) s(`.btn-close-modal-log-out`).click();
17
- if (s(`.modal-account`)) s(`.btn-close-modal-account`).click();
18
-
19
- NotificationManager.Push({
20
- html: Translate.Render(`success-logout`),
21
- status: 'success',
22
- });
23
7
  };
24
8
  };
25
9
 
@@ -17,10 +17,11 @@ import { LogOut } from '../core/LogOut.js';
17
17
  import { buildBadgeToolTipMenuOption, Modal, renderMenuLabel, renderViewTitle } from '../core/Modal.js';
18
18
  import { SignUp } from '../core/SignUp.js';
19
19
  import { Translate } from '../core/Translate.js';
20
- import { getProxyPath, htmls, s } from '../core/VanillaJs.js';
20
+ import { htmls, s } from '../core/VanillaJs.js';
21
+ import { getProxyPath } from '../core/Router.js';
21
22
  import { ElementsDefault } from './ElementsDefault.js';
22
23
  import Sortable from 'sortablejs';
23
- import { RouterDefault } from './RoutesDefault.js';
24
+ import { RouterDefault, BannerAppTemplate } from './RoutesDefault.js';
24
25
  import { SettingsDefault } from './SettingsDefault.js';
25
26
  import { Badge } from '../core/Badge.js';
26
27
  import { Docs } from '../core/Docs.js';
@@ -28,6 +29,8 @@ import { Recover } from '../core/Recover.js';
28
29
  import { DefaultManagement } from '../../services/default/default.management.js';
29
30
  import { Page500 } from '../core/500.js';
30
31
  import { Page404 } from '../core/404.js';
32
+ import { PanelForm } from '../core/PanelForm.js';
33
+ import { Chat } from '../core/Chat.js';
31
34
 
32
35
  const MenuDefault = {
33
36
  Data: {},
@@ -35,7 +38,7 @@ const MenuDefault = {
35
38
  const id = getId(this.Data, 'menu-');
36
39
  this.Data[id] = {};
37
40
  const RouterInstance = RouterDefault();
38
- const { BannerAppTemplate } = RouterInstance;
41
+
39
42
  const { barConfig } = await Themes[Css.currentTheme]();
40
43
  const heightTopBar = 50;
41
44
  const heightBottomBar = 50;
@@ -159,6 +162,34 @@ const MenuDefault = {
159
162
  handleContainerClass: 'handle-btn-container',
160
163
  tooltipHtml: await Badge.Render(buildBadgeToolTipMenuOption('500')),
161
164
  })}
165
+ ${await BtnIcon.Render({
166
+ class: 'in wfa main-btn-menu main-btn-blog',
167
+ label: renderMenuLabel({
168
+ icon: html`<i class="fa-solid fa-file-invoice"></i>`,
169
+ text: html`<span class="menu-label-text">${Translate.Render('blog')}</span>`,
170
+ }),
171
+ attrs: `data-id="blog"`,
172
+ tabHref: `${getProxyPath()}blog`,
173
+ handleContainerClass: 'handle-btn-container',
174
+ tooltipHtml: await Badge.Render(buildBadgeToolTipMenuOption('blog')),
175
+ })}
176
+ ${await BtnIcon.Render({
177
+ class: 'in wfa main-btn-menu main-btn-chat',
178
+ label: html`${renderMenuLabel({
179
+ icon: html`<i class="far fa-comments"></i>`,
180
+ text: html`<span class="menu-label-text">${Translate.Render('chat')}</span>`,
181
+ })}
182
+ ${await Badge.Render({
183
+ id: 'main-btn-chat',
184
+ type: 'circle-red',
185
+ style: badgeNotificationMenuStyle,
186
+ classList: 'hide',
187
+ })}`,
188
+ attrs: `data-id="chat"`,
189
+ tabHref: `${getProxyPath()}chat`,
190
+ handleContainerClass: 'handle-btn-container',
191
+ tooltipHtml: await Badge.Render(buildBadgeToolTipMenuOption('chat')),
192
+ })}
162
193
  </div>
163
194
  `,
164
195
  barConfig: newInstance(barConfig),
@@ -180,47 +211,7 @@ const MenuDefault = {
180
211
  RouterInstance,
181
212
  heightTopBar,
182
213
  heightBottomBar,
183
- htmlMainBody: async () => {
184
- setTimeout(() => {
185
- EventsUI.onClick('.get-started-button', (e) => {
186
- e.preventDefault();
187
- location.href = `https://www.nexodev.org/docs/?cid=src`;
188
- });
189
- });
190
- return html`
191
- <div class="landing-container">
192
- <div class="content-wrapper">
193
- <h1 class="animated-text">
194
- <span class="greeting">Hello, World!</span>
195
- <span class="subtitle">Welcome to Our Platform</span>
196
- </h1>
197
-
198
- <div class="features">
199
- <div class="feature-card">
200
- <i class="icon">🚀</i>
201
- <h3>Fast & Reliable</h3>
202
- <p>Lightning-fast performance with 99.9% uptime</p>
203
- </div>
204
- <div class="feature-card">
205
- <i class="icon">🎨</i>
206
- <h3>Beautiful UI</h3>
207
- <p>Modern and intuitive user interface</p>
208
- </div>
209
- <div class="feature-card">
210
- <i class="icon">⚡</i>
211
- <h3>Powerful Features</h3>
212
- <p>Everything you need in one place</p>
213
- </div>
214
- </div>
215
-
216
- <button class="cta-button get-started-button">
217
- Get Started
218
- <span class="button-icon">→</span>
219
- </button>
220
- </div>
221
- </div>
222
- `;
223
- },
214
+ htmlMainBody: options.htmlMainBody,
224
215
  });
225
216
 
226
217
  ThemeEvents['main-theme-handler'] = () => {
@@ -671,6 +662,68 @@ const MenuDefault = {
671
662
  observer: true,
672
663
  });
673
664
  });
665
+
666
+ EventsUI.onClick(`.main-btn-blog`, async () => {
667
+ const { barConfig } = await Themes[Css.currentTheme]();
668
+ const idModal = 'modal-blog';
669
+ const routeModal = 'blog';
670
+ const idEvent = `form-panel-${idModal}`;
671
+ await Modal.Render({
672
+ id: idModal,
673
+ route: routeModal,
674
+ barConfig,
675
+ title: renderViewTitle({
676
+ icon: html`<i class="fa-solid fa-file-invoice"></i>`,
677
+ text: Translate.Render('blog'),
678
+ }),
679
+ observer: true,
680
+ html: async () => {
681
+ setTimeout(async () => {
682
+ await PanelForm.instance({
683
+ idPanel: 'default-blog',
684
+ heightTopBar,
685
+ heightBottomBar,
686
+ defaultUrlImage: `${getProxyPath()}android-chrome-96x96.png`,
687
+ Elements: ElementsDefault,
688
+ parentIdModal: idModal,
689
+ scrollClassContainer: `html-${idModal}`,
690
+ route: routeModal,
691
+ });
692
+ });
693
+ },
694
+ handleType: 'bar',
695
+ maximize: true,
696
+ mode: 'view',
697
+ slideMenu: 'modal-menu',
698
+ RouterInstance,
699
+ heightTopBar,
700
+ heightBottomBar,
701
+ barMode,
702
+ });
703
+ });
704
+
705
+ EventsUI.onClick(`.main-btn-chat`, async () => {
706
+ const { barConfig } = await Themes[Css.currentTheme]();
707
+ await Modal.Render({
708
+ id: 'modal-chat',
709
+ route: 'chat',
710
+ barConfig,
711
+ title: renderViewTitle({
712
+ icon: html` <i class="far fa-comments"></i>`,
713
+ text: Translate.Render('chat'),
714
+ }),
715
+ html: async () => await Chat.Render({ idModal: 'modal-chat' }),
716
+ handleType: 'bar',
717
+ maximize: true,
718
+ observer: true,
719
+ mode: 'view',
720
+ slideMenu: 'modal-menu',
721
+ RouterInstance,
722
+ heightTopBar,
723
+ heightBottomBar,
724
+ barMode,
725
+ });
726
+ });
674
727
  },
675
728
  };
676
729
 
@@ -1,6 +1,7 @@
1
1
  import { loggerFactory } from '../core/Logger.js';
2
2
  import { Modal } from '../core/Modal.js';
3
- import { getProxyPath, s } from '../core/VanillaJs.js';
3
+ import { s } from '../core/VanillaJs.js';
4
+ import { getProxyPath } from '../core/Router.js';
4
5
 
5
6
  const logger = loggerFactory(import.meta);
6
7
 
@@ -26,6 +27,8 @@ const RoutesDefault = () => {
26
27
  render: () => s(`.main-btn-account`).click(),
27
28
  },
28
29
  '/docs': { title: 'docs', render: () => s(`.main-btn-docs`).click() },
30
+ '/chat': { title: 'docs', render: () => s(`.main-btn-chat`).click() },
31
+ '/blog': { title: 'docs', render: () => s(`.main-btn-blog`).click() },
29
32
  '/recover': { title: 'recover', render: () => s(`.main-btn-recover`).click() },
30
33
  '/default-management': {
31
34
  title: 'default-management',
@@ -39,7 +42,7 @@ const RoutesDefault = () => {
39
42
  window.Routes = RoutesDefault;
40
43
 
41
44
  const RouterDefault = () => {
42
- return { Routes: RoutesDefault, BannerAppTemplate };
45
+ return { Routes: RoutesDefault };
43
46
  };
44
47
 
45
48
  export { RoutesDefault, RouterDefault, BannerAppTemplate };
@@ -1,6 +1,6 @@
1
1
  import { Auth } from '../../components/core/Auth.js';
2
2
  import { loggerFactory } from '../../components/core/Logger.js';
3
- import { getProxyPath } from '../../components/core/VanillaJs.js';
3
+ import { getProxyPath } from '../../components/core/Router.js';
4
4
 
5
5
  const logger = loggerFactory(import.meta);
6
6
 
@@ -33,7 +33,9 @@ const getWsBaseUrl = (options = { id: '', endpoint: '', wsBasePath: '' }) =>
33
33
  }${options?.endpoint ? options.endpoint : ''}${options?.id ? `/${options.id}` : ''}`;
34
34
 
35
35
  const headersFactory = (headerId = '') => {
36
- const headers = { Authorization: Auth.getJWT() }; // , mode: 'no-cors'
36
+ const headers = {
37
+ Authorization: Auth.getJWT(),
38
+ };
37
39
  switch (headerId) {
38
40
  case 'file':
39
41
  return headers;
@@ -67,29 +69,12 @@ const CoreService = {
67
69
  return reject(error);
68
70
  }),
69
71
  ),
70
- getRandomImage: (options = { category: ['city'], mimetype: 'image/jpg' }) => {
71
- const src = `https://api.api-ninjas.com/v1/randomimage?category=${options.category[0]}`;
72
- return new Promise((resolve) => {
73
- fetch(src, {
74
- headers: { 'X-Api-Key': 'FyITmcxRXkCaUehbX6K0/g==uxZcFKL0dZUUg48G', Accept: options.mimetype },
75
- })
76
- .then((res) => res.blob())
77
- .then(async (blob) => {
78
- return resolve({
79
- file: {
80
- mimetype: 'image/jpg',
81
- name: 'image.jpg',
82
- },
83
- url: URL.createObjectURL(blob),
84
- });
85
- });
86
- });
87
- },
88
72
  post: (options = { id: '', body: {} }) =>
89
73
  new Promise((resolve, reject) =>
90
74
  fetch(getApiBaseUrl({ id: options.id, endpoint }), {
91
75
  method: 'POST',
92
76
  headers: headersFactory(),
77
+ credentials: 'include',
93
78
  body: payloadFactory(options.body),
94
79
  })
95
80
  .then(async (res) => {
@@ -109,6 +94,7 @@ const CoreService = {
109
94
  fetch(getApiBaseUrl({ id: options.id, endpoint }), {
110
95
  method: 'PUT',
111
96
  headers: headersFactory(),
97
+ credentials: 'include',
112
98
  body: payloadFactory(options.body),
113
99
  })
114
100
  .then(async (res) => {
@@ -128,6 +114,7 @@ const CoreService = {
128
114
  fetch(getApiBaseUrl({ id: options.id, endpoint }), {
129
115
  method: 'GET',
130
116
  headers: headersFactory(),
117
+ credentials: 'include',
131
118
  })
132
119
  .then(async (res) => {
133
120
  return await res.json();
@@ -146,6 +133,7 @@ const CoreService = {
146
133
  fetch(getApiBaseUrl({ id: options.id, endpoint }), {
147
134
  method: 'DELETE',
148
135
  headers: headersFactory(),
136
+ credentials: 'include',
149
137
  body: payloadFactory(options.body),
150
138
  })
151
139
  .then(async (res) => {