badmfck-api-server 1.9.9 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -56,7 +56,7 @@ export declare class MysqlService extends BaseService {
56
56
  init(): Promise<void>;
57
57
  recreatePool(): Promise<void>;
58
58
  onApplicationReady(): Promise<void>;
59
- static fieldsToObject(fields: MysqlQueryField[] | MysqlQueryFieldObject): MysqlQueryFieldObject;
59
+ static fieldsToObject(fields: MysqlQueryField[] | MysqlQueryFieldObject, ignoreSystemParameters?: boolean): MysqlQueryFieldObject;
60
60
  static objectToFields(obj: MysqlQueryFieldObject | MysqlQueryField[]): MysqlQueryField[];
61
61
  static prepareQuery(query: string, fields: MysqlQueryField[] | MysqlQueryFieldObject): string;
62
62
  static prepareQueryFieldValue(value: string | number | boolean | null | undefined, system?: boolean): string | number | boolean | null | undefined;
@@ -88,7 +88,7 @@ class MysqlService extends BaseService_1.BaseService {
88
88
  }
89
89
  }
90
90
  async onApplicationReady() { }
91
- static fieldsToObject(fields) {
91
+ static fieldsToObject(fields, ignoreSystemParameters) {
92
92
  if (!Array.isArray(fields))
93
93
  return fields;
94
94
  const obj = {};
@@ -98,13 +98,17 @@ class MysqlService extends BaseService_1.BaseService {
98
98
  if (typeof i.value !== "object")
99
99
  obj[i.name] = i.value;
100
100
  else {
101
- obj[i.name] = {
102
- value: i.value,
103
- system: i.system,
104
- ignoreInInsert: i.ignoreInInsert,
105
- ignoreInUpdate: i.ignoreInUpdate,
106
- useInReplace: i.useInReplace
107
- };
101
+ if (!ignoreSystemParameters) {
102
+ obj[i.name] = {
103
+ value: i.value,
104
+ system: i.system,
105
+ ignoreInInsert: i.ignoreInInsert,
106
+ ignoreInUpdate: i.ignoreInUpdate,
107
+ useInReplace: i.useInReplace
108
+ };
109
+ }
110
+ else
111
+ obj[i.name] = i.value;
108
112
  }
109
113
  }
110
114
  return obj;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "badmfck-api-server",
3
- "version": "1.9.9",
3
+ "version": "2.0.0",
4
4
  "description": "Simple API http server based on express",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",