blixify-server 0.1.74 → 0.1.75

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.
@@ -1 +1 @@
1
- {"version":3,"file":"crypto.d.ts","sourceRoot":"","sources":["../../src/apis/crypto.ts"],"names":[],"mappings":"AAEA,qBAAa,gBAAgB;IAC3B,SAAS,SAAM;IACf,eAAe,UAAS;gBAEZ,SAAS,EAAE,MAAM,EAAE,eAAe,EAAE,OAAO;IAKvD,gBAAgB,SAAU,MAAM,SAiB9B;IAEF,IAAI,UAGsC,GAAG,OAAO,GAAG,SAAS,GAAG;CAqBpE"}
1
+ {"version":3,"file":"crypto.d.ts","sourceRoot":"","sources":["../../src/apis/crypto.ts"],"names":[],"mappings":"AACA,qBAAa,gBAAgB;IAC3B,SAAS,SAAM;IACf,eAAe,UAAS;gBAEZ,SAAS,EAAE,MAAM,EAAE,eAAe,EAAE,OAAO;IAKvD,gBAAgB,SAAU,MAAM,SAoB9B;IAEF,IAAI,UAGsC,GAAG,OAAO,GAAG,SAAS,GAAG;CAqBpE"}
@@ -1,31 +1,28 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
2
  Object.defineProperty(exports, "__esModule", { value: true });
6
3
  exports.CryptoMiddleware = void 0;
7
4
  const CryptoJS = require("crypto-js");
8
- const moment_timezone_1 = __importDefault(require("moment-timezone"));
9
5
  class CryptoMiddleware {
10
6
  constructor(secretKey, forceDecryption) {
11
7
  this.secretKey = "";
12
8
  this.forceDecryption = false;
13
9
  this.handleDecryption = (data) => {
14
- // Decrypt the data
10
+ //INFO : Decrypt the data
15
11
  const bytes = CryptoJS.AES.decrypt(data, this.secretKey);
16
12
  const decrypted = JSON.parse(bytes.toString(CryptoJS.enc.Utf8));
17
13
  if (decrypted) {
18
14
  if (decrypted.baseSignDate) {
19
- const tolerance = moment_timezone_1.default.duration(1, "minute");
20
- const startWindow = (0, moment_timezone_1.default)(decrypted.baseSignDate).utc();
21
- const endWindow = startWindow.clone().add(tolerance);
22
- const currentUTCDate = (0, moment_timezone_1.default)().utc();
23
- if (currentUTCDate.isBetween(startWindow, endWindow)) {
24
- delete decrypted["baseSignDate"];
25
- return decrypted;
26
- }
27
- else
28
- throw "Error";
15
+ //TODO : Add date timing
16
+ delete decrypted["baseSignDate"];
17
+ return decrypted;
18
+ // const tolerance = moment.duration(1, "minute");
19
+ // const startWindow = moment(decrypted.baseSignDate).utc();
20
+ // const endWindow = startWindow.clone().add(tolerance);
21
+ // const currentUTCDate = moment().utc();
22
+ // if (currentUTCDate.isBetween(startWindow, endWindow)) {
23
+ // delete decrypted["baseSignDate"];
24
+ // return decrypted;
25
+ // } else throw "Error";
29
26
  }
30
27
  else
31
28
  throw "Error";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "blixify-server",
3
- "version": "0.1.74",
3
+ "version": "0.1.75",
4
4
  "license": "MIT",
5
5
  "main": "dist/apis/index.js",
6
6
  "private": false,