@gradientedge/commercetools-utils 4.24.0 → 4.26.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/api/CommercetoolsApi.d.ts +3 -0
- package/dist/typings/models/cart.d.ts +87 -1
- package/dist/typings/models/common.d.ts +1 -1
- package/dist/typings/models/me.d.ts +2 -2
- package/dist/typings/models/message.d.ts +254 -84
- package/dist/typings/models/order-edit.d.ts +2 -1
- package/dist/typings/models/order.d.ts +6 -2
- package/dist/typings/models/product-discount.d.ts +2 -2
- package/dist/typings/models/product.d.ts +5 -2
- package/dist/typings/models/quote-request.d.ts +9 -1
- package/dist/typings/models/quote.d.ts +15 -2
- package/dist/typings/models/staged-quote.d.ts +9 -1
- package/dist/typings/models/standalone-price.d.ts +16 -1
- package/dist/typings/models/state.d.ts +1 -1
- package/package.json +1 -1
|
@@ -72,6 +72,9 @@ export declare class CommercetoolsApi {
|
|
|
72
72
|
getChannelById(options: CommonRequestOptions & {
|
|
73
73
|
id: string;
|
|
74
74
|
}): Promise<Channel>;
|
|
75
|
+
getChannelByKey(options: CommonRequestOptions & {
|
|
76
|
+
key: string;
|
|
77
|
+
}): Promise<Channel>;
|
|
75
78
|
getCategory(options: CommonRequestOptions & {
|
|
76
79
|
id?: string;
|
|
77
80
|
key?: string;
|
|
@@ -28,9 +28,12 @@ export interface Cart extends BaseResource {
|
|
|
28
28
|
readonly customLineItems: CustomLineItem[];
|
|
29
29
|
readonly totalPrice: TypedMoney;
|
|
30
30
|
readonly taxedPrice?: TaxedPrice;
|
|
31
|
+
readonly taxedShippingPrice?: TaxedPrice;
|
|
31
32
|
readonly cartState: CartState;
|
|
32
33
|
readonly shippingAddress?: Address;
|
|
33
34
|
readonly billingAddress?: Address;
|
|
35
|
+
readonly shippingMode: ShippingMode;
|
|
36
|
+
readonly shipping: Shipping[];
|
|
34
37
|
readonly inventoryMode?: InventoryMode;
|
|
35
38
|
readonly taxMode: TaxMode;
|
|
36
39
|
readonly taxRoundingMode: RoundingMode;
|
|
@@ -73,6 +76,9 @@ export interface CartDraft {
|
|
|
73
76
|
readonly locale?: string;
|
|
74
77
|
readonly deleteDaysAfterLastModification?: number;
|
|
75
78
|
readonly origin?: CartOrigin;
|
|
79
|
+
readonly shippingMode?: ShippingMode;
|
|
80
|
+
readonly customShipping?: CustomShippingDraft[];
|
|
81
|
+
readonly shipping?: ShippingDraft[];
|
|
76
82
|
readonly shippingRateInput?: ShippingRateInputDraft;
|
|
77
83
|
readonly itemShippingAddresses?: BaseAddress[];
|
|
78
84
|
readonly discountCodes?: string[];
|
|
@@ -100,7 +106,7 @@ export interface CartUpdate {
|
|
|
100
106
|
readonly version: number;
|
|
101
107
|
readonly actions: CartUpdateAction[];
|
|
102
108
|
}
|
|
103
|
-
export declare type CartUpdateAction = CartAddCustomLineItemAction | CartAddDiscountCodeAction | CartAddItemShippingAddressAction | CartAddLineItemAction | CartAddPaymentAction | CartAddShoppingListAction | CartApplyDeltaToCustomLineItemShippingDetailsTargetsAction | CartApplyDeltaToLineItemShippingDetailsTargetsAction | CartChangeCustomLineItemMoneyAction | CartChangeCustomLineItemPriceModeAction | CartChangeCustomLineItemQuantityAction | CartChangeLineItemQuantityAction | CartChangeTaxCalculationModeAction | CartChangeTaxModeAction | CartChangeTaxRoundingModeAction | CartRecalculateAction | CartRemoveCustomLineItemAction | CartRemoveDiscountCodeAction | CartRemoveItemShippingAddressAction | CartRemoveLineItemAction | CartRemovePaymentAction | CartSetAnonymousIdAction | CartSetBillingAddressAction | CartSetBillingAddressCustomFieldAction | CartSetBillingAddressCustomTypeAction | 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 | CartSetShippingMethodAction | CartSetShippingMethodTaxAmountAction | CartSetShippingMethodTaxRateAction | CartSetShippingRateInputAction | CartUpdateItemShippingAddressAction;
|
|
109
|
+
export declare 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 | CartSetItemShippingAddressCustomFieldAction | CartSetItemShippingAddressCustomTypeAction | CartSetKeyAction | CartSetLineItemCustomFieldAction | CartSetLineItemCustomTypeAction | CartSetLineItemDistributionChannelAction | CartSetLineItemPriceAction | CartSetLineItemShippingDetailsAction | CartSetLineItemSupplyChannelAction | CartSetLineItemTaxAmountAction | CartSetLineItemTaxRateAction | CartSetLineItemTotalPriceAction | CartSetLocaleAction | CartSetShippingAddressAction | CartSetShippingAddressCustomFieldAction | CartSetShippingAddressCustomTypeAction | CartSetShippingCustomFieldAction | CartSetShippingCustomTypeAction | CartSetShippingMethodAction | CartSetShippingMethodTaxAmountAction | CartSetShippingMethodTaxRateAction | CartSetShippingRateInputAction | CartUpdateItemShippingAddressAction;
|
|
104
110
|
export interface CustomLineItem {
|
|
105
111
|
readonly id: string;
|
|
106
112
|
readonly name: LocalizedString;
|
|
@@ -126,8 +132,20 @@ export interface CustomLineItemDraft {
|
|
|
126
132
|
readonly externalTaxRate?: ExternalTaxRateDraft;
|
|
127
133
|
readonly custom?: CustomFieldsDraft;
|
|
128
134
|
readonly shippingDetails?: ItemShippingDetailsDraft;
|
|
135
|
+
readonly priceMode: CustomLineItemPriceMode;
|
|
129
136
|
}
|
|
130
137
|
export declare type CustomLineItemPriceMode = 'External' | 'Standard';
|
|
138
|
+
export interface CustomShippingDraft {
|
|
139
|
+
readonly key: string;
|
|
140
|
+
readonly shippingMethodName: string;
|
|
141
|
+
readonly shippingAddress?: BaseAddress;
|
|
142
|
+
readonly shippingRate: ShippingRateDraft;
|
|
143
|
+
readonly shippingRateInput?: ShippingRateInputDraft;
|
|
144
|
+
readonly taxCategory?: TaxCategoryResourceIdentifier;
|
|
145
|
+
readonly externalTaxRate?: string;
|
|
146
|
+
readonly deliveries: Delivery[];
|
|
147
|
+
readonly custom?: string;
|
|
148
|
+
}
|
|
131
149
|
export interface DirectDiscount {
|
|
132
150
|
readonly id: string;
|
|
133
151
|
readonly value: CartDiscountValue;
|
|
@@ -181,6 +199,7 @@ export interface ItemShippingDetailsDraft {
|
|
|
181
199
|
export interface ItemShippingTarget {
|
|
182
200
|
readonly addressKey: string;
|
|
183
201
|
readonly quantity: number;
|
|
202
|
+
readonly shippingMethodKey?: string;
|
|
184
203
|
}
|
|
185
204
|
export interface LineItem {
|
|
186
205
|
readonly id: string;
|
|
@@ -192,11 +211,13 @@ export interface LineItem {
|
|
|
192
211
|
readonly variant: ProductVariant;
|
|
193
212
|
readonly price: Price;
|
|
194
213
|
readonly taxedPrice?: TaxedItemPrice;
|
|
214
|
+
readonly taxedPricePortions: MethodTaxedPrice[];
|
|
195
215
|
readonly totalPrice: TypedMoney;
|
|
196
216
|
readonly quantity: number;
|
|
197
217
|
readonly addedAt?: string;
|
|
198
218
|
readonly state: ItemState[];
|
|
199
219
|
readonly taxRate?: TaxRate;
|
|
220
|
+
readonly perMethodTaxRate: MethodTaxRate[];
|
|
200
221
|
readonly supplyChannel?: ChannelReference;
|
|
201
222
|
readonly distributionChannel?: ChannelReference;
|
|
202
223
|
readonly discountedPricePerQuantity: DiscountedLineItemPriceForQuantity[];
|
|
@@ -224,11 +245,35 @@ export interface LineItemDraft {
|
|
|
224
245
|
}
|
|
225
246
|
export declare type LineItemMode = 'GiftLineItem' | 'Standard';
|
|
226
247
|
export declare type LineItemPriceMode = 'ExternalPrice' | 'ExternalTotal' | 'Platform';
|
|
248
|
+
export interface MethodTaxRate {
|
|
249
|
+
readonly shippingMethodKey: string;
|
|
250
|
+
readonly taxRate?: TaxRate;
|
|
251
|
+
}
|
|
252
|
+
export interface MethodTaxedPrice {
|
|
253
|
+
readonly shippingMethodKey: string;
|
|
254
|
+
readonly taxedPrice?: TaxedItemPrice;
|
|
255
|
+
}
|
|
227
256
|
export interface ReplicaCartDraft {
|
|
228
257
|
readonly reference: CartReference | OrderReference;
|
|
229
258
|
readonly key?: string;
|
|
230
259
|
}
|
|
231
260
|
export declare type RoundingMode = 'HalfDown' | 'HalfEven' | 'HalfUp';
|
|
261
|
+
export interface Shipping {
|
|
262
|
+
readonly shippingKey: string;
|
|
263
|
+
readonly shippingInfo: ShippingInfo;
|
|
264
|
+
readonly shippingAddress: Address;
|
|
265
|
+
readonly shippingRateInput?: ShippingRateInput;
|
|
266
|
+
readonly shippingCustomFields?: CustomFields;
|
|
267
|
+
}
|
|
268
|
+
export interface ShippingDraft {
|
|
269
|
+
readonly key: string;
|
|
270
|
+
readonly shippingMethod?: ShippingMethodReference;
|
|
271
|
+
readonly shippingAddress?: BaseAddress;
|
|
272
|
+
readonly shippingRateInput?: ShippingRateInputDraft;
|
|
273
|
+
readonly externalTaxRate?: string;
|
|
274
|
+
readonly deliveries: Delivery[];
|
|
275
|
+
readonly custom?: string;
|
|
276
|
+
}
|
|
232
277
|
export interface ShippingInfo {
|
|
233
278
|
readonly shippingMethodName: string;
|
|
234
279
|
readonly price: TypedMoney;
|
|
@@ -242,6 +287,7 @@ export interface ShippingInfo {
|
|
|
242
287
|
readonly shippingMethodState: ShippingMethodState;
|
|
243
288
|
}
|
|
244
289
|
export declare type ShippingMethodState = 'DoesNotMatchCart' | 'MatchesCart';
|
|
290
|
+
export declare type ShippingMode = 'Multiple' | 'Single';
|
|
245
291
|
export declare type ShippingRateInput = ClassificationShippingRateInput | ScoreShippingRateInput;
|
|
246
292
|
export interface ClassificationShippingRateInput {
|
|
247
293
|
readonly type: 'Classification';
|
|
@@ -298,6 +344,19 @@ export interface CartAddCustomLineItemAction {
|
|
|
298
344
|
readonly taxCategory?: TaxCategoryResourceIdentifier;
|
|
299
345
|
readonly custom?: CustomFieldsDraft;
|
|
300
346
|
readonly externalTaxRate?: ExternalTaxRateDraft;
|
|
347
|
+
readonly priceMode?: CustomLineItemPriceMode;
|
|
348
|
+
}
|
|
349
|
+
export interface CartAddCustomShippingMethodAction {
|
|
350
|
+
readonly action: 'addCustomShippingMethod';
|
|
351
|
+
readonly shippingKey: string;
|
|
352
|
+
readonly shippingMethodName: string;
|
|
353
|
+
readonly shippingAddress?: BaseAddress;
|
|
354
|
+
readonly shippingRate: ShippingRateDraft;
|
|
355
|
+
readonly shippingRateInput?: ShippingRateInputDraft;
|
|
356
|
+
readonly taxCategory?: TaxCategoryResourceIdentifier;
|
|
357
|
+
readonly externalTaxRate?: string;
|
|
358
|
+
readonly deliveries: Delivery[];
|
|
359
|
+
readonly custom?: string;
|
|
301
360
|
}
|
|
302
361
|
export interface CartAddDiscountCodeAction {
|
|
303
362
|
readonly action: 'addDiscountCode';
|
|
@@ -325,6 +384,16 @@ export interface CartAddPaymentAction {
|
|
|
325
384
|
readonly action: 'addPayment';
|
|
326
385
|
readonly payment: PaymentResourceIdentifier;
|
|
327
386
|
}
|
|
387
|
+
export interface CartAddShippingMethodAction {
|
|
388
|
+
readonly action: 'addShippingMethod';
|
|
389
|
+
readonly shippingKey: string;
|
|
390
|
+
readonly shippingMethod?: ShippingMethodReference;
|
|
391
|
+
readonly shippingAddress?: BaseAddress;
|
|
392
|
+
readonly shippingRateInput?: ShippingRateInputDraft;
|
|
393
|
+
readonly externalTaxRate?: string;
|
|
394
|
+
readonly deliveries: Delivery[];
|
|
395
|
+
readonly custom?: string;
|
|
396
|
+
}
|
|
328
397
|
export interface CartAddShoppingListAction {
|
|
329
398
|
readonly action: 'addShoppingList';
|
|
330
399
|
readonly shoppingList: ShoppingListResourceIdentifier;
|
|
@@ -403,6 +472,10 @@ export interface CartRemovePaymentAction {
|
|
|
403
472
|
readonly action: 'removePayment';
|
|
404
473
|
readonly payment: PaymentResourceIdentifier;
|
|
405
474
|
}
|
|
475
|
+
export interface CartRemoveShippingMethodAction {
|
|
476
|
+
readonly action: 'removeShippingMethod';
|
|
477
|
+
readonly shippingKey: string;
|
|
478
|
+
}
|
|
406
479
|
export interface CartSetAnonymousIdAction {
|
|
407
480
|
readonly action: 'setAnonymousId';
|
|
408
481
|
readonly anonymousId?: string;
|
|
@@ -587,6 +660,18 @@ export interface CartSetShippingAddressCustomTypeAction {
|
|
|
587
660
|
readonly type?: TypeResourceIdentifier;
|
|
588
661
|
readonly fields?: FieldContainer;
|
|
589
662
|
}
|
|
663
|
+
export interface CartSetShippingCustomFieldAction {
|
|
664
|
+
readonly action: 'setShippingCustomField';
|
|
665
|
+
readonly shippingKey?: string;
|
|
666
|
+
readonly name: string;
|
|
667
|
+
readonly value?: any;
|
|
668
|
+
}
|
|
669
|
+
export interface CartSetShippingCustomTypeAction {
|
|
670
|
+
readonly action: 'setShippingCustomType';
|
|
671
|
+
readonly shippingKey?: string;
|
|
672
|
+
readonly type?: TypeResourceIdentifier;
|
|
673
|
+
readonly fields?: FieldContainer;
|
|
674
|
+
}
|
|
590
675
|
export interface CartSetShippingMethodAction {
|
|
591
676
|
readonly action: 'setShippingMethod';
|
|
592
677
|
readonly shippingMethod?: ShippingMethodResourceIdentifier;
|
|
@@ -618,5 +703,6 @@ export interface CustomLineItemImportDraft {
|
|
|
618
703
|
readonly taxCategory?: TaxCategoryResourceIdentifier;
|
|
619
704
|
readonly custom?: CustomFieldsDraft;
|
|
620
705
|
readonly shippingDetails?: ItemShippingDetailsDraft;
|
|
706
|
+
readonly priceMode: CustomLineItemPriceMode;
|
|
621
707
|
}
|
|
622
708
|
export declare type ProductPublishScope = 'All' | 'Prices';
|
|
@@ -203,7 +203,7 @@ export interface QueryPrice {
|
|
|
203
203
|
readonly tiers?: PriceTierDraft[];
|
|
204
204
|
}
|
|
205
205
|
export declare type Reference = CartDiscountReference | CartReference | CategoryReference | ChannelReference | CustomObjectReference | CustomerGroupReference | CustomerReference | DiscountCodeReference | InventoryEntryReference | OrderEditReference | OrderReference | PaymentReference | ProductDiscountReference | ProductReference | ProductSelectionReference | ProductTypeReference | QuoteReference | QuoteRequestReference | ReviewReference | ShippingMethodReference | ShoppingListReference | StagedQuoteReference | StandalonePriceReference | StateReference | StoreReference | TaxCategoryReference | TypeReference | ZoneReference;
|
|
206
|
-
export declare type ReferenceTypeId = 'cart' | 'cart-discount' | 'category' | 'channel' | 'customer' | 'customer-group' | 'discount-code' | 'extension' | 'inventory-entry' | 'key-value-document' | 'order' | 'order-edit' | 'payment' | 'product' | 'product-discount' | 'product-price' | 'product-selection' | 'product-type' | 'quote' | 'quote-request' | 'review' | 'shipping-method' | 'shopping-list' | 'staged-quote' | 'state' | 'store' | 'subscription' | 'tax-category' | 'type' | 'zone';
|
|
206
|
+
export declare type ReferenceTypeId = 'cart' | 'cart-discount' | 'category' | 'channel' | 'customer' | 'customer-group' | 'discount-code' | 'extension' | 'inventory-entry' | 'key-value-document' | 'order' | 'order-edit' | 'payment' | 'product' | 'product-discount' | 'product-price' | 'product-selection' | 'product-type' | 'quote' | 'quote-request' | 'review' | 'shipping-method' | 'shopping-list' | 'staged-quote' | 'standalone-price' | 'state' | 'store' | 'subscription' | 'tax-category' | 'type' | 'zone';
|
|
207
207
|
export declare type ResourceIdentifier = CartDiscountResourceIdentifier | CartResourceIdentifier | CategoryResourceIdentifier | ChannelResourceIdentifier | CustomerGroupResourceIdentifier | CustomerResourceIdentifier | DiscountCodeResourceIdentifier | InventoryEntryResourceIdentifier | OrderEditResourceIdentifier | OrderResourceIdentifier | PaymentResourceIdentifier | ProductDiscountResourceIdentifier | ProductResourceIdentifier | ProductSelectionResourceIdentifier | ProductTypeResourceIdentifier | QuoteRequestResourceIdentifier | QuoteResourceIdentifier | ReviewResourceIdentifier | ShippingMethodResourceIdentifier | ShoppingListResourceIdentifier | StagedQuoteResourceIdentifier | StandalonePriceResourceIdentifier | StateResourceIdentifier | StoreResourceIdentifier | TaxCategoryResourceIdentifier | TypeResourceIdentifier | ZoneResourceIdentifier;
|
|
208
208
|
export interface ScopedPrice {
|
|
209
209
|
readonly id: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CartReference, CartResourceIdentifier,
|
|
1
|
+
import { CartReference, CartResourceIdentifier, ExternalLineItemTotalPrice, ExternalTaxRateDraft, InventoryMode, ItemShippingDetailsDraft, ItemShippingTarget, TaxMode } from './cart';
|
|
2
2
|
import { ChannelResourceIdentifier } from './channel';
|
|
3
3
|
import { BaseAddress, LocalizedString, Money, TypedMoney } from './common';
|
|
4
4
|
import { CustomerReference } from './customer';
|
|
@@ -24,7 +24,7 @@ export interface MyCartDraft {
|
|
|
24
24
|
readonly deleteDaysAfterLastModification?: number;
|
|
25
25
|
readonly itemShippingAddresses?: BaseAddress[];
|
|
26
26
|
readonly store?: StoreKeyReference;
|
|
27
|
-
readonly discountCodes?:
|
|
27
|
+
readonly discountCodes?: string[];
|
|
28
28
|
}
|
|
29
29
|
export interface MyCartUpdate {
|
|
30
30
|
readonly version: number;
|