axe-api 0.31.3 → 0.31.4

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.
@@ -47,5 +47,5 @@ exports.default = (pack) => __awaiter(void 0, void 0, void 0, function* () {
47
47
  yield query.delete();
48
48
  }
49
49
  yield (0, Helpers_1.callHooks)(model, Enums_1.HookFunctionTypes.onAfterDelete, Object.assign(Object.assign({}, pack), { item }));
50
- return res.json();
50
+ return res.status(204).json();
51
51
  });
@@ -41,5 +41,5 @@ exports.default = (pack) => __awaiter(void 0, void 0, void 0, function* () {
41
41
  item }));
42
42
  yield query.delete();
43
43
  yield (0, Helpers_1.callHooks)(model, Enums_1.HookFunctionTypes.onAfterForceDelete, Object.assign(Object.assign({}, pack), { item }));
44
- return res.json();
44
+ return res.status(204).json();
45
45
  });
@@ -67,7 +67,8 @@ exports.getParentColumn = getParentColumn;
67
67
  const checkPrimaryKeyValueType = (model, value) => {
68
68
  // We should check the parameter type
69
69
  const primaryColumn = model.columns.find((column) => column.name === model.instance.primaryKey);
70
- if ((primaryColumn === null || primaryColumn === void 0 ? void 0 : primaryColumn.data_type) === "integer" && isNaN(parseInt(value))) {
70
+ if (constants_1.NUMERIC_PRIMARY_KEY_TYPES.includes((primaryColumn === null || primaryColumn === void 0 ? void 0 : primaryColumn.data_type) || "") &&
71
+ isNaN(parseInt(value))) {
71
72
  throw new ApiError_1.default(`Unacceptable parameter: ${value}`);
72
73
  }
73
74
  };
@@ -326,14 +326,6 @@ class QueryService {
326
326
  this.applySpecialCondition(where, "$between", Enums_1.ConditionTypes.Between);
327
327
  this.applySpecialCondition(where, "$notBetween", Enums_1.ConditionTypes.NotBetween);
328
328
  }
329
- if (where.condition === Enums_1.ConditionTypes.In ||
330
- where.condition === Enums_1.ConditionTypes.NotIn) {
331
- where.value = where.value.split(",");
332
- }
333
- if (where.condition === Enums_1.ConditionTypes.Between ||
334
- where.condition === Enums_1.ConditionTypes.NotBetween) {
335
- where.value = where.value.split(":");
336
- }
337
329
  if (where.condition === Enums_1.ConditionTypes.LIKE ||
338
330
  where.condition === Enums_1.ConditionTypes["NOT LIKE"]) {
339
331
  where.value = where.value.replace(/\*/g, "%");
@@ -27,3 +27,4 @@ export declare const API_ROUTE_TEMPLATES: {
27
27
  export declare const ConditionQueryFeatureMap: Record<ConditionTypes, QueryFeature>;
28
28
  export declare const RelationQueryFeatureMap: Record<Relationships, QueryFeature>;
29
29
  export declare const DEFAULT_VERSION_CONFIG: IVersionConfig;
30
+ export declare const NUMERIC_PRIMARY_KEY_TYPES: string[];
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DEFAULT_VERSION_CONFIG = exports.RelationQueryFeatureMap = exports.ConditionQueryFeatureMap = exports.API_ROUTE_TEMPLATES = exports.DEFAULT_METHODS_OF_MODELS = exports.DEFAULT_HANDLERS = exports.RESERVED_KEYWORDS = exports.LOG_COLORS = void 0;
3
+ exports.NUMERIC_PRIMARY_KEY_TYPES = exports.DEFAULT_VERSION_CONFIG = exports.RelationQueryFeatureMap = exports.ConditionQueryFeatureMap = exports.API_ROUTE_TEMPLATES = exports.DEFAULT_METHODS_OF_MODELS = exports.DEFAULT_HANDLERS = exports.RESERVED_KEYWORDS = exports.LOG_COLORS = void 0;
4
4
  const Enums_1 = require("./Enums");
5
5
  const LimitService_1 = require("./Services/LimitService");
6
6
  exports.LOG_COLORS = {
@@ -115,3 +115,4 @@ exports.DEFAULT_VERSION_CONFIG = {
115
115
  },
116
116
  },
117
117
  };
118
+ exports.NUMERIC_PRIMARY_KEY_TYPES = ["integer", "bigint"];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "axe-api",
3
- "version": "0.31.3",
3
+ "version": "0.31.4",
4
4
  "description": "AXE API is a simple tool which has been created based on Express and Knex.js to create Rest APIs quickly.",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",
@@ -39,8 +39,11 @@
39
39
  "lint:watch": "esw --watch --color",
40
40
  "prepare:integration": "nodemon --ignore \"./tests/**\" ./scripts/run-integration-test.js",
41
41
  "test:postgres": "sh ./scripts/test-postgres.sh",
42
+ "test:cockroach": "sh ./scripts/test-cockroach.sh",
42
43
  "test:mysql57": "sh ./scripts/test-mysql57.sh",
43
44
  "test:mysql8": "sh ./scripts/test-mysql8.sh",
45
+ "test:mariadb": "sh ./scripts/test-mariadb.sh",
46
+ "test:sqlite": "sh ./scripts/test-sqlite.sh",
44
47
  "prettier:check": "prettier --check .",
45
48
  "prepare": "husky install"
46
49
  },