@gradientedge/commercetools-utils 4.20.0 → 4.22.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.
Files changed (35) hide show
  1. package/dist/ge-commercetools-utils-browser.cjs.js +1 -1
  2. package/dist/ge-commercetools-utils-browser.cjs.js.map +1 -1
  3. package/dist/ge-commercetools-utils-browser.esm.js +1 -1
  4. package/dist/ge-commercetools-utils-browser.esm.js.map +1 -1
  5. package/dist/ge-commercetools-utils-node.cjs.js +1 -1
  6. package/dist/ge-commercetools-utils-node.cjs.js.map +1 -1
  7. package/dist/ge-commercetools-utils-node.esm.js +1 -1
  8. package/dist/typings/models/cart-discount.d.ts +4 -4
  9. package/dist/typings/models/cart.d.ts +18 -9
  10. package/dist/typings/models/category.d.ts +2 -2
  11. package/dist/typings/models/common.d.ts +25 -10
  12. package/dist/typings/models/custom-object.d.ts +1 -1
  13. package/dist/typings/models/customer.d.ts +6 -0
  14. package/dist/typings/models/discount-code.d.ts +1 -1
  15. package/dist/typings/models/error.d.ts +31 -2
  16. package/dist/typings/models/extension.d.ts +2 -1
  17. package/dist/typings/models/inventory.d.ts +1 -1
  18. package/dist/typings/models/me.d.ts +14 -1
  19. package/dist/typings/models/message.d.ts +394 -6
  20. package/dist/typings/models/order.d.ts +21 -3
  21. package/dist/typings/models/payment.d.ts +1 -23
  22. package/dist/typings/models/product-discount.d.ts +4 -4
  23. package/dist/typings/models/product-selection.d.ts +20 -1
  24. package/dist/typings/models/product-type.d.ts +5 -8
  25. package/dist/typings/models/product.d.ts +8 -1
  26. package/dist/typings/models/project.d.ts +1 -5
  27. package/dist/typings/models/quote-request.d.ts +82 -0
  28. package/dist/typings/models/quote.d.ts +85 -0
  29. package/dist/typings/models/staged-quote.d.ts +72 -0
  30. package/dist/typings/models/standalone-price.d.ts +76 -0
  31. package/dist/typings/models/store.d.ts +10 -10
  32. package/dist/typings/models/type.d.ts +2 -7
  33. package/dist/typings/utils/get-attribute-value.d.ts +6 -0
  34. package/dist/typings/utils/index.d.ts +1 -0
  35. package/package.json +1 -1
