@candlerip/shared3 0.0.119 → 0.0.121
Sign up to get free protection for your applications and to get access to all the features.
- package/_devops/cdk/cdk-deploy.sh +1 -1
- package/_devops/ec2/ec2-deploy.sh +1 -1
- package/_devops/git/git-push.sh +1 -1
- package/_devops/typescript/tsc-compile.sh +1 -1
- package/_devops/typescript/tsc-watch.sh +1 -1
- package/package.json +3 -1
- package/src/backend/database/model/error-log/util.d.ts +1 -1
- package/src/backend/database/model/error-log/util.js +6 -4
- package/src/backend/database/model/translation/util.d.ts +1 -1
- package/src/backend/database/model/translation/util.js +8 -6
- package/src/backend/database/mutation/error-log/create-error-log/util.js +2 -2
- package/src/backend/database/mutation/translation/get-translations/util.js +2 -2
- package/src/backend/database/mutation/translation/get-translations-as-dictionary/util.js +2 -2
- package/src/backend/index.d.ts +0 -2
- package/src/backend/index.js +0 -2
package/_devops/git/git-push.sh
CHANGED
package/package.json
CHANGED
@@ -1,12 +1,14 @@
|
|
1
1
|
{
|
2
2
|
"name": "@candlerip/shared3",
|
3
|
-
"version": "0.0.
|
3
|
+
"version": "0.0.121",
|
4
4
|
"type": "module",
|
5
5
|
"exports": {
|
6
6
|
".": "./src/index.js",
|
7
7
|
"./aws": "./src/aws/index.js",
|
8
8
|
"./backend": "./src/backend/index.js",
|
9
9
|
"./backend/cache": "./src/backend/cache/index.js",
|
10
|
+
"./backend/database": "./src/backend/database/index.js",
|
11
|
+
"./backend/dictionary": "./src/backend/dictionary/index.js",
|
10
12
|
"./backend/environment": "./src/backend/environment/index.js",
|
11
13
|
"./backend/express": "./src/backend/express/index.js",
|
12
14
|
"./backend/message-broker": "./src/backend/message-broker/index.js"
|
@@ -1,2 +1,2 @@
|
|
1
1
|
import * as mongoose from 'mongoose';
|
2
|
-
export declare const
|
2
|
+
export declare const getErrorLogModel: () => mongoose.Model<any, {}, {}, {}, any, any>;
|
@@ -1,5 +1,7 @@
|
|
1
1
|
import * as mongoose from 'mongoose';
|
2
|
-
const
|
3
|
-
|
4
|
-
|
5
|
-
|
2
|
+
export const getErrorLogModel = () => {
|
3
|
+
const ErrorLogSchema = new mongoose.Schema({
|
4
|
+
customError: { type: mongoose.Schema.Types.Mixed },
|
5
|
+
}, { timestamps: true, versionKey: false });
|
6
|
+
return mongoose.models?.errorLogs || mongoose.model('errorLogs', ErrorLogSchema);
|
7
|
+
};
|
@@ -1,2 +1,2 @@
|
|
1
1
|
import * as mongoose from 'mongoose';
|
2
|
-
export declare const
|
2
|
+
export declare const getTranslationLogModel: () => mongoose.Model<any, {}, {}, {}, any, any>;
|
@@ -1,7 +1,9 @@
|
|
1
1
|
import * as mongoose from 'mongoose';
|
2
|
-
const
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
2
|
+
export const getTranslationLogModel = () => {
|
3
|
+
const TranslationSchema = new mongoose.Schema({
|
4
|
+
id: { type: String },
|
5
|
+
en: { type: String },
|
6
|
+
hu: { type: String },
|
7
|
+
}, { timestamps: true, versionKey: false });
|
8
|
+
return mongoose.models?.translations || mongoose.model('translations', TranslationSchema);
|
9
|
+
};
|
@@ -1,10 +1,10 @@
|
|
1
1
|
import { customErrorWorker } from '../../../../../error/index.js';
|
2
|
-
import {
|
2
|
+
import { getErrorLogModel } from '../../../model/error-log/index.js';
|
3
3
|
export const createErrorLog = async (customError) => {
|
4
4
|
let data;
|
5
5
|
const { composeCustomError } = customErrorWorker({ customError });
|
6
6
|
try {
|
7
|
-
data = await
|
7
|
+
data = await getErrorLogModel().create({ customError });
|
8
8
|
}
|
9
9
|
catch (err) {
|
10
10
|
return composeCustomError('Create error log failed', { err });
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { customErrorWorker } from '../../../../../error/index.js';
|
2
|
-
import {
|
2
|
+
import { getTranslationLogModel } from '../../../model/translation/index.js';
|
3
3
|
export const getTranslations = async (ids) => {
|
4
4
|
let query = {};
|
5
5
|
const _customErrorWorker = customErrorWorker({ ids });
|
@@ -10,7 +10,7 @@ export const getTranslations = async (ids) => {
|
|
10
10
|
}
|
11
11
|
let resp;
|
12
12
|
try {
|
13
|
-
resp = await
|
13
|
+
resp = await getTranslationLogModel().find(query);
|
14
14
|
}
|
15
15
|
catch (err) {
|
16
16
|
return _customErrorWorker.composeCustomError('Get translations failed', { err, query });
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { customErrorWorker } from '../../../../../error/index.js';
|
2
|
-
import {
|
2
|
+
import { getTranslationLogModel } from '../../../model/translation/index.js';
|
3
3
|
export const getTranslationsAsDictionary = async (language, ids) => {
|
4
4
|
const aggregates = [];
|
5
5
|
const _customErrorWorker = customErrorWorker({ ids, language });
|
@@ -40,7 +40,7 @@ export const getTranslationsAsDictionary = async (language, ids) => {
|
|
40
40
|
]);
|
41
41
|
let data;
|
42
42
|
try {
|
43
|
-
data = await
|
43
|
+
data = await getTranslationLogModel().aggregate(aggregates);
|
44
44
|
}
|
45
45
|
catch (err) {
|
46
46
|
return _customErrorWorker.composeCustomError('Get translations failed', { err });
|
package/src/backend/index.d.ts
DELETED
package/src/backend/index.js
DELETED