@gradientedge/commercetools-utils 4.25.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.
@@ -1,4 +1,4 @@
1
- import { ExternalLineItemTotalPrice, ExternalTaxAmountDraft, ExternalTaxRateDraft, ItemShippingDetailsDraft, RoundingMode, ShippingRateInputDraft, TaxCalculationMode, TaxedPrice, TaxMode, TaxPortionDraft } from './cart';
1
+ import { CustomLineItemPriceMode, ExternalLineItemTotalPrice, ExternalTaxAmountDraft, ExternalTaxRateDraft, ItemShippingDetailsDraft, RoundingMode, ShippingRateInputDraft, TaxCalculationMode, TaxedPrice, TaxMode, TaxPortionDraft } from './cart';
2
2
  import { ChannelResourceIdentifier } from './channel';
3
3
  import { BaseAddress, BaseResource, CreatedBy, LastModifiedBy, LocalizedString, Money, TypedMoney } from './common';
4
4
  import { CustomerGroupResourceIdentifier } from './customer-group';
@@ -122,6 +122,7 @@ export interface StagedOrderAddCustomLineItemAction {
122
122
  readonly taxCategory?: TaxCategoryResourceIdentifier;
123
123
  readonly custom?: CustomFieldsDraft;
124
124
  readonly externalTaxRate?: ExternalTaxRateDraft;
125
+ readonly priceMode?: CustomLineItemPriceMode;
125
126
  }
