@devite/shopware-client 1.5.5 → 1.5.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 CHANGED
@@ -12866,7 +12866,7 @@ class AccountClient extends Client {
12866
12866
  * @throws {ShopwareError | import('ofetch').FetchError} if the request failed
12867
12867
  */
12868
12868
  async getCustomer(request = {}) {
12869
- const response = await this.get(
12869
+ const response = await this.post(
12870
12870
  `/account/customer`,
12871
12871
  this.client.withContextToken({
12872
12872
  body: new JsonPayload(request)
@@ -12891,12 +12891,9 @@ class AccountClient extends Client {
12891
12891
  * @throws {ShopwareError | import('ofetch').FetchError} if the request failed
12892
12892
  */
12893
12893
  async confirmRecoveryPassword(request) {
12894
- const response = await this.post(
12895
- `/account/recovery-password-confirm`,
12896
- this.client.withContextToken({
12897
- body: new JsonPayload(request)
12898
- })
12899
- );
12894
+ const response = await this.post(`/account/recovery-password-confirm`, {
12895
+ body: new JsonPayload(request)
12896
+ });
12900
12897
  if (response.statusCode === 200)
12901
12898
  return response.body.data;
12902
12899
  throw new ShopwareError("Failed to confirm recovery password", response);
@@ -12905,12 +12902,9 @@ class AccountClient extends Client {
12905
12902
  * @throws {ShopwareError | import('ofetch').FetchError} if the request failed
12906
12903
  */
12907
12904
  async requestPasswordRecoveryMail(request) {
12908
- const response = await this.post(
12909
- `/account/recovery-password`,
12910
- this.client.withContextToken({
12911
- body: new JsonPayload(request)
12912
- })
12913
- );
12905
+ const response = await this.post(`/account/recovery-password`, {
12906
+ body: new JsonPayload(request)
12907
+ });
12914
12908
  if (response.statusCode === 200)
12915
12909
  return response.body.data;
12916
12910
  throw new ShopwareError("Failed to request password recovery mail", response);
package/dist/index.d.cts CHANGED
@@ -3373,6 +3373,7 @@ type ProductReview = ProductReview$1 & {
3373
3373
  externalUser?: string;
3374
3374
  externalEmail?: string;
3375
3375
  product?: Product;
3376
+ customerId?: string;
3376
3377
  customer?: Customer;
3377
3378
  salesChannel?: SalesChannel;
3378
3379
  language?: Language;
package/dist/index.d.mts CHANGED
@@ -3373,6 +3373,7 @@ type ProductReview = ProductReview$1 & {
3373
3373
  externalUser?: string;
3374
3374
  externalEmail?: string;
3375
3375
  product?: Product;
3376
+ customerId?: string;
3376
3377
  customer?: Customer;
3377
3378
  salesChannel?: SalesChannel;
3378
3379
  language?: Language;
package/dist/index.d.ts CHANGED
@@ -3373,6 +3373,7 @@ type ProductReview = ProductReview$1 & {
3373
3373
  externalUser?: string;
3374
3374
  externalEmail?: string;
3375
3375
  product?: Product;
3376
+ customerId?: string;
3376
3377
  customer?: Customer;
3377
3378
  salesChannel?: SalesChannel;
3378
3379
  language?: Language;
package/dist/index.mjs CHANGED
@@ -12864,7 +12864,7 @@ class AccountClient extends Client {
12864
12864
  * @throws {ShopwareError | import('ofetch').FetchError} if the request failed
12865
12865
  */
12866
12866
  async getCustomer(request = {}) {
12867
- const response = await this.get(
12867
+ const response = await this.post(
12868
12868
  `/account/customer`,
12869
12869
  this.client.withContextToken({
12870
12870
  body: new JsonPayload(request)
@@ -12889,12 +12889,9 @@ class AccountClient extends Client {
12889
12889
  * @throws {ShopwareError | import('ofetch').FetchError} if the request failed
12890
12890
  */
12891
12891
  async confirmRecoveryPassword(request) {
12892
- const response = await this.post(
12893
- `/account/recovery-password-confirm`,
12894
- this.client.withContextToken({
12895
- body: new JsonPayload(request)
12896
- })
12897
- );
12892
+ const response = await this.post(`/account/recovery-password-confirm`, {
12893
+ body: new JsonPayload(request)
12894
+ });
12898
12895
  if (response.statusCode === 200)
12899
12896
  return response.body.data;
12900
12897
  throw new ShopwareError("Failed to confirm recovery password", response);
@@ -12903,12 +12900,9 @@ class AccountClient extends Client {
12903
12900
  * @throws {ShopwareError | import('ofetch').FetchError} if the request failed
12904
12901
  */
12905
12902
  async requestPasswordRecoveryMail(request) {
12906
- const response = await this.post(
12907
- `/account/recovery-password`,
12908
- this.client.withContextToken({
12909
- body: new JsonPayload(request)
12910
- })
12911
- );
12903
+ const response = await this.post(`/account/recovery-password`, {
12904
+ body: new JsonPayload(request)
12905
+ });
12912
12906
  if (response.statusCode === 200)
12913
12907
  return response.body.data;
12914
12908
  throw new ShopwareError("Failed to request password recovery mail", response);
@@ -7,6 +7,7 @@ export type ProductReview = StoreApiProductReview & {
7
7
  externalUser?: string;
8
8
  externalEmail?: string;
9
9
  product?: Product;
10
+ customerId?: string;
10
11
  customer?: Customer;
11
12
  salesChannel?: SalesChannel;
12
13
  language?: Language;
@@ -1,3 +1 @@
1
- export type GenericRecord = never | null | string | Array<string> | number | {
2
- [key: string]: GenericRecord;
3
- };
1
+ export type GenericRecord = Record<string, string | number | null | Array<string>> | string | number | null | Array<string>;
@@ -1,13 +1,18 @@
1
1
  import { CalculatedPrice } from "../price/CalculatedPrice";
2
2
  import { CartError } from "./CartError";
3
3
  import { CartDelivery } from "./delivery/CartDelivery";
4
- import { LineItem } from "#types/api/store";
4
+ import { CartLineItem } from "#types/api/store";
5
5
  export interface Cart {
6
6
  name?: string;
7
7
  token?: string;
8
8
  price?: CalculatedPrice;
9
- lineItems?: Array<LineItem>;
9
+ lineItems?: Array<CartLineItem>;
10
+ source?: string;
11
+ states?: Array<string>;
12
+ hash?: string;
10
13
  errors?: Array<CartError>;
14
+ errorHash?: string;
15
+ extensions?: Record<string, any>;
11
16
  deliveries?: Array<CartDelivery>;
12
17
  transactions?: Array<{
13
18
  paymentMethodId?: string;
@@ -1,9 +1,9 @@
1
1
  import { CartDeliveryDate } from "./CartDeliveryDate";
2
- import { LineItem } from "../../lineItem/LineItem";
2
+ import { CartLineItem } from "#types/api/store/cart/lineItem/CartLineItem";
3
3
  import { CalculatedPrice } from "../../price/CalculatedPrice";
4
4
  export interface CartDeliveryPosition {
5
5
  deliveryDate?: CartDeliveryDate;
6
6
  identifier?: string;
7
- lineItem?: LineItem;
7
+ lineItem?: CartLineItem;
8
8
  price?: CalculatedPrice;
9
9
  }
@@ -0,0 +1,6 @@
1
+ export { CartDelivery } from "./CartDelivery";
2
+ export { CartDeliveryDate } from "./CartDeliveryDate";
3
+ export { CartDeliveryInformation } from "./CartDeliveryInformation";
4
+ export { CartDeliveryPosition } from "./CartDeliveryPosition";
5
+ export { CartDeliveryShippingLocation } from "./CartDeliveryShippingLocation";
6
+ export { CartDeliveryTime } from "./CartDeliveryTime";
@@ -1,2 +1,4 @@
1
+ export * from "./delivery";
2
+ export * from "./lineItem";
1
3
  export { Cart } from "./Cart";
2
4
  export { CartError } from "./CartError";
@@ -1,11 +1,12 @@
1
- import { Media } from "../media/Media";
2
- import { CartDeliveryInformation } from "../cart/delivery/CartDeliveryInformation";
3
- import { LineItemPayload } from "./LineItemPayload";
4
- import { CalculatedPrice } from "../price/CalculatedPrice";
5
- import { CartPriceQuantity } from "../price/cart/CartPriceQuantity";
6
- import { LineItemType } from "./LineItemType";
7
- export interface LineItem {
8
- children?: Array<LineItem>;
1
+ import { Media } from "../../media/Media";
2
+ import { CartDeliveryInformation } from "../delivery/CartDeliveryInformation";
3
+ import { CartLineItemPayload } from "./CartLineItemPayload";
4
+ import { CalculatedPrice } from "../../price/CalculatedPrice";
5
+ import { CartPriceQuantity } from "../../price/cart/CartPriceQuantity";
6
+ import { CartLineItemType } from "./CartLineItemType";
7
+ export interface CartLineItem {
8
+ apiAlias: "cart_line_item";
9
+ children?: Array<CartLineItem>;
9
10
  cover?: Media;
10
11
  dataContextHash?: string;
11
12
  dataTimestamp?: string;
@@ -16,7 +17,7 @@ export interface LineItem {
16
17
  label?: string;
17
18
  modified?: string;
18
19
  modifiedByApp?: boolean;
19
- payload?: LineItemPayload;
20
+ payload?: CartLineItemPayload;
20
21
  price?: CalculatedPrice;
21
22
  priceDefinition?: CartPriceQuantity;
22
23
  quantity?: number;
@@ -29,6 +30,6 @@ export interface LineItem {
29
30
  removable?: boolean;
30
31
  stackable?: boolean;
31
32
  states?: Array<"is-physical" | "is-download">;
32
- type: LineItemType;
33
+ type: CartLineItemType;
33
34
  uniqueIdentifier?: string;
34
35
  }
@@ -0,0 +1 @@
1
+ export type CartLineItemPayload = Record<string, any>;
@@ -0,0 +1 @@
1
+ export type CartLineItemType = "product" | "credit" | "custom" | "promotion" | "discount" | "container" | "quantity";
@@ -0,0 +1,3 @@
1
+ export { CartLineItem } from "./CartLineItem";
2
+ export { CartLineItemPayload } from "./CartLineItemPayload";
3
+ export { CartLineItemType } from "./CartLineItemType";
@@ -39,7 +39,7 @@ export interface Customer {
39
39
  readonly reviewCount?: number;
40
40
  customFields?: GenericRecord;
41
41
  readonly tagIds?: Array<string>;
42
- accountType?: string;
42
+ accountType?: "private" | "business";
43
43
  createdById?: string;
44
44
  updatedById?: string;
45
45
  defaultPaymentMethodId: string;
@@ -4,7 +4,6 @@ export * from "./cms";
4
4
  export * from "./country";
5
5
  export * from "./customer";
6
6
  export * from "./document";
7
- export * from "./lineItem";
8
7
  export * from "./link";
9
8
  export * from "./locale";
10
9
  export * from "./media";
@@ -1,4 +1,4 @@
1
- import { LineItemPayload } from "../lineItem/LineItemPayload";
1
+ import { CartLineItemPayload } from "#types/api/store/cart/lineItem/CartLineItemPayload";
2
2
  import { CartPriceQuantity } from "../price/cart/CartPriceQuantity";
3
3
  import { GenericRecord } from "#types/api/global/GenericRecord";
4
4
  import { Media } from "../media/Media";
@@ -20,7 +20,7 @@ export interface OrderLineItem {
20
20
  referencedId?: string;
21
21
  quantity: number;
22
22
  label: string;
23
- payload?: LineItemPayload;
23
+ payload?: CartLineItemPayload;
24
24
  good?: boolean;
25
25
  removable?: boolean;
26
26
  stackable?: boolean;
@@ -1,7 +1,11 @@
1
1
  export interface OrderPrice {
2
2
  netPrice: number;
3
3
  totalPrice: number;
4
- calculatedTaxes?: object;
4
+ calculatedTaxes?: Array<{
5
+ tax: number;
6
+ taxRate: number;
7
+ price: number;
8
+ }>;
5
9
  taxRules?: object;
6
10
  positionPrice: number;
7
11
  rawTotal: number;
@@ -2,6 +2,7 @@ import { Criteria } from "#types/api/global/query/Criteria";
2
2
  import { Customer } from "#types/api/store/customer/Customer";
3
3
  import { CustomerAddress } from "#types/api/store/customer/address/CustomerAddress";
4
4
  import { CustomerGroup } from "#types/api/store";
5
+ import { GenericRecord } from "#types/api/global";
5
6
  export interface AccountEmailChangeRequest {
6
7
  email: string;
7
8
  emailConfirmation: string;
@@ -59,6 +60,7 @@ export interface AccountRecoveryExpiryCheckResponse {
59
60
  };
60
61
  }
61
62
  export interface AccountUpdateRequest {
63
+ accountType?: "private" | "business";
62
64
  salutationId?: string;
63
65
  title?: string;
64
66
  firstName: string;
@@ -67,13 +69,15 @@ export interface AccountUpdateRequest {
67
69
  birthdayDay?: number;
68
70
  birthdayMonth?: number;
69
71
  birthdayYear?: number;
72
+ vatIds?: Array<string>;
73
+ customFields?: GenericRecord;
70
74
  }
71
75
  export interface AccountUpdateResponse {
72
76
  success?: boolean;
73
77
  }
74
78
  export interface CustomerRegisterRequest {
75
79
  email: string;
76
- password: string;
80
+ password?: string;
77
81
  salutationId: string;
78
82
  firstName: string;
79
83
  lastName: string;
@@ -92,6 +96,7 @@ export interface CustomerRegisterRequest {
92
96
  accountType?: "private" | "business";
93
97
  company?: string;
94
98
  vatIds?: Array<string>;
99
+ customFields?: GenericRecord;
95
100
  }
96
101
  export type CustomerRegisterResponse = {
97
102
  accountType: "private" | "business";
@@ -1,7 +1,7 @@
1
- import { LineItem } from "#types/api/store/lineItem/LineItem";
1
+ import { CartLineItem } from "#types/api/store/cart/lineItem/CartLineItem";
2
2
  import { Cart } from "#types/api/store/cart/Cart";
3
3
  export interface CartAddItemsRequest {
4
- items?: Array<LineItem>;
4
+ items?: Array<CartLineItem>;
5
5
  }
6
6
  export type CartAddItemsResponse = Cart;
7
7
  export interface CartRemoveItemsRequest {
@@ -9,7 +9,7 @@ export interface CartRemoveItemsRequest {
9
9
  }
10
10
  export type CartRemoveItemsResponse = Cart;
11
11
  export interface CartUpdateItemsRequest {
12
- items?: Array<Partial<LineItem>>;
12
+ items?: Array<CartLineItem>;
13
13
  }
14
14
  export type CartUpdateItemsResponse = Cart;
15
15
  export type CartGetOrCreateResponse = Cart;
@@ -1,20 +1,22 @@
1
1
  import { StateMachineState } from "#types/api/store/StateMachineState";
2
2
  import { Order } from "#types/api/store/order/Order";
3
3
  import { Criteria } from "#types/api/global/query/Criteria";
4
+ import { EntitySearchResult } from "#types/api/store";
4
5
  export interface OrderPaymentInitiateRequest {
5
6
  orderId: string;
6
7
  finishUrl?: string;
7
8
  errorUrl?: string;
9
+ paymentDetails?: Record<string, any>;
8
10
  }
9
11
  export interface OrderPaymentInitiateResponse {
10
- redirectUrl: string;
12
+ redirectUrl: string | null;
11
13
  }
12
14
  export interface OrderCancelRequest {
13
15
  orderId: string;
14
16
  }
15
17
  export type OrderCancelResponse = StateMachineState;
16
18
  export type OrderDownloadFileResponse = Blob;
17
- export interface OrderFromCartRequest {
19
+ export interface OrderFromCartRequest extends Criteria {
18
20
  customerComment?: string;
19
21
  affiliateCode?: string;
20
22
  campaignCode?: string;
@@ -24,7 +26,9 @@ export type OrderListRequest = Criteria & {
24
26
  checkPromotion?: boolean;
25
27
  };
26
28
  export interface OrderListResponse {
27
- orders: Array<Order>;
29
+ orders: EntitySearchResult & {
30
+ elements?: Array<Order>;
31
+ };
28
32
  paymentChangeable: Record<string, boolean>;
29
33
  }
30
34
  export interface OrderUpdatePaymentMethodRequest {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@devite/shopware-client",
3
- "version": "1.5.5",
3
+ "version": "1.5.7",
4
4
  "description": "Third party API client for Shopware 6.",
5
5
  "repository": "devite-io/shopware-client",
6
6
  "license": "MIT",
@@ -41,12 +41,12 @@
41
41
  "dist"
42
42
  ],
43
43
  "devDependencies": {
44
- "@types/node": "^22.14.0",
44
+ "@types/node": "^22.15.12",
45
45
  "changelogen": "^0.5.7",
46
- "eslint": "^9.24.0",
46
+ "eslint": "^9.26.0",
47
47
  "prettier": "^3.5.3",
48
48
  "typescript": "^5.8.3",
49
- "typescript-eslint": "^8.29.1",
49
+ "typescript-eslint": "^8.32.0",
50
50
  "unbuild": "^3.5.0",
51
51
  "vitest": "^2.1.9"
52
52
  },
@@ -1 +0,0 @@
1
- export type LineItemPayload = Record<string, any>;
@@ -1 +0,0 @@
1
- export type LineItemType = "product" | "credit" | "custom" | "promotion" | "discount" | "container" | "quantity";
@@ -1,3 +0,0 @@
1
- export { LineItem } from "./LineItem";
2
- export { LineItemPayload } from "./LineItemPayload";
3
- export { LineItemType } from "./LineItemType";