@devite/shopware-client 1.5.5 → 1.5.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 +1 -1
- package/dist/index.d.cts +1 -0
- package/dist/index.d.mts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.mjs +1 -1
- package/dist/types/api/admin/product/review/ProductReview.d.ts +1 -0
- package/dist/types/api/global/GenericRecord.d.ts +1 -3
- package/dist/types/api/store/cart/Cart.d.ts +7 -2
- package/dist/types/api/store/cart/delivery/CartDeliveryPosition.d.ts +2 -2
- package/dist/types/api/store/cart/delivery/index.d.ts +6 -0
- package/dist/types/api/store/cart/index.d.ts +2 -0
- package/dist/types/api/store/{lineItem/LineItem.d.ts → cart/lineItem/CartLineItem.d.ts} +11 -10
- package/dist/types/api/store/cart/lineItem/CartLineItemPayload.d.ts +1 -0
- package/dist/types/api/store/cart/lineItem/CartLineItemType.d.ts +1 -0
- package/dist/types/api/store/cart/lineItem/index.d.ts +3 -0
- package/dist/types/api/store/customer/Customer.d.ts +1 -1
- package/dist/types/api/store/index.d.ts +0 -1
- package/dist/types/api/store/order/OrderLineItem.d.ts +2 -2
- package/dist/types/api/store/order/OrderPrice.d.ts +5 -1
- package/dist/types/clients/store/AccountClient.d.ts +6 -1
- package/dist/types/clients/store/CartClient.d.ts +3 -3
- package/dist/types/clients/store/OrderClient.d.ts +7 -3
- package/package.json +4 -4
- package/dist/types/api/store/lineItem/LineItemPayload.d.ts +0 -1
- package/dist/types/api/store/lineItem/LineItemType.d.ts +0 -1
- package/dist/types/api/store/lineItem/index.d.ts +0 -3
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.
|
|
12869
|
+
const response = await this.post(
|
|
12870
12870
|
`/account/customer`,
|
|
12871
12871
|
this.client.withContextToken({
|
|
12872
12872
|
body: new JsonPayload(request)
|
package/dist/index.d.cts
CHANGED
package/dist/index.d.mts
CHANGED
package/dist/index.d.ts
CHANGED
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.
|
|
12867
|
+
const response = await this.post(
|
|
12868
12868
|
`/account/customer`,
|
|
12869
12869
|
this.client.withContextToken({
|
|
12870
12870
|
body: new JsonPayload(request)
|
|
@@ -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 {
|
|
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<
|
|
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 {
|
|
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?:
|
|
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,11 +1,12 @@
|
|
|
1
|
-
import { Media } from "
|
|
2
|
-
import { CartDeliveryInformation } from "../
|
|
3
|
-
import {
|
|
4
|
-
import { CalculatedPrice } from "
|
|
5
|
-
import { CartPriceQuantity } from "
|
|
6
|
-
import {
|
|
7
|
-
export interface
|
|
8
|
-
|
|
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?:
|
|
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:
|
|
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";
|
|
@@ -39,7 +39,7 @@ export interface Customer {
|
|
|
39
39
|
readonly reviewCount?: number;
|
|
40
40
|
customFields?: GenericRecord;
|
|
41
41
|
readonly tagIds?: Array<string>;
|
|
42
|
-
accountType?:
|
|
42
|
+
accountType?: "private" | "business";
|
|
43
43
|
createdById?: string;
|
|
44
44
|
updatedById?: string;
|
|
45
45
|
defaultPaymentMethodId: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
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?:
|
|
23
|
+
payload?: CartLineItemPayload;
|
|
24
24
|
good?: boolean;
|
|
25
25
|
removable?: boolean;
|
|
26
26
|
stackable?: boolean;
|
|
@@ -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
|
|
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 {
|
|
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<
|
|
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<
|
|
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:
|
|
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.
|
|
3
|
+
"version": "1.5.6",
|
|
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.
|
|
44
|
+
"@types/node": "^22.15.12",
|
|
45
45
|
"changelogen": "^0.5.7",
|
|
46
|
-
"eslint": "^9.
|
|
46
|
+
"eslint": "^9.26.0",
|
|
47
47
|
"prettier": "^3.5.3",
|
|
48
48
|
"typescript": "^5.8.3",
|
|
49
|
-
"typescript-eslint": "^8.
|
|
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";
|