126
127
  export interface StagedOrderAddDeliveryAction {
127
128
  readonly action: 'addDelivery';
@@ -1,4 +1,4 @@
1
- import { CartOrigin, CartReference, CartResourceIdentifier, CustomLineItem, CustomLineItemImportDraft, DiscountCodeInfo, DiscountedLineItemPortion, InventoryMode, ItemShippingDetailsDraft, LineItem, RoundingMode, ShippingInfo, ShippingMethodState, ShippingRateInput, TaxCalculationMode, TaxedPrice, TaxedPriceDraft, TaxMode } from './cart';
1
+ import { CartOrigin, CartReference, CartResourceIdentifier, CustomLineItem, CustomLineItemImportDraft, DiscountCodeInfo, DiscountedLineItemPortion, InventoryMode, ItemShippingDetailsDraft, LineItem, RoundingMode, Shipping, ShippingInfo, ShippingMethodState, ShippingMode, ShippingRateInput, TaxCalculationMode, TaxedPrice, TaxedPriceDraft, TaxMode } from './cart';
2
2
  import { CartDiscountReference } from './cart-discount';
3
3
  import { ChannelReference, ChannelResourceIdentifier } from './channel';
4
4
  import { Address, AddressDraft, BaseAddress, BaseResource, CreatedBy, Image, LastModifiedBy, LocalizedString, Money, PriceDraft, TypedMoney } from './common';
@@ -16,7 +16,7 @@ export declare type StagedOrderUpdateAction = StagedOrderAddCustomLineItemAction
16
16
  export interface Hit {
17
17
  readonly id: string;
18
18
  readonly version: number;
19
- readonly relevance: number;
19
+ readonly relevance?: number;
20
20
  }
21
21
  export interface OrderPagedSearchResponse {
22
22
  readonly total: number;
@@ -81,8 +81,11 @@ export interface Order extends BaseResource {
81
81
  readonly customLineItems: CustomLineItem[];
82
82
  readonly totalPrice: TypedMoney;
83
83
  readonly taxedPrice?: TaxedPrice;
84
+ readonly taxedShippingPrice?: TaxedPrice;
84
85
  readonly shippingAddress?: Address;
85
86
  readonly billingAddress?: Address;
87
+ readonly shippingMode: ShippingMode;
88
+ readonly shipping: Shipping[];
86
89
  readonly taxMode?: TaxMode;
87
90
  readonly taxRoundingMode?: RoundingMode;
88
91
  readonly customerGroup?: CustomerGroupReference;
@@ -292,6 +295,7 @@ export interface TrackingData {
292
295
  export interface OrderAddDeliveryAction {
293
296
  readonly action: 'addDelivery';
294
297
  readonly items?: DeliveryItem[];
298
+ readonly shippingKey?: string;
295
299
  readonly address?: BaseAddress;
296
300
  readonly parcels?: ParcelDraft[];
297
301
  readonly custom?: CustomFieldsDraft;
@@ -1,4 +1,4 @@
1
- import { BaseResource, CentPrecisionMoney, CentPrecisionMoneyDraft, CreatedBy, LastModifiedBy, LocalizedString, QueryPrice, Reference } from './common';
1
+ import { BaseResource, CentPrecisionMoney, CreatedBy, LastModifiedBy, LocalizedString, Money, QueryPrice, Reference } from './common';
2
2
  export interface ProductDiscount extends BaseResource {
3
3
  readonly id: string;
4
4
  readonly version: number;
@@ -64,7 +64,7 @@ export interface ProductDiscountValueAbsolute {
64
64
  export declare type ProductDiscountValueDraft = ProductDiscountValueAbsoluteDraft | ProductDiscountValueExternalDraft | ProductDiscountValueRelativeDraft;
65
65
  export interface ProductDiscountValueAbsoluteDraft {
66
66
  readonly type: 'absolute';
67
- readonly money: CentPrecisionMoneyDraft[];
67
+ readonly money: Money[];
68
68
  }
69
69
  export interface ProductDiscountValueExternal {
70
70
  readonly type: 'external';
@@ -95,9 +95,9 @@ export interface ProductDraft {
95
95
  }
96
96
  export interface ProductPagedQueryResponse {
97
97
  readonly limit: number;
98
+ readonly offset: number;
98
99
  readonly count: number;
99
100
  readonly total?: number;
100
- readonly offset: number;
101
101
  readonly results: Product[];
102
102
  }
103
103
  export declare type ProductPriceModeEnum = 'Embedded' | 'Standalone';
@@ -122,6 +122,7 @@ export interface ProductProjection extends BaseResource {
122
122
  readonly taxCategory?: TaxCategoryReference;
123
123
  readonly state?: StateReference;
124
124
  readonly reviewRatingStatistics?: ReviewRatingStatistics;
125
+ readonly priceMode?: ProductPriceModeEnum;
125
126
  }
126
127
  export interface ProductProjectionPagedQueryResponse {
127
128
  readonly limit: number;
@@ -168,15 +169,17 @@ export interface ProductVariant {
168
169
  readonly scopedPriceDiscounted?: boolean;
169
170
  }
170
171
  export interface ProductVariantAvailability {
172
+ readonly channels?: ProductVariantChannelAvailabilityMap;
171
173
  readonly isOnStock?: boolean;
172
174
  readonly restockableInDays?: number;
173
175
  readonly availableQuantity?: number;
174
- readonly channels?: ProductVariantChannelAvailabilityMap;
175
176
  }
176
177
  export interface ProductVariantChannelAvailability {
177
178
  readonly isOnStock?: boolean;
178
179
  readonly restockableInDays?: number;
179
180
  readonly availableQuantity?: number;
181
+ readonly id: string;
182
+ readonly version: number;
180
183
  }
181
184
  export interface ProductVariantChannelAvailabilityMap {
182
185
  [key: string]: ProductVariantChannelAvailability;
@@ -3,6 +3,7 @@ import { Address, BaseResource, CreatedBy, LastModifiedBy, TypedMoney } from './
3
3
  import { CustomerReference } from './customer';
4
4
  import { CustomerGroupReference } from './customer-group';
5
5
  import { PaymentInfo } from './order';
6
+ import { StateReference, StateResourceIdentifier } from './state';
6
7
  import { StoreKeyReference } from './store';
7
8
  import { CustomFields, CustomFieldsDraft, FieldContainer, TypeResourceIdentifier } from './type';
8
9
  export interface QuoteRequest extends BaseResource {
@@ -35,6 +36,7 @@ export interface QuoteRequest extends BaseResource {
35
36
  readonly itemShippingAddresses?: Address[];
36
37
  readonly directDiscounts?: DirectDiscount[];
37
38
  readonly custom?: CustomFields;
39
+ readonly state?: StateReference;
38
40
  }
39
41
  export interface QuoteRequestDraft {
40
42
  readonly cart: CartResourceIdentifier;
@@ -42,6 +44,7 @@ export interface QuoteRequestDraft {
42
44
  readonly key?: string;
43
45
  readonly comment: string;
44
46
  readonly custom?: CustomFieldsDraft;
47
+ readonly state?: StateReference;
45
48
  }
46
49
  export interface QuoteRequestPagedQueryResponse {
47
50
  readonly limit: number;
@@ -65,7 +68,7 @@ export interface QuoteRequestUpdate {
65
68
  readonly version: number;
66
69
  readonly actions: QuoteRequestUpdateAction[];
67
70
  }
68
- export declare type QuoteRequestUpdateAction = QuoteRequestChangeQuoteRequestStateAction | QuoteRequestSetCustomFieldAction | QuoteRequestSetCustomTypeAction;
71
+ export declare type QuoteRequestUpdateAction = QuoteRequestChangeQuoteRequestStateAction | QuoteRequestSetCustomFieldAction | QuoteRequestSetCustomTypeAction | QuoteRequestTransitionStateAction;
69
72
  export interface QuoteRequestChangeQuoteRequestStateAction {
70
73
  readonly action: 'changeQuoteRequestState';
71
74
  readonly quoteRequestState: QuoteRequestState;
@@ -80,3 +83,8 @@ export interface QuoteRequestSetCustomTypeAction {
80
83
  readonly type?: TypeResourceIdentifier;
81
84
  readonly fields?: FieldContainer;
82
85
  }
86
+ export interface QuoteRequestTransitionStateAction {
87
+ readonly action: 'transitionState';
88
+ readonly state: StateResourceIdentifier;
89
+ readonly force?: boolean;
90
+ }
@@ -5,6 +5,7 @@ import { CustomerGroupReference } from './customer-group';
5
5
  import { PaymentInfo } from './order';
6
6
  import { QuoteRequestReference } from './quote-request';
7
7
  import { StagedQuoteReference, StagedQuoteResourceIdentifier } from './staged-quote';
8
+ import { StateReference, StateResourceIdentifier } from './state';
8
9
  import { StoreKeyReference } from './store';
9
10
  import { CustomFields, CustomFieldsDraft, FieldContainer, TypeResourceIdentifier } from './type';
10
11
  export interface Quote extends BaseResource {
@@ -21,6 +22,7 @@ export interface Quote extends BaseResource {
21
22
  readonly customerGroup?: CustomerGroupReference;
22
23
  readonly validTo?: string;
23
24
  readonly sellerComment?: string;
25
+ readonly buyerComment?: string;
24
26
  readonly store?: StoreKeyReference;
25
27
  readonly lineItems: LineItem[];
26
28
  readonly customLineItems: CustomLineItem[];
@@ -39,12 +41,14 @@ export interface Quote extends BaseResource {
39
41
  readonly itemShippingAddresses?: Address[];
40
42
  readonly directDiscounts?: DirectDiscount[];
41
43
  readonly custom?: CustomFields;
44
+ readonly state?: StateReference;
42
45
  }
43
46
  export interface QuoteDraft {
44
47
  readonly stagedQuote: StagedQuoteResourceIdentifier;
45
48
  readonly stagedQuoteVersion: number;
46
49
  readonly key?: string;
47
50
  readonly custom?: CustomFieldsDraft;
51
+ readonly state?: StateReference;
48
52
  }
49
53
  export interface QuotePagedQueryResponse {
50
54
  readonly limit: number;
@@ -63,16 +67,20 @@ export interface QuoteResourceIdentifier {
63
67
  readonly id?: string;
64
68
  readonly key?: string;
65
69
  }
66
- export declare type QuoteState = 'Accepted' | 'Declined' | 'Failed' | 'Pending' | 'Withdrawn';
70
+ export declare type QuoteState = 'Accepted' | 'Declined' | 'DeclinedForRenegotiation' | 'Failed' | 'Pending' | 'Withdrawn';
67
71
  export interface QuoteUpdate {
68
72
  readonly version: number;
69
73
  readonly actions: QuoteUpdateAction[];
70
74
  }
71
- export declare type QuoteUpdateAction = QuoteChangeQuoteStateAction | QuoteSetCustomFieldAction | QuoteSetCustomTypeAction;
75
+ export declare type QuoteUpdateAction = QuoteChangeQuoteStateAction | QuoteRequestQuoteRenegotiationAction | QuoteSetCustomFieldAction | QuoteSetCustomTypeAction | QuoteTransitionStateAction;
72
76
  export interface QuoteChangeQuoteStateAction {
73
77
  readonly action: 'changeQuoteState';
74
78
  readonly quoteState: QuoteState;
75
79
  }
80
+ export interface QuoteRequestQuoteRenegotiationAction {
81
+ readonly action: 'requestQuoteRenegotiation';
82
+ readonly buyerComment?: string;
83
+ }
76
84
  export interface QuoteSetCustomFieldAction {
77
85
  readonly action: 'setCustomField';
78
86
  readonly name: string;
@@ -83,3 +91,8 @@ export interface QuoteSetCustomTypeAction {
83
91
  readonly type?: TypeResourceIdentifier;
84
92
  readonly fields?: FieldContainer;
85
93
  }
94
+ export interface QuoteTransitionStateAction {
95
+ readonly action: 'transitionState';
96
+ readonly state: StateResourceIdentifier;
97
+ readonly force?: boolean;
98
+ }
@@ -2,6 +2,7 @@ import { CartReference } from './cart';
2
2
  import { BaseResource, CreatedBy, LastModifiedBy } from './common';
3
3
  import { CustomerReference } from './customer';
4
4
  import { QuoteRequestReference, QuoteRequestResourceIdentifier } from './quote-request';
5
+ import { StateReference, StateResourceIdentifier } from './state';
5
6
  import { CustomFields, CustomFieldsDraft, FieldContainer, TypeResourceIdentifier } from './type';
6
7
  export interface StagedQuote extends BaseResource {
7
8
  readonly id: string;
@@ -18,12 +19,14 @@ export interface StagedQuote extends BaseResource {
18
19
  readonly validTo?: string;
19
20
  readonly sellerComment?: string;
20
21
  readonly custom?: CustomFields;
22
+ readonly state?: StateReference;
21
23
  }
22
24
  export interface StagedQuoteDraft {
23
25
  readonly quoteRequest: QuoteRequestResourceIdentifier;
24
26
  readonly quoteRequestVersion: number;
25
27
  readonly key?: string;
26
28
  readonly custom?: CustomFieldsDraft;
29
+ readonly state?: StateReference;
27
30
  }
28
31
  export interface StagedQuotePagedQueryResponse {
29
32
  readonly limit: number;
@@ -47,7 +50,7 @@ export interface StagedQuoteUpdate {
47
50
  readonly version: number;
48
51
  readonly actions: StagedQuoteUpdateAction[];
49
52
  }
50
- export declare type StagedQuoteUpdateAction = StagedQuoteChangeStagedQuoteStateAction | StagedQuoteSetCustomFieldAction | StagedQuoteSetCustomTypeAction | StagedQuoteSetSellerCommentAction | StagedQuoteSetValidToAction;
53
+ export declare type StagedQuoteUpdateAction = StagedQuoteChangeStagedQuoteStateAction | StagedQuoteSetCustomFieldAction | StagedQuoteSetCustomTypeAction | StagedQuoteSetSellerCommentAction | StagedQuoteSetValidToAction | StagedQuoteTransitionStateAction;
51
54
  export interface StagedQuoteChangeStagedQuoteStateAction {
52
55
  readonly action: 'changeStagedQuoteState';
53
56
  readonly stagedQuoteState: StagedQuoteState;
@@ -70,3 +73,8 @@ export interface StagedQuoteSetValidToAction {
70
73
  readonly action: 'setValidTo';
71
74
  readonly validTo?: string;
72
75
  }
76
+ export interface StagedQuoteTransitionStateAction {
77
+ readonly action: 'transitionState';
78
+ readonly state: StateResourceIdentifier;
79
+ readonly force?: boolean;
80
+ }
@@ -2,6 +2,10 @@ import { ChannelReference, ChannelResourceIdentifier } from './channel';
2
2
  import { BaseResource, CreatedBy, DiscountedPrice, DiscountedPriceDraft, LastModifiedBy, Money, PriceTier, PriceTierDraft, TypedMoney } from './common';
3
3
  import { CustomerGroupReference, CustomerGroupResourceIdentifier } from './customer-group';
4
4
  import { CustomFields, CustomFieldsDraft, FieldContainer, TypeResourceIdentifier } from './type';
5
+ export interface StagedStandalonePrice {
6
+ readonly value: TypedMoney;
7
+ readonly discounted: DiscountedPrice;
8
+ }
5
9
  export interface StandalonePrice extends BaseResource {
6
10
  readonly id: string;
7
11
  readonly version: number;
@@ -20,6 +24,8 @@ export interface StandalonePrice extends BaseResource {
20
24
  readonly tiers?: PriceTier[];
21
25
  readonly discounted?: DiscountedPrice;
22
26
  readonly custom?: CustomFields;
27
+ readonly staged?: StagedStandalonePrice;
28
+ readonly active: boolean;
23
29
  }
24
30
  export interface StandalonePriceDraft {
25
31
  readonly key?: string;
@@ -33,6 +39,7 @@ export interface StandalonePriceDraft {
33
39
  readonly tiers?: PriceTierDraft[];
34
40
  readonly discounted?: DiscountedPriceDraft;
35
41
  readonly custom?: CustomFieldsDraft;
42
+ readonly active?: boolean;
36
43
  }
37
44
  export interface StandalonePricePagedQueryResponse {
38
45
  readonly limit: number;
@@ -55,10 +62,18 @@ export interface StandalonePriceUpdate {
55
62
  readonly version: number;
56
63
  readonly actions: StandalonePriceUpdateAction[];
57
64
  }
58
- export declare type StandalonePriceUpdateAction = StandalonePriceChangeValueAction | StandalonePriceSetCustomFieldAction | StandalonePriceSetCustomTypeAction | StandalonePriceSetDiscountedPriceAction;
65
+ export declare type StandalonePriceUpdateAction = StandalonePriceApplyStagedChangesAction | StandalonePriceChangeActiveAction | StandalonePriceChangeValueAction | StandalonePriceSetCustomFieldAction | StandalonePriceSetCustomTypeAction | StandalonePriceSetDiscountedPriceAction;
66
+ export interface StandalonePriceApplyStagedChangesAction {
67
+ readonly action: 'applyStagedChanges';
68
+ }
69
+ export interface StandalonePriceChangeActiveAction {
70
+ readonly action: 'changeActive';
71
+ readonly active: boolean;
72
+ }
59
73
  export interface StandalonePriceChangeValueAction {
60
74
  readonly action: 'changeValue';
61
75
  readonly value: Money;
76
+ readonly staged?: boolean;
62
77
  }
63
78
  export interface StandalonePriceSetCustomFieldAction {
64
79
  readonly action: 'setCustomField';
@@ -42,7 +42,7 @@ export interface StateResourceIdentifier {
42
42
  readonly key?: string;
43
43
  }
44
44
  export declare type StateRoleEnum = 'Return' | 'ReviewIncludedInStatistics';
45
- export declare type StateTypeEnum = 'LineItemState' | 'OrderState' | 'PaymentState' | 'ProductState' | 'ReviewState';
45
+ export declare type StateTypeEnum = 'LineItemState' | 'OrderState' | 'PaymentState' | 'ProductState' | 'QuoteRequestState' | 'QuoteState' | 'ReviewState' | 'StagedQuoteState';
46
46
  export interface StateUpdate {
47
47
  readonly version: number;
48
48
  readonly actions: StateUpdateAction[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gradientedge/commercetools-utils",
3
- "version": "4.25.0",
3
+ "version": "4.26.0",
4
4
  "description": "Provide utility classes and functions for interacting with the commercetools API",
5
5
  "main": "./dist/ge-commercetools-utils-node.cjs.js",
6
6
  "module": "./dist/ge-commercetools-utils-node.esm.js",