@gradientedge/commercetools-utils 4.11.2 → 4.12.1
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 +2 -0
- package/dist/ge-commercetools-utils-browser.cjs.js.map +1 -0
- package/dist/ge-commercetools-utils-browser.esm.js +2 -0
- package/dist/ge-commercetools-utils-browser.esm.js.map +1 -0
- package/dist/ge-commercetools-utils-node.cjs.js +2 -0
- package/dist/ge-commercetools-utils-node.cjs.js.map +1 -0
- package/dist/ge-commercetools-utils-node.esm.js +1 -0
- package/dist/typings/api/CommercetoolsApi.d.ts +436 -0
- package/dist/{api → typings/api}/index.d.ts +0 -1
- package/dist/typings/api/types.d.ts +12 -0
- package/dist/typings/auth/CommercetoolsAuth.d.ts +22 -0
- package/dist/typings/auth/CommercetoolsAuthApi.d.ts +21 -0
- package/dist/typings/auth/CommercetoolsGrant.d.ts +13 -0
- package/dist/{auth → typings/auth}/constants.d.ts +0 -4
- package/dist/{auth → typings/auth}/index.d.ts +0 -1
- package/dist/typings/auth/scopes.d.ts +2 -0
- package/dist/typings/auth/types.d.ts +43 -0
- package/dist/{auth → typings/auth}/utils.d.ts +0 -1
- package/dist/typings/constants.d.ts +1 -0
- package/dist/typings/error/CommercetoolsError.d.ts +16 -0
- package/dist/{error → typings/error}/index.d.ts +0 -1
- package/dist/typings/index.d.ts +6 -0
- package/dist/typings/models/cart-discount.d.ts +196 -0
- package/dist/typings/models/cart.d.ts +597 -0
- package/dist/typings/models/category.d.ts +166 -0
- package/dist/typings/models/channel.d.ts +103 -0
- package/dist/typings/models/common.d.ts +232 -0
- package/dist/typings/models/custom-object.d.ts +30 -0
- package/dist/typings/models/customer-group.d.ts +58 -0
- package/dist/typings/models/customer.d.ts +276 -0
- package/dist/typings/models/discount-code.d.ts +116 -0
- package/dist/typings/models/error.d.ts +412 -0
- package/dist/typings/models/extension.d.ts +78 -0
- package/dist/typings/models/graph-ql.d.ts +21 -0
- package/dist/typings/models/index.d.ts +33 -0
- package/dist/typings/models/inventory.d.ts +82 -0
- package/dist/typings/models/me.d.ts +481 -0
- package/dist/typings/models/message.d.ts +1823 -0
- package/dist/typings/models/order-edit.d.ts +565 -0
- package/dist/typings/models/order.d.ts +558 -0
- package/dist/typings/models/payment.d.ts +208 -0
- package/dist/typings/models/product-discount.d.ts +123 -0
- package/dist/typings/models/product-selection.d.ts +106 -0
- package/dist/typings/models/product-type.d.ts +216 -0
- package/dist/typings/models/product.d.ts +517 -0
- package/dist/typings/models/project.d.ts +108 -0
- package/dist/typings/models/review.d.ts +115 -0
- package/dist/typings/models/scalar-types.d.ts +4 -0
- package/dist/typings/models/shipping-method.d.ts +160 -0
- package/dist/typings/models/shopping-list.d.ts +217 -0
- package/dist/typings/models/state.d.ts +86 -0
- package/dist/typings/models/store.d.ts +121 -0
- package/dist/typings/models/subscription.d.ts +148 -0
- package/dist/typings/models/tax-category.d.ts +87 -0
- package/dist/typings/models/type.d.ts +182 -0
- package/dist/typings/models/zone.d.ts +65 -0
- package/dist/typings/types.d.ts +21 -0
- package/dist/typings/utils/format.d.ts +1 -0
- package/dist/{utils → typings/utils}/index.d.ts +0 -2
- package/dist/typings/utils/mask.d.ts +6 -0
- package/dist/typings/utils/useragent.d.ts +1 -0
- package/package.json +34 -19
- package/dist/api/CommercetoolsApi.d.ts +0 -1096
- package/dist/api/CommercetoolsApi.d.ts.map +0 -1
- package/dist/api/CommercetoolsApi.js +0 -1425
- package/dist/api/CommercetoolsApi.js.map +0 -1
- package/dist/api/index.d.ts.map +0 -1
- package/dist/api/index.js +0 -15
- package/dist/api/index.js.map +0 -1
- package/dist/api/types.d.ts +0 -33
- package/dist/api/types.d.ts.map +0 -1
- package/dist/api/types.js +0 -3
- package/dist/api/types.js.map +0 -1
- package/dist/auth/CommercetoolsAuth.d.ts +0 -182
- package/dist/auth/CommercetoolsAuth.d.ts.map +0 -1
- package/dist/auth/CommercetoolsAuth.js +0 -326
- package/dist/auth/CommercetoolsAuth.js.map +0 -1
- package/dist/auth/CommercetoolsAuthApi.d.ts +0 -74
- package/dist/auth/CommercetoolsAuthApi.d.ts.map +0 -1
- package/dist/auth/CommercetoolsAuthApi.js +0 -248
- package/dist/auth/CommercetoolsAuthApi.js.map +0 -1
- package/dist/auth/CommercetoolsGrant.d.ts +0 -66
- package/dist/auth/CommercetoolsGrant.d.ts.map +0 -1
- package/dist/auth/CommercetoolsGrant.js +0 -82
- package/dist/auth/CommercetoolsGrant.js.map +0 -1
- package/dist/auth/constants.d.ts.map +0 -1
- package/dist/auth/constants.js +0 -32
- package/dist/auth/constants.js.map +0 -1
- package/dist/auth/index.d.ts.map +0 -1
- package/dist/auth/index.js +0 -15
- package/dist/auth/index.js.map +0 -1
- package/dist/auth/scopes.d.ts +0 -11
- package/dist/auth/scopes.d.ts.map +0 -1
- package/dist/auth/scopes.js +0 -30
- package/dist/auth/scopes.js.map +0 -1
- package/dist/auth/types.d.ts +0 -120
- package/dist/auth/types.d.ts.map +0 -1
- package/dist/auth/types.js +0 -28
- package/dist/auth/types.js.map +0 -1
- package/dist/auth/utils.d.ts.map +0 -1
- package/dist/auth/utils.js +0 -15
- package/dist/auth/utils.js.map +0 -1
- package/dist/constants.d.ts +0 -6
- package/dist/constants.d.ts.map +0 -1
- package/dist/constants.js +0 -9
- package/dist/constants.js.map +0 -1
- package/dist/error/CommercetoolsError.d.ts +0 -38
- package/dist/error/CommercetoolsError.d.ts.map +0 -1
- package/dist/error/CommercetoolsError.js +0 -117
- package/dist/error/CommercetoolsError.js.map +0 -1
- package/dist/error/index.d.ts.map +0 -1
- package/dist/error/index.js +0 -14
- package/dist/error/index.js.map +0 -1
- package/dist/index.d.ts +0 -7
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -21
- package/dist/index.js.map +0 -1
- package/dist/types.d.ts +0 -44
- package/dist/types.d.ts.map +0 -1
- package/dist/types.js +0 -16
- package/dist/types.js.map +0 -1
- package/dist/utils/format.d.ts +0 -11
- package/dist/utils/format.d.ts.map +0 -1
- package/dist/utils/format.js +0 -48
- package/dist/utils/format.js.map +0 -1
- package/dist/utils/index.d.ts.map +0 -1
- package/dist/utils/index.js +0 -17
- package/dist/utils/index.js.map +0 -1
- package/dist/utils/isNode.d.ts +0 -2
- package/dist/utils/isNode.d.ts.map +0 -1
- package/dist/utils/isNode.js +0 -12
- package/dist/utils/isNode.js.map +0 -1
- package/dist/utils/mask.d.ts +0 -28
- package/dist/utils/mask.d.ts.map +0 -1
- package/dist/utils/mask.js +0 -56
- package/dist/utils/mask.js.map +0 -1
- package/dist/utils/useragent.d.ts +0 -10
- package/dist/utils/useragent.d.ts.map +0 -1
- package/dist/utils/useragent.js +0 -20
- package/dist/utils/useragent.js.map +0 -1
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
import { ChannelReference, ChannelResourceIdentifier } from './channel';
|
|
2
|
+
import { BaseResource, CreatedBy, LastModifiedBy, LocalizedString, Money, Reference, TypedMoney } from './common';
|
|
3
|
+
import { ProductReference, ProductResourceIdentifier } from './product';
|
|
4
|
+
import { CustomFields, CustomFieldsDraft, FieldContainer, TypeResourceIdentifier } from './type';
|
|
5
|
+
export interface CartDiscount 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 name: LocalizedString;
|
|
13
|
+
readonly key?: string;
|
|
14
|
+
readonly description?: LocalizedString;
|
|
15
|
+
readonly value: CartDiscountValue;
|
|
16
|
+
readonly cartPredicate: string;
|
|
17
|
+
readonly target?: CartDiscountTarget;
|
|
18
|
+
readonly sortOrder: string;
|
|
19
|
+
readonly isActive: boolean;
|
|
20
|
+
readonly validFrom?: string;
|
|
21
|
+
readonly validUntil?: string;
|
|
22
|
+
readonly requiresDiscountCode: boolean;
|
|
23
|
+
readonly references: Reference[];
|
|
24
|
+
readonly stackingMode: StackingMode;
|
|
25
|
+
readonly custom?: CustomFields;
|
|
26
|
+
}
|
|
27
|
+
export interface CartDiscountDraft {
|
|
28
|
+
readonly name: LocalizedString;
|
|
29
|
+
readonly key?: string;
|
|
30
|
+
readonly description?: LocalizedString;
|
|
31
|
+
readonly value: CartDiscountValueDraft;
|
|
32
|
+
readonly cartPredicate: string;
|
|
33
|
+
readonly target?: CartDiscountTarget;
|
|
34
|
+
readonly sortOrder: string;
|
|
35
|
+
readonly isActive?: boolean;
|
|
36
|
+
readonly validFrom?: string;
|
|
37
|
+
readonly validUntil?: string;
|
|
38
|
+
readonly requiresDiscountCode?: boolean;
|
|
39
|
+
readonly stackingMode?: StackingMode;
|
|
40
|
+
readonly custom?: CustomFieldsDraft;
|
|
41
|
+
}
|
|
42
|
+
export interface CartDiscountPagedQueryResponse {
|
|
43
|
+
readonly limit: number;
|
|
44
|
+
readonly count: number;
|
|
45
|
+
readonly total?: number;
|
|
46
|
+
readonly offset: number;
|
|
47
|
+
readonly results: CartDiscount[];
|
|
48
|
+
}
|
|
49
|
+
export interface CartDiscountReference {
|
|
50
|
+
readonly typeId: 'cart-discount';
|
|
51
|
+
readonly id: string;
|
|
52
|
+
readonly obj?: CartDiscount;
|
|
53
|
+
}
|
|
54
|
+
export interface CartDiscountResourceIdentifier {
|
|
55
|
+
readonly typeId: 'cart-discount';
|
|
56
|
+
readonly id?: string;
|
|
57
|
+
readonly key?: string;
|
|
58
|
+
}
|
|
59
|
+
export declare type CartDiscountTarget = CartDiscountCustomLineItemsTarget | CartDiscountLineItemsTarget | CartDiscountShippingCostTarget | MultiBuyCustomLineItemsTarget | MultiBuyLineItemsTarget;
|
|
60
|
+
export interface CartDiscountCustomLineItemsTarget {
|
|
61
|
+
readonly type: 'customLineItems';
|
|
62
|
+
readonly predicate: string;
|
|
63
|
+
}
|
|
64
|
+
export interface CartDiscountLineItemsTarget {
|
|
65
|
+
readonly type: 'lineItems';
|
|
66
|
+
readonly predicate: string;
|
|
67
|
+
}
|
|
68
|
+
export interface CartDiscountShippingCostTarget {
|
|
69
|
+
readonly type: 'shipping';
|
|
70
|
+
}
|
|
71
|
+
export interface CartDiscountUpdate {
|
|
72
|
+
readonly version: number;
|
|
73
|
+
readonly actions: CartDiscountUpdateAction[];
|
|
74
|
+
}
|
|
75
|
+
export declare type CartDiscountUpdateAction = CartDiscountChangeCartPredicateAction | CartDiscountChangeIsActiveAction | CartDiscountChangeNameAction | CartDiscountChangeRequiresDiscountCodeAction | CartDiscountChangeSortOrderAction | CartDiscountChangeStackingModeAction | CartDiscountChangeTargetAction | CartDiscountChangeValueAction | CartDiscountSetCustomFieldAction | CartDiscountSetCustomTypeAction | CartDiscountSetDescriptionAction | CartDiscountSetKeyAction | CartDiscountSetValidFromAction | CartDiscountSetValidFromAndUntilAction | CartDiscountSetValidUntilAction;
|
|
76
|
+
export declare type CartDiscountValue = CartDiscountValueAbsolute | CartDiscountValueFixed | CartDiscountValueGiftLineItem | CartDiscountValueRelative;
|
|
77
|
+
export interface CartDiscountValueAbsolute {
|
|
78
|
+
readonly type: 'absolute';
|
|
79
|
+
readonly money: TypedMoney[];
|
|
80
|
+
}
|
|
81
|
+
export declare type CartDiscountValueDraft = CartDiscountValueAbsoluteDraft | CartDiscountValueFixedDraft | CartDiscountValueGiftLineItemDraft | CartDiscountValueRelativeDraft;
|
|
82
|
+
export interface CartDiscountValueAbsoluteDraft {
|
|
83
|
+
readonly type: 'absolute';
|
|
84
|
+
readonly money: Money[];
|
|
85
|
+
}
|
|
86
|
+
export interface CartDiscountValueFixed {
|
|
87
|
+
readonly type: 'fixed';
|
|
88
|
+
readonly money: TypedMoney[];
|
|
89
|
+
}
|
|
90
|
+
export interface CartDiscountValueFixedDraft {
|
|
91
|
+
readonly type: 'fixed';
|
|
92
|
+
readonly money: Money[];
|
|
93
|
+
}
|
|
94
|
+
export interface CartDiscountValueGiftLineItem {
|
|
95
|
+
readonly type: 'giftLineItem';
|
|
96
|
+
readonly product: ProductReference;
|
|
97
|
+
readonly variantId: number;
|
|
98
|
+
readonly supplyChannel?: ChannelReference;
|
|
99
|
+
readonly distributionChannel?: ChannelReference;
|
|
100
|
+
}
|
|
101
|
+
export interface CartDiscountValueGiftLineItemDraft {
|
|
102
|
+
readonly type: 'giftLineItem';
|
|
103
|
+
readonly product: ProductResourceIdentifier;
|
|
104
|
+
readonly variantId: number;
|
|
105
|
+
readonly supplyChannel?: ChannelResourceIdentifier;
|
|
106
|
+
readonly distributionChannel?: ChannelResourceIdentifier;
|
|
107
|
+
}
|
|
108
|
+
export interface CartDiscountValueRelative {
|
|
109
|
+
readonly type: 'relative';
|
|
110
|
+
readonly permyriad: number;
|
|
111
|
+
}
|
|
112
|
+
export interface CartDiscountValueRelativeDraft {
|
|
113
|
+
readonly type: 'relative';
|
|
114
|
+
readonly permyriad: number;
|
|
115
|
+
}
|
|
116
|
+
export interface MultiBuyCustomLineItemsTarget {
|
|
117
|
+
readonly type: 'multiBuyCustomLineItems';
|
|
118
|
+
readonly predicate: string;
|
|
119
|
+
readonly triggerQuantity: number;
|
|
120
|
+
readonly discountedQuantity: number;
|
|
121
|
+
readonly maxOccurrence?: number;
|
|
122
|
+
readonly selectionMode: SelectionMode;
|
|
123
|
+
}
|
|
124
|
+
export interface MultiBuyLineItemsTarget {
|
|
125
|
+
readonly type: 'multiBuyLineItems';
|
|
126
|
+
readonly predicate: string;
|
|
127
|
+
readonly triggerQuantity: number;
|
|
128
|
+
readonly discountedQuantity: number;
|
|
129
|
+
readonly maxOccurrence?: number;
|
|
130
|
+
readonly selectionMode: SelectionMode;
|
|
131
|
+
}
|
|
132
|
+
export declare type SelectionMode = 'Cheapest' | 'MostExpensive';
|
|
133
|
+
export declare type StackingMode = 'Stacking' | 'StopAfterThisDiscount';
|
|
134
|
+
export interface CartDiscountChangeCartPredicateAction {
|
|
135
|
+
readonly action: 'changeCartPredicate';
|
|
136
|
+
readonly cartPredicate: string;
|
|
137
|
+
}
|
|
138
|
+
export interface CartDiscountChangeIsActiveAction {
|
|
139
|
+
readonly action: 'changeIsActive';
|
|
140
|
+
readonly isActive: boolean;
|
|
141
|
+
}
|
|
142
|
+
export interface CartDiscountChangeNameAction {
|
|
143
|
+
readonly action: 'changeName';
|
|
144
|
+
readonly name: LocalizedString;
|
|
145
|
+
}
|
|
146
|
+
export interface CartDiscountChangeRequiresDiscountCodeAction {
|
|
147
|
+
readonly action: 'changeRequiresDiscountCode';
|
|
148
|
+
readonly requiresDiscountCode: boolean;
|
|
149
|
+
}
|
|
150
|
+
export interface CartDiscountChangeSortOrderAction {
|
|
151
|
+
readonly action: 'changeSortOrder';
|
|
152
|
+
readonly sortOrder: string;
|
|
153
|
+
}
|
|
154
|
+
export interface CartDiscountChangeStackingModeAction {
|
|
155
|
+
readonly action: 'changeStackingMode';
|
|
156
|
+
readonly stackingMode: StackingMode;
|
|
157
|
+
}
|
|
158
|
+
export interface CartDiscountChangeTargetAction {
|
|
159
|
+
readonly action: 'changeTarget';
|
|
160
|
+
readonly target: CartDiscountTarget;
|
|
161
|
+
}
|
|
162
|
+
export interface CartDiscountChangeValueAction {
|
|
163
|
+
readonly action: 'changeValue';
|
|
164
|
+
readonly value: CartDiscountValueDraft;
|
|
165
|
+
}
|
|
166
|
+
export interface CartDiscountSetCustomFieldAction {
|
|
167
|
+
readonly action: 'setCustomField';
|
|
168
|
+
readonly name: string;
|
|
169
|
+
readonly value?: any;
|
|
170
|
+
}
|
|
171
|
+
export interface CartDiscountSetCustomTypeAction {
|
|
172
|
+
readonly action: 'setCustomType';
|
|
173
|
+
readonly type?: TypeResourceIdentifier;
|
|
174
|
+
readonly fields?: FieldContainer;
|
|
175
|
+
}
|
|
176
|
+
export interface CartDiscountSetDescriptionAction {
|
|
177
|
+
readonly action: 'setDescription';
|
|
178
|
+
readonly description?: LocalizedString;
|
|
179
|
+
}
|
|
180
|
+
export interface CartDiscountSetKeyAction {
|
|
181
|
+
readonly action: 'setKey';
|
|
182
|
+
readonly key?: string;
|
|
183
|
+
}
|
|
184
|
+
export interface CartDiscountSetValidFromAction {
|
|
185
|
+
readonly action: 'setValidFrom';
|
|
186
|
+
readonly validFrom?: string;
|
|
187
|
+
}
|
|
188
|
+
export interface CartDiscountSetValidFromAndUntilAction {
|
|
189
|
+
readonly action: 'setValidFromAndUntil';
|
|
190
|
+
readonly validFrom?: string;
|
|
191
|
+
readonly validUntil?: string;
|
|
192
|
+
}
|
|
193
|
+
export interface CartDiscountSetValidUntilAction {
|
|
194
|
+
readonly action: 'setValidUntil';
|
|
195
|
+
readonly validUntil?: string;
|
|
196
|
+
}
|