chatbot-nc 2.0.7 → 2.0.8

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,5 +1,6 @@
1
1
  import Hashids from 'hashids';
2
- export default class HashService extends Hashids {
2
+ export default class HashService {
3
3
  constructor();
4
4
  getHashedDataString(value: string): Promise<string>;
5
+ hashIds(): Promise<Hashids>;
5
6
  }
@@ -16,26 +16,29 @@ const node_crypto_1 = require("node:crypto");
16
16
  const AWSSSM_1 = require("../aws/services/AWSSSM");
17
17
  const SSMParameters_1 = require("../config/SSMParameters");
18
18
  const hashids_1 = __importDefault(require("hashids"));
19
- class SSMParam {
19
+ class HashService {
20
20
  constructor() {
21
- (() => __awaiter(this, void 0, void 0, function* () {
22
- let config = yield AWSSSM_1.SSM.getSSMParameter(SSMParameters_1.ssmParameter.idObfuscationSSM);
23
- this.Salt = config.Salt;
24
- this.MinHashLength = config.MinHashLength;
25
- }))();
26
- }
27
- }
28
- class HashService extends hashids_1.default {
29
- constructor() {
30
- let ssmParam = new SSMParam();
31
- console.log(ssmParam.Salt);
32
- console.log("Called Super");
33
- super(ssmParam.Salt, ssmParam.MinHashLength);
34
21
  }
35
22
  getHashedDataString(value) {
36
23
  return __awaiter(this, void 0, void 0, function* () {
37
- return (0, node_crypto_1.createHash)('sha256').update(value, 'utf8').digest('base64');
38
- ;
24
+ try {
25
+ return (0, node_crypto_1.createHash)('sha256').update(value, 'utf8').digest('base64');
26
+ ;
27
+ }
28
+ catch (error) {
29
+ throw error;
30
+ }
31
+ });
32
+ }
33
+ hashIds() {
34
+ return __awaiter(this, void 0, void 0, function* () {
35
+ try {
36
+ let config = yield AWSSSM_1.SSM.getSSMParameter(SSMParameters_1.ssmParameter.idObfuscationSSM);
37
+ return new hashids_1.default(config.Salt, config.MinHashLength);
38
+ }
39
+ catch (error) {
40
+ throw error;
41
+ }
39
42
  });
40
43
  }
41
44
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../hashing/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,6CAAyC;AACzC,mDAA4C;AAC5C,2DAAuD;AACvD,sDAA8B;AAE9B,MAAM,QAAQ;IAGV;QAEG,CAAC,GAAS,EAAE;YACX,IAAI,MAAM,GAAG,MAAM,YAAG,CAAC,eAAe,CAAC,4BAAY,CAAC,gBAAgB,CAAC,CAAC;YACtE,IAAI,CAAC,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC;YACxB,IAAI,CAAC,aAAa,GAAG,MAAM,CAAC,aAAa,CAAC;QAC3C,CAAC,CAAA,CAAC,EAAE,CAAC;IACR,CAAC;CACJ;AAED,MAAqB,WAAY,SAAQ,iBAAO;IAE5C;QACE,IAAI,QAAQ,GAAG,IAAI,QAAQ,EAAE,CAAC;QAC9B,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;QAC3B,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;QAC5B,KAAK,CAAC,QAAQ,CAAC,IAAI,EAAC,QAAQ,CAAC,aAAa,CAAC,CAAC;IAC9C,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;AAdD,8BAcC"}
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,5 +1,6 @@
1
1
  import Hashids from 'hashids';
2
- export default class HashService extends Hashids {
2
+ export default class HashService {
3
3
  constructor();
4
4
  getHashedDataString(value: string): Promise<string>;
5
+ hashIds(): Promise<Hashids>;
5
6
  }
@@ -11,26 +11,29 @@ 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
- class SSMParam {
14
+ export default class HashService {
15
15
  constructor() {
16
- (() => __awaiter(this, void 0, void 0, function* () {
17
- let config = yield SSM.getSSMParameter(ssmParameter.idObfuscationSSM);
18
- this.Salt = config.Salt;
19
- this.MinHashLength = config.MinHashLength;
20
- }))();
21
- }
22
- }
23
- export default class HashService extends Hashids {
24
- constructor() {
25
- let ssmParam = new SSMParam();
26
- console.log(ssmParam.Salt);
27
- console.log("Called Super");
28
- super(ssmParam.Salt, ssmParam.MinHashLength);
29
16
  }
30
17
  getHashedDataString(value) {
31
18
  return __awaiter(this, void 0, void 0, function* () {
32
- return createHash('sha256').update(value, 'utf8').digest('base64');
33
- ;
19
+ try {
20
+ return createHash('sha256').update(value, 'utf8').digest('base64');
21
+ ;
22
+ }
23
+ catch (error) {
24
+ throw error;
25
+ }
26
+ });
27
+ }
28
+ hashIds() {
29
+ return __awaiter(this, void 0, void 0, function* () {
30
+ try {
31
+ let config = yield SSM.getSSMParameter(ssmParameter.idObfuscationSSM);
32
+ return new Hashids(config.Salt, config.MinHashLength);
33
+ }
34
+ catch (error) {
35
+ throw error;
36
+ }
34
37
  });
35
38
  }
36
39
  }
@@ -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,EAAE,GAAG,EAAE,MAAM,wBAAwB,CAAA;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,OAAO,MAAM,SAAS,CAAC;AAE9B,MAAM,QAAQ;IAGV;QAEG,CAAC,GAAS,EAAE;YACX,IAAI,MAAM,GAAG,MAAM,GAAG,CAAC,eAAe,CAAC,YAAY,CAAC,gBAAgB,CAAC,CAAC;YACtE,IAAI,CAAC,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC;YACxB,IAAI,CAAC,aAAa,GAAG,MAAM,CAAC,aAAa,CAAC;QAC3C,CAAC,CAAA,CAAC,EAAE,CAAC;IACR,CAAC;CACJ;AAED,MAAM,CAAC,OAAO,OAAO,WAAY,SAAQ,OAAO;IAE5C;QACE,IAAI,QAAQ,GAAG,IAAI,QAAQ,EAAE,CAAC;QAC9B,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;QAC3B,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;QAC5B,KAAK,CAAC,QAAQ,CAAC,IAAI,EAAC,QAAQ,CAAC,aAAa,CAAC,CAAC;IAC9C,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"}
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,KAAK,CAAC;aACf;QACL,CAAC;KAAA;IAEK,OAAO;;YAET,IAAI;gBACA,IAAI,MAAM,GAAG,MAAM,GAAG,CAAC,eAAe,CAAC,YAAY,CAAC,gBAAgB,CAAC,CAAC;gBACtE,OAAO,IAAI,OAAO,CAAC,MAAM,CAAC,IAAI,EAAC,MAAM,CAAC,aAAa,CAAC,CAAA;aACvD;YAAC,OAAO,KAAK,EAAE;gBACZ,MAAM,KAAK,CAAC;aACf;QACL,CAAC;KAAA;CACJ"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "chatbot-nc",
3
- "version": "2.0.7",
3
+ "version": "2.0.8",
4
4
  "description": "",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",