chatbot-nc 2.0.9 → 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
- import HashIdsService from "./hashids";
2
- declare class HashService {
1
+ import Hashids from 'hashids';
2
+ export declare class HashService {
3
+ hashIds: Hashids;
3
4
  constructor();
4
5
  getHashedDataString(value: string): Promise<string>;
6
+ private getHashIds;
5
7
  }
6
- export { HashService, HashIdsService };
@@ -12,12 +12,18 @@ 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.HashIdsService = exports.HashService = void 0;
15
+ exports.HashService = void 0;
16
16
  const node_crypto_1 = require("node:crypto");
17
- const hashids_1 = __importDefault(require("./hashids"));
18
- exports.HashIdsService = hashids_1.default;
17
+ const AWSSSM_1 = require("../aws/services/AWSSSM");
18
+ const SSMParameters_1 = require("../config/SSMParameters");
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* () {
@@ -25,6 +31,19 @@ class HashService {
25
31
  ;
26
32
  });
27
33
  }
34
+ getHashIds() {
35
+ return __awaiter(this, void 0, void 0, function* () {
36
+ try {
37
+ let config = yield AWSSSM_1.SSM.getSSMParameter(SSMParameters_1.ssmParameter.idObfuscationSSM);
38
+ console.log("config", config);
39
+ this.hashIds = yield new hashids_1.default(config.Salt, +config.MinHashLength);
40
+ return;
41
+ }
42
+ catch (error) {
43
+ throw error;
44
+ }
45
+ });
46
+ }
28
47
  }
29
48
  exports.HashService = HashService;
30
49
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../hashing/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,6CAAyC;AACzC,wDAAuC;AAgBnC,yBAhBG,iBAAc,CAgBH;AAdlB,MAAM,WAAW;IAEb;IACA,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;CAEJ;AAGG,kCAAW"}
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, HashIdsService } from "./hashing";
7
+ import { HashService } from "./hashing";
8
8
  import UrlService from "./shortner";
9
9
  import { Utils } from "./utils";
10
- export { AWS, axios, ENUM, Utils, BaseCommunicationService, WebHookEvent, BaseDynamoDBRepository, HashService, HashIdsService, UrlService };
10
+ export { AWS, axios, ENUM, Utils, BaseCommunicationService, WebHookEvent, BaseDynamoDBRepository, HashService, UrlService };
package/dist/cjs/index.js CHANGED
@@ -26,7 +26,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
26
26
  return (mod && mod.__esModule) ? mod : { "default": mod };
27
27
  };
28
28
  Object.defineProperty(exports, "__esModule", { value: true });
29
- exports.UrlService = exports.HashIdsService = exports.HashService = exports.BaseDynamoDBRepository = exports.WebHookEvent = exports.BaseCommunicationService = exports.Utils = exports.ENUM = exports.axios = exports.AWS = void 0;
29
+ exports.UrlService = exports.HashService = exports.BaseDynamoDBRepository = exports.WebHookEvent = exports.BaseCommunicationService = exports.Utils = exports.ENUM = exports.axios = exports.AWS = void 0;
30
30
  const aws_1 = require("./aws");
31
31
  Object.defineProperty(exports, "AWS", { enumerable: true, get: function () { return aws_1.AWS; } });
32
32
  const axios_1 = __importDefault(require("axios"));
@@ -41,7 +41,6 @@ const communication_1 = __importDefault(require("./communication"));
41
41
  exports.BaseCommunicationService = communication_1.default;
42
42
  const hashing_1 = require("./hashing");
43
43
  Object.defineProperty(exports, "HashService", { enumerable: true, get: function () { return hashing_1.HashService; } });
44
- Object.defineProperty(exports, "HashIdsService", { enumerable: true, get: function () { return hashing_1.HashIdsService; } });
45
44
  const shortner_1 = __importDefault(require("./shortner"));
46
45
  exports.UrlService = shortner_1.default;
