@gradientedge/commercetools-utils 5.3.1 → 5.5.0
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/ge-commercetools-utils-browser.cjs.js +1 -1
- package/dist/ge-commercetools-utils-browser.cjs.js.map +1 -1
- package/dist/ge-commercetools-utils-browser.esm.js +1 -1
- package/dist/ge-commercetools-utils-browser.esm.js.map +1 -1
- package/dist/ge-commercetools-utils-node.cjs.js +1 -1
- package/dist/ge-commercetools-utils-node.cjs.js.map +1 -1
- package/dist/ge-commercetools-utils-node.esm.js +1 -1
- package/dist/typings/models/associate-role.d.ts +79 -0
- package/dist/typings/models/attribute-group.d.ts +68 -0
- package/dist/typings/models/business-unit.d.ts +272 -0
- package/dist/typings/models/cart-discount.d.ts +2 -2
- package/dist/typings/models/cart.d.ts +133 -115
- package/dist/typings/models/channel.d.ts +4 -4
- package/dist/typings/models/common.d.ts +49 -40
- package/dist/typings/models/customer.d.ts +16 -13
- package/dist/typings/models/error.d.ts +451 -18
- package/dist/typings/models/extension.d.ts +7 -3
- package/dist/typings/models/graph-ql.d.ts +3 -1
- package/dist/typings/models/index.d.ts +13 -6
- package/dist/typings/models/me.d.ts +179 -37
- package/dist/typings/models/message.d.ts +849 -20
- package/dist/typings/models/order-edit.d.ts +22 -16
- package/dist/typings/models/order.d.ts +124 -25
- package/dist/typings/models/payment.d.ts +19 -14
- package/dist/typings/models/product-selection.d.ts +39 -6
- package/dist/typings/models/product-type.d.ts +4 -4
- package/dist/typings/models/product.d.ts +13 -5
- package/dist/typings/models/project.d.ts +18 -3
- package/dist/typings/models/quote-request.d.ts +5 -1
- package/dist/typings/models/quote.d.ts +8 -3
- package/dist/typings/models/scalar-types.d.ts +0 -1
- package/dist/typings/models/shipping-method.d.ts +7 -7
- package/dist/typings/models/shopping-list.d.ts +22 -22
- package/dist/typings/models/staged-quote.d.ts +5 -1
- package/dist/typings/models/standalone-price.d.ts +9 -5
- package/dist/typings/models/state.d.ts +2 -2
- package/dist/typings/models/store-country.d.ts +3 -0
- package/dist/typings/models/store.d.ts +16 -1
- package/dist/typings/models/subscription.d.ts +27 -14
- package/dist/typings/models/tax-category.d.ts +6 -2
- package/dist/typings/models/type.d.ts +3 -3
- package/package.json +19 -19
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
import { BusinessUnitKeyReference, BusinessUnitResourceIdentifier } from './business-unit';
|
|
1
2
|
import { CartDiscountReference, CartDiscountTarget, CartDiscountValue } from './cart-discount';
|
|
2
3
|
import { ChannelReference, ChannelResourceIdentifier } from './channel';
|
|
3
|
-
import { Address, BaseAddress, BaseResource, CreatedBy, LastModifiedBy, LocalizedString,
|
|
4
|
+
import { Address, BaseAddress, BaseResource, CentPrecisionMoney, CreatedBy, LastModifiedBy, LocalizedString, Price, Reference, TypedMoney, _BaseAddress, _Money } from './common';
|
|
4
5
|
import { CustomerGroupReference, CustomerGroupResourceIdentifier } from './customer-group';
|
|
5
6
|
import { DiscountCodeReference } from './discount-code';
|
|
6
|
-
import { Delivery, ItemState, OrderReference, PaymentInfo } from './order';
|
|
7
|
+
import { Delivery, DeliveryDraft, ItemState, OrderReference, PaymentInfo } from './order';
|
|
7
8
|
import { PaymentResourceIdentifier } from './payment';
|
|
8
9
|
import { ProductVariant } from './product';
|
|
9
10
|
import { ProductTypeReference } from './product-type';
|
|
@@ -14,44 +15,47 @@ import { SubRate, TaxCategoryReference, TaxCategoryResourceIdentifier, TaxRate }
|
|
|
14
15
|
import { CustomFields, CustomFieldsDraft, FieldContainer, TypeResourceIdentifier } from './type';
|
|
15
16
|
export interface Cart extends BaseResource {
|
|
16
17
|
readonly id: string;
|
|
17
|
-
readonly key?: string;
|
|
18
18
|
readonly version: number;
|
|
19
|
-
readonly
|
|
20
|
-
readonly lastModifiedAt: string;
|
|
21
|
-
readonly lastModifiedBy?: LastModifiedBy;
|
|
22
|
-
readonly createdBy?: CreatedBy;
|
|
19
|
+
readonly key?: string;
|
|
23
20
|
readonly customerId?: string;
|
|
24
21
|
readonly customerEmail?: string;
|
|
22
|
+
readonly customerGroup?: CustomerGroupReference;
|
|
25
23
|
readonly anonymousId?: string;
|
|
24
|
+
readonly businessUnit?: BusinessUnitKeyReference;
|
|
26
25
|
readonly store?: StoreKeyReference;
|
|
27
26
|
readonly lineItems: LineItem[];
|
|
28
27
|
readonly customLineItems: CustomLineItem[];
|
|
29
|
-
readonly
|
|
28
|
+
readonly totalLineItemQuantity?: number;
|
|
29
|
+
readonly totalPrice: CentPrecisionMoney;
|
|
30
30
|
readonly taxedPrice?: TaxedPrice;
|
|
31
31
|
readonly taxedShippingPrice?: TaxedPrice;
|
|
32
|
-
readonly cartState: CartState;
|
|
33
|
-
readonly shippingAddress?: Address;
|
|
34
|
-
readonly billingAddress?: Address;
|
|
35
|
-
readonly shippingMode: ShippingMode;
|
|
36
|
-
readonly shipping: Shipping[];
|
|
37
|
-
readonly inventoryMode?: InventoryMode;
|
|
38
32
|
readonly taxMode: TaxMode;
|
|
39
33
|
readonly taxRoundingMode: RoundingMode;
|
|
40
34
|
readonly taxCalculationMode: TaxCalculationMode;
|
|
41
|
-
readonly
|
|
42
|
-
readonly
|
|
35
|
+
readonly inventoryMode: InventoryMode;
|
|
36
|
+
readonly cartState: CartState;
|
|
37
|
+
readonly billingAddress?: Address;
|
|
38
|
+
readonly shippingAddress?: Address;
|
|
39
|
+
readonly shippingMode: ShippingMode;
|
|
40
|
+
readonly shippingKey?: string;
|
|
43
41
|
readonly shippingInfo?: ShippingInfo;
|
|
44
|
-
readonly
|
|
45
|
-
readonly
|
|
46
|
-
readonly
|
|
42
|
+
readonly shippingRateInput?: ShippingRateInput;
|
|
43
|
+
readonly shippingCustomFields?: CustomFields;
|
|
44
|
+
readonly shipping: Shipping[];
|
|
45
|
+
readonly itemShippingAddresses: Address[];
|
|
46
|
+
readonly discountCodes: DiscountCodeInfo[];
|
|
47
|
+
readonly directDiscounts: DirectDiscount[];
|
|
48
|
+
readonly refusedGifts: CartDiscountReference[];
|
|
47
49
|
readonly paymentInfo?: PaymentInfo;
|
|
50
|
+
readonly country?: string;
|
|
48
51
|
readonly locale?: string;
|
|
49
|
-
readonly deleteDaysAfterLastModification?: number;
|
|
50
|
-
readonly refusedGifts: CartDiscountReference[];
|
|
51
52
|
readonly origin: CartOrigin;
|
|
52
|
-
readonly
|
|
53
|
-
readonly
|
|
54
|
-
readonly
|
|
53
|
+
readonly custom?: CustomFields;
|
|
54
|
+
readonly deleteDaysAfterLastModification?: number;
|
|
55
|
+
readonly createdAt: string;
|
|
56
|
+
readonly lastModifiedAt: string;
|
|
57
|
+
readonly lastModifiedBy?: LastModifiedBy;
|
|
58
|
+
readonly createdBy?: CreatedBy;
|
|
55
59
|
}
|
|
56
60
|
export interface CartDraft {
|
|
57
61
|
readonly currency: string;
|
|
@@ -60,35 +64,36 @@ export interface CartDraft {
|
|
|
60
64
|
readonly customerEmail?: string;
|
|
61
65
|
readonly customerGroup?: CustomerGroupResourceIdentifier;
|
|
62
66
|
readonly anonymousId?: string;
|
|
67
|
+
readonly businessUnit?: BusinessUnitResourceIdentifier;
|
|
63
68
|
readonly store?: StoreResourceIdentifier;
|
|
64
|
-
readonly
|
|
65
|
-
readonly
|
|
69
|
+
readonly lineItems?: LineItemDraft[];
|
|
70
|
+
readonly customLineItems?: CustomLineItemDraft[];
|
|
66
71
|
readonly taxMode?: TaxMode;
|
|
72
|
+
readonly externalTaxRateForShippingMethod?: ExternalTaxRateDraft;
|
|
67
73
|
readonly taxRoundingMode?: RoundingMode;
|
|
68
74
|
readonly taxCalculationMode?: TaxCalculationMode;
|
|
69
|
-
readonly
|
|
70
|
-
readonly
|
|
71
|
-
readonly shippingAddress?:
|
|
72
|
-
readonly billingAddress?: BaseAddress;
|
|
75
|
+
readonly inventoryMode?: InventoryMode;
|
|
76
|
+
readonly billingAddress?: _BaseAddress;
|
|
77
|
+
readonly shippingAddress?: _BaseAddress;
|
|
73
78
|
readonly shippingMethod?: ShippingMethodResourceIdentifier;
|
|
74
|
-
readonly
|
|
75
|
-
readonly custom?: CustomFieldsDraft;
|
|
76
|
-
readonly locale?: string;
|
|
77
|
-
readonly deleteDaysAfterLastModification?: number;
|
|
78
|
-
readonly origin?: CartOrigin;
|
|
79
|
+
readonly shippingRateInput?: ShippingRateInputDraft;
|
|
79
80
|
readonly shippingMode?: ShippingMode;
|
|
80
81
|
readonly customShipping?: CustomShippingDraft[];
|
|
81
82
|
readonly shipping?: ShippingDraft[];
|
|
82
|
-
readonly shippingRateInput?: ShippingRateInputDraft;
|
|
83
83
|
readonly itemShippingAddresses?: BaseAddress[];
|
|
84
84
|
readonly discountCodes?: string[];
|
|
85
|
+
readonly country?: string;
|
|
86
|
+
readonly locale?: string;
|
|
87
|
+
readonly origin?: CartOrigin;
|
|
88
|
+
readonly deleteDaysAfterLastModification?: number;
|
|
89
|
+
readonly custom?: CustomFieldsDraft;
|
|
85
90
|
}
|
|
86
|
-
export type CartOrigin = 'Customer' | 'Merchant' | 'Quote';
|
|
91
|
+
export type CartOrigin = 'Customer' | 'Merchant' | 'Quote' | string;
|
|
87
92
|
export interface CartPagedQueryResponse {
|
|
88
93
|
readonly limit: number;
|
|
94
|
+
readonly offset: number;
|
|
89
95
|
readonly count: number;
|
|
90
96
|
readonly total?: number;
|
|
91
|
-
readonly offset: number;
|
|
92
97
|
readonly results: Cart[];
|
|
93
98
|
}
|
|
94
99
|
export interface CartReference {
|
|
@@ -101,18 +106,18 @@ export interface CartResourceIdentifier {
|
|
|
101
106
|
readonly id?: string;
|
|
102
107
|
readonly key?: string;
|
|
103
108
|
}
|
|
104
|
-
export type CartState = 'Active' | 'Merged' | 'Ordered' |
|
|
109
|
+
export type CartState = 'Active' | 'Frozen' | 'Merged' | 'Ordered' | string;
|
|
105
110
|
export interface CartUpdate {
|
|
106
111
|
readonly version: number;
|
|
107
112
|
readonly actions: CartUpdateAction[];
|
|
108
113
|
}
|
|
109
|
-
export type CartUpdateAction = CartAddCustomLineItemAction | CartAddCustomShippingMethodAction | CartAddDiscountCodeAction | CartAddItemShippingAddressAction | CartAddLineItemAction | CartAddPaymentAction | CartAddShippingMethodAction | CartAddShoppingListAction | CartApplyDeltaToCustomLineItemShippingDetailsTargetsAction | CartApplyDeltaToLineItemShippingDetailsTargetsAction | CartChangeCustomLineItemMoneyAction | CartChangeCustomLineItemPriceModeAction | CartChangeCustomLineItemQuantityAction | CartChangeLineItemQuantityAction | CartChangeTaxCalculationModeAction | CartChangeTaxModeAction | CartChangeTaxRoundingModeAction | CartRecalculateAction | CartRemoveCustomLineItemAction | CartRemoveDiscountCodeAction | CartRemoveItemShippingAddressAction | CartRemoveLineItemAction | CartRemovePaymentAction | CartRemoveShippingMethodAction | CartSetAnonymousIdAction | CartSetBillingAddressAction | CartSetBillingAddressCustomFieldAction | CartSetBillingAddressCustomTypeAction | CartSetCartTotalTaxAction | CartSetCountryAction | CartSetCustomFieldAction | CartSetCustomLineItemCustomFieldAction | CartSetCustomLineItemCustomTypeAction | CartSetCustomLineItemShippingDetailsAction | CartSetCustomLineItemTaxAmountAction | CartSetCustomLineItemTaxRateAction | CartSetCustomShippingMethodAction | CartSetCustomTypeAction | CartSetCustomerEmailAction | CartSetCustomerGroupAction | CartSetCustomerIdAction | CartSetDeleteDaysAfterLastModificationAction | CartSetDeliveryAddressCustomFieldAction | CartSetDeliveryAddressCustomTypeAction | CartSetDirectDiscountsAction |
|
|
114
|
+
export type CartUpdateAction = CartAddCustomLineItemAction | CartAddCustomShippingMethodAction | CartAddDiscountCodeAction | CartAddItemShippingAddressAction | CartAddLineItemAction | CartAddPaymentAction | CartAddShippingMethodAction | CartAddShoppingListAction | CartApplyDeltaToCustomLineItemShippingDetailsTargetsAction | CartApplyDeltaToLineItemShippingDetailsTargetsAction | CartChangeCustomLineItemMoneyAction | CartChangeCustomLineItemPriceModeAction | CartChangeCustomLineItemQuantityAction | CartChangeLineItemQuantityAction | CartChangeTaxCalculationModeAction | CartChangeTaxModeAction | CartChangeTaxRoundingModeAction | CartFreezeCartAction | CartRecalculateAction | CartRemoveCustomLineItemAction | CartRemoveDiscountCodeAction | CartRemoveItemShippingAddressAction | CartRemoveLineItemAction | CartRemovePaymentAction | CartRemoveShippingMethodAction | CartSetAnonymousIdAction | CartSetBillingAddressAction | CartSetBillingAddressCustomFieldAction | CartSetBillingAddressCustomTypeAction | CartSetBusinessUnitAction | CartSetCartTotalTaxAction | CartSetCountryAction | CartSetCustomFieldAction | CartSetCustomLineItemCustomFieldAction | CartSetCustomLineItemCustomTypeAction | CartSetCustomLineItemShippingDetailsAction | CartSetCustomLineItemTaxAmountAction | CartSetCustomLineItemTaxRateAction | CartSetCustomShippingMethodAction | CartSetCustomTypeAction | CartSetCustomerEmailAction | CartSetCustomerGroupAction | CartSetCustomerIdAction | CartSetDeleteDaysAfterLastModificationAction | CartSetDeliveryAddressCustomFieldAction | CartSetDeliveryAddressCustomTypeAction | CartSetDirectDiscountsAction | CartSetItemShippingAddressCustomFieldAction | CartSetItemShippingAddressCustomTypeAction | CartSetKeyAction | CartSetLineItemCustomFieldAction | CartSetLineItemCustomTypeAction | CartSetLineItemDistributionChannelAction | CartSetLineItemPriceAction | CartSetLineItemShippingDetailsAction | CartSetLineItemSupplyChannelAction | CartSetLineItemTaxAmountAction | CartSetLineItemTaxRateAction | CartSetLineItemTotalPriceAction | CartSetLocaleAction | CartSetShippingAddressAction | CartSetShippingAddressCustomFieldAction | CartSetShippingAddressCustomTypeAction | CartSetShippingCustomFieldAction | CartSetShippingCustomTypeAction | CartSetShippingMethodAction | CartSetShippingMethodTaxAmountAction | CartSetShippingMethodTaxRateAction | CartSetShippingRateInputAction | CartUnfreezeCartAction | CartUpdateItemShippingAddressAction;
|
|
110
115
|
export interface CustomLineItem {
|
|
111
116
|
readonly id: string;
|
|
112
117
|
readonly name: LocalizedString;
|
|
113
118
|
readonly money: TypedMoney;
|
|
114
119
|
readonly taxedPrice?: TaxedItemPrice;
|
|
115
|
-
readonly totalPrice:
|
|
120
|
+
readonly totalPrice: CentPrecisionMoney;
|
|
116
121
|
readonly slug: string;
|
|
117
122
|
readonly quantity: number;
|
|
118
123
|
readonly state: ItemState[];
|
|
@@ -125,8 +130,8 @@ export interface CustomLineItem {
|
|
|
125
130
|
}
|
|
126
131
|
export interface CustomLineItemDraft {
|
|
127
132
|
readonly name: LocalizedString;
|
|
128
|
-
readonly quantity
|
|
129
|
-
readonly money:
|
|
133
|
+
readonly quantity?: number;
|
|
134
|
+
readonly money: _Money;
|
|
130
135
|
readonly slug: string;
|
|
131
136
|
readonly taxCategory?: TaxCategoryResourceIdentifier;
|
|
132
137
|
readonly externalTaxRate?: ExternalTaxRateDraft;
|
|
@@ -134,17 +139,17 @@ export interface CustomLineItemDraft {
|
|
|
134
139
|
readonly shippingDetails?: ItemShippingDetailsDraft;
|
|
135
140
|
readonly priceMode: CustomLineItemPriceMode;
|
|
136
141
|
}
|
|
137
|
-
export type CustomLineItemPriceMode = 'External' | 'Standard';
|
|
142
|
+
export type CustomLineItemPriceMode = 'External' | 'Standard' | string;
|
|
138
143
|
export interface CustomShippingDraft {
|
|
139
144
|
readonly key: string;
|
|
140
145
|
readonly shippingMethodName: string;
|
|
141
|
-
readonly shippingAddress?:
|
|
146
|
+
readonly shippingAddress?: _BaseAddress;
|
|
142
147
|
readonly shippingRate: ShippingRateDraft;
|
|
143
148
|
readonly shippingRateInput?: ShippingRateInputDraft;
|
|
144
149
|
readonly taxCategory?: TaxCategoryResourceIdentifier;
|
|
145
|
-
readonly externalTaxRate?:
|
|
146
|
-
readonly deliveries
|
|
147
|
-
readonly custom?:
|
|
150
|
+
readonly externalTaxRate?: ExternalTaxRateDraft;
|
|
151
|
+
readonly deliveries?: DeliveryDraft[];
|
|
152
|
+
readonly custom?: CustomFieldsDraft;
|
|
148
153
|
}
|
|
149
154
|
export interface DirectDiscount {
|
|
150
155
|
readonly id: string;
|
|
@@ -155,13 +160,17 @@ export interface DirectDiscountDraft {
|
|
|
155
160
|
readonly value: CartDiscountValue;
|
|
156
161
|
readonly target?: CartDiscountTarget;
|
|
157
162
|
}
|
|
163
|
+
export interface DirectDiscountReference {
|
|
164
|
+
readonly typeId: 'direct-discount';
|
|
165
|
+
readonly id: string;
|
|
166
|
+
}
|
|
158
167
|
export interface DiscountCodeInfo {
|
|
159
168
|
readonly discountCode: DiscountCodeReference;
|
|
160
169
|
readonly state: DiscountCodeState;
|
|
161
170
|
}
|
|
162
|
-
export type DiscountCodeState = 'ApplicationStoppedByPreviousDiscount' | 'DoesNotMatchCart' | 'MatchesCart' | 'MaxApplicationReached' | 'NotActive' | 'NotValid';
|
|
171
|
+
export type DiscountCodeState = 'ApplicationStoppedByPreviousDiscount' | 'DoesNotMatchCart' | 'MatchesCart' | 'MaxApplicationReached' | 'NotActive' | 'NotValid' | string;
|
|
163
172
|
export interface DiscountedLineItemPortion {
|
|
164
|
-
readonly discount:
|
|
173
|
+
readonly discount: Reference;
|
|
165
174
|
readonly discountedAmount: TypedMoney;
|
|
166
175
|
}
|
|
167
176
|
export interface DiscountedLineItemPrice {
|
|
@@ -173,22 +182,22 @@ export interface DiscountedLineItemPriceForQuantity {
|
|
|
173
182
|
readonly discountedPrice: DiscountedLineItemPrice;
|
|
174
183
|
}
|
|
175
184
|
export interface ExternalLineItemTotalPrice {
|
|
176
|
-
readonly price:
|
|
177
|
-
readonly totalPrice:
|
|
185
|
+
readonly price: _Money;
|
|
186
|
+
readonly totalPrice: _Money;
|
|
178
187
|
}
|
|
179
188
|
export interface ExternalTaxAmountDraft {
|
|
180
|
-
readonly totalGross:
|
|
189
|
+
readonly totalGross: _Money;
|
|
181
190
|
readonly taxRate: ExternalTaxRateDraft;
|
|
182
191
|
}
|
|
183
192
|
export interface ExternalTaxRateDraft {
|
|
184
193
|
readonly name: string;
|
|
185
194
|
readonly amount?: number;
|
|
195
|
+
readonly includedInPrice?: boolean;
|
|
186
196
|
readonly country: string;
|
|
187
197
|
readonly state?: string;
|
|
188
198
|
readonly subRates?: SubRate[];
|
|
189
|
-
readonly includedInPrice?: boolean;
|
|
190
199
|
}
|
|
191
|
-
export type InventoryMode = 'None' | 'ReserveOnOrder' | 'TrackOnly';
|
|
200
|
+
export type InventoryMode = 'None' | 'ReserveOnOrder' | 'TrackOnly' | string;
|
|
192
201
|
export interface ItemShippingDetails {
|
|
193
202
|
readonly targets: ItemShippingTarget[];
|
|
194
203
|
readonly valid: boolean;
|
|
@@ -210,22 +219,22 @@ export interface LineItem {
|
|
|
210
219
|
readonly productType: ProductTypeReference;
|
|
211
220
|
readonly variant: ProductVariant;
|
|
212
221
|
readonly price: Price;
|
|
222
|
+
readonly quantity: number;
|
|
223
|
+
readonly totalPrice: CentPrecisionMoney;
|
|
224
|
+
readonly discountedPricePerQuantity: DiscountedLineItemPriceForQuantity[];
|
|
213
225
|
readonly taxedPrice?: TaxedItemPrice;
|
|
214
226
|
readonly taxedPricePortions: MethodTaxedPrice[];
|
|
215
|
-
readonly totalPrice: TypedMoney;
|
|
216
|
-
readonly quantity: number;
|
|
217
|
-
readonly addedAt?: string;
|
|
218
227
|
readonly state: ItemState[];
|
|
219
228
|
readonly taxRate?: TaxRate;
|
|
220
229
|
readonly perMethodTaxRate: MethodTaxRate[];
|
|
221
230
|
readonly supplyChannel?: ChannelReference;
|
|
222
231
|
readonly distributionChannel?: ChannelReference;
|
|
223
|
-
readonly discountedPricePerQuantity: DiscountedLineItemPriceForQuantity[];
|
|
224
232
|
readonly priceMode: LineItemPriceMode;
|
|
225
233
|
readonly lineItemMode: LineItemMode;
|
|
226
|
-
readonly custom?: CustomFields;
|
|
227
234
|
readonly inventoryMode?: InventoryMode;
|
|
228
235
|
readonly shippingDetails?: ItemShippingDetails;
|
|
236
|
+
readonly custom?: CustomFields;
|
|
237
|
+
readonly addedAt?: string;
|
|
229
238
|
readonly lastModifiedAt?: string;
|
|
230
239
|
}
|
|
231
240
|
export interface LineItemDraft {
|
|
@@ -234,17 +243,17 @@ export interface LineItemDraft {
|
|
|
234
243
|
readonly sku?: string;
|
|
235
244
|
readonly quantity?: number;
|
|
236
245
|
readonly addedAt?: string;
|
|
237
|
-
readonly supplyChannel?: ChannelResourceIdentifier;
|
|
238
246
|
readonly distributionChannel?: ChannelResourceIdentifier;
|
|
239
|
-
readonly
|
|
240
|
-
readonly
|
|
241
|
-
readonly externalPrice?: Money;
|
|
247
|
+
readonly supplyChannel?: ChannelResourceIdentifier;
|
|
248
|
+
readonly externalPrice?: _Money;
|
|
242
249
|
readonly externalTotalPrice?: ExternalLineItemTotalPrice;
|
|
250
|
+
readonly externalTaxRate?: ExternalTaxRateDraft;
|
|
243
251
|
readonly inventoryMode?: InventoryMode;
|
|
244
252
|
readonly shippingDetails?: ItemShippingDetailsDraft;
|
|
253
|
+
readonly custom?: CustomFieldsDraft;
|
|
245
254
|
}
|
|
246
|
-
export type LineItemMode = 'GiftLineItem' | 'Standard';
|
|
247
|
-
export type LineItemPriceMode = 'ExternalPrice' | 'ExternalTotal' | 'Platform';
|
|
255
|
+
export type LineItemMode = 'GiftLineItem' | 'Standard' | string;
|
|
256
|
+
export type LineItemPriceMode = 'ExternalPrice' | 'ExternalTotal' | 'Platform' | string;
|
|
248
257
|
export interface MethodTaxRate {
|
|
249
258
|
readonly shippingMethodKey: string;
|
|
250
259
|
readonly taxRate?: TaxRate;
|
|
@@ -257,7 +266,7 @@ export interface ReplicaCartDraft {
|
|
|
257
266
|
readonly reference: CartReference | OrderReference;
|
|
258
267
|
readonly key?: string;
|
|
259
268
|
}
|
|
260
|
-
export type RoundingMode = 'HalfDown' | 'HalfEven' | 'HalfUp';
|
|
269
|
+
export type RoundingMode = 'HalfDown' | 'HalfEven' | 'HalfUp' | string;
|
|
261
270
|
export interface Shipping {
|
|
262
271
|
readonly shippingKey: string;
|
|
263
272
|
readonly shippingInfo: ShippingInfo;
|
|
@@ -268,15 +277,15 @@ export interface Shipping {
|
|
|
268
277
|
export interface ShippingDraft {
|
|
269
278
|
readonly key: string;
|
|
270
279
|
readonly shippingMethod?: ShippingMethodReference;
|
|
271
|
-
readonly shippingAddress
|
|
280
|
+
readonly shippingAddress: _BaseAddress;
|
|
272
281
|
readonly shippingRateInput?: ShippingRateInputDraft;
|
|
273
|
-
readonly externalTaxRate?:
|
|
274
|
-
readonly deliveries
|
|
275
|
-
readonly custom?:
|
|
282
|
+
readonly externalTaxRate?: ExternalTaxRateDraft;
|
|
283
|
+
readonly deliveries?: DeliveryDraft[];
|
|
284
|
+
readonly custom?: CustomFieldsDraft;
|
|
276
285
|
}
|
|
277
286
|
export interface ShippingInfo {
|
|
278
287
|
readonly shippingMethodName: string;
|
|
279
|
-
readonly price:
|
|
288
|
+
readonly price: CentPrecisionMoney;
|
|
280
289
|
readonly shippingRate: ShippingRate;
|
|
281
290
|
readonly taxedPrice?: TaxedItemPrice;
|
|
282
291
|
readonly taxRate?: TaxRate;
|
|
@@ -286,8 +295,8 @@ export interface ShippingInfo {
|
|
|
286
295
|
readonly discountedPrice?: DiscountedLineItemPrice;
|
|
287
296
|
readonly shippingMethodState: ShippingMethodState;
|
|
288
297
|
}
|
|
289
|
-
export type ShippingMethodState = 'DoesNotMatchCart' | 'MatchesCart';
|
|
290
|
-
export type ShippingMode = 'Multiple' | 'Single';
|
|
298
|
+
export type ShippingMethodState = 'DoesNotMatchCart' | 'MatchesCart' | string;
|
|
299
|
+
export type ShippingMode = 'Multiple' | 'Single' | string;
|
|
291
300
|
export type ShippingRateInput = ClassificationShippingRateInput | ScoreShippingRateInput;
|
|
292
301
|
export interface ClassificationShippingRateInput {
|
|
293
302
|
readonly type: 'Classification';
|
|
@@ -307,56 +316,57 @@ export interface ScoreShippingRateInputDraft {
|
|
|
307
316
|
readonly type: 'Score';
|
|
308
317
|
readonly score: number;
|
|
309
318
|
}
|
|
310
|
-
export type TaxCalculationMode = 'LineItemLevel' | 'UnitPriceLevel';
|
|
311
|
-
export type TaxMode = 'Disabled' | 'External' | 'ExternalAmount' | 'Platform';
|
|
319
|
+
export type TaxCalculationMode = 'LineItemLevel' | 'UnitPriceLevel' | string;
|
|
320
|
+
export type TaxMode = 'Disabled' | 'External' | 'ExternalAmount' | 'Platform' | string;
|
|
312
321
|
export interface TaxPortion {
|
|
313
322
|
readonly name?: string;
|
|
314
323
|
readonly rate: number;
|
|
315
|
-
readonly amount:
|
|
324
|
+
readonly amount: CentPrecisionMoney;
|
|
316
325
|
}
|
|
317
326
|
export interface TaxPortionDraft {
|
|
318
327
|
readonly name?: string;
|
|
319
328
|
readonly rate: number;
|
|
320
|
-
readonly amount:
|
|
329
|
+
readonly amount: _Money;
|
|
321
330
|
}
|
|
322
331
|
export interface TaxedItemPrice {
|
|
323
|
-
readonly totalNet:
|
|
324
|
-
readonly totalGross:
|
|
325
|
-
readonly totalTax?:
|
|
332
|
+
readonly totalNet: CentPrecisionMoney;
|
|
333
|
+
readonly totalGross: CentPrecisionMoney;
|
|
334
|
+
readonly totalTax?: CentPrecisionMoney;
|
|
326
335
|
}
|
|
327
336
|
export interface TaxedPrice {
|
|
328
|
-
readonly totalNet:
|
|
329
|
-
readonly totalGross:
|
|
337
|
+
readonly totalNet: CentPrecisionMoney;
|
|
338
|
+
readonly totalGross: CentPrecisionMoney;
|
|
330
339
|
readonly taxPortions: TaxPortion[];
|
|
331
|
-
readonly totalTax?:
|
|
340
|
+
readonly totalTax?: CentPrecisionMoney;
|
|
332
341
|
}
|
|
333
342
|
export interface TaxedPriceDraft {
|
|
334
|
-
readonly totalNet:
|
|
335
|
-
readonly totalGross:
|
|
343
|
+
readonly totalNet: _Money;
|
|
344
|
+
readonly totalGross: _Money;
|
|
336
345
|
readonly taxPortions: TaxPortionDraft[];
|
|
337
346
|
}
|
|
338
347
|
export interface CartAddCustomLineItemAction {
|
|
339
348
|
readonly action: 'addCustomLineItem';
|
|
340
|
-
readonly money:
|
|
349
|
+
readonly money: _Money;
|
|
341
350
|
readonly name: LocalizedString;
|
|
342
|
-
readonly quantity
|
|
351
|
+
readonly quantity?: number;
|
|
343
352
|
readonly slug: string;
|
|
344
353
|
readonly taxCategory?: TaxCategoryResourceIdentifier;
|
|
345
|
-
readonly custom?: CustomFieldsDraft;
|
|
346
354
|
readonly externalTaxRate?: ExternalTaxRateDraft;
|
|
355
|
+
readonly shippingDetails?: ItemShippingDetailsDraft;
|
|
356
|
+
readonly custom?: CustomFieldsDraft;
|
|
347
357
|
readonly priceMode?: CustomLineItemPriceMode;
|
|
348
358
|
}
|
|
349
359
|
export interface CartAddCustomShippingMethodAction {
|
|
350
360
|
readonly action: 'addCustomShippingMethod';
|
|
351
361
|
readonly shippingKey: string;
|
|
352
362
|
readonly shippingMethodName: string;
|
|
353
|
-
readonly shippingAddress
|
|
363
|
+
readonly shippingAddress: _BaseAddress;
|
|
354
364
|
readonly shippingRate: ShippingRateDraft;
|
|
355
365
|
readonly shippingRateInput?: ShippingRateInputDraft;
|
|
356
366
|
readonly taxCategory?: TaxCategoryResourceIdentifier;
|
|
357
|
-
readonly externalTaxRate?:
|
|
358
|
-
readonly deliveries
|
|
359
|
-
readonly custom?:
|
|
367
|
+
readonly externalTaxRate?: ExternalTaxRateDraft;
|
|
368
|
+
readonly deliveries?: DeliveryDraft[];
|
|
369
|
+
readonly custom?: CustomFieldsDraft;
|
|
360
370
|
}
|
|
361
371
|
export interface CartAddDiscountCodeAction {
|
|
362
372
|
readonly action: 'addDiscountCode';
|
|
@@ -364,21 +374,23 @@ export interface CartAddDiscountCodeAction {
|
|
|
364
374
|
}
|
|
365
375
|
export interface CartAddItemShippingAddressAction {
|
|
366
376
|
readonly action: 'addItemShippingAddress';
|
|
367
|
-
readonly address:
|
|
377
|
+
readonly address: _BaseAddress;
|
|
368
378
|
}
|
|
369
379
|
export interface CartAddLineItemAction {
|
|
370
380
|
readonly action: 'addLineItem';
|
|
371
|
-
readonly custom?: CustomFieldsDraft;
|
|
372
|
-
readonly distributionChannel?: ChannelResourceIdentifier;
|
|
373
|
-
readonly externalTaxRate?: ExternalTaxRateDraft;
|
|
374
381
|
readonly productId?: string;
|
|
375
382
|
readonly variantId?: number;
|
|
376
383
|
readonly sku?: string;
|
|
377
384
|
readonly quantity?: number;
|
|
385
|
+
readonly addedAt?: string;
|
|
386
|
+
readonly distributionChannel?: ChannelResourceIdentifier;
|
|
378
387
|
readonly supplyChannel?: ChannelResourceIdentifier;
|
|
379
|
-
readonly externalPrice?:
|
|
388
|
+
readonly externalPrice?: _Money;
|
|
380
389
|
readonly externalTotalPrice?: ExternalLineItemTotalPrice;
|
|
390
|
+
readonly externalTaxRate?: ExternalTaxRateDraft;
|
|
391
|
+
readonly inventoryMode?: InventoryMode;
|
|
381
392
|
readonly shippingDetails?: ItemShippingDetailsDraft;
|
|
393
|
+
readonly custom?: CustomFieldsDraft;
|
|
382
394
|
}
|
|
383
395
|
export interface CartAddPaymentAction {
|
|
384
396
|
readonly action: 'addPayment';
|
|
@@ -387,18 +399,18 @@ export interface CartAddPaymentAction {
|
|
|
387
399
|
export interface CartAddShippingMethodAction {
|
|
388
400
|
readonly action: 'addShippingMethod';
|
|
389
401
|
readonly shippingKey: string;
|
|
390
|
-
readonly shippingMethod
|
|
391
|
-
readonly shippingAddress
|
|
402
|
+
readonly shippingMethod: ShippingMethodResourceIdentifier;
|
|
403
|
+
readonly shippingAddress: _BaseAddress;
|
|
392
404
|
readonly shippingRateInput?: ShippingRateInputDraft;
|
|
393
|
-
readonly externalTaxRate?:
|
|
394
|
-
readonly deliveries
|
|
395
|
-
readonly custom?:
|
|
405
|
+
readonly externalTaxRate?: ExternalTaxRateDraft;
|
|
406
|
+
readonly deliveries?: DeliveryDraft[];
|
|
407
|
+
readonly custom?: CustomFieldsDraft;
|
|
396
408
|
}
|
|
397
409
|
export interface CartAddShoppingListAction {
|
|
398
410
|
readonly action: 'addShoppingList';
|
|
399
411
|
readonly shoppingList: ShoppingListResourceIdentifier;
|
|
400
|
-
readonly supplyChannel?: ChannelResourceIdentifier;
|
|
401
412
|
readonly distributionChannel?: ChannelResourceIdentifier;
|
|
413
|
+
readonly supplyChannel?: ChannelResourceIdentifier;
|
|
402
414
|
}
|
|
403
415
|
export interface CartApplyDeltaToCustomLineItemShippingDetailsTargetsAction {
|
|
404
416
|
readonly action: 'applyDeltaToCustomLineItemShippingDetailsTargets';
|
|
@@ -413,7 +425,7 @@ export interface CartApplyDeltaToLineItemShippingDetailsTargetsAction {
|
|
|
413
425
|
export interface CartChangeCustomLineItemMoneyAction {
|
|
414
426
|
readonly action: 'changeCustomLineItemMoney';
|
|
415
427
|
readonly customLineItemId: string;
|
|
416
|
-
readonly money:
|
|
428
|
+
readonly money: _Money;
|
|
417
429
|
}
|
|
418
430
|
export interface CartChangeCustomLineItemPriceModeAction {
|
|
419
431
|
readonly action: 'changeCustomLineItemPriceMode';
|
|
@@ -429,7 +441,7 @@ export interface CartChangeLineItemQuantityAction {
|
|
|
429
441
|
readonly action: 'changeLineItemQuantity';
|
|
430
442
|
readonly lineItemId: string;
|
|
431
443
|
readonly quantity: number;
|
|
432
|
-
readonly externalPrice?:
|
|
444
|
+
readonly externalPrice?: _Money;
|
|
433
445
|
readonly externalTotalPrice?: ExternalLineItemTotalPrice;
|
|
434
446
|
}
|
|
435
447
|
export interface CartChangeTaxCalculationModeAction {
|
|
@@ -467,7 +479,7 @@ export interface CartRemoveLineItemAction {
|
|
|
467
479
|
readonly action: 'removeLineItem';
|
|
468
480
|
readonly lineItemId: string;
|
|
469
481
|
readonly quantity?: number;
|
|
470
|
-
readonly externalPrice?:
|
|
482
|
+
readonly externalPrice?: _Money;
|
|
471
483
|
readonly externalTotalPrice?: ExternalLineItemTotalPrice;
|
|
472
484
|
readonly shippingDetailsToRemove?: ItemShippingDetailsDraft;
|
|
473
485
|
}
|
|
@@ -485,7 +497,7 @@ export interface CartSetAnonymousIdAction {
|
|
|
485
497
|
}
|
|
486
498
|
export interface CartSetBillingAddressAction {
|
|
487
499
|
readonly action: 'setBillingAddress';
|
|
488
|
-
readonly address?:
|
|
500
|
+
readonly address?: _BaseAddress;
|
|
489
501
|
}
|
|
490
502
|
export interface CartSetBillingAddressCustomFieldAction {
|
|
491
503
|
readonly action: 'setBillingAddressCustomField';
|
|
@@ -497,9 +509,13 @@ export interface CartSetBillingAddressCustomTypeAction {
|
|
|
497
509
|
readonly type?: TypeResourceIdentifier;
|
|
498
510
|
readonly fields?: FieldContainer;
|
|
499
511
|
}
|
|
512
|
+
export interface CartSetBusinessUnitAction {
|
|
513
|
+
readonly action: 'setBusinessUnit';
|
|
514
|
+
readonly businessUnit: BusinessUnitResourceIdentifier;
|
|
515
|
+
}
|
|
500
516
|
export interface CartSetCartTotalTaxAction {
|
|
501
517
|
readonly action: 'setCartTotalTax';
|
|
502
|
-
readonly externalTotalGross:
|
|
518
|
+
readonly externalTotalGross: _Money;
|
|
503
519
|
readonly externalTaxPortions?: TaxPortionDraft[];
|
|
504
520
|
}
|
|
505
521
|
export interface CartSetCountryAction {
|
|
@@ -552,7 +568,7 @@ export interface CartSetCustomTypeAction {
|
|
|
552
568
|
}
|
|
553
569
|
export interface CartSetCustomerEmailAction {
|
|
554
570
|
readonly action: 'setCustomerEmail';
|
|
555
|
-
readonly email
|
|
571
|
+
readonly email?: string;
|
|
556
572
|
}
|
|
557
573
|
export interface CartSetCustomerGroupAction {
|
|
558
574
|
readonly action: 'setCustomerGroup';
|
|
@@ -618,7 +634,7 @@ export interface CartSetLineItemDistributionChannelAction {
|
|
|
618
634
|
export interface CartSetLineItemPriceAction {
|
|
619
635
|
readonly action: 'setLineItemPrice';
|
|
620
636
|
readonly lineItemId: string;
|
|
621
|
-
readonly externalPrice?:
|
|
637
|
+
readonly externalPrice?: _Money;
|
|
622
638
|
}
|
|
623
639
|
export interface CartSetLineItemShippingDetailsAction {
|
|
624
640
|
readonly action: 'setLineItemShippingDetails';
|
|
@@ -634,11 +650,13 @@ export interface CartSetLineItemTaxAmountAction {
|
|
|
634
650
|
readonly action: 'setLineItemTaxAmount';
|
|
635
651
|
readonly lineItemId: string;
|
|
636
652
|
readonly externalTaxAmount?: ExternalTaxAmountDraft;
|
|
653
|
+
readonly shippingKey?: string;
|
|
637
654
|
}
|
|
638
655
|
export interface CartSetLineItemTaxRateAction {
|
|
639
656
|
readonly action: 'setLineItemTaxRate';
|
|
640
657
|
readonly lineItemId: string;
|
|
641
658
|
readonly externalTaxRate?: ExternalTaxRateDraft;
|
|
659
|
+
readonly shippingKey?: string;
|
|
642
660
|
}
|
|
643
661
|
export interface CartSetLineItemTotalPriceAction {
|
|
644
662
|
readonly action: 'setLineItemTotalPrice';
|
|
@@ -651,7 +669,7 @@ export interface CartSetLocaleAction {
|
|
|
651
669
|
}
|
|
652
670
|
export interface CartSetShippingAddressAction {
|
|
653
671
|
readonly action: 'setShippingAddress';
|
|
654
|
-
readonly address?:
|
|
672
|
+
readonly address?: _BaseAddress;
|
|
655
673
|
}
|
|
656
674
|
export interface CartSetShippingAddressCustomFieldAction {
|
|
657
675
|
readonly action: 'setShippingAddressCustomField';
|
|
@@ -697,12 +715,12 @@ export interface CartUnfreezeCartAction {
|
|
|
697
715
|
}
|
|
698
716
|
export interface CartUpdateItemShippingAddressAction {
|
|
699
717
|
readonly action: 'updateItemShippingAddress';
|
|
700
|
-
readonly address:
|
|
718
|
+
readonly address: _BaseAddress;
|
|
701
719
|
}
|
|
702
720
|
export interface CustomLineItemImportDraft {
|
|
703
721
|
readonly name: LocalizedString;
|
|
704
722
|
readonly quantity: number;
|
|
705
|
-
readonly money:
|
|
723
|
+
readonly money: _Money;
|
|
706
724
|
readonly slug: string;
|
|
707
725
|
readonly state?: ItemState[];
|
|
708
726
|
readonly taxRate?: TaxRate;
|
|
@@ -711,4 +729,4 @@ export interface CustomLineItemImportDraft {
|
|
|
711
729
|
readonly shippingDetails?: ItemShippingDetailsDraft;
|
|
712
730
|
readonly priceMode: CustomLineItemPriceMode;
|
|
713
731
|
}
|
|
714
|
-
export type ProductPublishScope = 'All' | 'Prices';
|
|
732
|
+
export type ProductPublishScope = 'All' | 'Prices' | string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Address,
|
|
1
|
+
import { Address, BaseResource, CreatedBy, GeoJson, LastModifiedBy, LocalizedString, _BaseAddress } from './common';
|
|
2
2
|
import { ReviewRatingStatistics } from './review';
|
|
3
3
|
import { CustomFields, CustomFieldsDraft, FieldContainer, TypeResourceIdentifier } from './type';
|
|
4
4
|
export interface Channel extends BaseResource {
|
|
@@ -22,7 +22,7 @@ export interface ChannelDraft {
|
|
|
22
22
|
readonly roles?: ChannelRoleEnum[];
|
|
23
23
|
readonly name?: LocalizedString;
|
|
24
24
|
readonly description?: LocalizedString;
|
|
25
|
-
readonly address?:
|
|
25
|
+
readonly address?: _BaseAddress;
|
|
26
26
|
readonly custom?: CustomFieldsDraft;
|
|
27
27
|
readonly geoLocation?: GeoJson;
|
|
28
28
|
}
|
|
@@ -43,7 +43,7 @@ export interface ChannelResourceIdentifier {
|
|
|
43
43
|
readonly id?: string;
|
|
44
44
|
readonly key?: string;
|
|
45
45
|
}
|
|
46
|
-
export type ChannelRoleEnum = 'InventorySupply' | 'OrderExport' | 'OrderImport' | 'Primary' | 'ProductDistribution';
|
|
46
|
+
export type ChannelRoleEnum = 'InventorySupply' | 'OrderExport' | 'OrderImport' | 'Primary' | 'ProductDistribution' | string;
|
|
47
47
|
export interface ChannelUpdate {
|
|
48
48
|
readonly version: number;
|
|
49
49
|
readonly actions: ChannelUpdateAction[];
|
|
@@ -71,7 +71,7 @@ export interface ChannelRemoveRolesAction {
|
|
|
71
71
|
}
|
|
72
72
|
export interface ChannelSetAddressAction {
|
|
73
73
|
readonly action: 'setAddress';
|
|
74
|
-
readonly address?:
|
|
74
|
+
readonly address?: _BaseAddress;
|
|
75
75
|
}
|
|
76
76
|
export interface ChannelSetAddressCustomFieldAction {
|
|
77
77
|
readonly action: 'setAddressCustomField';
|