@devite/shopware-client 1.5.0 → 1.5.1

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
@@ -12030,14 +12030,14 @@ class AddressClient extends Client {
12030
12030
  `/account/address/${addressId}`,
12031
12031
  this.client.withContextToken()
12032
12032
  );
12033
- if (response.statusCode === 200) return;
12033
+ if (response.statusCode === 204) return;
12034
12034
  throw new ShopwareError("Failed to delete address", response);
12035
12035
  }
12036
12036
  /**
12037
12037
  * @throws {Error} if the request failed
12038
12038
  */
12039
12039
  async updateAddress(addressId, request) {
12040
- const response = await this.put(
12040
+ const response = await this.patch(
12041
12041
  `/account/address/${addressId}`,
12042
12042
  this.client.withContextToken({
12043
12043
  body: new JsonPayload(request)
@@ -12065,22 +12065,22 @@ class AddressClient extends Client {
12065
12065
  * @throws {Error} if the request failed
12066
12066
  */
12067
12067
  async changeDefaultShippingAddress(addressId) {
12068
- const response = await this.post(
12068
+ const response = await this.patch(
12069
12069
  `/account/address/default-shipping/${addressId}`,
12070
12070
  this.client.withContextToken()
12071
12071
  );
12072
- if (response.statusCode === 200) return;
12072
+ if (response.statusCode === 204) return;
12073
12073
  throw new ShopwareError("Failed to change default shipping address", response);
12074
12074
  }
12075
12075
  /**
12076
12076
  * @throws {Error} if the request failed
12077
12077
  */
12078
12078
  async changeDefaultBillingAddress(addressId) {
12079
- const response = await this.post(
12079
+ const response = await this.patch(
12080
12080
  `/account/address/default-billing/${addressId}`,
12081
12081
  this.client.withContextToken()
12082
12082
  );
12083
- if (response.statusCode === 200) return;
12083
+ if (response.statusCode === 204) return;
12084
12084
  throw new ShopwareError("Failed to change default billing address", response);
12085
12085
  }
12086
12086
  }
package/dist/index.mjs CHANGED
@@ -12028,14 +12028,14 @@ class AddressClient extends Client {
12028
12028
  `/account/address/${addressId}`,
12029
12029
  this.client.withContextToken()
12030
12030
  );
12031
- if (response.statusCode === 200) return;
12031
+ if (response.statusCode === 204) return;
12032
12032
  throw new ShopwareError("Failed to delete address", response);
12033
12033
  }
12034
12034
  /**
12035
12035
  * @throws {Error} if the request failed
12036
12036
  */
12037
12037
  async updateAddress(addressId, request) {
12038
- const response = await this.put(
12038
+ const response = await this.patch(
12039
12039
  `/account/address/${addressId}`,
12040
12040
  this.client.withContextToken({
12041
12041
  body: new JsonPayload(request)
@@ -12063,22 +12063,22 @@ class AddressClient extends Client {
12063
12063
  * @throws {Error} if the request failed
12064
12064
  */
12065
12065
  async changeDefaultShippingAddress(addressId) {
12066
- const response = await this.post(
12066
+ const response = await this.patch(
12067
12067
  `/account/address/default-shipping/${addressId}`,
12068
12068
  this.client.withContextToken()
12069
12069
  );
12070
- if (response.statusCode === 200) return;
12070
+ if (response.statusCode === 204) return;
12071
12071
  throw new ShopwareError("Failed to change default shipping address", response);
12072
12072
  }
12073
12073
  /**
12074
12074
  * @throws {Error} if the request failed
12075
12075
  */
12076
12076
  async changeDefaultBillingAddress(addressId) {
12077
- const response = await this.post(
12077
+ const response = await this.patch(
12078
12078
  `/account/address/default-billing/${addressId}`,
12079
12079
  this.client.withContextToken()
12080
12080
  );
12081
- if (response.statusCode === 200) return;
12081
+ if (response.statusCode === 204) return;
12082
12082
  throw new ShopwareError("Failed to change default billing address", response);
12083
12083
  }
12084
12084
  }
@@ -1,9 +1,12 @@
1
1
  import { Criteria } from "#types/api/global/query/Criteria";
2
2
  import { CustomerAddress } from "#types/api/store/customer/address/CustomerAddress";
3
3
  import { CustomerAddressBody } from "#types/api/store/customer/address/CustomerAddressBody";
4
+ import { EntitySearchResult } from "#types/api/store/EntitySearchResult";
4
5
  export type AddressCreateRequest = CustomerAddressBody;
5
6
  export type AddressCreateResponse = CustomerAddress;
6
7
  export type AddressUpdateRequest = CustomerAddressBody;
7
8
  export type AddressUpdateResponse = CustomerAddressBody;
8
9
  export type AddressListRequest = Criteria;
9
- export type AddressListResponse = Array<CustomerAddress>;
10
+ export type AddressListResponse = EntitySearchResult & {
11
+ elements?: Array<CustomerAddress>;
12
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@devite/shopware-client",
3
- "version": "1.5.0",
3
+ "version": "1.5.1",
4
4
  "description": "Third party API client for Shopware 6.",
5
5
  "repository": "devite-io/shopware-client",
6
6
  "license": "MIT",