@adaptivestone/framework 4.7.0 → 4.8.0
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/CHANGELOG.md +9 -1
- package/Cli.js +1 -0
- package/commands/SyncIndexes.js +1 -1
- package/controllers/Auth.js +3 -5
- package/controllers/index.js +0 -2
- package/coverage/base.css +224 -0
- package/coverage/block-navigation.js +87 -0
- package/coverage/clover.xml +3542 -0
- package/coverage/coverage-final.json +44 -0
- package/coverage/favicon.png +0 -0
- package/coverage/framework/config/auth.js.html +100 -0
- package/coverage/framework/config/http.js.html +112 -0
- package/coverage/framework/config/i18n.js.html +121 -0
- package/coverage/framework/config/index.html +236 -0
- package/coverage/framework/config/log.js.html +151 -0
- package/coverage/framework/config/mail.js.html +172 -0
- package/coverage/framework/config/mongo.js.html +94 -0
- package/coverage/framework/config/rateLimiter.js.html +133 -0
- package/coverage/framework/config/redis.js.html +97 -0
- package/coverage/framework/config/validate.js.html +94 -0
- package/coverage/framework/controllers/Auth.js.html +715 -0
- package/coverage/framework/controllers/Home.js.html +169 -0
- package/coverage/framework/controllers/index.html +146 -0
- package/coverage/framework/controllers/index.js.html +259 -0
- package/coverage/framework/controllers/test/SomeController.js.html +571 -0
- package/coverage/framework/controllers/test/index.html +116 -0
- package/coverage/framework/helpers/files.js.html +310 -0
- package/coverage/framework/helpers/index.html +131 -0
- package/coverage/framework/helpers/logger.js.html +142 -0
- package/coverage/framework/helpers/redis/clearNamespace.js.html +127 -0
- package/coverage/framework/helpers/redis/index.html +116 -0
- package/coverage/framework/index.html +116 -0
- package/coverage/framework/models/Migration.js.html +130 -0
- package/coverage/framework/models/Sequence.js.html +151 -0
- package/coverage/framework/models/User.js.html +859 -0
- package/coverage/framework/models/index.html +146 -0
- package/coverage/framework/modules/AbstractController.js.html +1309 -0
- package/coverage/framework/modules/AbstractModel.js.html +268 -0
- package/coverage/framework/modules/Base.js.html +244 -0
- package/coverage/framework/modules/index.html +146 -0
- package/coverage/framework/server.js.html +1186 -0
- package/coverage/framework/services/cache/Cache.js.html +445 -0
- package/coverage/framework/services/cache/index.html +116 -0
- package/coverage/framework/services/documentation/DocumentationGenerator.js.html +592 -0
- package/coverage/framework/services/documentation/index.html +116 -0
- package/coverage/framework/services/http/HttpServer.js.html +373 -0
- package/coverage/framework/services/http/index.html +116 -0
- package/coverage/framework/services/http/middleware/AbstractMiddleware.js.html +238 -0
- package/coverage/framework/services/http/middleware/Auth.js.html +145 -0
- package/coverage/framework/services/http/middleware/GetUserByToken.js.html +223 -0
- package/coverage/framework/services/http/middleware/I18n.js.html +442 -0
- package/coverage/framework/services/http/middleware/Pagination.js.html +253 -0
- package/coverage/framework/services/http/middleware/PrepareAppInfo.js.html +139 -0
- package/coverage/framework/services/http/middleware/RateLimiter.js.html +472 -0
- package/coverage/framework/services/http/middleware/RequestLogger.js.html +151 -0
- package/coverage/framework/services/http/middleware/RequestParser.js.html +199 -0
- package/coverage/framework/services/http/middleware/Role.js.html +172 -0
- package/coverage/framework/services/http/middleware/index.html +251 -0
- package/coverage/framework/services/http/middleware/test/CheckFlag.js.html +139 -0
- package/coverage/framework/services/http/middleware/test/index.html +116 -0
- package/coverage/framework/services/messaging/email/index.html +116 -0
- package/coverage/framework/services/messaging/email/index.js.html +739 -0
- package/coverage/framework/services/messaging/index.html +116 -0
- package/coverage/framework/services/messaging/index.js.html +100 -0
- package/coverage/framework/services/validate/ValidateService.js.html +556 -0
- package/coverage/framework/services/validate/drivers/AbstractValidator.js.html +196 -0
- package/coverage/framework/services/validate/drivers/CustomValidator.js.html +241 -0
- package/coverage/framework/services/validate/drivers/YupValidator.js.html +394 -0
- package/coverage/framework/services/validate/drivers/index.html +146 -0
- package/coverage/framework/services/validate/index.html +116 -0
- package/coverage/index.html +356 -0
- package/coverage/prettify.css +1 -0
- package/coverage/prettify.js +2 -0
- package/coverage/sort-arrow-sprite.png +0 -0
- package/coverage/sorter.js +196 -0
- package/helpers/files.js +75 -0
- package/helpers/logger.js +19 -0
- package/models/Migration.test.js +19 -0
- package/modules/AbstractController.js +1 -3
- package/modules/Base.js +6 -56
- package/modules/BaseCli.js +0 -3
- package/package.json +2 -2
- package/server.d.ts +6 -0
- package/server.js +126 -78
- package/services/cache/Cache.js +10 -5
- package/services/cache/Cache.test.js +81 -0
- package/services/http/middleware/Auth.test.js +57 -0
- package/services/http/middleware/I18n.test.js +15 -3
- package/services/http/middleware/PrepareAppInfo.test.js +1 -1
- package/services/http/middleware/Role.test.js +93 -0
- package/tests/setup.js +1 -0
- package/tests/setupVitest.js +1 -0
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
var addSorting = (function() {
|
|
3
|
+
'use strict';
|
|
4
|
+
var cols,
|
|
5
|
+
currentSort = {
|
|
6
|
+
index: 0,
|
|
7
|
+
desc: false
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
// returns the summary table element
|
|
11
|
+
function getTable() {
|
|
12
|
+
return document.querySelector('.coverage-summary');
|
|
13
|
+
}
|
|
14
|
+
// returns the thead element of the summary table
|
|
15
|
+
function getTableHeader() {
|
|
16
|
+
return getTable().querySelector('thead tr');
|
|
17
|
+
}
|
|
18
|
+
// returns the tbody element of the summary table
|
|
19
|
+
function getTableBody() {
|
|
20
|
+
return getTable().querySelector('tbody');
|
|
21
|
+
}
|
|
22
|
+
// returns the th element for nth column
|
|
23
|
+
function getNthColumn(n) {
|
|
24
|
+
return getTableHeader().querySelectorAll('th')[n];
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function onFilterInput() {
|
|
28
|
+
const searchValue = document.getElementById('fileSearch').value;
|
|
29
|
+
const rows = document.getElementsByTagName('tbody')[0].children;
|
|
30
|
+
for (let i = 0; i < rows.length; i++) {
|
|
31
|
+
const row = rows[i];
|
|
32
|
+
if (
|
|
33
|
+
row.textContent
|
|
34
|
+
.toLowerCase()
|
|
35
|
+
.includes(searchValue.toLowerCase())
|
|
36
|
+
) {
|
|
37
|
+
row.style.display = '';
|
|
38
|
+
} else {
|
|
39
|
+
row.style.display = 'none';
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// loads the search box
|
|
45
|
+
function addSearchBox() {
|
|
46
|
+
var template = document.getElementById('filterTemplate');
|
|
47
|
+
var templateClone = template.content.cloneNode(true);
|
|
48
|
+
templateClone.getElementById('fileSearch').oninput = onFilterInput;
|
|
49
|
+
template.parentElement.appendChild(templateClone);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
// loads all columns
|
|
53
|
+
function loadColumns() {
|
|
54
|
+
var colNodes = getTableHeader().querySelectorAll('th'),
|
|
55
|
+
colNode,
|
|
56
|
+
cols = [],
|
|
57
|
+
col,
|
|
58
|
+
i;
|
|
59
|
+
|
|
60
|
+
for (i = 0; i < colNodes.length; i += 1) {
|
|
61
|
+
colNode = colNodes[i];
|
|
62
|
+
col = {
|
|
63
|
+
key: colNode.getAttribute('data-col'),
|
|
64
|
+
sortable: !colNode.getAttribute('data-nosort'),
|
|
65
|
+
type: colNode.getAttribute('data-type') || 'string'
|
|
66
|
+
};
|
|
67
|
+
cols.push(col);
|
|
68
|
+
if (col.sortable) {
|
|
69
|
+
col.defaultDescSort = col.type === 'number';
|
|
70
|
+
colNode.innerHTML =
|
|
71
|
+
colNode.innerHTML + '<span class="sorter"></span>';
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
return cols;
|
|
75
|
+
}
|
|
76
|
+
// attaches a data attribute to every tr element with an object
|
|
77
|
+
// of data values keyed by column name
|
|
78
|
+
function loadRowData(tableRow) {
|
|
79
|
+
var tableCols = tableRow.querySelectorAll('td'),
|
|
80
|
+
colNode,
|
|
81
|
+
col,
|
|
82
|
+
data = {},
|
|
83
|
+
i,
|
|
84
|
+
val;
|
|
85
|
+
for (i = 0; i < tableCols.length; i += 1) {
|
|
86
|
+
colNode = tableCols[i];
|
|
87
|
+
col = cols[i];
|
|
88
|
+
val = colNode.getAttribute('data-value');
|
|
89
|
+
if (col.type === 'number') {
|
|
90
|
+
val = Number(val);
|
|
91
|
+
}
|
|
92
|
+
data[col.key] = val;
|
|
93
|
+
}
|
|
94
|
+
return data;
|
|
95
|
+
}
|
|
96
|
+
// loads all row data
|
|
97
|
+
function loadData() {
|
|
98
|
+
var rows = getTableBody().querySelectorAll('tr'),
|
|
99
|
+
i;
|
|
100
|
+
|
|
101
|
+
for (i = 0; i < rows.length; i += 1) {
|
|
102
|
+
rows[i].data = loadRowData(rows[i]);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
// sorts the table using the data for the ith column
|
|
106
|
+
function sortByIndex(index, desc) {
|
|
107
|
+
var key = cols[index].key,
|
|
108
|
+
sorter = function(a, b) {
|
|
109
|
+
a = a.data[key];
|
|
110
|
+
b = b.data[key];
|
|
111
|
+
return a < b ? -1 : a > b ? 1 : 0;
|
|
112
|
+
},
|
|
113
|
+
finalSorter = sorter,
|
|
114
|
+
tableBody = document.querySelector('.coverage-summary tbody'),
|
|
115
|
+
rowNodes = tableBody.querySelectorAll('tr'),
|
|
116
|
+
rows = [],
|
|
117
|
+
i;
|
|
118
|
+
|
|
119
|
+
if (desc) {
|
|
120
|
+
finalSorter = function(a, b) {
|
|
121
|
+
return -1 * sorter(a, b);
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
for (i = 0; i < rowNodes.length; i += 1) {
|
|
126
|
+
rows.push(rowNodes[i]);
|
|
127
|
+
tableBody.removeChild(rowNodes[i]);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
rows.sort(finalSorter);
|
|
131
|
+
|
|
132
|
+
for (i = 0; i < rows.length; i += 1) {
|
|
133
|
+
tableBody.appendChild(rows[i]);
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
// removes sort indicators for current column being sorted
|
|
137
|
+
function removeSortIndicators() {
|
|
138
|
+
var col = getNthColumn(currentSort.index),
|
|
139
|
+
cls = col.className;
|
|
140
|
+
|
|
141
|
+
cls = cls.replace(/ sorted$/, '').replace(/ sorted-desc$/, '');
|
|
142
|
+
col.className = cls;
|
|
143
|
+
}
|
|
144
|
+
// adds sort indicators for current column being sorted
|
|
145
|
+
function addSortIndicators() {
|
|
146
|
+
getNthColumn(currentSort.index).className += currentSort.desc
|
|
147
|
+
? ' sorted-desc'
|
|
148
|
+
: ' sorted';
|
|
149
|
+
}
|
|
150
|
+
// adds event listeners for all sorter widgets
|
|
151
|
+
function enableUI() {
|
|
152
|
+
var i,
|
|
153
|
+
el,
|
|
154
|
+
ithSorter = function ithSorter(i) {
|
|
155
|
+
var col = cols[i];
|
|
156
|
+
|
|
157
|
+
return function() {
|
|
158
|
+
var desc = col.defaultDescSort;
|
|
159
|
+
|
|
160
|
+
if (currentSort.index === i) {
|
|
161
|
+
desc = !currentSort.desc;
|
|
162
|
+
}
|
|
163
|
+
sortByIndex(i, desc);
|
|
164
|
+
removeSortIndicators();
|
|
165
|
+
currentSort.index = i;
|
|
166
|
+
currentSort.desc = desc;
|
|
167
|
+
addSortIndicators();
|
|
168
|
+
};
|
|
169
|
+
};
|
|
170
|
+
for (i = 0; i < cols.length; i += 1) {
|
|
171
|
+
if (cols[i].sortable) {
|
|
172
|
+
// add the click event handler on the th so users
|
|
173
|
+
// dont have to click on those tiny arrows
|
|
174
|
+
el = getNthColumn(i).querySelector('.sorter').parentElement;
|
|
175
|
+
if (el.addEventListener) {
|
|
176
|
+
el.addEventListener('click', ithSorter(i));
|
|
177
|
+
} else {
|
|
178
|
+
el.attachEvent('onclick', ithSorter(i));
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
// adds sorting functionality to the UI
|
|
184
|
+
return function() {
|
|
185
|
+
if (!getTable()) {
|
|
186
|
+
return;
|
|
187
|
+
}
|
|
188
|
+
cols = loadColumns();
|
|
189
|
+
loadData();
|
|
190
|
+
addSearchBox();
|
|
191
|
+
addSortIndicators();
|
|
192
|
+
enableUI();
|
|
193
|
+
};
|
|
194
|
+
})();
|
|
195
|
+
|
|
196
|
+
window.addEventListener('load', addSorting);
|
package/helpers/files.js
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
const fs = require('node:fs').promises;
|
|
2
|
+
const { join } = require('node:path');
|
|
3
|
+
|
|
4
|
+
const getFilesPathWithInheritance = async ({
|
|
5
|
+
internalFolder,
|
|
6
|
+
externalFolder,
|
|
7
|
+
logger,
|
|
8
|
+
loggerFileType = '',
|
|
9
|
+
filter: { startWithCapital = true, notTests = true, notHidden = true } = {},
|
|
10
|
+
}) => {
|
|
11
|
+
let [internalFiles, externalFiles] = await Promise.all([
|
|
12
|
+
fs.readdir(internalFolder, { recursive: true, withFileTypes: true }),
|
|
13
|
+
fs.readdir(externalFolder, { recursive: true, withFileTypes: true }),
|
|
14
|
+
]);
|
|
15
|
+
|
|
16
|
+
const filterIndexFile = (fileDirent) => {
|
|
17
|
+
if (!fileDirent.isFile()) {
|
|
18
|
+
return false;
|
|
19
|
+
}
|
|
20
|
+
const fileArray = fileDirent.name.split('/');
|
|
21
|
+
const file = fileArray[fileArray.length - 1];
|
|
22
|
+
if (startWithCapital && file[0] !== file[0].toUpperCase()) {
|
|
23
|
+
// not start with capital
|
|
24
|
+
return false;
|
|
25
|
+
}
|
|
26
|
+
if (notTests && file.endsWith('.test.js')) {
|
|
27
|
+
return false;
|
|
28
|
+
}
|
|
29
|
+
if (notHidden && file[0] === '.') {
|
|
30
|
+
// not start with dot
|
|
31
|
+
return false;
|
|
32
|
+
}
|
|
33
|
+
return true;
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
internalFiles = internalFiles
|
|
37
|
+
.filter(filterIndexFile)
|
|
38
|
+
.map((fileDirent) =>
|
|
39
|
+
join(fileDirent.path, fileDirent.name).replace(`${internalFolder}/`, ''),
|
|
40
|
+
);
|
|
41
|
+
externalFiles = externalFiles
|
|
42
|
+
.filter(filterIndexFile)
|
|
43
|
+
.map((fileDirent) =>
|
|
44
|
+
join(fileDirent.path, fileDirent.name).replace(`${externalFolder}/`, ''),
|
|
45
|
+
);
|
|
46
|
+
|
|
47
|
+
const filesToLoad = [];
|
|
48
|
+
for (const file of internalFiles) {
|
|
49
|
+
if (externalFiles.includes(file)) {
|
|
50
|
+
logger(
|
|
51
|
+
`Skipping register INTERNAL file '${file}' ${
|
|
52
|
+
loggerFileType ? `of type ${loggerFileType}` : ''
|
|
53
|
+
} as it override by EXTERNAL ONE`,
|
|
54
|
+
);
|
|
55
|
+
} else {
|
|
56
|
+
filesToLoad.push({
|
|
57
|
+
path: `${internalFolder}/${file}`,
|
|
58
|
+
file,
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
for (const file of externalFiles) {
|
|
64
|
+
filesToLoad.push({
|
|
65
|
+
path: `${externalFolder}/${file}`,
|
|
66
|
+
file,
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
return filesToLoad;
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
module.exports = {
|
|
73
|
+
// eslint-disable-next-line import/prefer-default-export
|
|
74
|
+
getFilesPathWithInheritance,
|
|
75
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/* eslint-disable no-console */
|
|
2
|
+
const levels = ['error', 'warn', 'info', 'http', 'verbose', 'debug', 'silly'];
|
|
3
|
+
|
|
4
|
+
const consoleLogger = (level, message) => {
|
|
5
|
+
if (
|
|
6
|
+
!process.env.LOGGER_CONSOLE_LEVEL ||
|
|
7
|
+
levels.indexOf(process.env.LOGGER_CONSOLE_LEVEL) >= levels.indexOf(level)
|
|
8
|
+
) {
|
|
9
|
+
if (console[level]) {
|
|
10
|
+
console[level](message);
|
|
11
|
+
} else {
|
|
12
|
+
console.log(message);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
module.exports = {
|
|
17
|
+
levels,
|
|
18
|
+
consoleLogger,
|
|
19
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest';
|
|
2
|
+
|
|
3
|
+
describe('migration model', () => {
|
|
4
|
+
it('migrationFile should be uniqe', async () => {
|
|
5
|
+
expect.assertions(1);
|
|
6
|
+
let errorCode;
|
|
7
|
+
const MigrationModel = global.server.app.getModel('Migration');
|
|
8
|
+
await MigrationModel.create({
|
|
9
|
+
migrationFile: 'a',
|
|
10
|
+
});
|
|
11
|
+
await MigrationModel.create({
|
|
12
|
+
migrationFile: 'a',
|
|
13
|
+
}).catch((e) => {
|
|
14
|
+
errorCode = e.code;
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
expect(errorCode).toBe(11000);
|
|
18
|
+
});
|
|
19
|
+
});
|
|
@@ -227,9 +227,7 @@ class AbstractController extends Base {
|
|
|
227
227
|
});
|
|
228
228
|
}
|
|
229
229
|
return routeObject.handler.call(this, req, res, next).catch((e) => {
|
|
230
|
-
this.logger.error(e
|
|
231
|
-
// eslint-disable-next-line no-console
|
|
232
|
-
console.error(e);
|
|
230
|
+
this.logger.error(e);
|
|
233
231
|
return res.status(500).json({
|
|
234
232
|
message:
|
|
235
233
|
'Platform error. Please check later or contact support',
|
package/modules/Base.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
const
|
|
2
|
-
const { join, normalize } = require('node:path');
|
|
1
|
+
const { getFilesPathWithInheritance } = require('../helpers/files');
|
|
3
2
|
|
|
4
3
|
class Base {
|
|
5
4
|
#realLogger = null;
|
|
@@ -36,60 +35,11 @@ class Base {
|
|
|
36
35
|
}
|
|
37
36
|
|
|
38
37
|
async getFilesPathWithInheritance(internalFolder, externalFolder) {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
if ((await fs.stat(f)).isDirectory()) {
|
|
45
|
-
allFiles.pop();
|
|
46
|
-
return rreaddir(f, allFiles);
|
|
47
|
-
}
|
|
48
|
-
return null;
|
|
49
|
-
}),
|
|
50
|
-
);
|
|
51
|
-
return allFiles.map((file) => file.replace(`${normalize(dir)}/`, ''));
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
let [internalFiles, externalFiles] = await Promise.all([
|
|
55
|
-
rreaddir(internalFolder),
|
|
56
|
-
rreaddir(externalFolder),
|
|
57
|
-
]);
|
|
58
|
-
|
|
59
|
-
const filterIndexFile = (fileName) => {
|
|
60
|
-
const fileArray = fileName.split('/');
|
|
61
|
-
const file = fileArray[fileArray.length - 1];
|
|
62
|
-
return (
|
|
63
|
-
file[0] === file[0].toUpperCase() && // Start with capital
|
|
64
|
-
file[0] !== '.' && // not start with dot
|
|
65
|
-
!file.includes('.test.js') // not test files
|
|
66
|
-
);
|
|
67
|
-
};
|
|
68
|
-
|
|
69
|
-
internalFiles = internalFiles.filter(filterIndexFile);
|
|
70
|
-
externalFiles = externalFiles.filter(filterIndexFile);
|
|
71
|
-
|
|
72
|
-
const filesToLoad = [];
|
|
73
|
-
for (const file of internalFiles) {
|
|
74
|
-
if (externalFiles.includes(file)) {
|
|
75
|
-
this.logger.verbose(
|
|
76
|
-
`Skipping register INTERNAL file ${file} as it override by EXTERNAL ONE`,
|
|
77
|
-
);
|
|
78
|
-
} else {
|
|
79
|
-
filesToLoad.push({
|
|
80
|
-
path: `${internalFolder}/${file}`,
|
|
81
|
-
file,
|
|
82
|
-
});
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
for (const file of externalFiles) {
|
|
87
|
-
filesToLoad.push({
|
|
88
|
-
path: `${externalFolder}/${file}`,
|
|
89
|
-
file,
|
|
90
|
-
});
|
|
91
|
-
}
|
|
92
|
-
return filesToLoad;
|
|
38
|
+
return getFilesPathWithInheritance({
|
|
39
|
+
internalFolder,
|
|
40
|
+
externalFolder,
|
|
41
|
+
logger: (text) => this.logger.verbose(text),
|
|
42
|
+
});
|
|
93
43
|
}
|
|
94
44
|
|
|
95
45
|
/**
|
package/modules/BaseCli.js
CHANGED
|
@@ -47,11 +47,8 @@ class Cli extends Base {
|
|
|
47
47
|
);
|
|
48
48
|
return false;
|
|
49
49
|
}
|
|
50
|
-
// TODO wait until https://github.com/nodejs/node/issues/35889
|
|
51
50
|
const { default: Command } = await import(this.commands[command]);
|
|
52
51
|
|
|
53
|
-
// const Command = require(this.commands[command]);
|
|
54
|
-
|
|
55
52
|
const c = new Command(this.app, this.commands, args);
|
|
56
53
|
let result = false;
|
|
57
54
|
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adaptivestone/framework",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.8.0",
|
|
4
4
|
"description": "Adaptive stone node js framework",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"engines": {
|
|
7
|
-
"node": ">=18.
|
|
7
|
+
"node": ">=18.17.0"
|
|
8
8
|
},
|
|
9
9
|
"repository": {
|
|
10
10
|
"type": "git",
|
package/server.d.ts
CHANGED
|
@@ -45,6 +45,12 @@ declare class Server {
|
|
|
45
45
|
*/
|
|
46
46
|
startServer(callbackBefore404?: Promise<null>): Promise<null>;
|
|
47
47
|
|
|
48
|
+
/**
|
|
49
|
+
* Do an initialization (config reading, etc)
|
|
50
|
+
* @returns {Promise}
|
|
51
|
+
*/
|
|
52
|
+
init(): Promise<boolean>;
|
|
53
|
+
|
|
48
54
|
/**
|
|
49
55
|
* Return config from {configName} (file name) on config folder.
|
|
50
56
|
* Support cache and updating confing into cache
|