badmfck-api-server 3.9.85 → 3.9.86

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.
@@ -93,7 +93,7 @@ async function Initializer(services) {
93
93
  }
94
94
  exports.Initializer = Initializer;
95
95
  class APIService extends BaseService_1.BaseService {
96
- version = "3.9.81";
96
+ version = "3.9.86";
97
97
  options;
98
98
  monitor = null;
99
99
  started = new Date();
@@ -0,0 +1,8 @@
1
+ /// <reference types="node" />
2
+ /// <reference types="node" />
3
+ export declare class ZipUtils {
4
+ static zipBufferToBase64: (input: Buffer) => string;
5
+ static unzipBase64ToBuffer: (base64: string) => Buffer;
6
+ static zipStringToBase64: (input: string) => string;
7
+ static unzipBase64ToString: (base64: string) => string;
8
+ }
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.ZipUtils = void 0;
7
+ const zlib_1 = __importDefault(require("zlib"));
8
+ class ZipUtils {
9
+ static zipBufferToBase64 = (input) => {
10
+ const compressed = zlib_1.default.gzipSync(input);
11
+ return compressed.toString("base64");
12
+ };
13
+ static unzipBase64ToBuffer = (base64) => {
14
+ const compressed = Buffer.from(base64, "base64");
15
+ return zlib_1.default.gunzipSync(compressed);
16
+ };
17
+ static zipStringToBase64 = (input) => {
18
+ const buffer = Buffer.from(input, "utf-8");
19
+ const compressed = zlib_1.default.gzipSync(buffer);
20
+ return compressed.toString("base64");
21
+ };
22
+ static unzipBase64ToString = (base64) => {
23
+ const compressed = Buffer.from(base64, "base64");
24
+ const uncompressed = zlib_1.default.gunzipSync(compressed);
25
+ return uncompressed.toString("utf-8");
26
+ };
27
+ }
28
+ exports.ZipUtils = ZipUtils;
@@ -0,0 +1,5 @@
1
+ import { IInterceptor } from "../APIService";
2
+ import { HTTPRequestVO } from "../structures/Interfaces";
3
+ export declare class IntHmacSha256 implements IInterceptor<any> {
4
+ intercept(req: HTTPRequestVO): Promise<any>;
5
+ }
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.IntHmacSha256 = void 0;
7
+ const DefaultErrors_1 = __importDefault(require("../structures/DefaultErrors"));
8
+ const _TAuthParams = {
9
+ v: 0,
10
+ ts: "",
11
+ nonce: "",
12
+ kid: "",
13
+ alg: "",
14
+ $__alg_optional: true,
15
+ sig: ""
16
+ };
17
+ class IntHmacSha256 {
18
+ async intercept(req) {
19
+ throw { ...DefaultErrors_1.default.UNAUTHORIZED, details: "Key not found" };
20
+ }
21
+ }
22
+ exports.IntHmacSha256 = IntHmacSha256;
package/dist/index.d.ts CHANGED
@@ -12,4 +12,5 @@ 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 };
15
+ import { ZipUtils } from "./apiServer/helper/ZipUtils";
16
+ export { ZipUtils, 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.JSONStableStringify = 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 = exports.ZipUtils = 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; } });
@@ -30,3 +30,5 @@ const TimeframeService_1 = require("./apiServer/TimeframeService");
30
30
  Object.defineProperty(exports, "TimeframeService", { enumerable: true, get: function () { return TimeframeService_1.TimeframeService; } });
31
31
  const JSONStableStringify_1 = require("./apiServer/helper/JSONStableStringify");
32
32
  Object.defineProperty(exports, "JSONStableStringify", { enumerable: true, get: function () { return JSONStableStringify_1.JSONStableStringify; } });
33
+ const ZipUtils_1 = require("./apiServer/helper/ZipUtils");
34
+ Object.defineProperty(exports, "ZipUtils", { enumerable: true, get: function () { return ZipUtils_1.ZipUtils; } });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "badmfck-api-server",
3
- "version": "3.9.85",
3
+ "version": "3.9.86",
4
4
  "description": "Simple API http server based on express",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",