badmfck-api-server 3.9.3 → 3.9.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.
- package/dist/apiServer/APIService.js +1 -1
- package/dist/apiServer/helper/JSONStableStringify.d.ts +1 -0
- package/dist/apiServer/helper/JSONStableStringify.js +16 -0
- package/dist/apiServer/structures/DefaultErrors.d.ts +3 -0
- package/dist/apiServer/structures/DefaultErrors.js +3 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.js +3 -1
- package/package.json +1 -1
@@ -0,0 +1 @@
|
|
1
|
+
export declare function JSONStableStringify(obj: any): string;
|
@@ -0,0 +1,16 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.JSONStableStringify = void 0;
|
4
|
+
function JSONStableStringify(obj) {
|
5
|
+
if (obj === null || typeof obj !== "object") {
|
6
|
+
return JSON.stringify(obj);
|
7
|
+
}
|
8
|
+
if (Array.isArray(obj)) {
|
9
|
+
return "[" + obj.map(JSONStableStringify).join(",") + "]";
|
10
|
+
}
|
11
|
+
const keys = Object.keys(obj).sort();
|
12
|
+
return ("{" +
|
13
|
+
keys.map(k => JSON.stringify(k) + ":" + JSONStableStringify(obj[k])).join(",") +
|
14
|
+
"}");
|
15
|
+
}
|
16
|
+
exports.JSONStableStringify = JSONStableStringify;
|
@@ -15,6 +15,9 @@ declare class DefaultErrors {
|
|
15
15
|
static FORBIDDEN: IError;
|
16
16
|
static NOT_FOUND: IError;
|
17
17
|
static INTERNAL_SERVER_ERROR: IError;
|
18
|
+
static EXTERNAL_SERVICE_ERROR: IError;
|
19
|
+
static MAINTENANCE_MODE: IError;
|
20
|
+
static CONFLICT: IError;
|
18
21
|
static INVALID_TOKEN: IError;
|
19
22
|
static INVALID_CREDENTIALS: IError;
|
20
23
|
static INVALID_DATA: IError;
|
@@ -18,6 +18,9 @@ class DefaultErrors {
|
|
18
18
|
static FORBIDDEN = { code: 12, message: "Forbidden", httpStatus: 403 };
|
19
19
|
static NOT_FOUND = { code: 13, message: "Not found", httpStatus: 404 };
|
20
20
|
static INTERNAL_SERVER_ERROR = { code: 14, message: "Internal server error.", httpStatus: 500 };
|
21
|
+
static EXTERNAL_SERVICE_ERROR = { code: 19, message: "External service error", httpStatus: 502 };
|
22
|
+
static MAINTENANCE_MODE = { code: 21, message: "Service in maintenance mode", httpStatus: 503 };
|
23
|
+
static CONFLICT = { code: 22, message: "Conflict", httpStatus: 409 };
|
21
24
|
static INVALID_TOKEN = { code: 15, message: "Invalid token", httpStatus: 401 };
|
22
25
|
static INVALID_CREDENTIALS = { code: 16, message: "Invalid credentials", httpStatus: 401 };
|
23
26
|
static INVALID_DATA = { code: 17, message: "Invalid data", httpStatus: 422 };
|
package/dist/index.d.ts
CHANGED
@@ -11,4 +11,5 @@ import { ExternalService } from "./apiServer/external/ExternalService";
|
|
11
11
|
import { DBService } from "./apiServer/DBService";
|
12
12
|
import { YYYYMMDDHH } from "./apiServer/helper/YYYYMMDDHH";
|
13
13
|
import { TimeframeService } from "./apiServer/TimeframeService";
|
14
|
-
|
14
|
+
import { JSONStableStringify } from "./apiServer/helper/JSONStableStringify";
|
15
|
+
export { UID, YYYYMMDDHH, JSONStableStringify, APIService, Initializer, LocalRequest, ValidationModel, MysqlService, TimeframeService, Validator, LogService, DataProvider, ErrorUtils, ExternalService, DBService, S_MONITOR_REGISTRATE_ACTION };
|
package/dist/index.js
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.S_MONITOR_REGISTRATE_ACTION = exports.DBService = exports.ExternalService = exports.ErrorUtils = exports.DataProvider = exports.LogService = exports.Validator = exports.TimeframeService = exports.MysqlService = exports.LocalRequest = exports.Initializer = exports.APIService = exports.YYYYMMDDHH = exports.UID = void 0;
|
3
|
+
exports.S_MONITOR_REGISTRATE_ACTION = exports.DBService = exports.ExternalService = exports.ErrorUtils = exports.DataProvider = exports.LogService = exports.Validator = exports.TimeframeService = exports.MysqlService = exports.LocalRequest = exports.Initializer = exports.APIService = exports.JSONStableStringify = exports.YYYYMMDDHH = exports.UID = void 0;
|
4
4
|
const APIService_1 = require("./apiServer/APIService");
|
5
5
|
Object.defineProperty(exports, "APIService", { enumerable: true, get: function () { return APIService_1.APIService; } });
|
6
6
|
Object.defineProperty(exports, "Initializer", { enumerable: true, get: function () { return APIService_1.Initializer; } });
|
@@ -28,3 +28,5 @@ const YYYYMMDDHH_1 = require("./apiServer/helper/YYYYMMDDHH");
|
|
28
28
|
Object.defineProperty(exports, "YYYYMMDDHH", { enumerable: true, get: function () { return YYYYMMDDHH_1.YYYYMMDDHH; } });
|
29
29
|
const TimeframeService_1 = require("./apiServer/TimeframeService");
|
30
30
|
Object.defineProperty(exports, "TimeframeService", { enumerable: true, get: function () { return TimeframeService_1.TimeframeService; } });
|
31
|
+
const JSONStableStringify_1 = require("./apiServer/helper/JSONStableStringify");
|
32
|
+
Object.defineProperty(exports, "JSONStableStringify", { enumerable: true, get: function () { return JSONStableStringify_1.JSONStableStringify; } });
|