@underpostnet/underpost 2.7.82
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/.dockerignore +14 -0
- package/.env.development +6 -0
- package/.env.production +6 -0
- package/.env.test +6 -0
- package/.github/workflows/ghpkg.yml +75 -0
- package/.github/workflows/publish.yml +84 -0
- package/.github/workflows/pwa-microservices-template.test.yml +30 -0
- package/.nycrc +9 -0
- package/.prettierignore +13 -0
- package/.prettierrc +9 -0
- package/.vscode/extensions.json +72 -0
- package/.vscode/settings.json +100 -0
- package/AUTHORS.md +10 -0
- package/CHANGELOG.md +37 -0
- package/Dockerfile +90 -0
- package/LICENSE +21 -0
- package/README.md +96 -0
- package/bin/db.js +172 -0
- package/bin/deploy.js +674 -0
- package/bin/file.js +93 -0
- package/bin/index.js +82 -0
- package/bin/ssl.js +55 -0
- package/bin/util.js +182 -0
- package/bin/vs.js +35 -0
- package/conf.js +251 -0
- package/docker-compose.yml +67 -0
- package/jsconfig.json +7 -0
- package/jsdoc.json +32 -0
- package/nodemon.json +6 -0
- package/package.json +134 -0
- package/prometheus.yml +36 -0
- package/src/api/core/core.controller.js +69 -0
- package/src/api/core/core.model.js +11 -0
- package/src/api/core/core.router.js +23 -0
- package/src/api/core/core.service.js +29 -0
- package/src/api/crypto/crypto.controller.js +51 -0
- package/src/api/crypto/crypto.model.js +23 -0
- package/src/api/crypto/crypto.router.js +20 -0
- package/src/api/crypto/crypto.service.js +64 -0
- package/src/api/default/default.controller.js +69 -0
- package/src/api/default/default.model.js +20 -0
- package/src/api/default/default.router.js +23 -0
- package/src/api/default/default.service.js +31 -0
- package/src/api/file/file.controller.js +53 -0
- package/src/api/file/file.model.js +19 -0
- package/src/api/file/file.router.js +21 -0
- package/src/api/file/file.service.js +80 -0
- package/src/api/instance/instance.controller.js +69 -0
- package/src/api/instance/instance.model.js +36 -0
- package/src/api/instance/instance.router.js +33 -0
- package/src/api/instance/instance.service.js +48 -0
- package/src/api/test/test.controller.js +59 -0
- package/src/api/test/test.model.js +14 -0
- package/src/api/test/test.router.js +21 -0
- package/src/api/test/test.service.js +35 -0
- package/src/api/user/user.build.js +16 -0
- package/src/api/user/user.controller.js +70 -0
- package/src/api/user/user.model.js +65 -0
- package/src/api/user/user.router.js +345 -0
- package/src/api/user/user.service.js +479 -0
- package/src/api.js +23 -0
- package/src/client/Default.index.js +40 -0
- package/src/client/components/core/Account.js +290 -0
- package/src/client/components/core/AgGrid.js +160 -0
- package/src/client/components/core/Auth.js +19 -0
- package/src/client/components/core/Badge.js +32 -0
- package/src/client/components/core/Blockchain.js +41 -0
- package/src/client/components/core/Blog.js +9 -0
- package/src/client/components/core/BtnIcon.js +101 -0
- package/src/client/components/core/CalendarCore.js +458 -0
- package/src/client/components/core/Chat.js +64 -0
- package/src/client/components/core/ColorPalette.js +5267 -0
- package/src/client/components/core/CommonJs.js +742 -0
- package/src/client/components/core/Content.js +193 -0
- package/src/client/components/core/Css.js +846 -0
- package/src/client/components/core/CssCore.js +817 -0
- package/src/client/components/core/D3Chart.js +44 -0
- package/src/client/components/core/Docs.js +231 -0
- package/src/client/components/core/DropDown.js +164 -0
- package/src/client/components/core/EventsUI.js +46 -0
- package/src/client/components/core/FileExplorer.js +699 -0
- package/src/client/components/core/FullScreen.js +45 -0
- package/src/client/components/core/Input.js +346 -0
- package/src/client/components/core/JoyStick.js +77 -0
- package/src/client/components/core/Keyboard.js +73 -0
- package/src/client/components/core/LoadingAnimation.js +178 -0
- package/src/client/components/core/LogIn.js +187 -0
- package/src/client/components/core/LogOut.js +58 -0
- package/src/client/components/core/Logger.js +26 -0
- package/src/client/components/core/Modal.js +1612 -0
- package/src/client/components/core/NotificationManager.js +84 -0
- package/src/client/components/core/Panel.js +613 -0
- package/src/client/components/core/PanelForm.js +468 -0
- package/src/client/components/core/Polyhedron.js +162 -0
- package/src/client/components/core/Recover.js +204 -0
- package/src/client/components/core/Responsive.js +53 -0
- package/src/client/components/core/RichText.js +51 -0
- package/src/client/components/core/Router.js +76 -0
- package/src/client/components/core/Scroll.js +34 -0
- package/src/client/components/core/SignUp.js +125 -0
- package/src/client/components/core/SocketIo.js +72 -0
- package/src/client/components/core/Stream.js +113 -0
- package/src/client/components/core/ToggleSwitch.js +87 -0
- package/src/client/components/core/ToolTip.js +26 -0
- package/src/client/components/core/Translate.js +446 -0
- package/src/client/components/core/Validator.js +100 -0
- package/src/client/components/core/VanillaJs.js +463 -0
- package/src/client/components/core/Wallet.js +106 -0
- package/src/client/components/core/Webhook.js +25 -0
- package/src/client/components/core/Worker.js +282 -0
- package/src/client/components/default/CommonDefault.js +29 -0
- package/src/client/components/default/CssDefault.js +13 -0
- package/src/client/components/default/ElementsDefault.js +38 -0
- package/src/client/components/default/LogInDefault.js +41 -0
- package/src/client/components/default/LogOutDefault.js +28 -0
- package/src/client/components/default/MenuDefault.js +389 -0
- package/src/client/components/default/RoutesDefault.js +48 -0
- package/src/client/components/default/SettingsDefault.js +16 -0
- package/src/client/components/default/SignUpDefault.js +9 -0
- package/src/client/components/default/SocketIoDefault.js +54 -0
- package/src/client/components/default/TranslateDefault.js +7 -0
- package/src/client/public/default/android-chrome-144x144.png +0 -0
- package/src/client/public/default/android-chrome-192x192.png +0 -0
- package/src/client/public/default/android-chrome-256x256.png +0 -0
- package/src/client/public/default/android-chrome-36x36.png +0 -0
- package/src/client/public/default/android-chrome-384x384.png +0 -0
- package/src/client/public/default/android-chrome-48x48.png +0 -0
- package/src/client/public/default/android-chrome-512x512.png +0 -0
- package/src/client/public/default/android-chrome-72x72.png +0 -0
- package/src/client/public/default/android-chrome-96x96.png +0 -0
- package/src/client/public/default/apple-touch-icon-1024x1024.png +0 -0
- package/src/client/public/default/apple-touch-icon-114x114.png +0 -0
- package/src/client/public/default/apple-touch-icon-120x120.png +0 -0
- package/src/client/public/default/apple-touch-icon-144x144.png +0 -0
- package/src/client/public/default/apple-touch-icon-152x152.png +0 -0
- package/src/client/public/default/apple-touch-icon-167x167.png +0 -0
- package/src/client/public/default/apple-touch-icon-180x180.png +0 -0
- package/src/client/public/default/apple-touch-icon-57x57.png +0 -0
- package/src/client/public/default/apple-touch-icon-60x60.png +0 -0
- package/src/client/public/default/apple-touch-icon-72x72.png +0 -0
- package/src/client/public/default/apple-touch-icon-76x76.png +0 -0
- package/src/client/public/default/apple-touch-icon-precomposed.png +0 -0
- package/src/client/public/default/apple-touch-icon.png +0 -0
- package/src/client/public/default/apple-touch-startup-image-1125x2436.png +0 -0
- package/src/client/public/default/apple-touch-startup-image-1136x640.png +0 -0
- package/src/client/public/default/apple-touch-startup-image-1170x2532.png +0 -0
- package/src/client/public/default/apple-touch-startup-image-1179x2556.png +0 -0
- package/src/client/public/default/apple-touch-startup-image-1242x2208.png +0 -0
- package/src/client/public/default/apple-touch-startup-image-1242x2688.png +0 -0
- package/src/client/public/default/apple-touch-startup-image-1284x2778.png +0 -0
- package/src/client/public/default/apple-touch-startup-image-1290x2796.png +0 -0
- package/src/client/public/default/apple-touch-startup-image-1334x750.png +0 -0
- package/src/client/public/default/apple-touch-startup-image-1488x2266.png +0 -0
- package/src/client/public/default/apple-touch-startup-image-1536x2048.png +0 -0
- package/src/client/public/default/apple-touch-startup-image-1620x2160.png +0 -0
- package/src/client/public/default/apple-touch-startup-image-1640x2160.png +0 -0
- package/src/client/public/default/apple-touch-startup-image-1668x2224.png +0 -0
- package/src/client/public/default/apple-touch-startup-image-1668x2388.png +0 -0
- package/src/client/public/default/apple-touch-startup-image-1792x828.png +0 -0
- package/src/client/public/default/apple-touch-startup-image-2048x1536.png +0 -0
- package/src/client/public/default/apple-touch-startup-image-2048x2732.png +0 -0
- package/src/client/public/default/apple-touch-startup-image-2160x1620.png +0 -0
- package/src/client/public/default/apple-touch-startup-image-2160x1640.png +0 -0
- package/src/client/public/default/apple-touch-startup-image-2208x1242.png +0 -0
- package/src/client/public/default/apple-touch-startup-image-2224x1668.png +0 -0
- package/src/client/public/default/apple-touch-startup-image-2266x1488.png +0 -0
- package/src/client/public/default/apple-touch-startup-image-2388x1668.png +0 -0
- package/src/client/public/default/apple-touch-startup-image-2436x1125.png +0 -0
- package/src/client/public/default/apple-touch-startup-image-2532x1170.png +0 -0
- package/src/client/public/default/apple-touch-startup-image-2556x1179.png +0 -0
- package/src/client/public/default/apple-touch-startup-image-2688x1242.png +0 -0
- package/src/client/public/default/apple-touch-startup-image-2732x2048.png +0 -0
- package/src/client/public/default/apple-touch-startup-image-2778x1284.png +0 -0
- package/src/client/public/default/apple-touch-startup-image-2796x1290.png +0 -0
- package/src/client/public/default/apple-touch-startup-image-640x1136.png +0 -0
- package/src/client/public/default/apple-touch-startup-image-750x1334.png +0 -0
- package/src/client/public/default/apple-touch-startup-image-828x1792.png +0 -0
- package/src/client/public/default/assets/background/white.jpg +0 -0
- package/src/client/public/default/assets/background/white0-min.jpg +0 -0
- package/src/client/public/default/assets/background/white0.jpg +0 -0
- package/src/client/public/default/assets/logo/base-icon.png +0 -0
- package/src/client/public/default/assets/mailer/api-user-check.png +0 -0
- package/src/client/public/default/assets/mailer/api-user-invalid-token.png +0 -0
- package/src/client/public/default/assets/mailer/api-user-recover.png +0 -0
- package/src/client/public/default/browserconfig.xml +12 -0
- package/src/client/public/default/favicon-16x16.png +0 -0
- package/src/client/public/default/favicon-32x32.png +0 -0
- package/src/client/public/default/favicon-48x48.png +0 -0
- package/src/client/public/default/favicon.ico +0 -0
- package/src/client/public/default/manifest.webmanifest +69 -0
- package/src/client/public/default/mstile-144x144.png +0 -0
- package/src/client/public/default/mstile-150x150.png +0 -0
- package/src/client/public/default/mstile-310x150.png +0 -0
- package/src/client/public/default/mstile-310x310.png +0 -0
- package/src/client/public/default/mstile-70x70.png +0 -0
- package/src/client/public/default/plantuml/client-conf.svg +1 -0
- package/src/client/public/default/plantuml/client-schema.svg +1 -0
- package/src/client/public/default/plantuml/cron-conf.svg +1 -0
- package/src/client/public/default/plantuml/cron-schema.svg +1 -0
- package/src/client/public/default/plantuml/server-conf.svg +1 -0
- package/src/client/public/default/plantuml/server-schema.svg +1 -0
- package/src/client/public/default/plantuml/ssr-conf.svg +1 -0
- package/src/client/public/default/plantuml/ssr-schema.svg +1 -0
- package/src/client/public/default/sitemap +148 -0
- package/src/client/public/default/yandex-browser-50x50.png +0 -0
- package/src/client/public/default/yandex-browser-manifest.json +9 -0
- package/src/client/public/doc/favicon.ico +0 -0
- package/src/client/public/doc/sitemap +148 -0
- package/src/client/public/test/favicon.ico +0 -0
- package/src/client/public/test/sitemap +148 -0
- package/src/client/services/core/core.service.js +170 -0
- package/src/client/services/crypto/crypto.service.js +70 -0
- package/src/client/services/default/default.management.js +343 -0
- package/src/client/services/default/default.service.js +89 -0
- package/src/client/services/file/file.service.js +70 -0
- package/src/client/services/instance/instance.management.js +74 -0
- package/src/client/services/instance/instance.service.js +89 -0
- package/src/client/services/test/test.service.js +70 -0
- package/src/client/services/user/user.management.js +50 -0
- package/src/client/services/user/user.service.js +89 -0
- package/src/client/ssr/Render.js +237 -0
- package/src/client/ssr/common/Alert.js +75 -0
- package/src/client/ssr/common/SsrCore.js +91 -0
- package/src/client/ssr/common/Translate.js +26 -0
- package/src/client/ssr/common/Worker.js +28 -0
- package/src/client/ssr/components/body/CacheControl.js +114 -0
- package/src/client/ssr/components/body/DefaultSplashScreen.js +90 -0
- package/src/client/ssr/components/email/DefaultRecoverEmail.js +21 -0
- package/src/client/ssr/components/email/DefaultVerifyEmail.js +17 -0
- package/src/client/ssr/components/head/Css.js +241 -0
- package/src/client/ssr/components/head/DefaultScripts.js +3 -0
- package/src/client/ssr/components/head/PwaDefault.js +60 -0
- package/src/client/ssr/offline/default.index.js +31 -0
- package/src/client/ssr/pages/404.js +12 -0
- package/src/client/ssr/pages/500.js +12 -0
- package/src/client/sw/default.sw.js +203 -0
- package/src/client/sw/template.sw.js +84 -0
- package/src/client.build.js +22 -0
- package/src/client.dev.js +21 -0
- package/src/cron.js +30 -0
- package/src/db/DataBaseProvider.js +34 -0
- package/src/db/mariadb/MariaDB.js +33 -0
- package/src/db/mongo/MongooseDB.js +125 -0
- package/src/dns.js +22 -0
- package/src/index.js +43 -0
- package/src/mailer/EmailRender.js +69 -0
- package/src/mailer/MailerProvider.js +96 -0
- package/src/proxy.js +22 -0
- package/src/runtime/lampp/Lampp.js +115 -0
- package/src/runtime/nginx/Nginx.js +3 -0
- package/src/runtime/xampp/Xampp.js +49 -0
- package/src/server/auth.js +235 -0
- package/src/server/backup.js +108 -0
- package/src/server/client-build-live.js +98 -0
- package/src/server/client-build.js +821 -0
- package/src/server/client-dev-server.js +60 -0
- package/src/server/client-formatted.js +58 -0
- package/src/server/client-icons.js +151 -0
- package/src/server/conf.js +883 -0
- package/src/server/cron.js +35 -0
- package/src/server/dns.js +89 -0
- package/src/server/downloader.js +42 -0
- package/src/server/logger.js +190 -0
- package/src/server/network.js +122 -0
- package/src/server/peer.js +33 -0
- package/src/server/process.js +66 -0
- package/src/server/prompt-optimizer.js +28 -0
- package/src/server/proxy.js +118 -0
- package/src/server/runtime.js +461 -0
- package/src/server/ssl.js +120 -0
- package/src/server.js +25 -0
- package/src/ws/IoInterface.js +45 -0
- package/src/ws/IoServer.js +39 -0
- package/src/ws/core/channels/core.ws.chat.js +23 -0
- package/src/ws/core/channels/core.ws.mailer.js +35 -0
- package/src/ws/core/channels/core.ws.stream.js +31 -0
- package/src/ws/core/core.ws.connection.js +28 -0
- package/src/ws/core/core.ws.emit.js +14 -0
- package/src/ws/core/core.ws.server.js +24 -0
- package/src/ws/core/management/core.ws.chat.js +8 -0
- package/src/ws/core/management/core.ws.mailer.js +16 -0
- package/src/ws/core/management/core.ws.stream.js +8 -0
- package/src/ws/default/channels/default.ws.main.js +16 -0
- package/src/ws/default/default.ws.connection.js +22 -0
- package/src/ws/default/default.ws.emit.js +14 -0
- package/src/ws/default/default.ws.server.js +20 -0
- package/src/ws/default/management/default.ws.main.js +8 -0
- package/startup.js +11 -0
- package/supervisord-openssh-server.conf +5 -0
- package/test/api.test.js +60 -0
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
import { loggerFactory } from '../components/core/Logger.js';
|
|
2
|
+
|
|
3
|
+
// https://googlechrome.github.io/samples/service-worker/custom-offline-page/
|
|
4
|
+
|
|
5
|
+
/*
|
|
6
|
+
Copyright 2015, 2019 Google Inc. All Rights Reserved.
|
|
7
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
8
|
+
you may not use this file except in compliance with the License.
|
|
9
|
+
You may obtain a copy of the License at
|
|
10
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
+
Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
See the License for the specific language governing permissions and
|
|
15
|
+
limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
// https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API
|
|
19
|
+
// https://web.dev/cache-api-quick-guide/
|
|
20
|
+
// https://developer.mozilla.org/en-US/docs/Web/API
|
|
21
|
+
// https://developer.mozilla.org/es/docs/Web/Progressive_web_apps/Re-engageable_Notifications_Push
|
|
22
|
+
// https://developer.mozilla.org/en-US/docs/Web/API/Notification/Notification
|
|
23
|
+
// https://github.com/GoogleChrome/samples/blob/9e4b3b77b091268d28e5438bb2fe8829091e9540/service-worker/basic/service-worker.js#L59
|
|
24
|
+
// https://developer.mozilla.org/en-US/docs/Web/API/Geolocation_API
|
|
25
|
+
|
|
26
|
+
/*
|
|
27
|
+
|
|
28
|
+
4 different ways to store data on client-side without using cookies:
|
|
29
|
+
|
|
30
|
+
- Local Storage (Session and Local key/value pairs)
|
|
31
|
+
- Web SQL (my favorite, it's a whole SQL Database, and it's NOT obsolete)
|
|
32
|
+
- IndexedDB (another Database with different structure and acceptance)
|
|
33
|
+
- Service Workers (Persistent background processing,
|
|
34
|
+
even while offline, can asynchronously save files and many other things)
|
|
35
|
+
|
|
36
|
+
*/
|
|
37
|
+
|
|
38
|
+
const logger = loggerFactory(import.meta);
|
|
39
|
+
|
|
40
|
+
self.addEventListener('install', (event) => {
|
|
41
|
+
// Activate right away
|
|
42
|
+
self.skipWaiting();
|
|
43
|
+
|
|
44
|
+
event.waitUntil(
|
|
45
|
+
(async () => {
|
|
46
|
+
// const cache = await caches.open(CACHE_NAME);
|
|
47
|
+
// Setting {cache: 'reload'} in the new request will ensure that the response
|
|
48
|
+
// isn't fulfilled from the HTTP cache; i.e., it will be from the network.
|
|
49
|
+
// await cache.add(new Request(OFFLINE_URL, { cache: 'reload' }));
|
|
50
|
+
// Open the app's cache.
|
|
51
|
+
// const cache = await caches.open(CACHE_NAME);
|
|
52
|
+
// Cache all static resources.
|
|
53
|
+
// await cache.addAll(PRE_CACHED_RESOURCES);
|
|
54
|
+
})(),
|
|
55
|
+
);
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
self.addEventListener('activate', (event) => {
|
|
59
|
+
event.waitUntil(
|
|
60
|
+
(async () => {
|
|
61
|
+
// Enable navigation preload if it's supported.
|
|
62
|
+
// See https://developers.google.com/web/updates/2017/02/navigation-preload
|
|
63
|
+
if ('navigationPreload' in self.registration) {
|
|
64
|
+
await self.registration.navigationPreload.enable();
|
|
65
|
+
}
|
|
66
|
+
})(),
|
|
67
|
+
);
|
|
68
|
+
|
|
69
|
+
// Tell the active service worker to take control of the page immediately.
|
|
70
|
+
self.clients.claim();
|
|
71
|
+
|
|
72
|
+
// event message
|
|
73
|
+
self.addEventListener('message', (event) => {
|
|
74
|
+
logger.info('Received event message', event.data);
|
|
75
|
+
|
|
76
|
+
switch (event.data.status) {
|
|
77
|
+
case 'skipWaiting':
|
|
78
|
+
return self.skipWaiting();
|
|
79
|
+
break;
|
|
80
|
+
|
|
81
|
+
default:
|
|
82
|
+
break;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
clients.matchAll().then((clientList) => {
|
|
86
|
+
for (const client of clientList) {
|
|
87
|
+
logger.info('client', client);
|
|
88
|
+
client.postMessage({
|
|
89
|
+
title: 'Hello from SW event message',
|
|
90
|
+
});
|
|
91
|
+
// client -> document.visibilityState
|
|
92
|
+
// client.visibilityState
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
});
|
|
96
|
+
// broadcast message
|
|
97
|
+
const channel = new BroadcastChannel('sw-messages');
|
|
98
|
+
channel.addEventListener('message', (event) => {
|
|
99
|
+
logger.info('Received broadcast message', event.data);
|
|
100
|
+
channel.postMessage({ title: 'Hello from SW broadcast message' });
|
|
101
|
+
});
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
self.addEventListener('fetch', (event) => {
|
|
105
|
+
let path;
|
|
106
|
+
|
|
107
|
+
if (event.request.url.match(location.origin)) path = event.request.url.slice(location.origin.length);
|
|
108
|
+
const preload = path && !path.match('/api');
|
|
109
|
+
|
|
110
|
+
logger.info(`On fetch`, {
|
|
111
|
+
mode: event.request.mode,
|
|
112
|
+
url: event.request.url,
|
|
113
|
+
referrer: event.request.referrer,
|
|
114
|
+
method: event.request.method,
|
|
115
|
+
path,
|
|
116
|
+
preload,
|
|
117
|
+
});
|
|
118
|
+
|
|
119
|
+
(async () => {
|
|
120
|
+
// Get the client.
|
|
121
|
+
const client = await clients.get(event.clientId);
|
|
122
|
+
if (client)
|
|
123
|
+
client.postMessage({
|
|
124
|
+
status: 'loader',
|
|
125
|
+
path,
|
|
126
|
+
});
|
|
127
|
+
else logger.warn('client not found');
|
|
128
|
+
})();
|
|
129
|
+
|
|
130
|
+
// We only want to call event.respondWith() if this is a navigation request
|
|
131
|
+
// for an HTML page.
|
|
132
|
+
if (path !== undefined || event.request.mode === 'navigate') {
|
|
133
|
+
event.respondWith(
|
|
134
|
+
(async () => {
|
|
135
|
+
try {
|
|
136
|
+
// First, try to use the navigation preload response if it's supported.
|
|
137
|
+
const preloadResponse = await event.preloadResponse;
|
|
138
|
+
if (preloadResponse) {
|
|
139
|
+
return preloadResponse;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
if (preload) {
|
|
143
|
+
const preloadCache = await caches.has(path);
|
|
144
|
+
const cache = await caches.open(path);
|
|
145
|
+
const cacheResponse = await cache.match(path);
|
|
146
|
+
if (!preloadCache || !cacheResponse || cacheResponse.status !== 200) {
|
|
147
|
+
logger.warn('install', path);
|
|
148
|
+
// await cache.add(new Request(event.request.url, { cache: 'reload' }));
|
|
149
|
+
|
|
150
|
+
// Other option:
|
|
151
|
+
// The resource wasn't found in the cache, so fetch it from the network.
|
|
152
|
+
const fetchResponse = await fetch(event.request.url);
|
|
153
|
+
|
|
154
|
+
if (fetchResponse.status === 200) {
|
|
155
|
+
// Put the response in cache.
|
|
156
|
+
await cache.put(event.request.url, fetchResponse.clone());
|
|
157
|
+
// And return the response.
|
|
158
|
+
return fetchResponse;
|
|
159
|
+
} else {
|
|
160
|
+
await caches.delete(path);
|
|
161
|
+
throw new Error(await fetchResponse.text());
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
// logger.info('cache response', path);
|
|
165
|
+
return cacheResponse;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
const networkResponse = await fetch(event.request);
|
|
169
|
+
logger.warn('fetch response', event.request.url);
|
|
170
|
+
return networkResponse;
|
|
171
|
+
} catch (error) {
|
|
172
|
+
// catch is only triggered if an exception is thrown, which is likely
|
|
173
|
+
// due to a network error.
|
|
174
|
+
// If fetch() returns a valid HTTP response with a response code in
|
|
175
|
+
// the 4xx or 5xx range, the catch() will NOT be called.
|
|
176
|
+
if (path) {
|
|
177
|
+
const preloadCache = await caches.has(path);
|
|
178
|
+
if (preloadCache) await caches.delete(path);
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
logger.error('Fetch failed; returning offline page instead.', { error, path });
|
|
182
|
+
try {
|
|
183
|
+
const cache = await caches.open('/offline.html');
|
|
184
|
+
const cachedResponse = await cache.match('/offline.html');
|
|
185
|
+
return cachedResponse;
|
|
186
|
+
} catch (error) {
|
|
187
|
+
logger.error('Error opening cache for offline page', { error, path });
|
|
188
|
+
const response = new Response(JSON.stringify({ status: 'error', message: 'offline test response' }));
|
|
189
|
+
// response.status = 200;
|
|
190
|
+
response.headers.set('Content-Type', 'application/json');
|
|
191
|
+
return response;
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
})(),
|
|
195
|
+
);
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
// If our if() condition is false, then this fetch handler won't intercept the
|
|
199
|
+
// request. If there are any other fetch handlers registered, they will get a
|
|
200
|
+
// chance to call event.respondWith(). If no fetch handlers call
|
|
201
|
+
// event.respondWith(), the request will be handled by the browser as if there
|
|
202
|
+
// were no service worker involvement.
|
|
203
|
+
});
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
// https://googlechrome.github.io/samples/service-worker/custom-offline-page/
|
|
2
|
+
|
|
3
|
+
/*
|
|
4
|
+
Copyright 2015, 2019 Google Inc. All Rights Reserved.
|
|
5
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
you may not use this file except in compliance with the License.
|
|
7
|
+
You may obtain a copy of the License at
|
|
8
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
See the License for the specific language governing permissions and
|
|
13
|
+
limitations under the License.
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
// Incrementing OFFLINE_VERSION will kick off the install event and force
|
|
17
|
+
// previously cached resources to be updated from the network.
|
|
18
|
+
const OFFLINE_VERSION = 1;
|
|
19
|
+
const CACHE_NAME = 'offline';
|
|
20
|
+
// Customize this with a different URL if needed.
|
|
21
|
+
const OFFLINE_URL = 'offline.html';
|
|
22
|
+
|
|
23
|
+
self.addEventListener('install', (event) => {
|
|
24
|
+
event.waitUntil(
|
|
25
|
+
(async () => {
|
|
26
|
+
const cache = await caches.open(CACHE_NAME);
|
|
27
|
+
// Setting {cache: 'reload'} in the new request will ensure that the response
|
|
28
|
+
// isn't fulfilled from the HTTP cache; i.e., it will be from the network.
|
|
29
|
+
await cache.add(new Request(OFFLINE_URL, { cache: 'reload' }));
|
|
30
|
+
})(),
|
|
31
|
+
);
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
self.addEventListener('activate', (event) => {
|
|
35
|
+
event.waitUntil(
|
|
36
|
+
(async () => {
|
|
37
|
+
// Enable navigation preload if it's supported.
|
|
38
|
+
// See https://developers.google.com/web/updates/2017/02/navigation-preload
|
|
39
|
+
if ('navigationPreload' in self.registration) {
|
|
40
|
+
await self.registration.navigationPreload.enable();
|
|
41
|
+
}
|
|
42
|
+
})(),
|
|
43
|
+
);
|
|
44
|
+
|
|
45
|
+
// Tell the active service worker to take control of the page immediately.
|
|
46
|
+
self.clients.claim();
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
self.addEventListener('fetch', (event) => {
|
|
50
|
+
// We only want to call event.respondWith() if this is a navigation request
|
|
51
|
+
// for an HTML page.
|
|
52
|
+
if (event.request.mode === 'navigate') {
|
|
53
|
+
event.respondWith(
|
|
54
|
+
(async () => {
|
|
55
|
+
try {
|
|
56
|
+
// First, try to use the navigation preload response if it's supported.
|
|
57
|
+
const preloadResponse = await event.preloadResponse;
|
|
58
|
+
if (preloadResponse) {
|
|
59
|
+
return preloadResponse;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
const networkResponse = await fetch(event.request);
|
|
63
|
+
return networkResponse;
|
|
64
|
+
} catch (error) {
|
|
65
|
+
// catch is only triggered if an exception is thrown, which is likely
|
|
66
|
+
// due to a network error.
|
|
67
|
+
// If fetch() returns a valid HTTP response with a response code in
|
|
68
|
+
// the 4xx or 5xx range, the catch() will NOT be called.
|
|
69
|
+
console.log('Fetch failed; returning offline page instead.', error);
|
|
70
|
+
|
|
71
|
+
const cache = await caches.open(CACHE_NAME);
|
|
72
|
+
const cachedResponse = await cache.match(OFFLINE_URL);
|
|
73
|
+
return cachedResponse;
|
|
74
|
+
}
|
|
75
|
+
})(),
|
|
76
|
+
);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
// If our if() condition is false, then this fetch handler won't intercept the
|
|
80
|
+
// request. If there are any other fetch handlers registered, they will get a
|
|
81
|
+
// chance to call event.respondWith(). If no fetch handlers call
|
|
82
|
+
// event.respondWith(), the request will be handled by the browser as if there
|
|
83
|
+
// were no service worker involvement.
|
|
84
|
+
});
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
// https://nodejs.org/api
|
|
4
|
+
// https://expressjs.com/en/4x/api.html
|
|
5
|
+
|
|
6
|
+
import dotenv from 'dotenv';
|
|
7
|
+
import { loggerFactory } from './server/logger.js';
|
|
8
|
+
import { Config } from './server/conf.js';
|
|
9
|
+
import { ProcessController } from './server/process.js';
|
|
10
|
+
import { clientLiveBuild } from './server/client-build-live.js';
|
|
11
|
+
|
|
12
|
+
dotenv.config();
|
|
13
|
+
|
|
14
|
+
await Config.build();
|
|
15
|
+
|
|
16
|
+
const logger = loggerFactory(import.meta);
|
|
17
|
+
|
|
18
|
+
await logger.setUpInfo();
|
|
19
|
+
|
|
20
|
+
await clientLiveBuild();
|
|
21
|
+
|
|
22
|
+
// ProcessController.init(logger);
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
// https://nodejs.org/api
|
|
4
|
+
// https://expressjs.com/en/4x/api.html
|
|
5
|
+
|
|
6
|
+
import dotenv from 'dotenv';
|
|
7
|
+
import { loggerFactory } from './server/logger.js';
|
|
8
|
+
import { ProcessController } from './server/process.js';
|
|
9
|
+
import { Config } from './server/conf.js';
|
|
10
|
+
import { createClientDevServer } from './server/client-dev-server.js';
|
|
11
|
+
dotenv.config();
|
|
12
|
+
|
|
13
|
+
await Config.build();
|
|
14
|
+
|
|
15
|
+
const logger = loggerFactory(import.meta);
|
|
16
|
+
|
|
17
|
+
await logger.setUpInfo();
|
|
18
|
+
|
|
19
|
+
await createClientDevServer();
|
|
20
|
+
|
|
21
|
+
ProcessController.init(logger);
|
package/src/cron.js
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
// https://nodejs.org/api
|
|
4
|
+
// https://expressjs.com/en/4x/api.html
|
|
5
|
+
|
|
6
|
+
import dotenv from 'dotenv';
|
|
7
|
+
import { loggerFactory } from './server/logger.js';
|
|
8
|
+
import { Dns } from './server/dns.js';
|
|
9
|
+
import { ProcessController } from './server/process.js';
|
|
10
|
+
import { Config } from './server/conf.js';
|
|
11
|
+
import { BackUpManagement } from './server/backup.js';
|
|
12
|
+
import { CronManagement } from './server/cron.js';
|
|
13
|
+
|
|
14
|
+
dotenv.config();
|
|
15
|
+
|
|
16
|
+
await Config.build();
|
|
17
|
+
|
|
18
|
+
const logger = loggerFactory(import.meta);
|
|
19
|
+
|
|
20
|
+
await logger.setUpInfo();
|
|
21
|
+
|
|
22
|
+
// every minutes
|
|
23
|
+
CronManagement.add('ip', '* * * * *', await Dns.InitIpDaemon());
|
|
24
|
+
|
|
25
|
+
// every day at 1 am
|
|
26
|
+
CronManagement.add('backup', '0 1 * * *', await BackUpManagement.Init());
|
|
27
|
+
|
|
28
|
+
await CronManagement.init();
|
|
29
|
+
|
|
30
|
+
ProcessController.init(logger);
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { MongooseDB } from './mongo/MongooseDB.js';
|
|
2
|
+
import { loggerFactory } from '../server/logger.js';
|
|
3
|
+
|
|
4
|
+
const logger = loggerFactory(import.meta);
|
|
5
|
+
|
|
6
|
+
const DataBaseProvider = {
|
|
7
|
+
instance: {},
|
|
8
|
+
load: async function (options = { apis: [], host: '', path: '', db: {} }) {
|
|
9
|
+
try {
|
|
10
|
+
const { apis, host, path, db } = options;
|
|
11
|
+
|
|
12
|
+
if (!this.instance[`${host}${path}`]) this.instance[`${host}${path}`] = {};
|
|
13
|
+
|
|
14
|
+
if (!db || this.instance[`${host}${path}`][db.provider]) return;
|
|
15
|
+
|
|
16
|
+
// logger.info(`Load ${db.provider} provider`, `${host}${path}`);
|
|
17
|
+
switch (db.provider) {
|
|
18
|
+
case 'mongoose':
|
|
19
|
+
{
|
|
20
|
+
const conn = await MongooseDB.connect(db.host, db.name);
|
|
21
|
+
this.instance[`${host}${path}`][db.provider] = await MongooseDB.loadModels({ conn, apis });
|
|
22
|
+
}
|
|
23
|
+
break;
|
|
24
|
+
default:
|
|
25
|
+
break;
|
|
26
|
+
}
|
|
27
|
+
return this.instance[`${host}${path}`][db.provider];
|
|
28
|
+
} catch (error) {
|
|
29
|
+
logger.error(error, { error: error.stack, options });
|
|
30
|
+
return undefined;
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
};
|
|
34
|
+
export { DataBaseProvider };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import mariadb from 'mariadb';
|
|
2
|
+
|
|
3
|
+
import { loggerFactory } from '../../server/logger.js';
|
|
4
|
+
|
|
5
|
+
const logger = loggerFactory(import.meta);
|
|
6
|
+
|
|
7
|
+
const MariaDB = {
|
|
8
|
+
query: async (options) => {
|
|
9
|
+
const { host, port, user, password, query } = options;
|
|
10
|
+
const pool = mariadb.createPool({
|
|
11
|
+
host: 'host' in options ? host : '127.0.0.1',
|
|
12
|
+
port: 'port' in options ? port : 3306,
|
|
13
|
+
user: 'user' in options ? user : 'root',
|
|
14
|
+
password: 'password' in options ? password : '',
|
|
15
|
+
});
|
|
16
|
+
let conn, result;
|
|
17
|
+
try {
|
|
18
|
+
conn = await pool.getConnection();
|
|
19
|
+
result = await conn.query(query, { supportBigNumbers: true, bigNumberStrings: true });
|
|
20
|
+
logger.info(query, result);
|
|
21
|
+
} catch (error) {
|
|
22
|
+
if (error.stack.startsWith('TypeError: Do not know how to serialize a BigInt')) return;
|
|
23
|
+
logger.error(error, error.stack);
|
|
24
|
+
} finally {
|
|
25
|
+
if (conn) conn.release(); //release to pool
|
|
26
|
+
await pool.end();
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
return result;
|
|
30
|
+
},
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export { MariaDB };
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import mongoose from 'mongoose';
|
|
2
|
+
import cron from 'node-cron';
|
|
3
|
+
import { loggerFactory } from '../../server/logger.js';
|
|
4
|
+
import { getCapVariableName } from '../../client/components/core/CommonJs.js';
|
|
5
|
+
import { shellCd, shellExec } from '../../server/process.js';
|
|
6
|
+
|
|
7
|
+
const logger = loggerFactory(import.meta);
|
|
8
|
+
|
|
9
|
+
const MongooseDB = {
|
|
10
|
+
connect: async (host, name) => {
|
|
11
|
+
const uri = `${host}/${name}`;
|
|
12
|
+
// logger.info('MongooseDB connect', { host, name, uri });
|
|
13
|
+
return await mongoose.createConnection(uri).asPromise();
|
|
14
|
+
return new Promise((resolve, reject) =>
|
|
15
|
+
mongoose
|
|
16
|
+
.connect(
|
|
17
|
+
uri,
|
|
18
|
+
// ,{
|
|
19
|
+
// useNewUrlParser: true,
|
|
20
|
+
// useUnifiedTopology: true,
|
|
21
|
+
// }
|
|
22
|
+
)
|
|
23
|
+
.then((db) => {
|
|
24
|
+
logger.info(`db connected`, uri);
|
|
25
|
+
return resolve(db);
|
|
26
|
+
})
|
|
27
|
+
.catch((err) => {
|
|
28
|
+
logger.error(err, { host, name, error: err.stack });
|
|
29
|
+
// return reject(err);
|
|
30
|
+
return resolve(undefined);
|
|
31
|
+
}),
|
|
32
|
+
);
|
|
33
|
+
},
|
|
34
|
+
loadModels: async function (options = { apis: ['test'], conn: new mongoose.Connection() }) {
|
|
35
|
+
const { conn, apis } = options;
|
|
36
|
+
const models = {};
|
|
37
|
+
for (const api of apis) {
|
|
38
|
+
const { ProviderSchema } = await import(`../../api/${api}/${api}.model.js`);
|
|
39
|
+
const keyModel = getCapVariableName(api);
|
|
40
|
+
models[keyModel] = conn.model(keyModel, ProviderSchema);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
return models;
|
|
44
|
+
},
|
|
45
|
+
server: async function () {
|
|
46
|
+
logger.info('platform', process.platform);
|
|
47
|
+
switch (process.platform) {
|
|
48
|
+
case 'win32':
|
|
49
|
+
{
|
|
50
|
+
// https://www.mongodb.com/docs/v7.0/tutorial/install-mongodb-on-windows-unattended/
|
|
51
|
+
|
|
52
|
+
// C:\Program Files\MongoDB\Tools\100\bin
|
|
53
|
+
|
|
54
|
+
const urlDownload = `https://fastdl.mongodb.org/windows/mongodb-windows-x86_64-7.0.14-signed.msi`;
|
|
55
|
+
const folderPath = `./engine-private/setup`;
|
|
56
|
+
if (!fs.existsSync(folderPath)) fs.mkdirSync(folderPath, { recursive: true });
|
|
57
|
+
const fullPath = `${folderPath}/${urlDownload.split('/').pop()}`;
|
|
58
|
+
logger.info('destination', fullPath);
|
|
59
|
+
shellCd(folderPath);
|
|
60
|
+
}
|
|
61
|
+
break;
|
|
62
|
+
case 'linux':
|
|
63
|
+
{
|
|
64
|
+
if (!process.argv.includes('server')) {
|
|
65
|
+
logger.info('remove');
|
|
66
|
+
shellExec(`sudo apt-get purge mongodb-org*`);
|
|
67
|
+
shellExec(`sudo rm -r /var/log/mongodb`);
|
|
68
|
+
shellExec(`sudo rm -r /var/lib/mongodb`);
|
|
69
|
+
// restore lib
|
|
70
|
+
// shellExec(`sudo chown -R mongodb:mongodb /var/lib/mongodb/*`);
|
|
71
|
+
|
|
72
|
+
if (process.argv.includes('legacy')) {
|
|
73
|
+
logger.info('install legacy 4.4');
|
|
74
|
+
shellExec(`wget -qO - https://www.mongodb.org/static/pgp/server-4.4.asc | sudo apt-key add -`);
|
|
75
|
+
|
|
76
|
+
shellExec(
|
|
77
|
+
`echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/4.4 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.4.list`,
|
|
78
|
+
);
|
|
79
|
+
|
|
80
|
+
shellExec(`sudo apt-get update`);
|
|
81
|
+
|
|
82
|
+
shellExec(
|
|
83
|
+
`sudo apt-get install mongodb-org=4.4.8 mongodb-org-server=4.4.8 mongodb-org-shell=4.4.8 mongodb-org-mongos=4.4.8 mongodb-org-tools=4.4.8`,
|
|
84
|
+
);
|
|
85
|
+
} else {
|
|
86
|
+
logger.info('install 7.0');
|
|
87
|
+
shellExec(`curl -fsSL https://www.mongodb.org/static/pgp/server-7.0.asc | \
|
|
88
|
+
sudo gpg -o /usr/share/keyrings/mongodb-server-7.0.gpg \
|
|
89
|
+
--dearmor`);
|
|
90
|
+
shellExec(
|
|
91
|
+
`echo "deb [ arch=amd64,arm64 signed-by=/usr/share/keyrings/mongodb-server-7.0.gpg ] https://repo.mongodb.org/apt/ubuntu jammy/mongodb-org/7.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-7.0.list`,
|
|
92
|
+
);
|
|
93
|
+
|
|
94
|
+
shellExec(`sudo apt-get update`);
|
|
95
|
+
|
|
96
|
+
shellExec(`sudo apt-get install -y mongodb-org`);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
logger.info('clean server environment');
|
|
100
|
+
shellExec(`sudo service mongod stop`);
|
|
101
|
+
shellExec(`sudo systemctl unmask mongod`);
|
|
102
|
+
shellExec(`sudo pkill -f mongod`);
|
|
103
|
+
shellExec(`sudo systemctl enable mongod.service`);
|
|
104
|
+
shellExec(`sudo chown -R mongodb:mongodb /var/lib/mongodb`);
|
|
105
|
+
shellExec(`sudo chown mongodb:mongodb /tmp/mongodb-27017.sock`);
|
|
106
|
+
|
|
107
|
+
logger.info('run server');
|
|
108
|
+
shellExec(`sudo service mongod restart`);
|
|
109
|
+
|
|
110
|
+
const checkStatus = () => {
|
|
111
|
+
logger.info('check status');
|
|
112
|
+
shellExec(`sudo systemctl status mongod`);
|
|
113
|
+
shellExec(`sudo systemctl --type=service | grep mongod`);
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
checkStatus();
|
|
117
|
+
}
|
|
118
|
+
break;
|
|
119
|
+
default:
|
|
120
|
+
break;
|
|
121
|
+
}
|
|
122
|
+
},
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
export { MongooseDB };
|
package/src/dns.js
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
// https://nodejs.org/api
|
|
4
|
+
// https://expressjs.com/en/4x/api.html
|
|
5
|
+
|
|
6
|
+
import dotenv from 'dotenv';
|
|
7
|
+
import { loggerFactory } from './server/logger.js';
|
|
8
|
+
import { Dns } from './server/dns.js';
|
|
9
|
+
import { ProcessController } from './server/process.js';
|
|
10
|
+
import { Config } from './server/conf.js';
|
|
11
|
+
|
|
12
|
+
dotenv.config();
|
|
13
|
+
|
|
14
|
+
await Config.build();
|
|
15
|
+
|
|
16
|
+
const logger = loggerFactory(import.meta);
|
|
17
|
+
|
|
18
|
+
await logger.setUpInfo();
|
|
19
|
+
|
|
20
|
+
await Dns.InitIpDaemon();
|
|
21
|
+
|
|
22
|
+
ProcessController.init(logger);
|
package/src/index.js
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Underpost index npm package
|
|
3
|
+
* @module src/index.js
|
|
4
|
+
* @namespace Underpost
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import { loggerFactory, setUpInfo } from './server/logger.js';
|
|
8
|
+
|
|
9
|
+
const logger = loggerFactory(import.meta);
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Underpost main module methods
|
|
13
|
+
* @class
|
|
14
|
+
* @memberof Underpost
|
|
15
|
+
*/
|
|
16
|
+
class Underpost {
|
|
17
|
+
constructor() {}
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Logs information about the current process environment to the console.
|
|
21
|
+
*
|
|
22
|
+
* This function is used to log details about
|
|
23
|
+
* the execution context, such as command-line arguments,
|
|
24
|
+
* environment variables, the process's administrative privileges,
|
|
25
|
+
* and the maximum available heap space size.
|
|
26
|
+
*
|
|
27
|
+
* @static
|
|
28
|
+
* @method setUpInfo
|
|
29
|
+
* @returns {Promise<void>}
|
|
30
|
+
* @memberof Underpost
|
|
31
|
+
*/
|
|
32
|
+
static async setUpInfo() {
|
|
33
|
+
return await setUpInfo(logger);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
const up = Underpost;
|
|
38
|
+
|
|
39
|
+
const underpost = Underpost;
|
|
40
|
+
|
|
41
|
+
export { underpost, up, Underpost };
|
|
42
|
+
|
|
43
|
+
export default Underpost;
|