chatbot-nc 2.0.8 → 2.0.10

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,6 +1,7 @@
1
1
  import Hashids from 'hashids';
2
- export default class HashService {
2
+ export declare class HashService {
3
+ hashIds: Hashids;
3
4
  constructor();
4
5
  getHashedDataString(value: string): Promise<string>;
5
- hashIds(): Promise<Hashids>;
6
+ private getHashIds;
6
7
  }
@@ -12,29 +12,32 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
12
12
  return (mod && mod.__esModule) ? mod : { "default": mod };
13
13
  };
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.HashService = void 0;
15
16
  const node_crypto_1 = require("node:crypto");
16
17
  const AWSSSM_1 = require("../aws/services/AWSSSM");
17
18
  const SSMParameters_1 = require("../config/SSMParameters");
18
19
  const hashids_1 = __importDefault(require("hashids"));
19
20
  class HashService {
20
21
  constructor() {
22
+ this.hashIds = new hashids_1.default();
23
+ console.log("hashId", this.hashIds);
24
+ (() => __awaiter(this, void 0, void 0, function* () {
25
+ yield this.getHashIds();
26
+ }))();
21
27
  }
22
28
  getHashedDataString(value) {
23
29
  return __awaiter(this, void 0, void 0, function* () {
24
- try {
25
- return (0, node_crypto_1.createHash)('sha256').update(value, 'utf8').digest('base64');
26
- ;
27
- }
28
- catch (error) {
29
- throw error;
30
- }
30
+ return (0, node_crypto_1.createHash)('sha256').update(value, 'utf8').digest('base64');
31
+ ;
31
32
  });
32
33
  }
33
- hashIds() {
34
+ getHashIds() {
34
35
  return __awaiter(this, void 0, void 0, function* () {
35
36
  try {
36
37
  let config = yield AWSSSM_1.SSM.getSSMParameter(SSMParameters_1.ssmParameter.idObfuscationSSM);
37
- return new hashids_1.default(config.Salt, config.MinHashLength);
38
+ console.log("config", config);
39
+ this.hashIds = yield new hashids_1.default(config.Salt, +config.MinHashLength);
40
+ return;
38
41
  }
39
42
  catch (error) {
40
43
  throw error;
@@ -42,5 +45,5 @@ class HashService {
42
45
  });
43
46
  }
44
47
  }
45
- exports.default = HashService;
48
+ exports.HashService = HashService;
46
49
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../hashing/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,6CAA0C;AAC1C,mDAA4C;AAC5C,2DAAuD;AACvD,sDAA8B;AAE9B,MAAqB,WAAW;IAC5B;IACA,CAAC;IAEK,mBAAmB,CAAC,KAAa;;YAEnC,IAAI;gBACD,OAAO,IAAA,wBAAU,EAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;gBAAA,CAAC;aACtE;YAAC,OAAO,KAAK,EAAE;gBACZ,MAAM,KAAK,CAAC;aACf;QACL,CAAC;KAAA;IAEK,OAAO;;YAET,IAAI;gBACA,IAAI,MAAM,GAAG,MAAM,YAAG,CAAC,eAAe,CAAC,4BAAY,CAAC,gBAAgB,CAAC,CAAC;gBACtE,OAAO,IAAI,iBAAO,CAAC,MAAM,CAAC,IAAI,EAAC,MAAM,CAAC,aAAa,CAAC,CAAA;aACvD;YAAC,OAAO,KAAK,EAAE;gBACZ,MAAM,KAAK,CAAC;aACf;QACL,CAAC;KAAA;CACJ;AAtBD,8BAsBC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../hashing/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,6CAAyC;AACzC,mDAA4C;AAC5C,2DAAuD;AACvD,sDAA8B;AAE9B,MAAa,WAAW;IAGpB;QAFO,YAAO,GAAY,IAAI,iBAAO,EAAE,CAAC;QAGpC,OAAO,CAAC,GAAG,CAAC,QAAQ,EAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACnC,CAAC,GAAQ,EAAE;YACP,MAAM,IAAI,CAAC,UAAU,EAAE,CAAC;QAC5B,CAAC,CAAA,CAAC,EAAE,CAAC;IACT,CAAC;IAEK,mBAAmB,CAAC,KAAa;;YAEnC,OAAO,IAAA,wBAAU,EAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;YAAA,CAAC;QACxE,CAAC;KAAA;IAEa,UAAU;;YACpB,IAAI;gBACA,IAAI,MAAM,GAAG,MAAM,YAAG,CAAC,eAAe,CAAC,4BAAY,CAAC,gBAAgB,CAAC,CAAC;gBACtE,OAAO,CAAC,GAAG,CAAC,QAAQ,EAAC,MAAM,CAAC,CAAC;gBAC7B,IAAI,CAAC,OAAO,GAAG,MAAM,IAAI,iBAAO,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC;gBACrE,OAAM;aACT;YAAC,OAAO,KAAK,EAAE;gBACZ,MAAM,KAAK,CAAC;aACf;QACL,CAAC;KAAA;CAEJ;AA1BD,kCA0BC"}
@@ -4,7 +4,7 @@ import * as ENUM from "./enum";
4
4
  import WebHookEvent from "./webbookEvent";
5
5
  import BaseDynamoDBRepository from "./repository/dynamodb";
6
6
  import BaseCommunicationService from "./communication";
7
- import HashService from "./hashing";
7
+ import { HashService } from "./hashing";
8
8
  import UrlService from "./shortner";
9
9
  import { Utils } from "./utils";
10
10
  export { AWS, axios, ENUM, Utils, BaseCommunicationService, WebHookEvent, BaseDynamoDBRepository, HashService, UrlService };
package/dist/cjs/index.js CHANGED
@@ -39,8 +39,8 @@ const dynamodb_1 = __importDefault(require("./repository/dynamodb"));
39
39
  exports.BaseDynamoDBRepository = dynamodb_1.default;
40
40
  const communication_1 = __importDefault(require("./communication"));
41
41
  exports.BaseCommunicationService = communication_1.default;
42
- const hashing_1 = __importDefault(require("./hashing"));
43
- exports.HashService = hashing_1.default;
42
+ const hashing_1 = require("./hashing");
43
+ Object.defineProperty(exports, "HashService", { enumerable: true, get: function () { return hashing_1.HashService; } });
44
44
  const shortner_1 = __importDefault(require("./shortner"));
45
45
  exports.UrlService = shortner_1.default;
46
46
  const utils_1 = require("./utils");
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+BAA4B;AAWzB,oFAXM,SAAG,OAWN;AAVN,kDAAyB;AAWtB,gBAXI,eAAK,CAWJ;AAVR,6CAA+B;AAW5B,oBAAI;AAVP,kEAA0C;AAavC,uBAbI,sBAAY,CAaJ;AAZf,qEAA2D;AAaxD,iCAbI,kBAAsB,CAaJ;AAZzB,oEAAuD;AAUpD,mCAVI,uBAAwB,CAUJ;AAT3B,wDAAoC;AAYjC,sBAZI,iBAAW,CAYJ;AAXd,0DAAoC;AAYjC,qBAZI,kBAAU,CAYJ;AAXb,mCAAgC;AAM7B,sFANM,aAAK,OAMN"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+BAA4B;AAWzB,oFAXM,SAAG,OAWN;AAVN,kDAAyB;AAWtB,gBAXI,eAAK,CAWJ;AAVR,6CAA+B;AAW5B,oBAAI;AAVP,kEAA0C;AAavC,uBAbI,sBAAY,CAaJ;AAZf,qEAA2D;AAaxD,iCAbI,kBAAsB,CAaJ;AAZzB,oEAAuD;AAUpD,mCAVI,uBAAwB,CAUJ;AAT3B,uCAAwC;AAYrC,4FAZM,qBAAW,OAYN;AAXd,0DAAoC;AAYjC,qBAZI,kBAAU,CAYJ;AAXb,mCAAgC;AAM7B,sFANM,aAAK,OAMN"}
@@ -1,6 +1,7 @@
1
1
  import Hashids from 'hashids';
2
- export default class HashService {
2
+ export declare class HashService {
3
+ hashIds: Hashids;
3
4
  constructor();
4
5
  getHashedDataString(value: string): Promise<string>;
5
- hashIds(): Promise<Hashids>;
6
+ private getHashIds;
6
7
  }
@@ -11,25 +11,27 @@ import { createHash } from 'node:crypto';
11
11
  import { SSM } from "../aws/services/AWSSSM";
12
12
  import { ssmParameter } from '../config/SSMParameters';
13
13
  import Hashids from 'hashids';
14
- export default class HashService {
14
+ export class HashService {
15
15
  constructor() {
16
+ this.hashIds = new Hashids();
17
+ console.log("hashId", this.hashIds);
18
+ (() => __awaiter(this, void 0, void 0, function* () {
19
+ yield this.getHashIds();
20
+ }))();
16
21
  }
17
22
  getHashedDataString(value) {
18
23
  return __awaiter(this, void 0, void 0, function* () {
19
- try {
20
- return createHash('sha256').update(value, 'utf8').digest('base64');
21
- ;
22
- }
23
- catch (error) {
24
- throw error;
25
- }
24
+ return createHash('sha256').update(value, 'utf8').digest('base64');
25
+ ;
26
26
  });
27
27
  }
28
- hashIds() {
28
+ getHashIds() {
29
29
  return __awaiter(this, void 0, void 0, function* () {
30
30
  try {
31
31
  let config = yield SSM.getSSMParameter(ssmParameter.idObfuscationSSM);
32
- return new Hashids(config.Salt, config.MinHashLength);
32
+ console.log("config", config);
33
+ this.hashIds = yield new Hashids(config.Salt, +config.MinHashLength);
34
+ return;
33
35
  }
34
36
  catch (error) {
35
37
  throw error;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../hashing/index.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,UAAU,EAAG,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,GAAG,EAAE,MAAM,wBAAwB,CAAA;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,OAAO,MAAM,SAAS,CAAC;AAE9B,MAAM,CAAC,OAAO,OAAO,WAAW;IAC5B;IACA,CAAC;IAEK,mBAAmB,CAAC,KAAa;;YAEnC,IAAI;gBACD,OAAO,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;gBAAA,CAAC;aACtE;YAAC,OAAO,KAAK,EAAE;gBACZ,MAAM,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AI,OAAO,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC;gBACrE,OAAM;aACT;YAAC,OAAO,KAAK,EAAE;gBACZ,MAAM,KAAK,CAAC;aACf;QACL,CAAC;KAAA;CAEJ"}
@@ -4,7 +4,7 @@ import * as ENUM from "./enum";
4
4
  import WebHookEvent from "./webbookEvent";
5
5
  import BaseDynamoDBRepository from "./repository/dynamodb";
6
6
  import BaseCommunicationService from "./communication";
7
- import HashService from "./hashing";
7
+ import { HashService } from "./hashing";
8
8
  import UrlService from "./shortner";
9
9
  import { Utils } from "./utils";
10
10
  export { AWS, axios, ENUM, Utils, BaseCommunicationService, WebHookEvent, BaseDynamoDBRepository, HashService, UrlService };
package/dist/esm/index.js CHANGED
@@ -4,7 +4,7 @@ import * as ENUM from "./enum";
4
4
  import WebHookEvent from "./webbookEvent";
5
5
  import BaseDynamoDBRepository from "./repository/dynamodb";
6
6
  import BaseCommunicationService from "./communication";
7
- import HashService from "./hashing";
7
+ import { HashService } from "./hashing";
8
8
  import UrlService from "./shortner";
9
9
  import { Utils } from "./utils";
10
10
  export { AWS, axios, ENUM, Utils, BaseCommunicationService, WebHookEvent, BaseDynamoDBRepository, HashService, UrlService };
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAC5B,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,KAAK,IAAI,MAAM,QAAQ,CAAC;AAC/B,OAAO,YAAY,MAAM,gBAAgB,CAAC;AAC1C,OAAO,sBAAsB,MAAM,uBAAuB,CAAC;AAC3D,OAAO,wBAAwB,MAAM,iBAAiB,CAAC;AACvD,OAAO,WAAW,MAAM,WAAW,CAAC;AACpC,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAEhC,OAAO,EACJ,GAAG,EACH,KAAK,EACL,IAAI,EACJ,KAAK,EACL,wBAAwB,EACxB,YAAY,EACZ,sBAAsB,EACtB,WAAW,EACX,UAAU,EACZ,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAC5B,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,KAAK,IAAI,MAAM,QAAQ,CAAC;AAC/B,OAAO,YAAY,MAAM,gBAAgB,CAAC;AAC1C,OAAO,sBAAsB,MAAM,uBAAuB,CAAC;AAC3D,OAAO,wBAAwB,MAAM,iBAAiB,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAEhC,OAAO,EACJ,GAAG,EACH,KAAK,EACL,IAAI,EACJ,KAAK,EACL,wBAAwB,EACxB,YAAY,EACZ,sBAAsB,EACtB,WAAW,EACX,UAAU,EACZ,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "chatbot-nc",
3
- "version": "2.0.8",
3
+ "version": "2.0.10",
4
4
  "description": "",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",