@plentymarkets/shop-core 1.21.5 → 1.21.6

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/module.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@plentymarkets/shop-core",
3
3
  "configKey": "shopCore",
4
- "version": "1.21.5",
4
+ "version": "1.21.6",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.2",
7
7
  "unbuild": "unknown"
@@ -2,7 +2,7 @@ import { useRuntimeConfig, useState, useCookie, useRouter } from "nuxt/app";
2
2
  import { computed, toRefs } from "vue";
3
3
  import { cookieBarHelper } from "../utils/cookieBarHelper.js";
4
4
  import { useCookieConsent } from "./useCookieConsent.js";
5
- import { sha256 } from "js-sha256";
5
+ import { useSha256 } from "./useSha256.js";
6
6
  const checkIfScriptIsExternal = (scriptName) => {
7
7
  return scriptName.startsWith("http");
8
8
  };
@@ -18,7 +18,7 @@ export const useCookieBar = () => {
18
18
  const initializeCookies = () => {
19
19
  const runtimeCookies = useRuntimeConfig().public.cookieGroups;
20
20
  const { configHash, ...configWithoutHash } = runtimeCookies;
21
- runtimeCookies.configHash = sha256(JSON.stringify(configWithoutHash));
21
+ runtimeCookies.configHash = useSha256(configWithoutHash);
22
22
  const browserCookies = useCookie("consent-cookie", { default: () => null });
23
23
  const browserHash = browserCookies.value?.hash ?? "";
24
24
  runtimeCookies.groups.forEach((group) => {
@@ -0,0 +1 @@
1
+ export declare const useSha256: (data: unknown) => string;
@@ -0,0 +1,6 @@
1
+ import { sha256 } from "@noble/hashes/sha2.js";
2
+ import { bytesToHex } from "@noble/hashes/utils.js";
3
+ export const useSha256 = (data) => {
4
+ const str = typeof data === "string" ? data : JSON.stringify(data);
5
+ return bytesToHex(sha256(new TextEncoder().encode(str)));
6
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plentymarkets/shop-core",
3
- "version": "1.21.5",
3
+ "version": "1.21.6",
4
4
  "description": "Core module for PlentyONE Shop",
5
5
  "repository": {
6
6
  "type": "git",
@@ -49,10 +49,10 @@
49
49
  "test:e2e:dev": "concurrently -k -s first --names \"server,playwright\" \"npm run start\" \"npx wait-on http-get://localhost:3000 && playwright test --ui\""
50
50
  },
51
51
  "dependencies": {
52
+ "@noble/hashes": "^2.0.1",
52
53
  "@plentymarkets/shop-api": "^0.154.1",
53
54
  "@vue-storefront/sdk": "^3.4.1",
54
55
  "cookie-es": "^2.0.0",
55
- "js-sha256": "^0.11.0",
56
56
  "knitwork": "^1.3.0",
57
57
  "ofetch": "^1.5.1",
58
58
  "resolve": "^1.22.10"
@@ -84,6 +84,7 @@
84
84
  "eslint-plugin-ceviz": "^0.0.6",
85
85
  "eslint-plugin-vuejs-accessibility": "^2.4.1",
86
86
  "happy-dom": "^20.0.2",
87
+ "js-sha256": "^0.11.0",
87
88
  "nuxi": "3.32.0",
88
89
  "nuxt": "^4.3.1",
89
90
  "prettier": "^3.6.2",