@devite/shopware-client 1.7.5 → 1.7.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/index.cjs
CHANGED
|
@@ -53,7 +53,7 @@ class BinaryPayload extends Payload {
|
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
class JsonPayload extends Payload {
|
|
56
|
-
static CONTENT_TYPES = ["application/json"];
|
|
56
|
+
static CONTENT_TYPES = ["application/json", "application/vnd.api+json"];
|
|
57
57
|
data;
|
|
58
58
|
constructor(data) {
|
|
59
59
|
super();
|
|
@@ -154,6 +154,8 @@ class ShopwareClient {
|
|
|
154
154
|
payload = new JsonPayload();
|
|
155
155
|
} else if (HtmlPayload.CONTENT_TYPES.includes(contentType)) {
|
|
156
156
|
payload = new HtmlPayload();
|
|
157
|
+
} else {
|
|
158
|
+
console.warn("Unsupported content type:", contentType);
|
|
157
159
|
}
|
|
158
160
|
}
|
|
159
161
|
if (payload && response._data) await payload.deserialize(response._data);
|
|
@@ -1326,8 +1328,12 @@ class AdminShopwareClient extends ShopwareClient {
|
|
|
1326
1328
|
refresh_token: entry.refreshToken
|
|
1327
1329
|
})
|
|
1328
1330
|
});
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
+
if (refreshResponse.statusCode === 200) {
|
|
1332
|
+
entry.save(refreshResponse);
|
|
1333
|
+
entryHeaders = entry.load().headers;
|
|
1334
|
+
} else {
|
|
1335
|
+
entry.clear();
|
|
1336
|
+
}
|
|
1331
1337
|
} else throw error;
|
|
1332
1338
|
}
|
|
1333
1339
|
return {
|
package/dist/index.d.cts
CHANGED
|
@@ -276,10 +276,10 @@ interface RangeFilter {
|
|
|
276
276
|
type: "range";
|
|
277
277
|
field: string;
|
|
278
278
|
parameters: {
|
|
279
|
-
gte?: number;
|
|
280
|
-
gt?: number;
|
|
281
|
-
lte?: number;
|
|
282
|
-
lt?: number;
|
|
279
|
+
gte?: number | string;
|
|
280
|
+
gt?: number | string;
|
|
281
|
+
lte?: number | string;
|
|
282
|
+
lt?: number | string;
|
|
283
283
|
};
|
|
284
284
|
}
|
|
285
285
|
|
package/dist/index.d.mts
CHANGED
|
@@ -276,10 +276,10 @@ interface RangeFilter {
|
|
|
276
276
|
type: "range";
|
|
277
277
|
field: string;
|
|
278
278
|
parameters: {
|
|
279
|
-
gte?: number;
|
|
280
|
-
gt?: number;
|
|
281
|
-
lte?: number;
|
|
282
|
-
lt?: number;
|
|
279
|
+
gte?: number | string;
|
|
280
|
+
gt?: number | string;
|
|
281
|
+
lte?: number | string;
|
|
282
|
+
lt?: number | string;
|
|
283
283
|
};
|
|
284
284
|
}
|
|
285
285
|
|
package/dist/index.d.ts
CHANGED
|
@@ -276,10 +276,10 @@ interface RangeFilter {
|
|
|
276
276
|
type: "range";
|
|
277
277
|
field: string;
|
|
278
278
|
parameters: {
|
|
279
|
-
gte?: number;
|
|
280
|
-
gt?: number;
|
|
281
|
-
lte?: number;
|
|
282
|
-
lt?: number;
|
|
279
|
+
gte?: number | string;
|
|
280
|
+
gt?: number | string;
|
|
281
|
+
lte?: number | string;
|
|
282
|
+
lt?: number | string;
|
|
283
283
|
};
|
|
284
284
|
}
|
|
285
285
|
|
package/dist/index.mjs
CHANGED
|
@@ -51,7 +51,7 @@ class BinaryPayload extends Payload {
|
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
class JsonPayload extends Payload {
|
|
54
|
-
static CONTENT_TYPES = ["application/json"];
|
|
54
|
+
static CONTENT_TYPES = ["application/json", "application/vnd.api+json"];
|
|
55
55
|
data;
|
|
56
56
|
constructor(data) {
|
|
57
57
|
super();
|
|
@@ -152,6 +152,8 @@ class ShopwareClient {
|
|
|
152
152
|
payload = new JsonPayload();
|
|
153
153
|
} else if (HtmlPayload.CONTENT_TYPES.includes(contentType)) {
|
|
154
154
|
payload = new HtmlPayload();
|
|
155
|
+
} else {
|
|
156
|
+
console.warn("Unsupported content type:", contentType);
|
|
155
157
|
}
|
|
156
158
|
}
|
|
157
159
|
if (payload && response._data) await payload.deserialize(response._data);
|
|
@@ -1324,8 +1326,12 @@ class AdminShopwareClient extends ShopwareClient {
|
|
|
1324
1326
|
refresh_token: entry.refreshToken
|
|
1325
1327
|
})
|
|
1326
1328
|
});
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
+
if (refreshResponse.statusCode === 200) {
|
|
1330
|
+
entry.save(refreshResponse);
|
|
1331
|
+
entryHeaders = entry.load().headers;
|
|
1332
|
+
} else {
|
|
1333
|
+
entry.clear();
|
|
1334
|
+
}
|
|
1329
1335
|
} else throw error;
|
|
1330
1336
|
}
|
|
1331
1337
|
return {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@devite/shopware-client",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.6",
|
|
4
4
|
"description": "Third party API client for Shopware 6.",
|
|
5
5
|
"repository": "devite-io/shopware-client",
|
|
6
6
|
"license": "MIT",
|
|
@@ -42,6 +42,7 @@
|
|
|
42
42
|
],
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"@types/node": "^22.16.5",
|
|
45
|
+
"@types/qs": "^6.14.0",
|
|
45
46
|
"changelogen": "^0.5.7",
|
|
46
47
|
"eslint": "^9.32.0",
|
|
47
48
|
"prettier": "^3.6.2",
|