@devite/shopware-client 1.7.5 → 1.7.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/index.cjs +12 -6
- package/dist/index.d.cts +5 -5
- package/dist/index.d.mts +5 -5
- package/dist/index.d.ts +5 -5
- package/dist/index.mjs +12 -6
- package/dist/types/api/admin/product/Product.d.ts +1 -1
- package/dist/types/api/global/filter/RangeFilter.d.ts +4 -4
- package/dist/types/auth/OAuthResponseBody.d.ts +1 -1
- package/package.json +2 -1
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);
|
|
@@ -646,13 +648,13 @@ class MailClient extends Client {
|
|
|
646
648
|
/** Rest Endpoints **/
|
|
647
649
|
headerFooters = createRestEndpoint(
|
|
648
650
|
this,
|
|
649
|
-
"header-footer",
|
|
651
|
+
"mail-header-footer",
|
|
650
652
|
"mail header/footer"
|
|
651
653
|
);
|
|
652
|
-
templates = createRestEndpoint(this, "template", "mail template");
|
|
654
|
+
templates = createRestEndpoint(this, "mail-template", "mail template");
|
|
653
655
|
templateTypes = createRestEndpoint(
|
|
654
656
|
this,
|
|
655
|
-
"template-type",
|
|
657
|
+
"mail-template-type",
|
|
656
658
|
"mail template type"
|
|
657
659
|
);
|
|
658
660
|
}
|
|
@@ -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
|
|
|
@@ -2938,7 +2938,7 @@ interface CustomerWishlist {
|
|
|
2938
2938
|
|
|
2939
2939
|
type Product = Product$1 & {
|
|
2940
2940
|
featureSetId?: string;
|
|
2941
|
-
price?: CalculatedPrice
|
|
2941
|
+
price?: Array<CalculatedPrice>;
|
|
2942
2942
|
readonly autoIncrement?: number;
|
|
2943
2943
|
variantRestrictions?: object;
|
|
2944
2944
|
purchasePrices?: Array<CalculatedPrice>;
|
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
|
|
|
@@ -2938,7 +2938,7 @@ interface CustomerWishlist {
|
|
|
2938
2938
|
|
|
2939
2939
|
type Product = Product$1 & {
|
|
2940
2940
|
featureSetId?: string;
|
|
2941
|
-
price?: CalculatedPrice
|
|
2941
|
+
price?: Array<CalculatedPrice>;
|
|
2942
2942
|
readonly autoIncrement?: number;
|
|
2943
2943
|
variantRestrictions?: object;
|
|
2944
2944
|
purchasePrices?: Array<CalculatedPrice>;
|
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
|
|
|
@@ -2938,7 +2938,7 @@ interface CustomerWishlist {
|
|
|
2938
2938
|
|
|
2939
2939
|
type Product = Product$1 & {
|
|
2940
2940
|
featureSetId?: string;
|
|
2941
|
-
price?: CalculatedPrice
|
|
2941
|
+
price?: Array<CalculatedPrice>;
|
|
2942
2942
|
readonly autoIncrement?: number;
|
|
2943
2943
|
variantRestrictions?: object;
|
|
2944
2944
|
purchasePrices?: Array<CalculatedPrice>;
|
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);
|
|
@@ -644,13 +646,13 @@ class MailClient extends Client {
|
|
|
644
646
|
/** Rest Endpoints **/
|
|
645
647
|
headerFooters = createRestEndpoint(
|
|
646
648
|
this,
|
|
647
|
-
"header-footer",
|
|
649
|
+
"mail-header-footer",
|
|
648
650
|
"mail header/footer"
|
|
649
651
|
);
|
|
650
|
-
templates = createRestEndpoint(this, "template", "mail template");
|
|
652
|
+
templates = createRestEndpoint(this, "mail-template", "mail template");
|
|
651
653
|
templateTypes = createRestEndpoint(
|
|
652
654
|
this,
|
|
653
|
-
"template-type",
|
|
655
|
+
"mail-template-type",
|
|
654
656
|
"mail template type"
|
|
655
657
|
);
|
|
656
658
|
}
|
|
@@ -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 {
|
|
@@ -25,7 +25,7 @@ import { CustomFieldSet } from "../custom/field/set/CustomFieldSet";
|
|
|
25
25
|
import { CalculatedPrice } from "#types/api/store/price/CalculatedPrice";
|
|
26
26
|
export type Product = StoreApiProduct & {
|
|
27
27
|
featureSetId?: string;
|
|
28
|
-
price?: CalculatedPrice
|
|
28
|
+
price?: Array<CalculatedPrice>;
|
|
29
29
|
readonly autoIncrement?: number;
|
|
30
30
|
variantRestrictions?: object;
|
|
31
31
|
purchasePrices?: Array<CalculatedPrice>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@devite/shopware-client",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.7",
|
|
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",
|