anote-server-libs 0.11.1 → 0.11.3
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/package.json +9 -9
- package/services/utils.js +1 -1
- package/services/utils.ts +4 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "anote-server-libs",
|
|
3
|
-
"version": "0.11.
|
|
3
|
+
"version": "0.11.3",
|
|
4
4
|
"description": "Helpers for express-TS servers",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"test": "echo \"Error: no test specified\" && exit 1",
|
|
@@ -17,19 +17,19 @@
|
|
|
17
17
|
"license": "MIT",
|
|
18
18
|
"dependencies": {
|
|
19
19
|
"@types/memcached": "2.2.10",
|
|
20
|
-
"@types/mssql": "
|
|
21
|
-
"@types/pg": "8.
|
|
22
|
-
"ajv": "8.
|
|
20
|
+
"@types/mssql": "12.3.0",
|
|
21
|
+
"@types/pg": "8.20.0",
|
|
22
|
+
"ajv": "8.20.0",
|
|
23
23
|
"memcached": "2.2.2",
|
|
24
|
-
"mssql": "12.
|
|
25
|
-
"pg": "8.
|
|
24
|
+
"mssql": "12.5.4",
|
|
25
|
+
"pg": "8.21.0"
|
|
26
26
|
},
|
|
27
27
|
"peerDependencies": {
|
|
28
|
-
"express": "5.1
|
|
29
|
-
"winston": "3.
|
|
28
|
+
"express": "5.2.1",
|
|
29
|
+
"winston": "3.19.0"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
|
-
"@types/express": "5.0.
|
|
32
|
+
"@types/express": "5.0.6",
|
|
33
33
|
"@types/node": "22.12.0",
|
|
34
34
|
"typescript": "5.7.3" }
|
|
35
35
|
}
|
package/services/utils.js
CHANGED
|
@@ -219,7 +219,7 @@ function readEmailTemplates(path, config) {
|
|
|
219
219
|
if (!product || !name)
|
|
220
220
|
return loadEmailTemplates(path);
|
|
221
221
|
const mainPath = path + '/' + product;
|
|
222
|
-
const overridePath = product !== name ?
|
|
222
|
+
const overridePath = product !== name ? path + `/${product}/${name}` : undefined;
|
|
223
223
|
const defaultTemplates = loadEmailTemplates(mainPath);
|
|
224
224
|
const overrideTemplates = overridePath ? loadEmailTemplates(overridePath) : {};
|
|
225
225
|
return { ...defaultTemplates, ...overrideTemplates };
|
package/services/utils.ts
CHANGED
|
@@ -193,11 +193,11 @@ function loadEmailTemplates(path: string): Record<string, string> | undefined {
|
|
|
193
193
|
return loadedEmailTemplates;
|
|
194
194
|
}
|
|
195
195
|
|
|
196
|
-
export function readEmailTemplates(path: string, config: Record<string, any>): {[id: string]: string} {
|
|
197
|
-
const {
|
|
198
|
-
if
|
|
196
|
+
export function readEmailTemplates(path: string, config: Record<string, any>): {[id: string]: string} | undefined {
|
|
197
|
+
const {product, name} = config.app;
|
|
198
|
+
if(!product || !name) return loadEmailTemplates(path);
|
|
199
199
|
const mainPath = path + '/' + product;
|
|
200
|
-
const overridePath = product !== name ?
|
|
200
|
+
const overridePath = product !== name ? path + `/${product}/${name}` : undefined;
|
|
201
201
|
const defaultTemplates = loadEmailTemplates(mainPath);
|
|
202
202
|
const overrideTemplates = overridePath ? loadEmailTemplates(overridePath) : {};
|
|
203
203
|
return {...defaultTemplates, ...overrideTemplates};
|