@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.
Files changed (42) 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/associate-role.d.ts +79 -0
  9. package/dist/typings/models/attribute-group.d.ts +68 -0
  10. package/dist/typings/models/business-unit.d.ts +272 -0
  11. package/dist/typings/models/cart-discount.d.ts +2 -2
  12. package/dist/typings/models/cart.d.ts +133 -115
  13. package/dist/typings/models/channel.d.ts +4 -4
  14. package/dist/typings/models/common.d.ts +49 -40
  15. package/dist/typings/models/customer.d.ts +16 -13
  16. package/dist/typings/models/error.d.ts +451 -18
  17. package/dist/typings/models/extension.d.ts +7 -3
  18. package/dist/typings/models/graph-ql.d.ts +3 -1
  19. package/dist/typings/models/index.d.ts +13 -6
  20. package/dist/typings/models/me.d.ts +179 -37
  21. package/dist/typings/models/message.d.ts +849 -20
  22. package/dist/typings/models/order-edit.d.ts +22 -16
  23. package/dist/typings/models/order.d.ts +124 -25
  24. package/dist/typings/models/payment.d.ts +19 -14
  25. package/dist/typings/models/product-selection.d.ts +39 -6
  26. package/dist/typings/models/product-type.d.ts +4 -4
  27. package/dist/typings/models/product.d.ts +13 -5
  28. package/dist/typings/models/project.d.ts +18 -3
  29. package/dist/typings/models/quote-request.d.ts +5 -1
  30. package/dist/typings/models/quote.d.ts +8 -3
  31. package/dist/typings/models/scalar-types.d.ts +0 -1
  32. package/dist/typings/models/shipping-method.d.ts +7 -7
  33. package/dist/typings/models/shopping-list.d.ts +22 -22
  34. package/dist/typings/models/staged-quote.d.ts +5 -1
  35. package/dist/typings/models/standalone-price.d.ts +9 -5
  36. package/dist/typings/models/state.d.ts +2 -2
  37. package/dist/typings/models/store-country.d.ts +3 -0
  38. package/dist/typings/models/store.d.ts +16 -1
  39. package/dist/typings/models/subscription.d.ts +27 -14
  40. package/dist/typings/models/tax-category.d.ts +6 -2
  41. package/dist/typings/models/type.d.ts +3 -3
  42. package/package.json +19 -19