47
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,uCAAwD;AAYrD,4FAZM,qBAAW,OAYN;AACX,+FAbmB,wBAAc,OAanB;AAZjB,0DAAoC;AAajC,qBAbI,kBAAU,CAaJ;AAZb,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
- import HashIdsService from "./hashids";
2
- declare class HashService {
1
+ import Hashids from 'hashids';
2
+ export declare class HashService {
3
+ hashIds: Hashids;
3
4
  constructor();
4
5
  getHashedDataString(value: string): Promise<string>;
6
+ private getHashIds;
5
7
  }
6
- export { HashService, HashIdsService };
@@ -8,9 +8,16 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
8
  });
9
9
  };
10
10
  import { createHash } from 'node:crypto';
11
- import HashIdsService from "./hashids";
12
- class HashService {
11
+ import { SSM } from "../aws/services/AWSSSM";
12
+ import { ssmParameter } from '../config/SSMParameters';
13
+ import Hashids from 'hashids';
14
+ export class HashService {
13
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
+ }))();
14
21
  }
15
22
  getHashedDataString(value) {
16
23
  return __awaiter(this, void 0, void 0, function* () {
@@ -18,6 +25,18 @@ class HashService {
18
25
  ;
19
26
  });
20
27
  }
28
+ getHashIds() {
29
+ return __awaiter(this, void 0, void 0, function* () {
30
+ try {
31
+ let config = yield SSM.getSSMParameter(ssmParameter.idObfuscationSSM);
32
+ console.log("config", config);
33
+ this.hashIds = yield new Hashids(config.Salt, +config.MinHashLength);
34
+ return;
35
+ }
36
+ catch (error) {
37
+ throw error;
38
+ }
39
+ });
40
+ }
21
41
  }
22
- export { HashService, HashIdsService };
23
42
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../hashing/index.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,cAAc,MAAM,WAAW,CAAC;AAEvC,MAAM,WAAW;IAEb;IACA,CAAC;IAEK,mBAAmB,CAAC,KAAa;;YAEnC,OAAO,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;YAAA,CAAC;QACxE,CAAC;KAAA;CAEJ;AAED,OAAO,EACH,WAAW,EACX,cAAc,EACjB,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../hashing/index.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,GAAG,EAAE,MAAM,wBAAwB,CAAA;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,OAAO,MAAM,SAAS,CAAC;AAE9B,MAAM,OAAO,WAAW;IAGpB;QAFO,YAAO,GAAY,IAAI,OAAO,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,UAAU,CAAC,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,GAAG,CAAC,eAAe,CAAC,YAAY,CAAC,gBAAgB,CAAC,CAAC;gBACtE,OAAO,CAAC,GAAG,CAAC,QAAQ,EAAC,MAAM,CAAC,CAAC;gBAC7B,IAAI,CAAC,OAAO,GAAG,MAAM,IAAI,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, HashIdsService } from "./hashing";
7
+ import { HashService } from "./hashing";
8
8
  import UrlService from "./shortner";
9
9
  import { Utils } from "./utils";
10
- export { AWS, axios, ENUM, Utils, BaseCommunicationService, WebHookEvent, BaseDynamoDBRepository, HashService, HashIdsService, UrlService };
10
+ export { AWS, axios, ENUM, Utils, BaseCommunicationService, WebHookEvent, BaseDynamoDBRepository, HashService, UrlService };
package/dist/esm/index.js CHANGED
@@ -4,8 +4,8 @@ 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, HashIdsService } from "./hashing";
7
+ import { HashService } from "./hashing";
8
8
  import UrlService from "./shortner";
9
9
  import { Utils } from "./utils";
10
- export { AWS, axios, ENUM, Utils, BaseCommunicationService, WebHookEvent, BaseDynamoDBRepository, HashService, HashIdsService, UrlService };
10
+ export { AWS, axios, ENUM, Utils, BaseCommunicationService, WebHookEvent, BaseDynamoDBRepository, HashService, UrlService };
11
11
  //# sourceMappingURL=index.js.map
@@ -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,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AACxD,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,cAAc,EACd,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.9",
3
+ "version": "2.0.10",
4
4
  "description": "",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -1,3 +0,0 @@
