underpost 2.6.2 → 2.7.1
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/.nycrc +2 -2
- package/AUTHORS.md +10 -0
- package/CHANGELOG.md +91 -0
- package/Dockerfile +5 -3
- package/README.md +48 -3
- package/bin/deploy.js +88 -27
- package/bin/index.js +45 -21
- package/bin/ssl.js +3 -0
- package/conf.js +7 -2
- package/docker-compose.yml +1 -1
- package/package.json +133 -128
- package/src/client/components/core/BtnIcon.js +4 -1
- package/src/client/components/core/CommonJs.js +26 -2
- package/src/client/components/core/CssCore.js +4 -0
- package/src/client/components/core/Docs.js +107 -8
- package/src/client/components/core/VanillaJs.js +10 -7
- package/src/client/ssr/body-components/CacheControl.js +1 -1
- package/src/index.js +29 -0
- package/src/server/auth.js +1 -1
- package/src/server/backup.js +17 -6
- package/src/server/client-build.js +16 -5
- package/src/server/dns.js +12 -1
- package/src/server/logger.js +54 -9
- package/src/server/process.js +4 -4
- package/src/server/prompt-optimizer.js +28 -0
- package/startup.js +1 -1
- package/bin/help.js +0 -110
package/package.json
CHANGED
|
@@ -1,128 +1,133 @@
|
|
|
1
|
-
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
"
|
|
127
|
-
|
|
128
|
-
|
|
1
|
+
{
|
|
2
|
+
"type": "module",
|
|
3
|
+
"main": "src/index.js",
|
|
4
|
+
"name": "underpost",
|
|
5
|
+
"version": "2.7.1",
|
|
6
|
+
"description": "pwa api rest template",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"start": "env-cmd -f .env.production node --max-old-space-size=8192 src/server",
|
|
9
|
+
"pm2": "env-cmd -f .env.production pm2 start src/server.js --node-args=\"--max-old-space-size=8192\" --name engine && pm2 logs",
|
|
10
|
+
"ssl": "env-cmd -f .env.production node bin/ssl",
|
|
11
|
+
"pm2-delete": "pm2 delete engine",
|
|
12
|
+
"build": "node bin/deploy build-full-client --no-warnings",
|
|
13
|
+
"dev": "env-cmd -f .env.development node src/client.dev --no-warnings",
|
|
14
|
+
"dev-api": "env-cmd -f .env.development nodemon --watch src --ignore src/client src/api",
|
|
15
|
+
"docs": "jsdoc -c jsdoc.json",
|
|
16
|
+
"backup": "node bin/db default.net/ export",
|
|
17
|
+
"install-template": "npm install && npm run build",
|
|
18
|
+
"install-global": "npm install -g pm2 && npm install -g jsdoc && npm install -g prettier && npm install -g env-cmd && npm install -g yarn && npm install -g auto-changelog",
|
|
19
|
+
"install-test": "npm install -g mocha && npm install -g c8 && npm install -g nyc && npm install -g coveralls",
|
|
20
|
+
"install-vs-extensions": "node bin/vs import",
|
|
21
|
+
"preinstall": "npm config set audit false && npm config set loglevel error",
|
|
22
|
+
"restore-preinstall": "npm config set audit true && npm config set loglevel notice",
|
|
23
|
+
"install": "npm run install-global && npm run install-test && npm run restore-preinstall --no-audit --no-warnings",
|
|
24
|
+
"docker:start": "docker-compose up",
|
|
25
|
+
"prettier": "prettier --write .",
|
|
26
|
+
"coveralls": "nyc npm run test --reporter=text-lcov | coveralls -v",
|
|
27
|
+
"test": "env-cmd -f .env.test c8 mocha",
|
|
28
|
+
"update": "npm update -g && npm update && npm audit fix --force && npm audit fix --force",
|
|
29
|
+
"underpost-publish": "npm publish --access public",
|
|
30
|
+
"underpost-unpublish": "npm unpublish underpost@2.5.x",
|
|
31
|
+
"login": "npm adduser",
|
|
32
|
+
"bin": "npm link --force"
|
|
33
|
+
},
|
|
34
|
+
"bin": {
|
|
35
|
+
"underpost": "bin/index.js"
|
|
36
|
+
},
|
|
37
|
+
"repository": {
|
|
38
|
+
"type": "git",
|
|
39
|
+
"url": "git+https://github.com/underpostnet/pwa-microservices-template.git"
|
|
40
|
+
},
|
|
41
|
+
"keywords": [
|
|
42
|
+
"pwa",
|
|
43
|
+
"template",
|
|
44
|
+
"microservices",
|
|
45
|
+
"api",
|
|
46
|
+
"server",
|
|
47
|
+
"proxy",
|
|
48
|
+
"client"
|
|
49
|
+
],
|
|
50
|
+
"author": "https://github.com/underpostnet",
|
|
51
|
+
"license": "MIT",
|
|
52
|
+
"bugs": {
|
|
53
|
+
"url": "https://github.com/underpostnet/pwa-microservices-template/issues"
|
|
54
|
+
},
|
|
55
|
+
"homepage": "https://github.com/underpostnet/pwa-microservices-template#readme",
|
|
56
|
+
"dependencies": {
|
|
57
|
+
"@fortawesome/fontawesome-free": "^6.4.2",
|
|
58
|
+
"@loadingio/css-spinner": "^2.0.2",
|
|
59
|
+
"@neodrag/vanilla": "^2.0.3",
|
|
60
|
+
"@pinata/sdk": "^2.1.0",
|
|
61
|
+
"@xenova/transformers": "^2.17.2",
|
|
62
|
+
"adm-zip": "^0.5.10",
|
|
63
|
+
"ag-grid-community": "31.0.0",
|
|
64
|
+
"axios": "^1.5.1",
|
|
65
|
+
"chai": "^5.1.0",
|
|
66
|
+
"cli-progress": "^3.12.0",
|
|
67
|
+
"cli-spinners": "^3.0.0",
|
|
68
|
+
"color": "^4.2.3",
|
|
69
|
+
"colors": "^1.4.0",
|
|
70
|
+
"commander": "^12.1.0",
|
|
71
|
+
"compression": "^1.7.4",
|
|
72
|
+
"copy-paste": "^1.5.3",
|
|
73
|
+
"cors": "^2.8.5",
|
|
74
|
+
"d3": "^7.9.0",
|
|
75
|
+
"deepmerge": "^4.3.1",
|
|
76
|
+
"detect-port": "^1.5.1",
|
|
77
|
+
"dotenv": "^16.3.1",
|
|
78
|
+
"easymde": "^2.18.0",
|
|
79
|
+
"env-cmd": "^10.1.0",
|
|
80
|
+
"eventemitter3": "^5.0.1",
|
|
81
|
+
"express": "^4.18.2",
|
|
82
|
+
"express-fileupload": "^1.4.3",
|
|
83
|
+
"favicons": "^7.2.0",
|
|
84
|
+
"font-awesome-assets": "^0.0.9",
|
|
85
|
+
"fs-extra": "^11.1.1",
|
|
86
|
+
"fullcalendar": "^6.1.15",
|
|
87
|
+
"html-minifier-terser": "^7.2.0",
|
|
88
|
+
"http-proxy-middleware": "^2.0.6",
|
|
89
|
+
"ignore-walk": "^6.0.4",
|
|
90
|
+
"is-admin": "^4.0.0",
|
|
91
|
+
"is-ip": "^5.0.1",
|
|
92
|
+
"jimp": "^0.22.12",
|
|
93
|
+
"joystick-controller": "^1.0.15",
|
|
94
|
+
"json-colorizer": "^2.2.2",
|
|
95
|
+
"jsonwebtoken": "^9.0.2",
|
|
96
|
+
"kill-port-process": "^3.2.0",
|
|
97
|
+
"log-update": "^6.0.0",
|
|
98
|
+
"mariadb": "^3.2.2",
|
|
99
|
+
"marked": "^12.0.1",
|
|
100
|
+
"mongoose": "^8.0.1",
|
|
101
|
+
"morgan": "^1.10.0",
|
|
102
|
+
"node-cron": "^3.0.3",
|
|
103
|
+
"nodemailer": "^6.9.9",
|
|
104
|
+
"nodemon": "^3.0.1",
|
|
105
|
+
"pathfinding": "^0.4.18",
|
|
106
|
+
"peer": "^1.0.2",
|
|
107
|
+
"peerjs": "^1.5.2",
|
|
108
|
+
"pixi.js": "7.4.0",
|
|
109
|
+
"prom-client": "^15.1.2",
|
|
110
|
+
"public-ip": "^6.0.1",
|
|
111
|
+
"read": "^2.1.0",
|
|
112
|
+
"sharp": "^0.32.5",
|
|
113
|
+
"shelljs": "^0.8.5",
|
|
114
|
+
"simple-git": "^3.26.0",
|
|
115
|
+
"simple-icons": "^13.9.0",
|
|
116
|
+
"sitemap": "^7.1.1",
|
|
117
|
+
"socket.io": "^4.7.2",
|
|
118
|
+
"sortablejs": "^1.15.0",
|
|
119
|
+
"swagger-ui-express": "^5.0.0",
|
|
120
|
+
"systeminformation": "^5.21.17",
|
|
121
|
+
"text-to-image": "^5.2.0",
|
|
122
|
+
"uglify-js": "^3.17.4",
|
|
123
|
+
"validator": "^13.11.0",
|
|
124
|
+
"winston": "^3.11.0"
|
|
125
|
+
},
|
|
126
|
+
"devDependencies": {
|
|
127
|
+
"clean-jsdoc-theme": "^4.3.0",
|
|
128
|
+
"mocha": "^10.4.0",
|
|
129
|
+
"plantuml": "^0.0.2",
|
|
130
|
+
"swagger-autogen": "^2.23.7",
|
|
131
|
+
"to-json-schema": "^0.2.5"
|
|
132
|
+
}
|
|
133
|
+
}
|
|
@@ -12,6 +12,7 @@ const BtnIcon = {
|
|
|
12
12
|
style: '',
|
|
13
13
|
attrs: '',
|
|
14
14
|
label: '',
|
|
15
|
+
labelStyle: '',
|
|
15
16
|
tabHref: '',
|
|
16
17
|
tooltipHtml: '',
|
|
17
18
|
},
|
|
@@ -41,7 +42,9 @@ const BtnIcon = {
|
|
|
41
42
|
href="${options.tabHref}"
|
|
42
43
|
style="${renderCssAttr({ style: { width: '100%', height: '100%', top: '0%', left: '0%' } })}"
|
|
43
44
|
>
|
|
44
|
-
<span class="in btn-label-content"
|
|
45
|
+
<span class="in btn-label-content" ${options?.labelStyle ? `style='${options.labelStyle}'` : ''}>
|
|
46
|
+
${label}</span
|
|
47
|
+
></a
|
|
45
48
|
>`
|
|
46
49
|
: label}
|
|
47
50
|
</button>`;
|
|
@@ -33,10 +33,10 @@ const range = (start, end) => {
|
|
|
33
33
|
* @param arr - The `arr` parameter in the `getId` function is an array of objects or an object. If it
|
|
34
34
|
* is an object, the function converts it into an array of objects where each object has a key
|
|
35
35
|
* specified by the `keyId` parameter.
|
|
36
|
-
* @param
|
|
36
|
+
* @param suffix - The `suffix` parameter in the `getId` function is a string that can be added to
|
|
37
37
|
* the generated ID. It is optional and by default is an empty string. You can provide a suffix to be
|
|
38
38
|
* appended to the generated ID if needed.
|
|
39
|
-
* @param
|
|
39
|
+
* @param keyId - The `keyId` parameter in the `getId` function is used to specify the key in the
|
|
40
40
|
* array elements that contains the unique identifier (ID) for each element. By default, the function
|
|
41
41
|
* assumes that the ID is stored in a property named `'id'`, but you can customize this by providing
|
|
42
42
|
* @returns The `getId` function returns a unique identifier `_id` based on the input array `arr`,
|
|
@@ -657,6 +657,28 @@ function validatePassword(password) {
|
|
|
657
657
|
return errors;
|
|
658
658
|
}
|
|
659
659
|
|
|
660
|
+
function componentFromStr(numStr, percent) {
|
|
661
|
+
const num = Math.max(0, parseInt(numStr, 10));
|
|
662
|
+
return percent ? Math.floor((255 * Math.min(100, num)) / 100) : Math.min(255, num);
|
|
663
|
+
}
|
|
664
|
+
|
|
665
|
+
function rgbToHex(rgb) {
|
|
666
|
+
const rgbRegex = /^rgb\(\s*(-?\d+)(%?)\s*,\s*(-?\d+)(%?)\s*,\s*(-?\d+)(%?)\s*\)$/;
|
|
667
|
+
let result,
|
|
668
|
+
r,
|
|
669
|
+
g,
|
|
670
|
+
b,
|
|
671
|
+
hex = '';
|
|
672
|
+
if ((result = rgbRegex.exec(rgb))) {
|
|
673
|
+
r = componentFromStr(result[1], result[2]);
|
|
674
|
+
g = componentFromStr(result[3], result[4]);
|
|
675
|
+
b = componentFromStr(result[5], result[6]);
|
|
676
|
+
|
|
677
|
+
hex = '' + (0x1000000 + (r << 16) + (g << 8) + b).toString(16).slice(1);
|
|
678
|
+
}
|
|
679
|
+
return hex;
|
|
680
|
+
}
|
|
681
|
+
|
|
660
682
|
export {
|
|
661
683
|
s4,
|
|
662
684
|
range,
|
|
@@ -705,4 +727,6 @@ export {
|
|
|
705
727
|
getMostFrequentValue,
|
|
706
728
|
getFillMatrix,
|
|
707
729
|
validatePassword,
|
|
730
|
+
componentFromStr,
|
|
731
|
+
rgbToHex,
|
|
708
732
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { BtnIcon } from './BtnIcon.js';
|
|
2
|
-
import {
|
|
2
|
+
import { rgbToHex } from './CommonJs.js';
|
|
3
|
+
import { Css, darkTheme, dynamicCol, renderCssAttr, ThemeEvents, Themes } from './Css.js';
|
|
3
4
|
import { DropDown } from './DropDown.js';
|
|
4
5
|
import { Modal, renderMenuLabel, renderViewTitle } from './Modal.js';
|
|
5
6
|
import { listenQueryPathInstance, setQueryPath } from './Router.js';
|
|
@@ -8,6 +9,8 @@ import { getProxyPath, getQueryParams, htmls, s } from './VanillaJs.js';
|
|
|
8
9
|
|
|
9
10
|
// https://mintlify.com/docs/quickstart
|
|
10
11
|
|
|
12
|
+
const umlTypes = ['server', 'cron', 'client', 'ssr'];
|
|
13
|
+
|
|
11
14
|
const Docs = {
|
|
12
15
|
RenderModal: async function (type, modalOptions) {
|
|
13
16
|
const docData = this.Data.find((d) => d.type === type);
|
|
@@ -22,8 +25,14 @@ const Docs = {
|
|
|
22
25
|
title: renderViewTitle(docData),
|
|
23
26
|
id: ModalId,
|
|
24
27
|
html: async () => {
|
|
28
|
+
if (docData.renderHtml) return await docData.renderHtml();
|
|
25
29
|
return html`
|
|
26
|
-
<iframe
|
|
30
|
+
<iframe
|
|
31
|
+
class="in iframe-${ModalId}"
|
|
32
|
+
style="width: 100%; border: none; background: white"
|
|
33
|
+
src="${docData.url()}"
|
|
34
|
+
>
|
|
35
|
+
</iframe>
|
|
27
36
|
`;
|
|
28
37
|
},
|
|
29
38
|
maximize: true,
|
|
@@ -40,12 +49,20 @@ const Docs = {
|
|
|
40
49
|
Modal.Data[ModalId].onObserverListener[ModalId]();
|
|
41
50
|
},
|
|
42
51
|
Data: [
|
|
52
|
+
{
|
|
53
|
+
type: 'repo',
|
|
54
|
+
icon: html`<i class="fab fa-github"></i>`,
|
|
55
|
+
text: `Last Release`,
|
|
56
|
+
url: function () {
|
|
57
|
+
return `https://github.com/underpostnet/engine/`;
|
|
58
|
+
},
|
|
59
|
+
},
|
|
43
60
|
{
|
|
44
61
|
type: 'src',
|
|
45
62
|
icon: html`<i class="fa-brands fa-osi"></i>`,
|
|
46
63
|
text: 'Source Docs',
|
|
47
64
|
url: function () {
|
|
48
|
-
return `${getProxyPath()}docs/engine/2.
|
|
65
|
+
return `${getProxyPath()}docs/engine/2.7.1`;
|
|
49
66
|
},
|
|
50
67
|
},
|
|
51
68
|
{
|
|
@@ -57,14 +74,59 @@ const Docs = {
|
|
|
57
74
|
},
|
|
58
75
|
},
|
|
59
76
|
{
|
|
60
|
-
type: '
|
|
61
|
-
icon: html`<
|
|
62
|
-
text: `
|
|
77
|
+
type: 'coverage',
|
|
78
|
+
icon: html`<img height="20" width="20" class="doc-icon-coverage" />`,
|
|
79
|
+
text: `Coverage report`,
|
|
63
80
|
url: function () {
|
|
64
|
-
return
|
|
81
|
+
return `${getProxyPath()}docs/coverage`;
|
|
82
|
+
},
|
|
83
|
+
themeEvent: () => {
|
|
84
|
+
s(`.doc-icon-coverage`).src = `https://cdn.simpleicons.org/coveralls/${rgbToHex(
|
|
85
|
+
window.getComputedStyle(s('html')).color,
|
|
86
|
+
)}`;
|
|
65
87
|
},
|
|
66
88
|
},
|
|
67
|
-
|
|
89
|
+
{
|
|
90
|
+
type: 'coverage-link',
|
|
91
|
+
icon: html`<img height="20" width="20" class="doc-icon-coverage-link" />`,
|
|
92
|
+
text: `Coverage`,
|
|
93
|
+
url: function () {
|
|
94
|
+
return `https://coveralls.io/github/underpostnet/engine`;
|
|
95
|
+
},
|
|
96
|
+
themeEvent: () => {
|
|
97
|
+
s(`.doc-icon-coverage-link`).src = `https://cdn.simpleicons.org/coveralls/${rgbToHex(
|
|
98
|
+
window.getComputedStyle(s('html')).color,
|
|
99
|
+
)}`;
|
|
100
|
+
},
|
|
101
|
+
},
|
|
102
|
+
].concat(
|
|
103
|
+
umlTypes.map((umlType) => {
|
|
104
|
+
const umlId = `uml-${umlType}`;
|
|
105
|
+
return {
|
|
106
|
+
type: umlId,
|
|
107
|
+
icon: html`<i class="fas fa-sitemap"></i>`,
|
|
108
|
+
text: Translate.Render(`${umlType} config uml`),
|
|
109
|
+
renderHtml: function () {
|
|
110
|
+
return html` <div class="in section-mp">
|
|
111
|
+
<div class="in sub-title-modal"><i class="fas fa-project-diagram"></i> Schema</div>
|
|
112
|
+
</div>
|
|
113
|
+
<div class="in section-mp">
|
|
114
|
+
<a href="${getProxyPath()}docs/plantuml/${umlType}-schema.svg" target="_blank"
|
|
115
|
+
><img class="in plantuml-svg" src="${getProxyPath()}docs/plantuml/${umlType}-schema.svg"
|
|
116
|
+
/></a>
|
|
117
|
+
</div>
|
|
118
|
+
<div class="in section-mp">
|
|
119
|
+
<div class="in sub-title-modal"><i class="fas fa-project-diagram"></i> Instance example</div>
|
|
120
|
+
</div>
|
|
121
|
+
<div class="in section-mp">
|
|
122
|
+
<a href="${getProxyPath()}docs/plantuml/${umlType}-conf.svg" target="_blank"
|
|
123
|
+
><img class="in plantuml-svg" src="${getProxyPath()}docs/plantuml/${umlType}-conf.svg"
|
|
124
|
+
/></a>
|
|
125
|
+
</div>`;
|
|
126
|
+
},
|
|
127
|
+
};
|
|
128
|
+
}),
|
|
129
|
+
),
|
|
68
130
|
Init: async function (options) {
|
|
69
131
|
const { idModal } = options;
|
|
70
132
|
setTimeout(() => {
|
|
@@ -76,10 +138,28 @@ const Docs = {
|
|
|
76
138
|
setTimeout(() => setQueryPath({ path: 'docs', queryPath: 'api' }));
|
|
77
139
|
await this.RenderModal('api', options.modalOptions);
|
|
78
140
|
};
|
|
141
|
+
s(`.btn-docs-coverage`).onclick = async () => {
|
|
142
|
+
setTimeout(() => setQueryPath({ path: 'docs', queryPath: 'coverage' }));
|
|
143
|
+
await this.RenderModal('coverage', options.modalOptions);
|
|
144
|
+
};
|
|
145
|
+
|
|
146
|
+
s(`.btn-docs-coverage-link`).onclick = () => {
|
|
147
|
+
const docData = this.Data.find((d) => d.type === 'coverage-link');
|
|
148
|
+
location.href = docData.url();
|
|
149
|
+
};
|
|
79
150
|
s(`.btn-docs-repo`).onclick = () => {
|
|
80
151
|
const docData = this.Data.find((d) => d.type === 'repo');
|
|
81
152
|
location.href = docData.url();
|
|
82
153
|
};
|
|
154
|
+
|
|
155
|
+
for (const umlType of umlTypes) {
|
|
156
|
+
const umlId = `uml-${umlType}`;
|
|
157
|
+
s(`.btn-docs-${umlId}`).onclick = async () => {
|
|
158
|
+
setTimeout(() => setQueryPath({ path: 'docs', queryPath: umlId }));
|
|
159
|
+
await this.RenderModal(umlId, { ...options.modalOptions, handleType: 'bar' });
|
|
160
|
+
};
|
|
161
|
+
}
|
|
162
|
+
|
|
83
163
|
// if (!getQueryParams().p) s(`.btn-docs-src`).click();
|
|
84
164
|
listenQueryPathInstance({
|
|
85
165
|
id: options.idModal,
|
|
@@ -91,10 +171,29 @@ const Docs = {
|
|
|
91
171
|
});
|
|
92
172
|
let docMenuRender = '';
|
|
93
173
|
for (const docData of this.Data) {
|
|
174
|
+
if (docData.themeEvent) {
|
|
175
|
+
ThemeEvents[`doc-icon-${docData.type}`] = docData.themeEvent;
|
|
176
|
+
setTimeout(ThemeEvents[`doc-icon-${docData.type}`]);
|
|
177
|
+
}
|
|
178
|
+
let tabHref, style, labelStyle;
|
|
179
|
+
switch (docData.type) {
|
|
180
|
+
case 'repo':
|
|
181
|
+
case 'coverage-link':
|
|
182
|
+
tabHref = docData.url();
|
|
183
|
+
style = renderCssAttr({ style: { height: '45px' } });
|
|
184
|
+
labelStyle = renderCssAttr({ style: { top: '8px', left: '9px' } });
|
|
185
|
+
break;
|
|
186
|
+
|
|
187
|
+
default:
|
|
188
|
+
break;
|
|
189
|
+
}
|
|
94
190
|
docMenuRender += html` <div class="in">
|
|
95
191
|
${await BtnIcon.Render({
|
|
96
192
|
class: `inl section-mp btn-custom btn-docs-${docData.type}`,
|
|
97
193
|
label: html`${docData.icon} ${docData.text}`,
|
|
194
|
+
tabHref,
|
|
195
|
+
style,
|
|
196
|
+
labelStyle,
|
|
98
197
|
})}
|
|
99
198
|
</div>`;
|
|
100
199
|
}
|
|
@@ -109,6 +109,9 @@ const sa = (el) => document.querySelectorAll(el); // .forEach((currentValue, cur
|
|
|
109
109
|
// s(`.${idModal}`).offsetWidth
|
|
110
110
|
// s(`.${idModal}`).offsetHeight
|
|
111
111
|
|
|
112
|
+
// get css style tag data definitions
|
|
113
|
+
// window.getComputedStyle(el).color;
|
|
114
|
+
|
|
112
115
|
/**
|
|
113
116
|
* The `copyData` function uses the Clipboard API to copy the provided data to the clipboard and
|
|
114
117
|
* returns a promise that resolves to true if successful or false if unsuccessful.
|
|
@@ -133,14 +136,14 @@ const pasteData = () => new Promise((resolve) => navigator.clipboard.readText().
|
|
|
133
136
|
|
|
134
137
|
/**
|
|
135
138
|
* The setPath function in JavaScript updates the browser's history with a new path, state, and title.
|
|
136
|
-
* @param
|
|
139
|
+
* @param path - The `path` parameter is a string that represents the URL path where you want to
|
|
137
140
|
* navigate or update in the browser history. It is the first parameter in the `setPath` function and
|
|
138
141
|
* has a default value of `'/'`.
|
|
139
|
-
* @param
|
|
142
|
+
* @param stateStorage - The `stateStorage` parameter in the `setPath` function is an object that
|
|
140
143
|
* represents the state object associated with the new history entry. It is used to store data related
|
|
141
144
|
* to the state of the application when navigating to a new path using `history.pushState()`. This data
|
|
142
145
|
* can be accessed later
|
|
143
|
-
* @param
|
|
146
|
+
* @param title - The `title` parameter in the `setPath` function is a string that represents the
|
|
144
147
|
* title of the new history entry. It is used as the title of the new history entry in the browser's
|
|
145
148
|
* history.
|
|
146
149
|
* @memberof VanillaJS
|
|
@@ -309,7 +312,7 @@ function downloadFile(fileInstance, fileName) {
|
|
|
309
312
|
|
|
310
313
|
/**
|
|
311
314
|
* The function `getRawContentFile` reads the raw content of a file using a FileReader in JavaScript.
|
|
312
|
-
* @param
|
|
315
|
+
* @param blob - The `blob` parameter in the `getRawContentFile` function is a Buffer object that
|
|
313
316
|
* represents raw binary data. It is used to read the content of a file as text using a FileReader in
|
|
314
317
|
* the browser environment.
|
|
315
318
|
* @memberof VanillaJS
|
|
@@ -326,9 +329,9 @@ const getRawContentFile = (blob = new Buffer()) =>
|
|
|
326
329
|
/**
|
|
327
330
|
* The function `getBlobFromUint8ArrayFile` creates a Blob object from a Uint8Array file data with a
|
|
328
331
|
* specified mimetype.
|
|
329
|
-
* @param
|
|
332
|
+
* @param data - The `data` parameter in the `getBlobFromUint8ArrayFile` function is an array of
|
|
330
333
|
* arrays containing Uint8Array data.
|
|
331
|
-
* @param
|
|
334
|
+
* @param mimetype - The `mimetype` parameter in the
|
|
332
335
|
* `getBlobFromUint8ArrayFile` function is a string that specifies the type of the Blob object being
|
|
333
336
|
* created. It indicates the MIME type of the data contained in the Blob. For example, common MIME
|
|
334
337
|
* types include 'image/jpeg' for JPEG images,
|
|
@@ -406,7 +409,7 @@ const isActiveTab = () => document.hasFocus();
|
|
|
406
409
|
/**
|
|
407
410
|
* The function `isActiveElement` checks if the active element in the document matches a specified
|
|
408
411
|
* class search.
|
|
409
|
-
* @param
|
|
412
|
+
* @param classSearch - The `classSearch` parameter is a string that is used to search for a specific
|
|
410
413
|
* class name within the `classList` of the active element in the document.
|
|
411
414
|
* @memberof VanillaJS
|
|
412
415
|
*/
|
|
@@ -108,6 +108,6 @@ SrrComponent = ({ ttiLoadTimeLimit }) => {
|
|
|
108
108
|
const CacheControl = ${CacheControl};
|
|
109
109
|
CacheControl({ ttiLoadTimeLimit: ${ttiLoadTimeLimit ? ttiLoadTimeLimit : 1000 * 70 * 1} });
|
|
110
110
|
</script>
|
|
111
|
-
<div class="clean-cache-container">v2.
|
|
111
|
+
<div class="clean-cache-container">v2.7.1</div>
|
|
112
112
|
`;
|
|
113
113
|
};
|
package/src/index.js
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
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
|
+
const underpost = {
|
|
12
|
+
/**
|
|
13
|
+
* Logs information about the current process environment to the console.
|
|
14
|
+
*
|
|
15
|
+
* This function is used to log details about
|
|
16
|
+
* the execution context, such as command-line arguments,
|
|
17
|
+
* environment variables, the process's administrative privileges,
|
|
18
|
+
* and the maximum available heap space size.
|
|
19
|
+
*
|
|
20
|
+
* @memberof Underpost
|
|
21
|
+
*/
|
|
22
|
+
setUpInfo: async () => await setUpInfo(logger),
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
const up = underpost;
|
|
26
|
+
|
|
27
|
+
export { underpost, up };
|
|
28
|
+
|
|
29
|
+
export default underpost;
|
package/src/server/auth.js
CHANGED
|
@@ -67,7 +67,7 @@ const hashJWT = (payload, expire) =>
|
|
|
67
67
|
/**
|
|
68
68
|
* The function `verifyJWT` is used to verify a JSON Web Token (JWT) using a secret key stored in the
|
|
69
69
|
* environment variables.
|
|
70
|
-
* @param
|
|
70
|
+
* @param token - The `token` parameter is a JSON Web Token (JWT) that is passed to the `verifyJWT`
|
|
71
71
|
* function for verification.
|
|
72
72
|
* @memberof Auth
|
|
73
73
|
*/
|