badmfck-api-server 1.5.0 → 1.5.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -43,7 +43,7 @@ async function Initializer(services) {
43
43
  exports.Initializer = Initializer;
44
44
  class APIService extends BaseService_1.BaseService {
45
45
  static nextLogID = 0;
46
- version = "1.5.0";
46
+ version = "1.5.2";
47
47
  options;
48
48
  netLog = [];
49
49
  constructor(options) {
@@ -141,7 +141,7 @@ class APIService extends BaseService_1.BaseService {
141
141
  let interceptorResult;
142
142
  if (this.options.interceptor) {
143
143
  interceptorResult = await this.options.interceptor.execute(httpRequest);
144
- if (interceptorResult.error) {
144
+ if (interceptorResult.error && !j.allowInterceptorError) {
145
145
  this.sendResponse(res, interceptorResult, tme, ep, log);
146
146
  return;
147
147
  }
@@ -10,6 +10,7 @@ export interface IEndpointHandler {
10
10
  handler?: (req: HTTPRequestVO) => Promise<TransferPacketVO<any>>;
11
11
  ignoreInterceptor?: boolean;
12
12
  independed?: boolean;
13
+ allowInterceptorError?: boolean;
13
14
  }
14
15
  export declare class BaseEndpoint implements IBaseEndpoint {
15
16
  endpoints?: IEndpointHandler[];
@@ -21,7 +21,7 @@ class Validator {
21
21
  return true;
22
22
  }
23
23
  static validateValue(value, opt) {
24
- if (!value)
24
+ if (value === undefined || value === null)
25
25
  return ValidationReport.VALUE_IS_NULL;
26
26
  if (!opt)
27
27
  return ValidationReport.OK;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "badmfck-api-server",
3
- "version": "1.5.0",
3
+ "version": "1.5.2",
4
4
  "description": "Simple API http server based on express",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",