@devite/shopware-client 1.7.0 → 1.7.2

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
@@ -316,7 +316,7 @@ function createRestEndpoint(client, resourceIdentifier, dataName) {
316
316
  client,
317
317
  HTTPRequestMethod.POST,
318
318
  `/${resourceIdentifier}`,
319
- 201,
319
+ responseDetails === "detail" ? 200 : 204,
320
320
  `create ${dataName}`,
321
321
  { _response: responseDetails },
322
322
  new JsonPayload(data)
@@ -344,7 +344,7 @@ function createRestEndpoint(client, resourceIdentifier, dataName) {
344
344
  client,
345
345
  HTTPRequestMethod.PATCH,
346
346
  `/${resourceIdentifier}/${id}`,
347
- 200,
347
+ responseDetails === "detail" ? 200 : 204,
348
348
  `update ${dataName} with id ${id}`,
349
349
  { _response: responseDetails },
350
350
  new JsonPayload(data)
@@ -1977,15 +1977,12 @@ class DocumentClient extends Client {
1977
1977
  * @throws {ShopwareError | import('ofetch').FetchError} if the request failed
1978
1978
  */
1979
1979
  async downloadAsGuest(id, deepLinkCode, email, billingAddressZipCode) {
1980
- const response = await this.post(
1981
- `/document/download/${id}/${deepLinkCode}`,
1982
- this.client.withContextToken({
1983
- body: new JsonPayload({
1984
- email,
1985
- zipcode: billingAddressZipCode
1986
- })
1980
+ const response = await this.post(`/document/download/${id}/${deepLinkCode}`, {
1981
+ body: new JsonPayload({
1982
+ email,
1983
+ zipcode: billingAddressZipCode
1987
1984
  })
1988
- );
1985
+ });
1989
1986
  if (response.statusCode === 200)
1990
1987
  return response.body.data;
1991
1988
  throw new ShopwareError("Failed to download document as guest", response);
package/dist/index.mjs CHANGED
@@ -314,7 +314,7 @@ function createRestEndpoint(client, resourceIdentifier, dataName) {
314
314
  client,
315
315
  HTTPRequestMethod.POST,
316
316
  `/${resourceIdentifier}`,
317
- 201,
317
+ responseDetails === "detail" ? 200 : 204,
318
318
  `create ${dataName}`,
319
319
  { _response: responseDetails },
320
320
  new JsonPayload(data)
@@ -342,7 +342,7 @@ function createRestEndpoint(client, resourceIdentifier, dataName) {
342
342
  client,
343
343
  HTTPRequestMethod.PATCH,
344
344
  `/${resourceIdentifier}/${id}`,
345
- 200,
345
+ responseDetails === "detail" ? 200 : 204,
346
346
  `update ${dataName} with id ${id}`,
347
347
  { _response: responseDetails },
348
348
  new JsonPayload(data)
@@ -1975,15 +1975,12 @@ class DocumentClient extends Client {
1975
1975
  * @throws {ShopwareError | import('ofetch').FetchError} if the request failed
1976
1976
  */
1977
1977
  async downloadAsGuest(id, deepLinkCode, email, billingAddressZipCode) {
1978
- const response = await this.post(
1979
- `/document/download/${id}/${deepLinkCode}`,
1980
- this.client.withContextToken({
1981
- body: new JsonPayload({
1982
- email,
1983
- zipcode: billingAddressZipCode
1984
- })
1978
+ const response = await this.post(`/document/download/${id}/${deepLinkCode}`, {
1979
+ body: new JsonPayload({
1980
+ email,
1981
+ zipcode: billingAddressZipCode
1985
1982
  })
1986
- );
1983
+ });
1987
1984
  if (response.statusCode === 200)
1988
1985
  return response.body.data;
1989
1986
  throw new ShopwareError("Failed to download document as guest", response);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@devite/shopware-client",
3
- "version": "1.7.0",
3
+ "version": "1.7.2",
4
4
  "description": "Third party API client for Shopware 6.",
5
5
  "repository": "devite-io/shopware-client",
6
6
  "license": "MIT",