@@ -1,31 +1,37 @@
1
- import { CartReference, CartResourceIdentifier } from './cart';
2
- import { CartDiscountReference, CartDiscountResourceIdentifier } from './cart-discount';
3
- import { CategoryReference, CategoryResourceIdentifier } from './category';
4
- import { ChannelReference, ChannelResourceIdentifier } from './channel';
5
- import { CustomObjectReference } from './custom-object';
6
- import { CustomerReference, CustomerResourceIdentifier } from './customer';
7
- import { CustomerGroupReference, CustomerGroupResourceIdentifier } from './customer-group';
8
- import { DiscountCodeReference, DiscountCodeResourceIdentifier } from './discount-code';
9
- import { InventoryEntryReference, InventoryEntryResourceIdentifier } from './inventory';
10
- import { OrderReference, OrderResourceIdentifier } from './order';
11
- import { OrderEditReference, OrderEditResourceIdentifier } from './order-edit';
12
- import { PaymentReference, PaymentResourceIdentifier } from './payment';
13
- import { ProductReference, ProductResourceIdentifier } from './product';
14
- import { ProductDiscountReference, ProductDiscountResourceIdentifier } from './product-discount';
15
- import { ProductSelectionReference, ProductSelectionResourceIdentifier } from './product-selection';
16
- import { ProductTypeReference, ProductTypeResourceIdentifier } from './product-type';
17
- import { QuoteReference, QuoteResourceIdentifier } from './quote';
18
- import { QuoteRequestReference, QuoteRequestResourceIdentifier } from './quote-request';
19
- import { ReviewReference, ReviewResourceIdentifier } from './review';
20
- import { ShippingMethodReference, ShippingMethodResourceIdentifier } from './shipping-method';
21
- import { ShoppingListReference, ShoppingListResourceIdentifier } from './shopping-list';
22
- import { StagedQuoteReference, StagedQuoteResourceIdentifier } from './staged-quote';
23
- import { StandalonePriceReference, StandalonePriceResourceIdentifier } from './standalone-price';
24
- import { StateReference, StateResourceIdentifier } from './state';
25
- import { StoreKeyReference, StoreReference, StoreResourceIdentifier } from './store';
26
- import { TaxCategoryReference, TaxCategoryResourceIdentifier } from './tax-category';
27
- import { CustomFields, CustomFieldsDraft, TypeReference, TypeResourceIdentifier } from './type';
28
- import { ZoneReference, ZoneResourceIdentifier } from './zone';
1
+ import { AssociateRole, AssociateRoleKeyReference, AssociateRoleReference, AssociateRoleResourceIdentifier } from './associate-role';
2
+ import { AttributeGroup, AttributeGroupReference, AttributeGroupResourceIdentifier } from './attribute-group';
3
+ import { BusinessUnit, BusinessUnitKeyReference, BusinessUnitReference, BusinessUnitResourceIdentifier } from './business-unit';
4
+ import { Cart, CartReference, CartResourceIdentifier, DirectDiscountReference } from './cart';
5
+ import { CartDiscount, CartDiscountReference, CartDiscountResourceIdentifier } from './cart-discount';
6
+ import { Category, CategoryReference, CategoryResourceIdentifier } from './category';
7
+ import { Channel, ChannelReference, ChannelResourceIdentifier } from './channel';
8
+ import { CustomObject, CustomObjectReference } from './custom-object';
9
+ import { Customer, CustomerReference, CustomerResourceIdentifier } from './customer';
10
+ import { CustomerGroup, CustomerGroupReference, CustomerGroupResourceIdentifier } from './customer-group';
11
+ import { DiscountCode, DiscountCodeReference, DiscountCodeResourceIdentifier } from './discount-code';
12
+ import { Extension } from './extension';
13
+ import { InventoryEntry, InventoryEntryReference, InventoryEntryResourceIdentifier } from './inventory';
14
+ import { Message } from './message';
15
+ import { Order, OrderReference, OrderResourceIdentifier } from './order';
16
+ import { OrderEdit, OrderEditReference, OrderEditResourceIdentifier } from './order-edit';
17
+ import { Payment, PaymentReference, PaymentResourceIdentifier } from './payment';
18
+ import { Product, ProductProjection, ProductReference, ProductResourceIdentifier } from './product';
19
+ import { ProductDiscount, ProductDiscountReference, ProductDiscountResourceIdentifier } from './product-discount';
20
+ import { ProductSelection, ProductSelectionReference, ProductSelectionResourceIdentifier } from './product-selection';
21
+ import { ProductType, ProductTypeReference, ProductTypeResourceIdentifier } from './product-type';
22
+ import { Quote, QuoteReference, QuoteResourceIdentifier } from './quote';
23
+ import { QuoteRequest, QuoteRequestReference, QuoteRequestResourceIdentifier } from './quote-request';
24
+ import { Review, ReviewReference, ReviewResourceIdentifier } from './review';
25
+ import { ShippingMethod, ShippingMethodReference, ShippingMethodResourceIdentifier } from './shipping-method';
26
+ import { ShoppingList, ShoppingListReference, ShoppingListResourceIdentifier } from './shopping-list';
27
+ import { StagedQuote, StagedQuoteReference, StagedQuoteResourceIdentifier } from './staged-quote';
28
+ import { StandalonePrice, StandalonePriceReference, StandalonePriceResourceIdentifier } from './standalone-price';
29
+ import { State, StateReference, StateResourceIdentifier } from './state';
30
+ import { Store, StoreKeyReference, StoreReference, StoreResourceIdentifier } from './store';
31
+ import { Subscription } from './subscription';
32
+ import { TaxCategory, TaxCategoryReference, TaxCategoryResourceIdentifier } from './tax-category';
33
+ import { CustomFields, CustomFieldsDraft, Type, TypeReference, TypeResourceIdentifier } from './type';
34
+ import { Zone, ZoneReference, ZoneResourceIdentifier } from './zone';
29
35
  export interface PagedQueryResponse {
30
36
  readonly limit: number;
31
37
  readonly offset: number;
@@ -95,14 +101,12 @@ export interface BaseAddress {
95
101
  readonly additionalAddressInfo?: string;
96
102
  readonly externalId?: string;
97
103
  }
104
+ export type _BaseAddress = BaseAddress | Address | AddressDraft;
98
105
  export interface Address extends BaseAddress {
99
- readonly id?: string;
100
106
  readonly custom?: CustomFields;
101
107
  }
102
108
  export interface AddressDraft extends BaseAddress {
103
109
  readonly custom?: CustomFieldsDraft;
104
- readonly id?: string;
105
- readonly key?: string;
106
110
  }
107
111
  export interface BaseResource {
108
112
  readonly id: string;
@@ -110,12 +114,14 @@ export interface BaseResource {
110
114
  readonly createdAt: string;
111
115
  readonly lastModifiedAt: string;
112
116
  }
117
+ export type _BaseResource = BaseResource | AssociateRole | AttributeGroup | BusinessUnit | Cart | CartDiscount | Category | Channel | CustomObject | Customer | CustomerGroup | DiscountCode | Extension | InventoryEntry | Message | Order | OrderEdit | Payment | Product | ProductDiscount | ProductProjection | ProductSelection | ProductType | Quote | QuoteRequest | Review | ShippingMethod | ShoppingList | StagedQuote | StandalonePrice | State | Store | Subscription | TaxCategory | Type | Zone;
113
118
  export interface ClientLogging {
114
119
  readonly clientId?: string;
115
120
  readonly externalUserId?: string;
116
121
  readonly customer?: CustomerReference;
117
122
  readonly anonymousId?: string;
118
123
  }
124
+ export type _ClientLogging = ClientLogging | CreatedBy | LastModifiedBy;
119
125
  export interface CreatedBy extends ClientLogging {
120
126
  readonly clientId?: string;
121
127
  readonly externalUserId?: string;
@@ -127,7 +133,7 @@ export interface DiscountedPrice {
127
133
  readonly discount: ProductDiscountReference;
128
134
  }
129
135
  export interface DiscountedPriceDraft {
130
- readonly value: Money;
136
+ readonly value: _Money;
131
137
  readonly discount: ProductDiscountReference;
132
138
  }
133
139
  export type GeoJson = GeoJsonPoint;
@@ -144,7 +150,7 @@ export interface ImageDimensions {
144
150
  readonly w: number;
145
151
  readonly h: number;
146
152
  }
147
- export type KeyReference = StoreKeyReference;
153
+ export type KeyReference = AssociateRoleKeyReference | BusinessUnitKeyReference | StoreKeyReference;
148
154
  export interface LastModifiedBy extends ClientLogging {
149
155
  readonly clientId?: string;
150
156
  readonly externalUserId?: string;
@@ -158,9 +164,11 @@ export interface Money {
158
164
  readonly centAmount: number;
159
165
  readonly currencyCode: string;
160
166
  }
161
- export type MoneyType = 'centPrecision' | 'highPrecision';
167
+ export type _Money = Money | TypedMoney | TypedMoneyDraft;
168
+ export type MoneyType = 'centPrecision' | 'highPrecision' | string;
162
169
  export interface Price {
163
170
  readonly id: string;
171
+ readonly key?: string;
164
172
  readonly value: TypedMoney;
165
173
  readonly country?: string;
166
174
  readonly customerGroup?: CustomerGroupReference;
@@ -172,7 +180,8 @@ export interface Price {
172
180
  readonly custom?: CustomFields;
173
181
  }
174
182
  export interface PriceDraft {
175
- readonly value: Money;
183
+ readonly key?: string;
184
+ readonly value: _Money;
176
185
  readonly country?: string;
177
186
  readonly customerGroup?: CustomerGroupResourceIdentifier;
178
187
  readonly channel?: ChannelResourceIdentifier;
@@ -188,11 +197,11 @@ export interface PriceTier {
188
197
  }
189
198
  export interface PriceTierDraft {
190
199
  readonly minimumQuantity: number;
191
- readonly value: Money;
200
+ readonly value: _Money;
192
201
  }
193
202
  export interface QueryPrice {
194
203
  readonly id?: string;
195
- readonly value: Money;
204
+ readonly value: _Money;
196
205
  readonly country?: string;
197
206
  readonly customerGroup?: CustomerGroupReference;
198
207
  readonly channel?: ChannelReference;
@@ -202,9 +211,9 @@ export interface QueryPrice {
202
211
  readonly custom?: CustomFields;
203
212
  readonly tiers?: PriceTierDraft[];
204
213
  }
205
- export 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 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
- export 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;
214
+ export type Reference = AssociateRoleReference | AttributeGroupReference | BusinessUnitReference | CartDiscountReference | CartReference | CategoryReference | ChannelReference | CustomObjectReference | CustomerGroupReference | CustomerReference | DirectDiscountReference | DiscountCodeReference | InventoryEntryReference | OrderEditReference | OrderReference | PaymentReference | ProductDiscountReference | ProductReference | ProductSelectionReference | ProductTypeReference | QuoteReference | QuoteRequestReference | ReviewReference | ShippingMethodReference | ShoppingListReference | StagedQuoteReference | StandalonePriceReference | StateReference | StoreReference | TaxCategoryReference | TypeReference | ZoneReference;
215
+ export type ReferenceTypeId = 'associate-role' | 'attribute-group' | 'business-unit' | 'cart' | 'cart-discount' | 'category' | 'channel' | 'customer' | 'customer-group' | 'direct-discount' | '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' | string;
216
+ export type ResourceIdentifier = AssociateRoleResourceIdentifier | AttributeGroupResourceIdentifier | BusinessUnitResourceIdentifier | 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
217
  export interface ScopedPrice {
209
218
  readonly id: string;
210
219
  readonly value: TypedMoney;
@@ -1,18 +1,20 @@
1
1
  import { Cart, CartResourceIdentifier } from './cart';
2
- import { Address, BaseAddress, BaseResource, CreatedBy, LastModifiedBy } from './common';
2
+ import { Address, BaseAddress, BaseResource, CreatedBy, LastModifiedBy, _BaseAddress } from './common';
3
3
  import { CustomerGroupReference, CustomerGroupResourceIdentifier } from './customer-group';
4
4
  import { StoreKeyReference, StoreResourceIdentifier } from './store';
5
5
  import { CustomFields, CustomFieldsDraft, FieldContainer, TypeResourceIdentifier } from './type';
6
- export type AnonymousCartSignInMode = 'MergeWithExistingCustomerCart' | 'UseAsNewActiveCustomerCart';
7
- export type AuthenticationMode = 'ExternalAuth' | 'Password';
6
+ export type AnonymousCartSignInMode = 'MergeWithExistingCustomerCart' | 'UseAsNewActiveCustomerCart' | string;
7
+ export type AuthenticationMode = 'ExternalAuth' | 'Password' | string;
8
8
  export interface Customer extends BaseResource {
9
9
  readonly id: string;
10
10
  readonly version: number;
11
+ readonly key?: string;
12
+ readonly customerNumber?: string;
13
+ readonly externalId?: string;
11
14
  readonly createdAt: string;
12
15
  readonly lastModifiedAt: string;
13
16
  readonly lastModifiedBy?: LastModifiedBy;
14
17
  readonly createdBy?: CreatedBy;
15
- readonly customerNumber?: string;
16
18
  readonly email: string;
17
19
  readonly password?: string;
18
20
  readonly firstName?: string;
@@ -28,14 +30,12 @@ export interface Customer extends BaseResource {
28
30
  readonly defaultBillingAddressId?: string;
29
31
  readonly billingAddressIds?: string[];
30
32
  readonly isEmailVerified: boolean;
31
- readonly externalId?: string;
32
33
  readonly customerGroup?: CustomerGroupReference;
33
34
  readonly custom?: CustomFields;
34
35
  readonly locale?: string;
35
36
  readonly salutation?: string;
36
- readonly key?: string;
37
37
  readonly stores?: StoreKeyReference[];
38
- readonly authenticationMode?: AuthenticationMode;
38
+ readonly authenticationMode: AuthenticationMode;
39
39
  }
40
40
  export interface CustomerChangePassword {
41
41
  readonly id: string;
@@ -53,7 +53,9 @@ export interface CustomerCreatePasswordResetToken {
53
53
  readonly ttlMinutes?: number;
54
54
  }
55
55
  export interface CustomerDraft {
56
+ readonly key?: string;
56
57
  readonly customerNumber?: string;
58
+ readonly externalId?: string;
57
59
  readonly email: string;
58
60
  readonly password?: string;
59
61
  readonly firstName?: string;
@@ -72,12 +74,10 @@ export interface CustomerDraft {
72
74
  readonly defaultBillingAddress?: number;
73
75
  readonly billingAddresses?: number[];
74
76
  readonly isEmailVerified?: boolean;
75
- readonly externalId?: string;
76
77
  readonly customerGroup?: CustomerGroupResourceIdentifier;
77
78
  readonly custom?: CustomFieldsDraft;
78
79
  readonly locale?: string;
79
80
  readonly salutation?: string;
80
- readonly key?: string;
81
81
  readonly stores?: StoreResourceIdentifier[];
82
82
  readonly authenticationMode?: AuthenticationMode;
83
83
  }
@@ -87,9 +87,9 @@ export interface CustomerEmailVerify {
87
87
  }
88
88
  export interface CustomerPagedQueryResponse {
89
89
  readonly limit: number;
90
+ readonly offset: number;
90
91
  readonly count: number;
91
92
  readonly total?: number;
92
- readonly offset: number;
93
93
  readonly results: Customer[];
94
94
  }
95
95
  export interface CustomerReference {
@@ -138,6 +138,9 @@ export interface MyCustomerChangePassword {
138
138
  readonly currentPassword: string;
139
139
  readonly newPassword: string;
140
140
  }
141
+ export interface MyCustomerEmailVerify {
142
+ readonly tokenValue: string;
143
+ }
141
144
  export interface MyCustomerResetPassword {
142
145
  readonly tokenValue: string;
143
146
  readonly newPassword: string;
@@ -150,7 +153,7 @@ export interface MyCustomerSignin {
150
153
  }
151
154
  export interface CustomerAddAddressAction {
152
155
  readonly action: 'addAddress';
153
- readonly address: BaseAddress;
156
+ readonly address: _BaseAddress;
154
157
  }
155
158
  export interface CustomerAddBillingAddressIdAction {
156
159
  readonly action: 'addBillingAddressId';
@@ -170,7 +173,7 @@ export interface CustomerChangeAddressAction {
170
173
  readonly action: 'changeAddress';
171
174
  readonly addressId?: string;
172
175
  readonly addressKey?: string;
173
- readonly address: BaseAddress;
176
+ readonly address: _BaseAddress;
174
177
  }
175
178
  export interface CustomerChangeEmailAction {
176
179
  readonly action: 'changeEmail';
@@ -203,9 +206,9 @@ export interface CustomerSetAddressCustomFieldAction {
203
206
  }
204
207
  export interface CustomerSetAddressCustomTypeAction {
205
208
  readonly action: 'setAddressCustomType';
209
+ readonly addressId: string;
206
210
  readonly type?: TypeResourceIdentifier;
207
211
  readonly fields?: FieldContainer;
208
- readonly addressId: string;
209
212
  }
210
213
  export interface CustomerSetAuthenticationModeAction {
211
214
  readonly action: 'setAuthenticationMode';