@@ -11,13 +11,8 @@ export interface Payment extends BaseResource {
11
11
  readonly createdBy?: CreatedBy;
12
12
  readonly customer?: CustomerReference;
13
13
  readonly anonymousId?: string;
14
- readonly externalId?: string;
15
14
  readonly interfaceId?: string;
16
15
  readonly amountPlanned: TypedMoney;
17
- readonly amountAuthorized?: TypedMoney;
18
- readonly authorizedUntil?: string;
19
- readonly amountPaid?: TypedMoney;
20
- readonly amountRefunded?: TypedMoney;
21
16
  readonly paymentMethodInfo: PaymentMethodInfo;
22
17
  readonly paymentStatus: PaymentStatus;
23
18
  readonly transactions: Transaction[];
@@ -78,7 +73,7 @@ export interface PaymentUpdate {
78
73
  readonly version: number;
79
74
  readonly actions: PaymentUpdateAction[];
80
75
  }
81
- export declare type PaymentUpdateAction = PaymentAddInterfaceInteractionAction | PaymentAddTransactionAction | PaymentChangeAmountPlannedAction | PaymentChangeTransactionInteractionIdAction | PaymentChangeTransactionStateAction | PaymentChangeTransactionTimestampAction | PaymentSetAmountPaidAction | PaymentSetAmountRefundedAction | PaymentSetAnonymousIdAction | PaymentSetAuthorizationAction | PaymentSetCustomFieldAction | PaymentSetCustomTypeAction | PaymentSetCustomerAction | PaymentSetExternalIdAction | PaymentSetInterfaceIdAction | PaymentSetKeyAction | PaymentSetMethodInfoInterfaceAction | PaymentSetMethodInfoMethodAction | PaymentSetMethodInfoNameAction | PaymentSetStatusInterfaceCodeAction | PaymentSetStatusInterfaceTextAction | PaymentSetTransactionCustomFieldAction | PaymentSetTransactionCustomTypeAction | PaymentTransitionStateAction;
76
+ export declare type PaymentUpdateAction = PaymentAddInterfaceInteractionAction | PaymentAddTransactionAction | PaymentChangeAmountPlannedAction | PaymentChangeTransactionInteractionIdAction | PaymentChangeTransactionStateAction | PaymentChangeTransactionTimestampAction | PaymentSetAnonymousIdAction | PaymentSetCustomFieldAction | PaymentSetCustomTypeAction | PaymentSetCustomerAction | PaymentSetInterfaceIdAction | PaymentSetKeyAction | PaymentSetMethodInfoInterfaceAction | PaymentSetMethodInfoMethodAction | PaymentSetMethodInfoNameAction | PaymentSetStatusInterfaceCodeAction | PaymentSetStatusInterfaceTextAction | PaymentSetTransactionCustomFieldAction | PaymentSetTransactionCustomTypeAction | PaymentTransitionStateAction;
82
77
  export interface Transaction {
83
78
  readonly id: string;
84
79
  readonly timestamp?: string;
@@ -126,23 +121,10 @@ export interface PaymentChangeTransactionTimestampAction {
126
121
  readonly transactionId: string;
127
122
  readonly timestamp: string;
128
123
  }
129
- export interface PaymentSetAmountPaidAction {
130
- readonly action: 'setAmountPaid';
131
- readonly amount?: Money;
132
- }
133
- export interface PaymentSetAmountRefundedAction {
134
- readonly action: 'setAmountRefunded';
135
- readonly amount?: Money;
136
- }
137
124
  export interface PaymentSetAnonymousIdAction {
138
125
  readonly action: 'setAnonymousId';
139
126
  readonly anonymousId?: string;
140
127
  }
141
- export interface PaymentSetAuthorizationAction {
142
- readonly action: 'setAuthorization';
143
- readonly amount?: Money;
144
- readonly until?: string;
145
- }
146
128
  export interface PaymentSetCustomFieldAction {
147
129
  readonly action: 'setCustomField';
148
130
  readonly name: string;
@@ -157,10 +139,6 @@ export interface PaymentSetCustomerAction {
157
139
  readonly action: 'setCustomer';
158
140
  readonly customer?: CustomerResourceIdentifier;
159
141
  }
160
- export interface PaymentSetExternalIdAction {
161
- readonly action: 'setExternalId';
162
- readonly externalId?: string;
163
- }
164
142
  export interface PaymentSetInterfaceIdAction {
165
143
  readonly action: 'setInterfaceId';
166
144
  readonly interfaceId: string;
@@ -1,4 +1,4 @@
1
- import { BaseResource, CreatedBy, LastModifiedBy, LocalizedString, Money, QueryPrice, Reference, TypedMoney } from './common';
1
+ import { BaseResource, CentPrecisionMoney, CentPrecisionMoneyDraft, CreatedBy, LastModifiedBy, LocalizedString, QueryPrice, Reference } from './common';
2
2
  export interface ProductDiscount extends BaseResource {
3
3
  readonly id: string;
4
4
  readonly version: number;
@@ -36,9 +36,9 @@ export interface ProductDiscountMatchQuery {
36
36
  }
37
37
  export interface ProductDiscountPagedQueryResponse {
38
38
  readonly limit: number;
39
+ readonly offset: number;
39
40
  readonly count: number;
40
41
  readonly total?: number;
41
- readonly offset: number;
42
42
  readonly results: ProductDiscount[];
43
43
  }
44
44
  export interface ProductDiscountReference {
@@ -59,12 +59,12 @@ export declare type ProductDiscountUpdateAction = ProductDiscountChangeIsActiveA
59
59
  export declare type ProductDiscountValue = ProductDiscountValueAbsolute | ProductDiscountValueExternal | ProductDiscountValueRelative;
60
60
  export interface ProductDiscountValueAbsolute {
61
61
  readonly type: 'absolute';
62
- readonly money: TypedMoney[];
62
+ readonly money: CentPrecisionMoney[];
63
63
  }
64
64
  export declare type ProductDiscountValueDraft = ProductDiscountValueAbsoluteDraft | ProductDiscountValueExternalDraft | ProductDiscountValueRelativeDraft;
65
65
  export interface ProductDiscountValueAbsoluteDraft {
66
66
  readonly type: 'absolute';
67
- readonly money: Money[];
67
+ readonly money: CentPrecisionMoneyDraft[];
68
68
  }
69
69
  export interface ProductDiscountValueExternal {
70
70
  readonly type: 'external';
@@ -3,9 +3,11 @@ import { ProductReference, ProductResourceIdentifier } from './product';
3
3
  import { CustomFields, CustomFieldsDraft, FieldContainer, TypeResourceIdentifier } from './type';
4
4
  export interface AssignedProductReference {
5
5
  readonly product: ProductReference;
6
+ readonly variantSelection?: ProductVariantSelection;
6
7
  }
7
8
  export interface AssignedProductSelection {
8
9
  readonly productSelection: ProductSelectionReference;
10
+ readonly variantSelection?: ProductVariantSelection;
9
11
  }
10
12
  export interface AssignedProductSelectionPagedQueryResponse {
11
13
  readonly limit: number;
@@ -30,6 +32,7 @@ export interface ProductSelection extends BaseResource {
30
32
  export interface ProductSelectionAssignment {
31
33
  readonly product: ProductReference;
32
34
  readonly productSelection: ProductSelectionReference;
35
+ readonly variantSelection?: ProductVariantSelection;
33
36
  }
34
37
  export interface ProductSelectionDraft {
35
38
  readonly key?: string;
@@ -70,7 +73,17 @@ export interface ProductSelectionUpdate {
70
73
  readonly version: number;
71
74
  readonly actions: ProductSelectionUpdateAction[];
72
75
  }
73
- export declare type ProductSelectionUpdateAction = ProductSelectionAddProductAction | ProductSelectionChangeNameAction | ProductSelectionRemoveProductAction | ProductSelectionSetCustomFieldAction | ProductSelectionSetCustomTypeAction | ProductSelectionSetKeyAction;
76
+ export declare type ProductSelectionUpdateAction = ProductSelectionAddProductAction | ProductSelectionChangeNameAction | ProductSelectionRemoveProductAction | ProductSelectionSetCustomFieldAction | ProductSelectionSetCustomTypeAction | ProductSelectionSetKeyAction | ProductSelectionSetVariantSelectionAction;
77
+ export declare type ProductVariantSelection = ProductVariantSelectionExclusion | ProductVariantSelectionInclusion;
78
+ export interface ProductVariantSelectionExclusion {
79
+ readonly type: 'exclusion';
80
+ readonly skus: string[];
81
+ }
82
+ export interface ProductVariantSelectionInclusion {
83
+ readonly type: 'inclusion';
84
+ readonly skus: string[];
85
+ }
86
+ export declare type ProductVariantSelectionTypeEnum = 'exclusion' | 'inclusion';
74
87
  export interface ProductsInStorePagedQueryResponse {
75
88
  readonly limit: number;
76
89
  readonly offset: number;
@@ -81,6 +94,7 @@ export interface ProductsInStorePagedQueryResponse {
81
94
  export interface ProductSelectionAddProductAction {
82
95
  readonly action: 'addProduct';
83
96
  readonly product: ProductResourceIdentifier;
97
+ readonly variantSelection?: ProductVariantSelection;
84
98
  }
85
99
  export interface ProductSelectionChangeNameAction {
86
100
  readonly action: 'changeName';
@@ -104,3 +118,8 @@ export interface ProductSelectionSetKeyAction {
104
118
  readonly action: 'setKey';
105
119
  readonly key?: string;
106
120
  }
121
+ export interface ProductSelectionSetVariantSelectionAction {
122
+ readonly action: 'setVariantSelection';
123
+ readonly product: ProductResourceIdentifier;
124
+ readonly variantSelection?: ProductVariantSelection;
125
+ }
@@ -1,4 +1,4 @@
1
- import { BaseResource, CreatedBy, LastModifiedBy, LocalizedString, ReferenceTypeId } from './common';
1
+ import { BaseResource, CreatedBy, LastModifiedBy, LocalizedString } from './common';
2
2
  export declare type AttributeConstraintEnum = 'CombinationUnique' | 'None' | 'SameForAll' | 'Unique';
3
3
  export declare type AttributeConstraintEnumDraft = 'None';
4
4
  export interface AttributeDefinition {
@@ -29,6 +29,7 @@ export interface AttributePlainEnumValue {
29
29
  readonly key: string;
30
30
  readonly label: string;
31
31
  }
32
+ export declare type AttributeReferenceTypeId = 'cart' | 'category' | 'channel' | 'customer' | 'key-value-document' | 'order' | 'product' | 'product-type' | 'review' | 'shipping-method' | 'state' | 'zone';
32
33
  export declare type AttributeType = AttributeBooleanType | AttributeDateTimeType | AttributeDateType | AttributeEnumType | AttributeLocalizableTextType | AttributeLocalizedEnumType | AttributeMoneyType | AttributeNestedType | AttributeNumberType | AttributeReferenceType | AttributeSetType | AttributeTextType | AttributeTimeType;
33
34
  export interface AttributeBooleanType {
34
35
  readonly name: 'boolean';
@@ -62,7 +63,7 @@ export interface AttributeNumberType {
62
63
  }
63
64
  export interface AttributeReferenceType {
64
65
  readonly name: 'reference';
65
- readonly referenceTypeId: ReferenceTypeId;
66
+ readonly referenceTypeId: AttributeReferenceTypeId;
66
67
  }
67
68
  export interface AttributeSetType {
68
69
  readonly name: 'set';
@@ -94,9 +95,9 @@ export interface ProductTypeDraft {
94
95
  }
95
96
  export interface ProductTypePagedQueryResponse {
96
97
  readonly limit: number;
98
+ readonly offset: number;
97
99
  readonly count: number;
98
100
  readonly total?: number;
99
- readonly offset: number;
100
101
  readonly results: ProductType[];
101
102
  }
102
103
  export interface ProductTypeReference {
@@ -113,7 +114,7 @@ export interface ProductTypeUpdate {
113
114
  readonly version: number;
114
115
  readonly actions: ProductTypeUpdateAction[];
115
116
  }
116
- export declare type ProductTypeUpdateAction = ProductTypeAddAttributeDefinitionAction | ProductTypeAddLocalizedEnumValueAction | ProductTypeAddPlainEnumValueAction | ProductTypeChangeAttributeConstraintAction | ProductTypeChangeAttributeNameAction | ProductTypeChangeAttributeOrderAction | ProductTypeChangeAttributeOrderByNameAction | ProductTypeChangeDescriptionAction | ProductTypeChangeEnumKeyAction | ProductTypeChangeInputHintAction | ProductTypeChangeIsSearchableAction | ProductTypeChangeLabelAction | ProductTypeChangeLocalizedEnumValueLabelAction | ProductTypeChangeLocalizedEnumValueOrderAction | ProductTypeChangeNameAction | ProductTypeChangePlainEnumValueLabelAction | ProductTypeChangePlainEnumValueOrderAction | ProductTypeRemoveAttributeDefinitionAction | ProductTypeRemoveEnumValuesAction | ProductTypeSetInputTipAction | ProductTypeSetKeyAction;
117
+ export declare type ProductTypeUpdateAction = ProductTypeAddAttributeDefinitionAction | ProductTypeAddLocalizedEnumValueAction | ProductTypeAddPlainEnumValueAction | ProductTypeChangeAttributeConstraintAction | ProductTypeChangeAttributeNameAction | ProductTypeChangeAttributeOrderByNameAction | ProductTypeChangeDescriptionAction | ProductTypeChangeEnumKeyAction | ProductTypeChangeInputHintAction | ProductTypeChangeIsSearchableAction | ProductTypeChangeLabelAction | ProductTypeChangeLocalizedEnumValueLabelAction | ProductTypeChangeLocalizedEnumValueOrderAction | ProductTypeChangeNameAction | ProductTypeChangePlainEnumValueLabelAction | ProductTypeChangePlainEnumValueOrderAction | ProductTypeRemoveAttributeDefinitionAction | ProductTypeRemoveEnumValuesAction | ProductTypeSetInputTipAction | ProductTypeSetKeyAction;
117
118
  export declare type TextInputHint = 'MultiLine' | 'SingleLine';
118
119
  export interface ProductTypeAddAttributeDefinitionAction {
119
120
  readonly action: 'addAttributeDefinition';
@@ -139,10 +140,6 @@ export interface ProductTypeChangeAttributeNameAction {
139
140
  readonly attributeName: string;
140
141
  readonly newAttributeName: string;
141
142
  }
142
- export interface ProductTypeChangeAttributeOrderAction {
143
- readonly action: 'changeAttributeOrder';
144
- readonly attributes: AttributeDefinition[];
145
- }
146
143
  export interface ProductTypeChangeAttributeOrderByNameAction {
147
144
  readonly action: 'changeAttributeOrderByName';
148
145
  readonly attributeNames: string[];
@@ -53,6 +53,7 @@ export interface Product extends BaseResource {
53
53
  readonly taxCategory?: TaxCategoryReference;
54
54
  readonly state?: StateReference;
55
55
  readonly reviewRatingStatistics?: ReviewRatingStatistics;
56
+ readonly priceMode?: ProductPriceModeEnum;
56
57
  }
57
58
  export interface ProductCatalogData {
58
59
  readonly published: boolean;
@@ -90,6 +91,7 @@ export interface ProductDraft {
90
91
  readonly searchKeywords?: SearchKeywords;
91
92
  readonly state?: StateResourceIdentifier;
92
93
  readonly publish?: boolean;
94
+ readonly priceMode?: ProductPriceModeEnum;
93
95
  }
94
96
  export interface ProductPagedQueryResponse {
95
97
  readonly limit: number;
@@ -98,6 +100,7 @@ export interface ProductPagedQueryResponse {
98
100
  readonly offset: number;
99
101
  readonly results: Product[];
100
102
  }
103
+ export declare type ProductPriceModeEnum = 'Embedded' | 'Standalone';
101
104
  export interface ProductProjection extends BaseResource {
102
105
  readonly id: string;
103
106
  readonly version: number;
@@ -149,7 +152,7 @@ export interface ProductUpdate {
149
152
  readonly version: number;
150
153
  readonly actions: ProductUpdateAction[];
151
154
  }
152
- export declare type ProductUpdateAction = ProductAddAssetAction | ProductAddExternalImageAction | ProductAddPriceAction | ProductAddToCategoryAction | ProductAddVariantAction | ProductChangeAssetNameAction | ProductChangeAssetOrderAction | ProductChangeMasterVariantAction | ProductChangeNameAction | ProductChangePriceAction | ProductChangeSlugAction | ProductLegacySetSkuAction | ProductMoveImageToPositionAction | ProductPublishAction | ProductRemoveAssetAction | ProductRemoveFromCategoryAction | ProductRemoveImageAction | ProductRemovePriceAction | ProductRemoveVariantAction | ProductRevertStagedChangesAction | ProductRevertStagedVariantChangesAction | ProductSetAssetCustomFieldAction | ProductSetAssetCustomTypeAction | ProductSetAssetDescriptionAction | ProductSetAssetKeyAction | ProductSetAssetSourcesAction | ProductSetAssetTagsAction | ProductSetAttributeAction | ProductSetAttributeInAllVariantsAction | ProductSetCategoryOrderHintAction | ProductSetDescriptionAction | ProductSetDiscountedPriceAction | ProductSetImageLabelAction | ProductSetKeyAction | ProductSetMetaDescriptionAction | ProductSetMetaKeywordsAction | ProductSetMetaTitleAction | ProductSetPricesAction | ProductSetProductPriceCustomFieldAction | ProductSetProductPriceCustomTypeAction | ProductSetProductVariantKeyAction | ProductSetSearchKeywordsAction | ProductSetSkuAction | ProductSetTaxCategoryAction | ProductTransitionStateAction | ProductUnpublishAction;
155
+ export declare type ProductUpdateAction = ProductAddAssetAction | ProductAddExternalImageAction | ProductAddPriceAction | ProductAddToCategoryAction | ProductAddVariantAction | ProductChangeAssetNameAction | ProductChangeAssetOrderAction | ProductChangeMasterVariantAction | ProductChangeNameAction | ProductChangePriceAction | ProductChangeSlugAction | ProductLegacySetSkuAction | ProductMoveImageToPositionAction | ProductPublishAction | ProductRemoveAssetAction | ProductRemoveFromCategoryAction | ProductRemoveImageAction | ProductRemovePriceAction | ProductRemoveVariantAction | ProductRevertStagedChangesAction | ProductRevertStagedVariantChangesAction | ProductSetAssetCustomFieldAction | ProductSetAssetCustomTypeAction | ProductSetAssetDescriptionAction | ProductSetAssetKeyAction | ProductSetAssetSourcesAction | ProductSetAssetTagsAction | ProductSetAttributeAction | ProductSetAttributeInAllVariantsAction | ProductSetCategoryOrderHintAction | ProductSetDescriptionAction | ProductSetDiscountedPriceAction | ProductSetImageLabelAction | ProductSetKeyAction | ProductSetMetaDescriptionAction | ProductSetMetaKeywordsAction | ProductSetMetaTitleAction | ProductSetPriceModeAction | ProductSetPricesAction | ProductSetProductPriceCustomFieldAction | ProductSetProductPriceCustomTypeAction | ProductSetProductVariantKeyAction | ProductSetSearchKeywordsAction | ProductSetSkuAction | ProductSetTaxCategoryAction | ProductTransitionStateAction | ProductUnpublishAction;
153
156
  export interface ProductVariant {
154
157
  readonly id: number;
155
158
  readonly sku?: string;
@@ -464,6 +467,10 @@ export interface ProductSetMetaTitleAction {
464
467
  readonly metaTitle?: LocalizedString;
465
468
  readonly staged?: boolean;
466
469
  }
470
+ export interface ProductSetPriceModeAction {
471
+ readonly action: 'setPriceMode';
472
+ readonly priceMode?: ProductPriceModeEnum;
473
+ }
467
474
  export interface ProductSetPricesAction {
468
475
  readonly action: 'setPrices';
469
476
  readonly variantId?: number;
@@ -30,7 +30,7 @@ export interface ProjectUpdate {
30
30
  readonly version: number;
31
31
  readonly actions: ProjectUpdateAction[];
32
32
  }
33
- export declare type ProjectUpdateAction = ProjectChangeCartsConfigurationAction | ProjectChangeCountriesAction | ProjectChangeCountryTaxRateFallbackEnabledAction | ProjectChangeCurrenciesAction | ProjectChangeLanguagesAction | ProjectChangeMessagesConfigurationAction | ProjectChangeMessagesEnabledAction | ProjectChangeNameAction | ProjectChangeOrderSearchStatusAction | ProjectChangeProductSearchIndexingEnabledAction | ProjectChangeShoppingListsConfigurationAction | ProjectSetExternalOAuthAction | ProjectSetShippingRateInputTypeAction;
33
+ export declare type ProjectUpdateAction = ProjectChangeCartsConfigurationAction | ProjectChangeCountriesAction | ProjectChangeCountryTaxRateFallbackEnabledAction | ProjectChangeCurrenciesAction | ProjectChangeLanguagesAction | ProjectChangeMessagesConfigurationAction | ProjectChangeNameAction | ProjectChangeOrderSearchStatusAction | ProjectChangeProductSearchIndexingEnabledAction | ProjectChangeShoppingListsConfigurationAction | ProjectSetExternalOAuthAction | ProjectSetShippingRateInputTypeAction;
34
34
  export interface SearchIndexingConfiguration {
35
35
  readonly products?: SearchIndexingConfigurationValues;
36
36
  readonly orders?: SearchIndexingConfigurationValues;
@@ -79,10 +79,6 @@ export interface ProjectChangeMessagesConfigurationAction {
79
79
  readonly action: 'changeMessagesConfiguration';
80
80
  readonly messagesConfiguration: MessagesConfigurationDraft;
81
81
  }
82
- export interface ProjectChangeMessagesEnabledAction {
83
- readonly action: 'changeMessagesEnabled';
84
- readonly messagesEnabled: boolean;
85
- }
86
82
  export interface ProjectChangeNameAction {
87
83
  readonly action: 'changeName';
88
84
  readonly name: string;
@@ -0,0 +1,82 @@
1
+ import { CartResourceIdentifier, CustomLineItem, DirectDiscount, InventoryMode, LineItem, RoundingMode, ShippingInfo, ShippingRateInput, TaxCalculationMode, TaxedPrice, TaxMode } from './cart';
2
+ import { Address, BaseResource, CreatedBy, LastModifiedBy, TypedMoney } from './common';
3
+ import { CustomerReference } from './customer';
4
+ import { CustomerGroupReference } from './customer-group';
5
+ import { PaymentInfo } from './order';
6
+ import { StoreKeyReference } from './store';
7
+ import { CustomFields, CustomFieldsDraft, FieldContainer, TypeResourceIdentifier } from './type';
8
+ export interface QuoteRequest extends BaseResource {
9
+ readonly id: string;
10
+ readonly version: number;
11
+ readonly key?: string;
12
+ readonly createdAt: string;
13
+ readonly lastModifiedAt: string;
14
+ readonly lastModifiedBy?: LastModifiedBy;
15
+ readonly createdBy?: CreatedBy;
16
+ readonly quoteRequestState: QuoteRequestState;
17
+ readonly comment?: string;
18
+ readonly customer: CustomerReference;
19
+ readonly customerGroup?: CustomerGroupReference;
20
+ readonly store?: StoreKeyReference;
21
+ readonly lineItems: LineItem[];
22
+ readonly customLineItems: CustomLineItem[];
23
+ readonly totalPrice: TypedMoney;
24
+ readonly taxedPrice?: TaxedPrice;
25
+ readonly shippingAddress?: Address;
26
+ readonly billingAddress?: Address;
27
+ readonly inventoryMode?: InventoryMode;
28
+ readonly taxMode: TaxMode;
29
+ readonly taxRoundingMode: RoundingMode;
30
+ readonly taxCalculationMode: TaxCalculationMode;
31
+ readonly country?: string;
32
+ readonly shippingInfo?: ShippingInfo;
33
+ readonly paymentInfo?: PaymentInfo;
34
+ readonly shippingRateInput?: ShippingRateInput;
35
+ readonly itemShippingAddresses?: Address[];
36
+ readonly directDiscounts?: DirectDiscount[];
37
+ readonly custom?: CustomFields;
38
+ }
39
+ export interface QuoteRequestDraft {
40
+ readonly cart: CartResourceIdentifier;
41
+ readonly cartVersion: number;
42
+ readonly key?: string;
43
+ readonly comment: string;
44
+ readonly custom?: CustomFieldsDraft;
45
+ }
46
+ export interface QuoteRequestPagedQueryResponse {
47
+ readonly limit: number;
48
+ readonly offset: number;
49
+ readonly count: number;
50
+ readonly total?: number;
51
+ readonly results: QuoteRequest[];
52
+ }
53
+ export interface QuoteRequestReference {
54
+ readonly typeId: 'quote-request';
55
+ readonly id: string;
56
+ readonly obj?: QuoteRequest;
57
+ }
58
+ export interface QuoteRequestResourceIdentifier {
59
+ readonly typeId: 'quote-request';
60
+ readonly id?: string;
61
+ readonly key?: string;
62
+ }
63
+ export declare type QuoteRequestState = 'Accepted' | 'Cancelled' | 'Closed' | 'Rejected' | 'Submitted';
64
+ export interface QuoteRequestUpdate {
65
+ readonly version: number;
66
+ readonly actions: QuoteRequestUpdateAction[];
67
+ }
68
+ export declare type QuoteRequestUpdateAction = QuoteRequestChangeQuoteRequestStateAction | QuoteRequestSetCustomFieldAction | QuoteRequestSetCustomTypeAction;
69
+ export interface QuoteRequestChangeQuoteRequestStateAction {
70
+ readonly action: 'changeQuoteRequestState';
71
+ readonly quoteRequestState: QuoteRequestState;
72
+ }
73
+ export interface QuoteRequestSetCustomFieldAction {
74
+ readonly action: 'setCustomField';
75
+ readonly name: string;
76
+ readonly value?: any;
77
+ }
78
+ export interface QuoteRequestSetCustomTypeAction {
79
+ readonly action: 'setCustomType';
80
+ readonly type?: TypeResourceIdentifier;
81
+ readonly fields?: FieldContainer;
82
+ }
@@ -0,0 +1,85 @@
1
+ import { CustomLineItem, DirectDiscount, InventoryMode, LineItem, RoundingMode, ShippingInfo, ShippingRateInput, TaxCalculationMode, TaxedPrice, TaxMode } from './cart';
2
+ import { Address, BaseResource, CreatedBy, LastModifiedBy, TypedMoney } from './common';
3
+ import { CustomerReference } from './customer';
4
+ import { CustomerGroupReference } from './customer-group';
5
+ import { PaymentInfo } from './order';
6
+ import { QuoteRequestReference } from './quote-request';
7
+ import { StagedQuoteReference, StagedQuoteResourceIdentifier } from './staged-quote';
8
+ import { StoreKeyReference } from './store';
9
+ import { CustomFields, CustomFieldsDraft, FieldContainer, TypeResourceIdentifier } from './type';
10
+ export interface Quote extends BaseResource {
11
+ readonly id: string;
12
+ readonly version: number;
13
+ readonly key?: string;
14
+ readonly createdAt: string;
15
+ readonly lastModifiedAt: string;
16
+ readonly lastModifiedBy?: LastModifiedBy;
17
+ readonly createdBy?: CreatedBy;
18
+ readonly quoteRequest: QuoteRequestReference;
19
+ readonly stagedQuote: StagedQuoteReference;
20
+ readonly customer?: CustomerReference;
21
+ readonly customerGroup?: CustomerGroupReference;
22
+ readonly validTo?: string;
23
+ readonly sellerComment?: string;
24
+ readonly store?: StoreKeyReference;
25
+ readonly lineItems: LineItem[];
26
+ readonly customLineItems: CustomLineItem[];
27
+ readonly totalPrice: TypedMoney;
28
+ readonly taxedPrice?: TaxedPrice;
29
+ readonly shippingAddress?: Address;
30
+ readonly billingAddress?: Address;
31
+ readonly inventoryMode?: InventoryMode;
32
+ readonly taxMode: TaxMode;
33
+ readonly taxRoundingMode: RoundingMode;
34
+ readonly taxCalculationMode: TaxCalculationMode;
35
+ readonly country?: string;
36
+ readonly shippingInfo?: ShippingInfo;
37
+ readonly paymentInfo?: PaymentInfo;
38
+ readonly shippingRateInput?: ShippingRateInput;
39
+ readonly itemShippingAddresses?: Address[];
40
+ readonly directDiscounts?: DirectDiscount[];
41
+ readonly custom?: CustomFields;
42
+ }
43
+ export interface QuoteDraft {
44
+ readonly stagedQuote: StagedQuoteResourceIdentifier;
45
+ readonly stagedQuoteVersion: number;
46
+ readonly key?: string;
47
+ readonly custom?: CustomFieldsDraft;
48
+ }
49
+ export interface QuotePagedQueryResponse {
50
+ readonly limit: number;
51
+ readonly offset: number;
52
+ readonly count: number;
53
+ readonly total?: number;
54
+ readonly results: Quote[];
55
+ }
56
+ export interface QuoteReference {
57
+ readonly typeId: 'quote';
58
+ readonly id: string;
59
+ readonly obj?: Quote;
60
+ }
61
+ export interface QuoteResourceIdentifier {
62
+ readonly typeId: 'quote';
63
+ readonly id?: string;
64
+ readonly key?: string;
65
+ }
66
+ export declare type QuoteState = 'Accepted' | 'Declined' | 'Failed' | 'Pending' | 'Withdrawn';
67
+ export interface QuoteUpdate {
68
+ readonly version: number;
69
+ readonly actions: QuoteUpdateAction[];
70
+ }
71
+ export declare type QuoteUpdateAction = QuoteChangeQuoteStateAction | QuoteSetCustomFieldAction | QuoteSetCustomTypeAction;
72
+ export interface QuoteChangeQuoteStateAction {
73
+ readonly action: 'changeQuoteState';
74
+ readonly quoteState: QuoteState;
75
+ }
76
+ export interface QuoteSetCustomFieldAction {
77
+ readonly action: 'setCustomField';
78
+ readonly name: string;
79
+ readonly value?: any;
80
+ }
81
+ export interface QuoteSetCustomTypeAction {
82
+ readonly action: 'setCustomType';
83
+ readonly type?: TypeResourceIdentifier;
84
+ readonly fields?: FieldContainer;
85
+ }
@@ -0,0 +1,72 @@
1
+ import { CartReference } from './cart';
2
+ import { BaseResource, CreatedBy, LastModifiedBy } from './common';
3
+ import { CustomerReference } from './customer';
4
+ import { QuoteRequestReference, QuoteRequestResourceIdentifier } from './quote-request';
5
+ import { CustomFields, CustomFieldsDraft, FieldContainer, TypeResourceIdentifier } from './type';
6
+ export interface StagedQuote extends BaseResource {
7
+ readonly id: string;
8
+ readonly version: number;
9
+ readonly key?: string;
10
+ readonly createdAt: string;
11
+ readonly lastModifiedAt: string;
12
+ readonly lastModifiedBy?: LastModifiedBy;
13
+ readonly createdBy?: CreatedBy;
14
+ readonly stagedQuoteState: StagedQuoteState;
15
+ readonly customer?: CustomerReference;
16
+ readonly quoteRequest: QuoteRequestReference;
17
+ readonly quotationCart: CartReference;
18
+ readonly validTo?: string;
19
+ readonly sellerComment?: string;
20
+ readonly custom?: CustomFields;
21
+ }
22
+ export interface StagedQuoteDraft {
23
+ readonly quoteRequest: QuoteRequestResourceIdentifier;
24
+ readonly quoteRequestVersion: number;
25
+ readonly key?: string;
26
+ readonly custom?: CustomFieldsDraft;
27
+ }
28
+ export interface StagedQuotePagedQueryResponse {
29
+ readonly limit: number;
30
+ readonly offset: number;
31
+ readonly count: number;
32
+ readonly total?: number;
33
+ readonly results: StagedQuote[];
34
+ }
35
+ export interface StagedQuoteReference {
36
+ readonly typeId: 'staged-quote';
37
+ readonly id: string;
38
+ readonly obj?: StagedQuote;
39
+ }
40
+ export interface StagedQuoteResourceIdentifier {
41
+ readonly typeId: 'staged-quote';
42
+ readonly id?: string;
43
+ readonly key?: string;
44
+ }
45
+ export declare type StagedQuoteState = 'Closed' | 'InProgress' | 'Sent';
46
+ export interface StagedQuoteUpdate {
47
+ readonly version: number;
48
+ readonly actions: StagedQuoteUpdateAction[];
49
+ }
50
+ export declare type StagedQuoteUpdateAction = StagedQuoteChangeStagedQuoteStateAction | StagedQuoteSetCustomFieldAction | StagedQuoteSetCustomTypeAction | StagedQuoteSetSellerCommentAction | StagedQuoteSetValidToAction;
51
+ export interface StagedQuoteChangeStagedQuoteStateAction {
52
+ readonly action: 'changeStagedQuoteState';
53
+ readonly stagedQuoteState: StagedQuoteState;
54
+ }
55
+ export interface StagedQuoteSetCustomFieldAction {
56
+ readonly action: 'setCustomField';
57
+ readonly name: string;
58
+ readonly value?: any;
59
+ }
60
+ export interface StagedQuoteSetCustomTypeAction {
61
+ readonly action: 'setCustomType';
62
+ readonly type?: TypeResourceIdentifier;
63
+ readonly fields?: FieldContainer;
64
+ }
65
+ export interface StagedQuoteSetSellerCommentAction {
66
+ readonly action: 'setSellerComment';
67
+ readonly sellerComment?: string;
68
+ }
69
+ export interface StagedQuoteSetValidToAction {
70
+ readonly action: 'setValidTo';
71
+ readonly validTo?: string;
72
+ }
@@ -0,0 +1,76 @@
1
+ import { ChannelReference, ChannelResourceIdentifier } from './channel';
2
+ import { BaseResource, CreatedBy, DiscountedPrice, DiscountedPriceDraft, LastModifiedBy, Money, PriceTier, PriceTierDraft, TypedMoney } from './common';
3
+ import { CustomerGroupReference, CustomerGroupResourceIdentifier } from './customer-group';
4
+ import { CustomFields, CustomFieldsDraft, FieldContainer, TypeResourceIdentifier } from './type';
5
+ export interface StandalonePrice extends BaseResource {
6
+ readonly id: string;
7
+ readonly version: number;
8
+ readonly createdAt: string;
9
+ readonly lastModifiedAt: string;
10
+ readonly lastModifiedBy?: LastModifiedBy;
11
+ readonly createdBy?: CreatedBy;
12
+ readonly key?: string;
13
+ readonly sku: string;
14
+ readonly value: TypedMoney;
15
+ readonly country?: string;
16
+ readonly customerGroup?: CustomerGroupReference;
17
+ readonly channel?: ChannelReference;
18
+ readonly validFrom?: string;
19
+ readonly validUntil?: string;
20
+ readonly tiers?: PriceTier[];
21
+ readonly discounted?: DiscountedPrice;
22
+ readonly custom?: CustomFields;
23
+ }
24
+ export interface StandalonePriceDraft {
25
+ readonly key?: string;
26
+ readonly sku: string;
27
+ readonly value: Money;
28
+ readonly country?: string;
29
+ readonly customerGroup?: CustomerGroupResourceIdentifier;
30
+ readonly channel?: ChannelResourceIdentifier;
31
+ readonly validFrom?: string;
32
+ readonly validUntil?: string;
33
+ readonly tiers?: PriceTierDraft[];
34
+ readonly discounted?: DiscountedPriceDraft;
35
+ readonly custom?: CustomFieldsDraft;
36
+ }
37
+ export interface StandalonePricePagedQueryResponse {
38
+ readonly limit: number;
39
+ readonly offset: number;
40
+ readonly count: number;
41
+ readonly total?: number;
42
+ readonly results: StandalonePrice[];
43
+ }
44
+ export interface StandalonePriceReference {
45
+ readonly typeId: 'standalone-price';
46
+ readonly id: string;
47
+ readonly obj?: StandalonePrice;
48
+ }
49
+ export interface StandalonePriceResourceIdentifier {
50
+ readonly typeId: 'standalone-price';
51
+ readonly id?: string;
52
+ readonly key?: string;
53
+ }
54
+ export interface StandalonePriceUpdate {
55
+ readonly version: number;
56
+ readonly actions: StandalonePriceUpdateAction[];
57
+ }
58
+ export declare type StandalonePriceUpdateAction = StandalonePriceChangeValueAction | StandalonePriceSetCustomFieldAction | StandalonePriceSetCustomTypeAction | StandalonePriceSetDiscountedPriceAction;
59
+ export interface StandalonePriceChangeValueAction {
60
+ readonly action: 'changeValue';
61
+ readonly value: Money;
62
+ }
63
+ export interface StandalonePriceSetCustomFieldAction {
64
+ readonly action: 'setCustomField';
65
+ readonly name: string;
66
+ readonly value?: any;
67
+ }
68
+ export interface StandalonePriceSetCustomTypeAction {
69
+ readonly action: 'setCustomType';
70
+ readonly type?: TypeResourceIdentifier;
71
+ readonly fields?: FieldContainer;
72
+ }
73
+ export interface StandalonePriceSetDiscountedPriceAction {
74
+ readonly action: 'setDiscountedPrice';
75
+ readonly discounted?: DiscountedPriceDraft;
76
+ }
@@ -1,5 +1,5 @@
1
1
  import { ChannelReference, ChannelResourceIdentifier } from './channel';
2
- import { BaseResource, CreatedBy, LastModifiedBy, LocalizedString, ResourceIdentifier } from './common';
2
+ import { BaseResource, CreatedBy, LastModifiedBy, LocalizedString } from './common';
3
3
  import { ProductSelectionReference, ProductSelectionResourceIdentifier } from './product-selection';
4
4
  import { CustomFields, CustomFieldsDraft, FieldContainer, TypeResourceIdentifier } from './type';
5
5
  export interface ProductSelectionSetting {
@@ -19,10 +19,10 @@ export interface Store extends BaseResource {
19
19
  readonly createdBy?: CreatedBy;
20
20
  readonly key: string;
21
21
  readonly name?: LocalizedString;
22
- readonly languages?: string[];
22
+ readonly languages: string[];
23
23
  readonly distributionChannels: ChannelReference[];
24
- readonly supplyChannels?: ChannelReference[];
25
- readonly productSelections?: ProductSelectionSetting[];
24
+ readonly supplyChannels: ChannelReference[];
25
+ readonly productSelections: ProductSelectionSetting[];
26
26
  readonly custom?: CustomFields;
27
27
  }
28
28
  export interface StoreDraft {
@@ -40,9 +40,9 @@ export interface StoreKeyReference {
40
40
  }
41
41
  export interface StorePagedQueryResponse {
42
42
  readonly limit: number;
43
+ readonly offset: number;
43
44
  readonly count: number;
44
45
  readonly total?: number;
45
- readonly offset: number;
46
46
  readonly results: Store[];
47
47
  }
48
48
  export interface StoreReference {
@@ -71,11 +71,11 @@ export interface StoreAddProductSelectionAction {
71
71
  }
72
72
  export interface StoreAddSupplyChannelAction {
73
73
  readonly action: 'addSupplyChannel';
74
- readonly supplyChannel?: ChannelResourceIdentifier;
74
+ readonly supplyChannel: ChannelResourceIdentifier;
75
75
  }
76
76
  export interface StoreChangeProductSelectionAction {
77
77
  readonly action: 'changeProductSelectionActive';
78
- readonly productSelection: ResourceIdentifier;
78
+ readonly productSelection: ProductSelectionResourceIdentifier;
79
79
  readonly active?: boolean;
80
80
  }
81
81
  export interface StoreRemoveDistributionChannelAction {
@@ -84,11 +84,11 @@ export interface StoreRemoveDistributionChannelAction {
84
84
  }
85
85
  export interface StoreRemoveProductSelectionAction {
86
86
  readonly action: 'removeProductSelection';
87
- readonly productSelection: ResourceIdentifier;
87
+ readonly productSelection: ProductSelectionResourceIdentifier;
88
88
  }
89
89
  export interface StoreRemoveSupplyChannelAction {
90
90
  readonly action: 'removeSupplyChannel';
91
- readonly supplyChannel?: ChannelResourceIdentifier;
91
+ readonly supplyChannel: ChannelResourceIdentifier;
92
92
  }
93
93
  export interface StoreSetCustomFieldAction {
94
94
  readonly action: 'setCustomField';
@@ -114,7 +114,7 @@ export interface StoreSetNameAction {
114
114
  }
115
115
  export interface StoreSetProductSelectionsAction {
116
116
  readonly action: 'setProductSelections';
117
- readonly productSelections: ProductSelectionSettingDraft[];
117
+ readonly productSelections?: ProductSelectionSettingDraft[];
118
118
  }
119
119
  export interface StoreSetSupplyChannelsAction {
120
120
  readonly action: 'setSupplyChannels';