1
- import Hashids from 'hashids';
2
- declare const _default: Hashids;
3
- export default _default;
@@ -1,29 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- var __importDefault = (this && this.__importDefault) || function (mod) {
12
- return (mod && mod.__esModule) ? mod : { "default": mod };
13
- };
14
- Object.defineProperty(exports, "__esModule", { value: true });
15
- const AWSSSM_1 = require("../aws/services/AWSSSM");
16
- const SSMParameters_1 = require("../config/SSMParameters");
17
- const hashids_1 = __importDefault(require("hashids"));
18
- const HashIdsService = () => __awaiter(void 0, void 0, void 0, function* () {
19
- try {
20
- let config = yield AWSSSM_1.SSM.getSSMParameter(SSMParameters_1.ssmParameter.idObfuscationSSM);
21
- console.log("config", config);
22
- return new hashids_1.default(config.Salt, config.MinHashLength);
23
- }
24
- catch (error) {
25
- throw error;
26
- }
27
- });
28
- exports.default = await HashIdsService();
29
- //# sourceMappingURL=hashids.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"hashids.js","sourceRoot":"","sources":["../../../hashing/hashids.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,mDAA4C;AAC5C,2DAAuD;AACvD,sDAA8B;AAE9B,MAAM,cAAc,GAAG,GAAS,EAAE;IAC9B,IAAI;QACA,IAAI,MAAM,GAAG,MAAM,YAAG,CAAC,eAAe,CAAC,4BAAY,CAAC,gBAAgB,CAAC,CAAC;QACtE,OAAO,CAAC,GAAG,CAAC,QAAQ,EAAC,MAAM,CAAC,CAAC;QAC7B,OAAO,IAAI,iBAAO,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,aAAa,CAAC,CAAC;KACzD;IAAC,OAAO,KAAK,EAAE;QACZ,MAAM,KAAK,CAAC;KACf;AACL,CAAC,CAAA,CAAA;AAED,kBAAe,MAAM,cAAc,EAAE,CAAC"}
@@ -1,3 +0,0 @@
1
- import Hashids from 'hashids';
2
- declare const _default: Hashids;
3
- export default _default;
@@ -1,24 +0,0 @@
1
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
- return new (P || (P = Promise))(function (resolve, reject) {
4
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
- step((generator = generator.apply(thisArg, _arguments || [])).next());
8
- });
9
- };
10
- import { SSM } from "../aws/services/AWSSSM";
11
- import { ssmParameter } from '../config/SSMParameters';
12
- import Hashids from 'hashids';
13
- const HashIdsService = () => __awaiter(void 0, void 0, void 0, function* () {
14
- try {
15
- let config = yield SSM.getSSMParameter(ssmParameter.idObfuscationSSM);
16
- console.log("config", config);
17
- return new Hashids(config.Salt, config.MinHashLength);
18
- }
19
- catch (error) {
20
- throw error;
21
- }
22
- });
23
- export default await HashIdsService();
24
- //# sourceMappingURL=hashids.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"hashids.js","sourceRoot":"","sources":["../../../hashing/hashids.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,wBAAwB,CAAA;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,OAAO,MAAM,SAAS,CAAC;AAE9B,MAAM,cAAc,GAAG,GAAS,EAAE;IAC9B,IAAI;QACA,IAAI,MAAM,GAAG,MAAM,GAAG,CAAC,eAAe,CAAC,YAAY,CAAC,gBAAgB,CAAC,CAAC;QACtE,OAAO,CAAC,GAAG,CAAC,QAAQ,EAAC,MAAM,CAAC,CAAC;QAC7B,OAAO,IAAI,OAAO,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,aAAa,CAAC,CAAC;KACzD;IAAC,OAAO,KAAK,EAAE;QACZ,MAAM,KAAK,CAAC;KACf;AACL,CAAC,CAAA,CAAA;AAED,eAAe,MAAM,cAAc,EAAE,CAAC"}