badmfck-api-server 3.3.7 → 3.3.8
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.
@@ -95,7 +95,7 @@ async function Initializer(services) {
|
|
95
95
|
exports.Initializer = Initializer;
|
96
96
|
class APIService extends BaseService_1.BaseService {
|
97
97
|
static nextLogID = 0;
|
98
|
-
version = "3.3.
|
98
|
+
version = "3.3.8";
|
99
99
|
options;
|
100
100
|
monitor = null;
|
101
101
|
started = new Date();
|
@@ -42,7 +42,8 @@ class DBService extends BaseService_1.BaseService {
|
|
42
42
|
fatal: true,
|
43
43
|
sql: "",
|
44
44
|
name: "DB_NOT_FOUND",
|
45
|
-
message: "DB not found: " + req.dbid
|
45
|
+
message: "DB not found: " + req.dbid,
|
46
|
+
isDuplicateError: false
|
46
47
|
};
|
47
48
|
let result = [];
|
48
49
|
for (let i of req.bulk) {
|
@@ -68,7 +69,8 @@ class DBService extends BaseService_1.BaseService {
|
|
68
69
|
fatal: true,
|
69
70
|
sql: "START TRANSACTION",
|
70
71
|
name: "TRX_NOT_SUPPORTED",
|
71
|
-
message: "Transactions not supported on selected adapter"
|
72
|
+
message: "Transactions not supported on selected adapter",
|
73
|
+
isDuplicateError: false
|
72
74
|
}
|
73
75
|
};
|
74
76
|
};
|
@@ -88,7 +90,8 @@ class DBService extends BaseService_1.BaseService {
|
|
88
90
|
fatal: true,
|
89
91
|
sql: "COMMIT",
|
90
92
|
name: "TRX_NOT_SUPPORTED",
|
91
|
-
message: "Transactions not supported on selected adapter"
|
93
|
+
message: "Transactions not supported on selected adapter",
|
94
|
+
isDuplicateError: false
|
92
95
|
}
|
93
96
|
};
|
94
97
|
};
|
@@ -108,7 +111,8 @@ class DBService extends BaseService_1.BaseService {
|
|
108
111
|
fatal: true,
|
109
112
|
sql: "ROLLBACK",
|
110
113
|
name: "TRX_NOT_SUPPORTED",
|
111
|
-
message: "Transactions not supported on selected adapter"
|
114
|
+
message: "Transactions not supported on selected adapter",
|
115
|
+
isDuplicateError: false
|
112
116
|
}
|
113
117
|
};
|
114
118
|
};
|
@@ -125,7 +129,8 @@ class DBService extends BaseService_1.BaseService {
|
|
125
129
|
fatal: true,
|
126
130
|
sql: "",
|
127
131
|
name: "DB_NOT_FOUND",
|
128
|
-
message: "DB not found: " + req.dbid
|
132
|
+
message: "DB not found: " + req.dbid,
|
133
|
+
isDuplicateError: false
|
129
134
|
};
|
130
135
|
if (req.throwable)
|
131
136
|
throw error;
|
@@ -145,7 +150,8 @@ class DBService extends BaseService_1.BaseService {
|
|
145
150
|
fatal: true,
|
146
151
|
sql: "",
|
147
152
|
name: "DB_NOT_FOUND",
|
148
|
-
message: "DB not found: " + dbid
|
153
|
+
message: "DB not found: " + dbid,
|
154
|
+
isDuplicateError: false
|
149
155
|
};
|
150
156
|
return error;
|
151
157
|
}
|
@@ -168,7 +168,8 @@ class MysqlAdapter {
|
|
168
168
|
fatal: true,
|
169
169
|
sql: "START TRANSACTION",
|
170
170
|
name: "CONN_IN_TRX",
|
171
|
-
message: "Selected connection already in transaction"
|
171
|
+
message: "Selected connection already in transaction",
|
172
|
+
isDuplicateError: false
|
172
173
|
}
|
173
174
|
};
|
174
175
|
}
|
@@ -205,6 +206,7 @@ class MysqlAdapter {
|
|
205
206
|
sql: "",
|
206
207
|
name: "NO_TRX",
|
207
208
|
message: "Transaction not found",
|
209
|
+
isDuplicateError: false
|
208
210
|
}
|
209
211
|
};
|
210
212
|
}
|
@@ -227,7 +229,8 @@ class MysqlAdapter {
|
|
227
229
|
fatal: true,
|
228
230
|
sql: "",
|
229
231
|
name: "NO_TRX",
|
230
|
-
message: "Transaction not found"
|
232
|
+
message: "Transaction not found",
|
233
|
+
isDuplicateError: false
|
231
234
|
} };
|
232
235
|
}
|
233
236
|
await this.rollbackTransaction(trx);
|
@@ -282,6 +285,7 @@ class MysqlAdapter {
|
|
282
285
|
sql: "",
|
283
286
|
name: "NO_POOL",
|
284
287
|
message: "Mysql pool not created",
|
288
|
+
isDuplicateError: false
|
285
289
|
};
|
286
290
|
}
|
287
291
|
try {
|
@@ -313,6 +317,7 @@ class MysqlAdapter {
|
|
313
317
|
sql: "",
|
314
318
|
name: "NO_CONN",
|
315
319
|
message: "Mysql pool cant get connection",
|
320
|
+
isDuplicateError: false
|
316
321
|
};
|
317
322
|
}
|
318
323
|
async query(request, conn) {
|
@@ -525,7 +530,8 @@ class MysqlAdapter {
|
|
525
530
|
sql: err.sql,
|
526
531
|
name: err.name,
|
527
532
|
message: err.message,
|
528
|
-
fatal: false
|
533
|
+
fatal: false,
|
534
|
+
isDuplicateError: err.code === "ER_DUP_ENTRY"
|
529
535
|
};
|
530
536
|
}
|
531
537
|
else {
|
@@ -536,6 +542,7 @@ class MysqlAdapter {
|
|
536
542
|
sql: "no query",
|
537
543
|
name: "QUERY_ERR",
|
538
544
|
message: "Error: " + (err) ? err : "",
|
545
|
+
isDuplicateError: false
|
539
546
|
};
|
540
547
|
}
|
541
548
|
}
|
@@ -130,7 +130,7 @@ class Validator {
|
|
130
130
|
const regex = structure["$__" + i + "_regex"];
|
131
131
|
const reg = new RegExp(regex);
|
132
132
|
if (reg.test(object[i]) === false)
|
133
|
-
errors.push("wrong value for field '" + i + "', false mask for: " + object[i]);
|
133
|
+
errors.push("wrong value for field '" + i + "', false mask for: >" + object[i] + "<");
|
134
134
|
}
|
135
135
|
if (typeof structure[i] === "string" && (structure[i] === "@" || structure[i] === "email")) {
|
136
136
|
const value = object[i].toString().toLowerCase().trim();
|