@plentymarkets/shop-core 1.3.5 → 1.3.7
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
|
@@ -20,6 +20,7 @@ const createHttpClient = () => {
|
|
|
20
20
|
if (noCache) request.headers["noCache"] = noCache;
|
|
21
21
|
if (configId) request.headers["x-config-id"] = configId;
|
|
22
22
|
if (pwaHashCookie.value) request.headers["x-pwa-edit-hash"] = pwaHashCookie.value;
|
|
23
|
+
request.headers["locale"] = locale;
|
|
23
24
|
if (import.meta.server) {
|
|
24
25
|
request.headers["cookie"] = updateVsfLocale(request.headers["cookie"], locale);
|
|
25
26
|
}
|
|
@@ -36,10 +37,11 @@ const handleHttpError = (error) => {
|
|
|
36
37
|
const axiosError = error;
|
|
37
38
|
const data = axiosError?.response?.data?.data || axiosError?.response?.data;
|
|
38
39
|
const events = axiosError?.response?.data?.events;
|
|
40
|
+
const key = data?.key ?? (axiosError?.response?.data?.errorMessage ? "customError" : null) ?? "unknownError";
|
|
39
41
|
throw new ApiError({
|
|
40
|
-
key
|
|
42
|
+
key,
|
|
41
43
|
code: axiosError?.response?.data?.error?.code ?? axiosError?.response?.status ?? axiosError.status,
|
|
42
|
-
message: data?.message ?? axiosError.message ?? "",
|
|
44
|
+
message: data?.message ?? axiosError?.response?.data?.errorMessage ?? axiosError.message ?? "",
|
|
43
45
|
cause: data?.errors ?? {},
|
|
44
46
|
events
|
|
45
47
|
});
|
|
@@ -5,7 +5,9 @@ export const useDynamicPaymentButtons = () => {
|
|
|
5
5
|
components: []
|
|
6
6
|
}));
|
|
7
7
|
const addComponent = (component) => {
|
|
8
|
-
if (state.value.components.some(
|
|
8
|
+
if (state.value.components.some(
|
|
9
|
+
(stateComponent) => stateComponent.componentName === component.componentName
|
|
10
|
+
)) {
|
|
9
11
|
return;
|
|
10
12
|
}
|
|
11
13
|
state.value.components.push(component);
|
|
@@ -9,7 +9,7 @@ export const useHandleError = (error) => {
|
|
|
9
9
|
const persist = true;
|
|
10
10
|
if (error instanceof ApiError) {
|
|
11
11
|
const translationKey = `storefrontError.${error.key}`;
|
|
12
|
-
const message = error.key && $i18n.te(translationKey) ? $i18n.t(translationKey) : error.message
|
|
12
|
+
const message = error.key && $i18n.te(translationKey) ? $i18n.t(translationKey) : error.message;
|
|
13
13
|
send({
|
|
14
14
|
type,
|
|
15
15
|
message,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plentymarkets/shop-core",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.7",
|
|
4
4
|
"description": "Core module for PlentyONE Shop",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -42,28 +42,31 @@
|
|
|
42
42
|
"test:types": "vue-tsc --noEmit && cd playground && vue-tsc --noEmit"
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@plentymarkets/shop-api": "^0.
|
|
45
|
+
"@plentymarkets/shop-api": "^0.100.1",
|
|
46
46
|
"@vue-storefront/sdk": "^3.4.1",
|
|
47
|
-
"mitt": "^3.0.1"
|
|
47
|
+
"mitt": "^3.0.1",
|
|
48
|
+
"resolve": "^1.22.10"
|
|
48
49
|
},
|
|
49
50
|
"devDependencies": {
|
|
50
51
|
"@nuxt/devtools": "^1.7.0",
|
|
51
|
-
"@nuxt/eslint-config": "^0.7.
|
|
52
|
-
"@nuxt/kit": "^3.16.
|
|
52
|
+
"@nuxt/eslint-config": "^0.7.6",
|
|
53
|
+
"@nuxt/kit": "^3.16.2",
|
|
53
54
|
"@nuxt/module-builder": "^0.8.4",
|
|
54
|
-
"@nuxt/schema": "^3.16.
|
|
55
|
-
"@nuxt/test-utils": "^3.
|
|
55
|
+
"@nuxt/schema": "^3.16.2",
|
|
56
|
+
"@nuxt/test-utils": "^3.17.2",
|
|
56
57
|
"@nuxtjs/i18n": "9.3.1",
|
|
57
58
|
"@types/node": "latest",
|
|
58
59
|
"@vitest/coverage-v8": "2.1.8",
|
|
59
60
|
"@vue-storefront/eslint-config": "^4.1.0",
|
|
60
61
|
"@vue/test-utils": "^2.4.6",
|
|
61
62
|
"changelogen": "^0.5.7",
|
|
62
|
-
"eslint": "^9.
|
|
63
|
-
"
|
|
64
|
-
"
|
|
63
|
+
"eslint": "^9.24.0",
|
|
64
|
+
"eslint-config-prettier": "^9.1.0",
|
|
65
|
+
"eslint-plugin-vuejs-accessibility": "^2.4.1",
|
|
66
|
+
"happy-dom": "^16.8.1",
|
|
67
|
+
"nuxt": "^3.16.2",
|
|
65
68
|
"typescript": "~5.7.3",
|
|
66
|
-
"vitest": "^2.1.
|
|
67
|
-
"vue-tsc": "^2.2.
|
|
69
|
+
"vitest": "^2.1.9",
|
|
70
|
+
"vue-tsc": "^2.2.8"
|
|
68
71
|
}
|
|
69
72
|
}
|