badmfck-api-server 2.8.1 → 2.8.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -88,7 +88,7 @@ async function Initializer(services) {
88
88
  exports.Initializer = Initializer;
89
89
  class APIService extends BaseService_1.BaseService {
90
90
  static nextLogID = 0;
91
- version = "2.8.1";
91
+ version = "2.8.2";
92
92
  options;
93
93
  monitor;
94
94
  monitorIndexFile;
@@ -18,6 +18,7 @@ export interface IDBQuery {
18
18
  throwable?: boolean;
19
19
  transactionID?: number;
20
20
  calculateCount?: boolean;
21
+ parseQueryOnly?: boolean;
21
22
  }
22
23
  export interface IDBError {
23
24
  code: string;
@@ -155,6 +155,12 @@ class MysqlAdapter {
155
155
  }
156
156
  async query(request) {
157
157
  const query = this.prepareQuery(request);
158
+ if (request.parseQueryOnly) {
159
+ return {
160
+ data: [{ query }],
161
+ error: null,
162
+ };
163
+ }
158
164
  if (!this.pool) {
159
165
  (0, LogService_1.logError)("${MysqlAdapter.js}", "No pool created, can't execute query");
160
166
  const error = {
@@ -263,7 +269,7 @@ class MysqlAdapter {
263
269
  for (let i in fields) {
264
270
  const name = i;
265
271
  const value = fields[i];
266
- if (typeof value === "string")
272
+ if (typeof value === "string" || typeof value === "number" || typeof value === "boolean")
267
273
  fields[i] = { value: value, system: false };
268
274
  if (value === undefined)
269
275
  continue;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "badmfck-api-server",
3
- "version": "2.8.1",
3
+ "version": "2.8.2",
4
4
  "description": "Simple API http server based on express",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",