@netacea/netaceaintegrationbase 2.0.128 → 2.0.130

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.
package/dist/index.cjs CHANGED
@@ -619,12 +619,13 @@ const lib = {
619
619
  };
620
620
 
621
621
  class HashGenerator {
622
- constructor(crypto) {
622
+ constructor(crypto, textEncoder) {
623
623
  this.crypto = crypto;
624
+ this.TextEncoder = textEncoder;
624
625
  }
625
626
  async hashString(algorithm, data, sort = false) {
626
627
  const headers = sort ? [...data].sort() : [...data];
627
- const dataEncoded = new TextEncoder().encode(headers.join(','));
628
+ const dataEncoded = new this.TextEncoder().encode(headers.join(','));
628
629
  const hashBuffer = await this.crypto.subtle.digest(algorithm, dataEncoded);
629
630
  const hashArray = Array.from(new Uint8Array(hashBuffer));
630
631
  const hashHex = hashArray
package/dist/index.d.ts CHANGED
@@ -548,9 +548,13 @@ interface CryptoLike {
548
548
  digest: (algorithm: CryptoAlgorithm, data: ArrayBuffer | ArrayBufferView) => Promise<ArrayBuffer>;
549
549
  };
550
550
  }
551
+ type TextEncoderLike = new () => {
552
+ encode: (str: string) => Uint8Array;
553
+ };
551
554
  declare class HashGenerator {
552
- crypto: CryptoLike;
553
- constructor(crypto: CryptoLike);
555
+ private readonly crypto;
556
+ private readonly TextEncoder;
557
+ constructor(crypto: CryptoLike, textEncoder: TextEncoderLike);
554
558
  hashString(algorithm: CryptoAlgorithm, data: string[], sort?: boolean): Promise<string>;
555
559
  static filterHeaderNames(headerNames: string[]): string[];
556
560
  hashHeaders(headerNames: string[], sort?: boolean): Promise<string>;
package/dist/index.mjs CHANGED
@@ -617,12 +617,13 @@ const lib = {
617
617
  };
618
618
 
619
619
  class HashGenerator {
620
- constructor(crypto) {
620
+ constructor(crypto, textEncoder) {
621
621
  this.crypto = crypto;
622
+ this.TextEncoder = textEncoder;
622
623
  }
623
624
  async hashString(algorithm, data, sort = false) {
624
625
  const headers = sort ? [...data].sort() : [...data];
625
- const dataEncoded = new TextEncoder().encode(headers.join(','));
626
+ const dataEncoded = new this.TextEncoder().encode(headers.join(','));
626
627
  const hashBuffer = await this.crypto.subtle.digest(algorithm, dataEncoded);
627
628
  const hashArray = Array.from(new Uint8Array(hashBuffer));
628
629
  const hashHex = hashArray
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@netacea/netaceaintegrationbase",
3
- "version": "2.0.128",
3
+ "version": "2.0.130",
4
4
  "description": "Base package for Netacea CDN integrations.",
5
5
  "type": "module",
6
6
  "types": "dist/index.d.ts",
@@ -24,7 +24,7 @@
24
24
  },
25
25
  "license": "UNLICENSED",
26
26
  "dependencies": {
27
- "@netacea/kinesisingest": "^1.5.146"
27
+ "@netacea/kinesisingest": "^1.5.148"
28
28
  },
29
- "gitHead": "1e3f889b8a9df68ddc27ba41ec5730a186587ed4"
29
+ "gitHead": "2070bf6160363090dadf337021972b3a47c8f2c2"
30
30
  }