@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
|
@@ -1,1096 +0,0 @@
|
|
|
1
|
-
import { AxiosInstance } from 'axios';
|
|
2
|
-
import { CommercetoolsApiConfig, CommercetoolsRetryConfig } from './types';
|
|
3
|
-
import { CommercetoolsAuth } from '../';
|
|
4
|
-
import { RegionEndpoints } from '../types';
|
|
5
|
-
import type { Cart, CartDiscount, CartDiscountPagedQueryResponse, CartDraft, CartPagedQueryResponse, CartUpdateAction, Category, CategoryDraft, CategoryPagedQueryResponse, CategoryUpdate, Channel, ChannelPagedQueryResponse, Customer, CustomerCreatePasswordResetToken, CustomerDraft, CustomerGroup, CustomerGroupDraft, CustomerGroupPagedQueryResponse, CustomerGroupUpdate, CustomerPagedQueryResponse, CustomerResetPassword, CustomerSignin, CustomerSignInResult, CustomerToken, CustomerUpdate, CustomObject, CustomObjectDraft, DiscountCode, GraphQLRequest, GraphQLResponse, MyCartDraft, MyCustomerDraft, MyPayment, MyPaymentDraft, MyPaymentPagedQueryResponse, MyPaymentUpdate, Order, OrderImportDraft, OrderPagedQueryResponse, OrderUpdate, Payment, PaymentPagedQueryResponse, PaymentUpdate, Product, ProductDraft, ProductProjection, ProductProjectionPagedQueryResponse, ProductsInStorePagedQueryResponse, ProductSelection, ProductSelectionDraft, ProductSelectionPagedQueryResponse, ProductSelectionUpdateAction, ProductType, ProductUpdate, ShippingMethod, ShippingMethodPagedQueryResponse, Store, StoreDraft, StorePagedQueryResponse, StoreUpdate, Type } from '@commercetools/platform-sdk';
|
|
6
|
-
export interface FetchOptions<T = Record<string, any>> {
|
|
7
|
-
/**
|
|
8
|
-
* Path of the REST endpoint
|
|
9
|
-
*
|
|
10
|
-
* This is the absolute path, without the host/schema/port etc.
|
|
11
|
-
* You should not include your project key, as this will be
|
|
12
|
-
* automatically prepended.
|
|
13
|
-
*
|
|
14
|
-
* Example: `/product-projections`
|
|
15
|
-
*
|
|
16
|
-
* Note that if you want to create a path that takes in to account
|
|
17
|
-
* the store key that you defined in {@see CommercetoolsApiConfig}
|
|
18
|
-
* then you should use the {@see CommercetoolsApi.applyStore} method.
|
|
19
|
-
*/
|
|
20
|
-
path: string;
|
|
21
|
-
/**
|
|
22
|
-
* Key/value pairs representing the HTTP headers to send
|
|
23
|
-
*
|
|
24
|
-
* You can pass in any headers you like using this property, however
|
|
25
|
-
* this is generally not necessary, as the {@see CommercetoolsApi.request}
|
|
26
|
-
* method applies all necessary headers.
|
|
27
|
-
*
|
|
28
|
-
* You should specifically avoid setting values for the following headers:
|
|
29
|
-
*
|
|
30
|
-
* - `Authorization`
|
|
31
|
-
* - `Content-Type`
|
|
32
|
-
* - `X-Correlation-ID`
|
|
33
|
-
* - `User-Agent`
|
|
34
|
-
*
|
|
35
|
-
* All of the above are set by the `CommercetoolsApi` class.
|
|
36
|
-
*
|
|
37
|
-
* Example value:
|
|
38
|
-
*
|
|
39
|
-
* ```
|
|
40
|
-
* {
|
|
41
|
-
* ...
|
|
42
|
-
* headers: {
|
|
43
|
-
* 'X-My-Special-Header': 'MyCustomValue'
|
|
44
|
-
* }
|
|
45
|
-
* ...
|
|
46
|
-
* }
|
|
47
|
-
* ```
|
|
48
|
-
*/
|
|
49
|
-
headers?: Record<string, string>;
|
|
50
|
-
/**
|
|
51
|
-
* HTTP method to use when sending the request
|
|
52
|
-
*/
|
|
53
|
-
method: 'GET' | 'POST' | 'DELETE' | 'HEAD';
|
|
54
|
-
/**
|
|
55
|
-
* Querystring parameters to send with the request
|
|
56
|
-
*
|
|
57
|
-
* Key/value pairs that are then converted in to a querystring
|
|
58
|
-
* using the `qs` npm package. See the `paramSerializer` option
|
|
59
|
-
* in {@see CommercetoolsApi.createAxiosInstance} for
|
|
60
|
-
* implementation details.
|
|
61
|
-
*/
|
|
62
|
-
params?: Record<string, any>;
|
|
63
|
-
/**
|
|
64
|
-
* Plain JavaScript object containing the payload to send as JSON
|
|
65
|
-
*
|
|
66
|
-
* This object will be converted to a JSON string and sent as the body
|
|
67
|
-
* of a `POST` or `DELETE` request.
|
|
68
|
-
*/
|
|
69
|
-
data?: T;
|
|
70
|
-
/**
|
|
71
|
-
* Access token to use as the value for the `Authorization` bearer token
|
|
72
|
-
*
|
|
73
|
-
* Typically this would be the access token that belongs to a customer.
|
|
74
|
-
* This must be passed in when using one of the `me` endpoints.
|
|
75
|
-
*
|
|
76
|
-
* If this property is not passed in, we fall back to using the client
|
|
77
|
-
* access token.
|
|
78
|
-
*/
|
|
79
|
-
accessToken?: string;
|
|
80
|
-
/**
|
|
81
|
-
* Value to be passed in the `X-Correlation-ID` HTTP header
|
|
82
|
-
*/
|
|
83
|
-
correlationId?: string;
|
|
84
|
-
/**
|
|
85
|
-
* Request retry configuration
|
|
86
|
-
*
|
|
87
|
-
* The request retry configuration can be set on the `CommercetoolsApi`
|
|
88
|
-
* instance or on a request by request basis. If no value is passed in
|
|
89
|
-
* here, we fall back to using the configuration provided when constructing
|
|
90
|
-
* the `CommercetoolsApi` instance. If no value was passed in to the
|
|
91
|
-
* constructor configuration, then no retries will take place.
|
|
92
|
-
*/
|
|
93
|
-
retry?: CommercetoolsRetryConfig;
|
|
94
|
-
}
|
|
95
|
-
/**
|
|
96
|
-
* Options that are available to all requests.
|
|
97
|
-
*/
|
|
98
|
-
export interface CommonRequestOptions {
|
|
99
|
-
/**
|
|
100
|
-
* A unique id used to track the source of a request.
|
|
101
|
-
*/
|
|
102
|
-
correlationId?: string;
|
|
103
|
-
/**
|
|
104
|
-
* Query string parameters.
|
|
105
|
-
*/
|
|
106
|
-
params?: Record<string, any>;
|
|
107
|
-
/**
|
|
108
|
-
* Retry configuration
|
|
109
|
-
*/
|
|
110
|
-
retry?: CommercetoolsRetryConfig;
|
|
111
|
-
}
|
|
112
|
-
/**
|
|
113
|
-
* Options that are available to all requests that support specifying a store
|
|
114
|
-
*/
|
|
115
|
-
export interface CommonStoreEnabledRequestOptions extends CommonRequestOptions {
|
|
116
|
-
/**
|
|
117
|
-
* The key of the store that you want this call to apply to
|
|
118
|
-
*/
|
|
119
|
-
storeKey?: string;
|
|
120
|
-
}
|
|
121
|
-
/**
|
|
122
|
-
* A collection of convenience methods for interacting with the
|
|
123
|
-
* commercetools API.
|
|
124
|
-
*/
|
|
125
|
-
export declare class CommercetoolsApi {
|
|
126
|
-
/**
|
|
127
|
-
* This is the instance of the {@see CommercetoolsAuth} class that
|
|
128
|
-
* this class uses internally. It's exposed publicly so that it can
|
|
129
|
-
* be used by consumer's of this class in order to access authorization
|
|
130
|
-
* API related functionality.
|
|
131
|
-
*/
|
|
132
|
-
readonly auth: CommercetoolsAuth;
|
|
133
|
-
/**
|
|
134
|
-
* The configuration passed in to the constructor.
|
|
135
|
-
*/
|
|
136
|
-
readonly config: CommercetoolsApiConfig;
|
|
137
|
-
/**
|
|
138
|
-
* The Auth and API endpoints driven by the user's setting of {@link CommercetoolsApiConfig.region}
|
|
139
|
-
* https://docs.commercetools.com/api/general-concepts#regions
|
|
140
|
-
*/
|
|
141
|
-
readonly endpoints: RegionEndpoints;
|
|
142
|
-
/**
|
|
143
|
-
* The string that's sent over in the `User-Agent` header
|
|
144
|
-
* when a request is made to commercetools.
|
|
145
|
-
*/
|
|
146
|
-
private readonly userAgent;
|
|
147
|
-
/**
|
|
148
|
-
* axios instance
|
|
149
|
-
*/
|
|
150
|
-
private readonly axios;
|
|
151
|
-
/**
|
|
152
|
-
* The default retry configuration for the instance. This can be overridden
|
|
153
|
-
* on a method by method basis.
|
|
154
|
-
*/
|
|
155
|
-
private readonly retry;
|
|
156
|
-
constructor(config: CommercetoolsApiConfig);
|
|
157
|
-
/**
|
|
158
|
-
* Define the base axios instance that forms the foundation
|
|
159
|
-
* of all axios calls made by the {@see request} method.
|
|
160
|
-
*/
|
|
161
|
-
createAxiosInstance(): AxiosInstance;
|
|
162
|
-
/**
|
|
163
|
-
* Get a store given it's id
|
|
164
|
-
* https://docs.commercetools.com/api/projects/stores#get-a-store-by-id
|
|
165
|
-
*/
|
|
166
|
-
getStoreById(options: CommonRequestOptions & {
|
|
167
|
-
id: string;
|
|
168
|
-
}): Promise<Store>;
|
|
169
|
-
/**
|
|
170
|
-
* Get a store given it's key
|
|
171
|
-
* https://docs.commercetools.com/api/projects/stores#get-a-store-by-key
|
|
172
|
-
*/
|
|
173
|
-
getStoreByKey(options: CommonRequestOptions & {
|
|
174
|
-
key: string;
|
|
175
|
-
}): Promise<Store>;
|
|
176
|
-
/**
|
|
177
|
-
* Query stores
|
|
178
|
-
* https://docs.commercetools.com/api/projects/stores#get-a-store-by-key
|
|
179
|
-
*/
|
|
180
|
-
queryStores(options?: CommonRequestOptions): Promise<StorePagedQueryResponse>;
|
|
181
|
-
/**
|
|
182
|
-
* Create a store:
|
|
183
|
-
* https://docs.commercetools.com/api/projects/stores#create-a-store
|
|
184
|
-
*/
|
|
185
|
-
createStore(options: CommonRequestOptions & {
|
|
186
|
-
data: StoreDraft;
|
|
187
|
-
}): Promise<Store>;
|
|
188
|
-
/**
|
|
189
|
-
* Update a store by id:
|
|
190
|
-
* https://docs.commercetools.com/api/projects/stores#update-store-by-id
|
|
191
|
-
*/
|
|
192
|
-
updateStoreById(options: CommonRequestOptions & {
|
|
193
|
-
id: string;
|
|
194
|
-
data: StoreUpdate;
|
|
195
|
-
}): Promise<Store>;
|
|
196
|
-
/**
|
|
197
|
-
* Update a store by key:
|
|
198
|
-
* https://docs.commercetools.com/api/projects/stores#update-store-by-key
|
|
199
|
-
*/
|
|
200
|
-
updateStoreByKey(options: CommonRequestOptions & {
|
|
201
|
-
key: string;
|
|
202
|
-
data: StoreUpdate;
|
|
203
|
-
}): Promise<Store>;
|
|
204
|
-
/**
|
|
205
|
-
* Delete a store by id:
|
|
206
|
-
* https://docs.commercetools.com/api/projects/stores#delete-store-by-id
|
|
207
|
-
*/
|
|
208
|
-
deleteStoreById(options: CommonRequestOptions & {
|
|
209
|
-
id: string;
|
|
210
|
-
version: number;
|
|
211
|
-
}): Promise<Store>;
|
|
212
|
-
/**
|
|
213
|
-
* Delete a store by key:
|
|
214
|
-
* https://docs.commercetools.com/api/projects/stores#delete-store-by-key
|
|
215
|
-
*/
|
|
216
|
-
deleteStoreByKey(options: CommonRequestOptions & {
|
|
217
|
-
key: string;
|
|
218
|
-
version: number;
|
|
219
|
-
}): Promise<Store>;
|
|
220
|
-
/**
|
|
221
|
-
* Get an individual category by id:
|
|
222
|
-
* https://docs.commercetools.com/api/projects/categories#get-category-by-id
|
|
223
|
-
*/
|
|
224
|
-
getCategoryById(options: CommonRequestOptions & {
|
|
225
|
-
id: string;
|
|
226
|
-
}): Promise<Category>;
|
|
227
|
-
/**
|
|
228
|
-
* Get an individual category by key:
|
|
229
|
-
* https://docs.commercetools.com/api/projects/categories#get-category-by-key
|
|
230
|
-
*/
|
|
231
|
-
getCategoryByKey(options: CommonRequestOptions & {
|
|
232
|
-
key: string;
|
|
233
|
-
}): Promise<Category>;
|
|
234
|
-
/**
|
|
235
|
-
* Query channels:
|
|
236
|
-
* https://docs.commercetools.com/api/projects/channels#query-channels
|
|
237
|
-
*/
|
|
238
|
-
queryChannels(options?: CommonRequestOptions): Promise<ChannelPagedQueryResponse>;
|
|
239
|
-
/**
|
|
240
|
-
* Import an order.
|
|
241
|
-
* https://docs.commercetools.com/api/projects/orders-import#orderimportdraft
|
|
242
|
-
*/
|
|
243
|
-
importOrder(options: CommonRequestOptions & {
|
|
244
|
-
data: OrderImportDraft;
|
|
245
|
-
}): Promise<Order>;
|
|
246
|
-
/**
|
|
247
|
-
* Get channel by id:
|
|
248
|
-
* https://docs.commercetools.com/api/projects/channels#get-channel-by-id
|
|
249
|
-
*/
|
|
250
|
-
getChannelById(options: CommonRequestOptions & {
|
|
251
|
-
id: string;
|
|
252
|
-
}): Promise<Channel>;
|
|
253
|
-
/**
|
|
254
|
-
* Get an category by id or key. Either the id or the key must be provided.
|
|
255
|
-
*/
|
|
256
|
-
getCategory(options: CommonRequestOptions & {
|
|
257
|
-
id?: string;
|
|
258
|
-
key?: string;
|
|
259
|
-
}): Promise<Category>;
|
|
260
|
-
/**
|
|
261
|
-
* Get a category projection by slug and locale
|
|
262
|
-
* Queries the categories for the given slug + locale using:
|
|
263
|
-
* https://docs.commercetools.com/api/projects/categories#query-categories
|
|
264
|
-
*/
|
|
265
|
-
getCategoryBySlug(options: CommonRequestOptions & {
|
|
266
|
-
slug: string;
|
|
267
|
-
languageCode?: string;
|
|
268
|
-
languageCodes?: string[];
|
|
269
|
-
}): Promise<Category>;
|
|
270
|
-
/**
|
|
271
|
-
* Query categories
|
|
272
|
-
* https://docs.commercetools.com/api/projects/categories#query-categories
|
|
273
|
-
*/
|
|
274
|
-
queryCategories(options?: CommonRequestOptions): Promise<CategoryPagedQueryResponse>;
|
|
275
|
-
/**
|
|
276
|
-
* Get the parent categories of a given category. This method returns an array
|
|
277
|
-
* of {@see Category} items representing the ancestry of categories for the given
|
|
278
|
-
* category id. The list is ordered from top down. In other words, the root
|
|
279
|
-
* category is always the first item in the list.
|
|
280
|
-
*/
|
|
281
|
-
getCategoryParents(options: CommonRequestOptions & {
|
|
282
|
-
id?: string;
|
|
283
|
-
key?: string;
|
|
284
|
-
}): Promise<Array<Category>>;
|
|
285
|
-
/**
|
|
286
|
-
* Get an individual product by id:
|
|
287
|
-
* https://docs.commercetools.com/api/projects/products#get-product-by-id
|
|
288
|
-
*/
|
|
289
|
-
getProductById(options: CommonRequestOptions & {
|
|
290
|
-
id: string;
|
|
291
|
-
}): Promise<Product>;
|
|
292
|
-
/**
|
|
293
|
-
* Get an individual product by key:
|
|
294
|
-
* https://docs.commercetools.com/api/projects/products#get-product-by-key
|
|
295
|
-
*/
|
|
296
|
-
getProductByKey(options: CommonRequestOptions & {
|
|
297
|
-
key: string;
|
|
298
|
-
}): Promise<Product>;
|
|
299
|
-
/**
|
|
300
|
-
* Get a product projection by id
|
|
301
|
-
* https://docs.commercetools.com/api/projects/productProjections#get-productprojection-by-id
|
|
302
|
-
*/
|
|
303
|
-
getProductProjectionById(options: CommonStoreEnabledRequestOptions & {
|
|
304
|
-
id: string;
|
|
305
|
-
}): Promise<ProductProjection>;
|
|
306
|
-
/**
|
|
307
|
-
* Get a product projection by key
|
|
308
|
-
* https://docs.commercetools.com/api/projects/productProjections#get-productprojection-by-key
|
|
309
|
-
*/
|
|
310
|
-
getProductProjectionByKey(options: CommonStoreEnabledRequestOptions & {
|
|
311
|
-
key: string;
|
|
312
|
-
}): Promise<ProductProjection>;
|
|
313
|
-
/**
|
|
314
|
-
* Get a product projection by searching the slug with a given locale or array of locales
|
|
315
|
-
*
|
|
316
|
-
* Utilises the product projection query endpoint:
|
|
317
|
-
* https://docs.commercetools.com/api/projects/productProjections#query-productprojections
|
|
318
|
-
*
|
|
319
|
-
* You must pass either the {@see options.languageCode} or {@see options.languageCodes}
|
|
320
|
-
* property in the {@see options} parameter. If both are provided, only the {@see options.languageCodes}
|
|
321
|
-
* is actually used.
|
|
322
|
-
*/
|
|
323
|
-
getProductProjectionBySlug(options: CommonRequestOptions & {
|
|
324
|
-
slug: string;
|
|
325
|
-
languageCode?: string;
|
|
326
|
-
languageCodes?: string[];
|
|
327
|
-
}): Promise<ProductProjection>;
|
|
328
|
-
/**
|
|
329
|
-
* Query product projections
|
|
330
|
-
* https://docs.commercetools.com/api/projects/productProjections#query-productprojections
|
|
331
|
-
*/
|
|
332
|
-
queryProductProjections(options?: CommonRequestOptions): Promise<ProductProjectionPagedQueryResponse>;
|
|
333
|
-
/**
|
|
334
|
-
* Search product projections
|
|
335
|
-
* https://docs.commercetools.com/api/projects/products-search#search-productprojections
|
|
336
|
-
*/
|
|
337
|
-
searchProductProjections(options: CommonStoreEnabledRequestOptions): Promise<ProductProjectionPagedQueryResponse>;
|
|
338
|
-
/**
|
|
339
|
-
* Get a product selection by id
|
|
340
|
-
* https://docs.commercetools.com/api/projects/product-selections#get-product-selection
|
|
341
|
-
*/
|
|
342
|
-
getProductSelectionById(options: CommonStoreEnabledRequestOptions & {
|
|
343
|
-
id: string;
|
|
344
|
-
}): Promise<ProductSelection>;
|
|
345
|
-
/**
|
|
346
|
-
* Get a product selection by key
|
|
347
|
-
* https://docs.commercetools.com/api/projects/product-selections#get-product-selection-by-key
|
|
348
|
-
*/
|
|
349
|
-
getProductSelectionByKey(options: CommonStoreEnabledRequestOptions & {
|
|
350
|
-
key: string;
|
|
351
|
-
}): Promise<ProductSelection>;
|
|
352
|
-
/**
|
|
353
|
-
* Query product selections
|
|
354
|
-
* https://docs.commercetools.com/api/projects/product-selections#query-product-selections
|
|
355
|
-
*/
|
|
356
|
-
queryProductSelections(options?: CommonStoreEnabledRequestOptions): Promise<ProductSelectionPagedQueryResponse>;
|
|
357
|
-
/**
|
|
358
|
-
* Create a product selection
|
|
359
|
-
* https://docs.commercetools.com/api/projects/product-selections#create-product-selection
|
|
360
|
-
*/
|
|
361
|
-
createProductSelection(options: CommonStoreEnabledRequestOptions & {
|
|
362
|
-
data: ProductSelectionDraft;
|
|
363
|
-
}): Promise<ProductSelection>;
|
|
364
|
-
/**
|
|
365
|
-
* Update a product selection by key
|
|
366
|
-
* https://docs.commercetools.com/api/projects/product-selections#update-product-selection-by-key
|
|
367
|
-
*/
|
|
368
|
-
updateProductSelectionByKey(options: CommonStoreEnabledRequestOptions & {
|
|
369
|
-
key: string;
|
|
370
|
-
version: number;
|
|
371
|
-
actions: ProductSelectionUpdateAction[];
|
|
372
|
-
}): Promise<ProductSelection>;
|
|
373
|
-
/**
|
|
374
|
-
* Delete a product selection by key
|
|
375
|
-
* https://docs.commercetools.com/api/projects/product-selections#delete-product-selection-by-key
|
|
376
|
-
*/
|
|
377
|
-
deleteProductSelectionByKey(options: CommonStoreEnabledRequestOptions & {
|
|
378
|
-
key: string;
|
|
379
|
-
version: number;
|
|
380
|
-
}): Promise<ProductSelection>;
|
|
381
|
-
/**
|
|
382
|
-
* Query the products available in a store through active Product Selections
|
|
383
|
-
* https://docs.commercetools.com/api/projects/product-selections#query-products-available-in-a-store-through-active-product-selections
|
|
384
|
-
*/
|
|
385
|
-
queryProductsInStore(options: CommonStoreEnabledRequestOptions): Promise<ProductsInStorePagedQueryResponse>;
|
|
386
|
-
/**
|
|
387
|
-
* Get a cart by id
|
|
388
|
-
* https://docs.commercetools.com/api/projects/carts#update-a-cart-by-id
|
|
389
|
-
*/
|
|
390
|
-
getCartById(options: CommonStoreEnabledRequestOptions & {
|
|
391
|
-
id: string;
|
|
392
|
-
}): Promise<Cart>;
|
|
393
|
-
/**
|
|
394
|
-
* Query carts
|
|
395
|
-
* https://docs.commercetools.com/api/projects/carts#query-carts-1
|
|
396
|
-
*/
|
|
397
|
-
queryCarts(options?: CommonStoreEnabledRequestOptions): Promise<CartPagedQueryResponse>;
|
|
398
|
-
/**
|
|
399
|
-
* Query my carts
|
|
400
|
-
* https://docs.commercetools.com/api/projects/me-carts#query-carts-1
|
|
401
|
-
*/
|
|
402
|
-
queryMyCarts(options: CommonStoreEnabledRequestOptions & {
|
|
403
|
-
accessToken: string;
|
|
404
|
-
}): Promise<CartPagedQueryResponse>;
|
|
405
|
-
/**
|
|
406
|
-
* Create a new cart:
|
|
407
|
-
* https://docs.commercetools.com/api/projects/carts#create-a-cart-1
|
|
408
|
-
*/
|
|
409
|
-
createCart(options: CommonStoreEnabledRequestOptions & {
|
|
410
|
-
data: CartDraft;
|
|
411
|
-
}): Promise<Cart>;
|
|
412
|
-
/**
|
|
413
|
-
* Update a cart by id
|
|
414
|
-
* https://docs.commercetools.com/api/projects/carts#update-a-cart-by-id
|
|
415
|
-
*/
|
|
416
|
-
updateCartById(options: CommonStoreEnabledRequestOptions & {
|
|
417
|
-
id: string;
|
|
418
|
-
version: number;
|
|
419
|
-
actions: CartUpdateAction[];
|
|
420
|
-
}): Promise<Cart>;
|
|
421
|
-
/**
|
|
422
|
-
* Get the active cart. Requires a logged in or anonymous customer access token:
|
|
423
|
-
* https://docs.commercetools.com/api/projects/me-carts#get-active-cart
|
|
424
|
-
*/
|
|
425
|
-
getMyActiveCart(options: CommonStoreEnabledRequestOptions & {
|
|
426
|
-
accessToken: string;
|
|
427
|
-
}): Promise<Cart>;
|
|
428
|
-
/**
|
|
429
|
-
* Get my cart. Requires a logged in or anonymous customer access token:
|
|
430
|
-
* https://docs.commercetools.com/api/projects/me-carts#get-cart-by-id
|
|
431
|
-
*/
|
|
432
|
-
getMyCartById(options: CommonStoreEnabledRequestOptions & {
|
|
433
|
-
accessToken: string;
|
|
434
|
-
cartId: string;
|
|
435
|
-
}): Promise<Cart>;
|
|
436
|
-
/**
|
|
437
|
-
* Create a new cart for the customer associated with the given `accessToken` parameter:
|
|
438
|
-
* https://docs.commercetools.com/api/projects/me-carts#create-a-cart-1
|
|
439
|
-
*/
|
|
440
|
-
createMyCart(options: CommonStoreEnabledRequestOptions & {
|
|
441
|
-
accessToken: string;
|
|
442
|
-
data: MyCartDraft;
|
|
443
|
-
}): Promise<Cart>;
|
|
444
|
-
/**
|
|
445
|
-
* Delete the active cart This method uses {@see getMyActiveCart} to first
|
|
446
|
-
* get the active cart, in order to find the cart id and version:
|
|
447
|
-
* https://docs.commercetools.com/api/projects/me-carts#delete-a-cart
|
|
448
|
-
*/
|
|
449
|
-
deleteMyActiveCart(options: CommonStoreEnabledRequestOptions & {
|
|
450
|
-
accessToken: string;
|
|
451
|
-
}): Promise<Cart>;
|
|
452
|
-
/**
|
|
453
|
-
* Delete my cart by id
|
|
454
|
-
* https://docs.commercetools.com/api/projects/me-carts#delete-a-cart
|
|
455
|
-
*/
|
|
456
|
-
deleteMyCartById(options: CommonStoreEnabledRequestOptions & {
|
|
457
|
-
accessToken: string;
|
|
458
|
-
cartId: string;
|
|
459
|
-
}): Promise<Cart>;
|
|
460
|
-
/**
|
|
461
|
-
* Update a customer's cart with the given actions. Note that we automatically
|
|
462
|
-
* retrieve the customer's active cart using the given access token:
|
|
463
|
-
* https://docs.commercetools.com/api/projects/me-carts#update-cart
|
|
464
|
-
* https://docs.commercetools.com/api/projects/me-carts#update-actions
|
|
465
|
-
*/
|
|
466
|
-
updateMyActiveCart(options: CommonStoreEnabledRequestOptions & {
|
|
467
|
-
accessToken: string;
|
|
468
|
-
actions: CartUpdateAction[];
|
|
469
|
-
}): Promise<Cart>;
|
|
470
|
-
/**
|
|
471
|
-
* Create an order from the given cart id. The cart id and version are automatically
|
|
472
|
-
* retrieved by looking up the customers active cart:
|
|
473
|
-
* https://docs.commercetools.com/api/projects/me-orders#create-order-from-a-cart
|
|
474
|
-
*/
|
|
475
|
-
createMyOrderFromActiveCart(options: CommonStoreEnabledRequestOptions & {
|
|
476
|
-
accessToken: string;
|
|
477
|
-
}): Promise<Order>;
|
|
478
|
-
/**
|
|
479
|
-
* Delete a cart by the given id:
|
|
480
|
-
* https://docs.commercetools.com/api/projects/carts#delete-a-cart-by-id
|
|
481
|
-
*/
|
|
482
|
-
deleteCartById(options: CommonStoreEnabledRequestOptions & {
|
|
483
|
-
id: string;
|
|
484
|
-
version: number;
|
|
485
|
-
}): Promise<Cart>;
|
|
486
|
-
/**
|
|
487
|
-
* Create a payment object:
|
|
488
|
-
* https://docs.commercetools.com/api/projects/payments#create-a-payment
|
|
489
|
-
*/
|
|
490
|
-
createPayment(options: CommonRequestOptions & {
|
|
491
|
-
data: MyPaymentDraft;
|
|
492
|
-
}): Promise<Payment>;
|
|
493
|
-
/**
|
|
494
|
-
* Delete a payment object by id:
|
|
495
|
-
* https://docs.commercetools.com/api/projects/payments#delete-payment-by-id
|
|
496
|
-
*/
|
|
497
|
-
deletePaymentById(options: CommonRequestOptions & {
|
|
498
|
-
id: string;
|
|
499
|
-
version: number;
|
|
500
|
-
}): Promise<Payment>;
|
|
501
|
-
/**
|
|
502
|
-
* Update a payment object by id:
|
|
503
|
-
* https://docs.commercetools.com/api/projects/payments#update-payment-by-id
|
|
504
|
-
*/
|
|
505
|
-
updatePaymentById(options: CommonRequestOptions & {
|
|
506
|
-
id: string;
|
|
507
|
-
data: PaymentUpdate;
|
|
508
|
-
}): Promise<Payment>;
|
|
509
|
-
/**
|
|
510
|
-
* Get a payment object by id:
|
|
511
|
-
* https://docs.commercetools.com/api/projects/payments#get-payment-by-id
|
|
512
|
-
*/
|
|
513
|
-
getPaymentById(options: CommonRequestOptions & {
|
|
514
|
-
id: string;
|
|
515
|
-
}): Promise<Payment>;
|
|
516
|
-
/**
|
|
517
|
-
* Query payment objects:
|
|
518
|
-
* https://docs.commercetools.com/api/projects/payments#query-payments
|
|
519
|
-
*/
|
|
520
|
-
queryPayments(options: CommonRequestOptions): Promise<PaymentPagedQueryResponse>;
|
|
521
|
-
/**
|
|
522
|
-
* Create a payment object using the customer's access token:
|
|
523
|
-
* https://docs.commercetools.com/api/projects/me-payments#create-mypayment
|
|
524
|
-
*/
|
|
525
|
-
createMyPayment(options: CommonRequestOptions & {
|
|
526
|
-
data: MyPaymentDraft;
|
|
527
|
-
accessToken: string;
|
|
528
|
-
}): Promise<MyPayment>;
|
|
529
|
-
/**
|
|
530
|
-
* Update a payment object using the customer's access token:
|
|
531
|
-
* https://docs.commercetools.com/api/projects/me-payments#update-mypayment
|
|
532
|
-
*/
|
|
533
|
-
updateMyPaymentById(options: CommonRequestOptions & {
|
|
534
|
-
id: string;
|
|
535
|
-
data: MyPaymentUpdate;
|
|
536
|
-
accessToken: string;
|
|
537
|
-
}): Promise<MyPayment>;
|
|
538
|
-
/**
|
|
539
|
-
* Get a payment object by id using the customer's access token:
|
|
540
|
-
* https://docs.commercetools.com/api/projects/me-payments#get-mypayment-by-id
|
|
541
|
-
*/
|
|
542
|
-
getMyPaymentById(options: CommonRequestOptions & {
|
|
543
|
-
id: string;
|
|
544
|
-
accessToken: string;
|
|
545
|
-
}): Promise<MyPayment>;
|
|
546
|
-
/**
|
|
547
|
-
* Query payment objects using the customer's access token:
|
|
548
|
-
* https://docs.commercetools.com/api/projects/me-payments#query-mypayments
|
|
549
|
-
*/
|
|
550
|
-
queryMyPayments(options: CommonRequestOptions & {
|
|
551
|
-
accessToken: string;
|
|
552
|
-
}): Promise<MyPaymentPagedQueryResponse>;
|
|
553
|
-
/**
|
|
554
|
-
* Get an order by id using the customer's access token:
|
|
555
|
-
* https://docs.commercetools.com/api/projects/me-orders#get-order-by-id
|
|
556
|
-
*/
|
|
557
|
-
getMyOrderById(options: CommonStoreEnabledRequestOptions & {
|
|
558
|
-
id: string;
|
|
559
|
-
accessToken: string;
|
|
560
|
-
}): Promise<Order>;
|
|
561
|
-
/**
|
|
562
|
-
* Query my orders:
|
|
563
|
-
* https://docs.commercetools.com/api/projects/me-orders#query-orders-1
|
|
564
|
-
*/
|
|
565
|
-
queryMyOrders(options: CommonStoreEnabledRequestOptions & {
|
|
566
|
-
accessToken: string;
|
|
567
|
-
}): Promise<OrderPagedQueryResponse>;
|
|
568
|
-
/**
|
|
569
|
-
* Update an order by id:
|
|
570
|
-
* https://docs.commercetools.com/api/projects/orders#update-order-by-id
|
|
571
|
-
*/
|
|
572
|
-
updateOrderById(options: CommonStoreEnabledRequestOptions & {
|
|
573
|
-
id: string;
|
|
574
|
-
data: OrderUpdate;
|
|
575
|
-
}): Promise<Order>;
|
|
576
|
-
/**
|
|
577
|
-
* Update an order by order number:
|
|
578
|
-
* https://docs.commercetools.com/api/projects/orders#update-order-by-ordernumber
|
|
579
|
-
*/
|
|
580
|
-
updateOrderByOrderNumber(options: CommonStoreEnabledRequestOptions & {
|
|
581
|
-
orderNumber: string;
|
|
582
|
-
data: OrderUpdate;
|
|
583
|
-
}): Promise<Order>;
|
|
584
|
-
/**
|
|
585
|
-
* Get an order by id:
|
|
586
|
-
* https://docs.commercetools.com/api/projects/orders#get-order-by-id
|
|
587
|
-
*/
|
|
588
|
-
getOrderById(options: CommonStoreEnabledRequestOptions & {
|
|
589
|
-
id: string;
|
|
590
|
-
}): Promise<Order>;
|
|
591
|
-
/**
|
|
592
|
-
* Get an order by order number:
|
|
593
|
-
* https://docs.commercetools.com/api/projects/orders#get-order-by-ordernumber
|
|
594
|
-
*/
|
|
595
|
-
getOrderByOrderNumber(options: CommonStoreEnabledRequestOptions & {
|
|
596
|
-
orderNumber: string;
|
|
597
|
-
}): Promise<Order>;
|
|
598
|
-
/**
|
|
599
|
-
* Delete an order by id:
|
|
600
|
-
* https://docs.commercetools.com/api/projects/orders#delete-order-by-id
|
|
601
|
-
*/
|
|
602
|
-
deleteOrderById(options: CommonStoreEnabledRequestOptions & {
|
|
603
|
-
id: string;
|
|
604
|
-
version: number;
|
|
605
|
-
dataErasure?: boolean;
|
|
606
|
-
}): Promise<Order>;
|
|
607
|
-
/**
|
|
608
|
-
* Delete an order by order number:
|
|
609
|
-
* https://docs.commercetools.com/api/projects/orders#delete-order-by-ordernumber
|
|
610
|
-
*/
|
|
611
|
-
deleteOrderByOrderNumber(options: CommonStoreEnabledRequestOptions & {
|
|
612
|
-
orderNo: string;
|
|
613
|
-
version: number;
|
|
614
|
-
dataErasure?: boolean;
|
|
615
|
-
}): Promise<Order>;
|
|
616
|
-
/**
|
|
617
|
-
* Query orders:
|
|
618
|
-
* https://docs.commercetools.com/api/projects/orders#query-orders-1
|
|
619
|
-
*/
|
|
620
|
-
queryOrders(options: CommonStoreEnabledRequestOptions): Promise<OrderPagedQueryResponse>;
|
|
621
|
-
/**
|
|
622
|
-
* Create a product:
|
|
623
|
-
* https://docs.commercetools.com/api/projects/products#create-a-product
|
|
624
|
-
*/
|
|
625
|
-
createProduct(options: CommonRequestOptions & {
|
|
626
|
-
data: ProductDraft;
|
|
627
|
-
}): Promise<Product>;
|
|
628
|
-
/**
|
|
629
|
-
* Update a product by key:
|
|
630
|
-
* https://docs.commercetools.com/api/projects/products#update-product-by-key
|
|
631
|
-
*/
|
|
632
|
-
updateProductByKey(options: CommonRequestOptions & {
|
|
633
|
-
key: string;
|
|
634
|
-
data: ProductUpdate;
|
|
635
|
-
}): Promise<Product>;
|
|
636
|
-
/**
|
|
637
|
-
* Update a product by id:
|
|
638
|
-
* https://docs.commercetools.com/api/projects/products#update-product-by-id
|
|
639
|
-
*/
|
|
640
|
-
updateProductById(options: CommonRequestOptions & {
|
|
641
|
-
id: string;
|
|
642
|
-
data: ProductUpdate;
|
|
643
|
-
}): Promise<Product>;
|
|
644
|
-
/**
|
|
645
|
-
* Delete a product by id:
|
|
646
|
-
* https://docs.commercetools.com/api/projects/products#delete-product-by-id
|
|
647
|
-
*
|
|
648
|
-
* @param {object} options Request options
|
|
649
|
-
* @param {boolean} options.unpublish If true, the product will be unpublished before being deleted
|
|
650
|
-
*/
|
|
651
|
-
deleteProductById(options: CommonRequestOptions & {
|
|
652
|
-
id: string;
|
|
653
|
-
version: number;
|
|
654
|
-
unpublish?: boolean;
|
|
655
|
-
}): Promise<Product>;
|
|
656
|
-
/**
|
|
657
|
-
* Delete a product by key:
|
|
658
|
-
* https://docs.commercetools.com/api/projects/products#delete-product-by-key
|
|
659
|
-
*
|
|
660
|
-
* @param {object} options Request options
|
|
661
|
-
* @param {boolean} options.unpublish If true, the product will be unpublished before being deleted
|
|
662
|
-
*/
|
|
663
|
-
deleteProductByKey(options: CommonRequestOptions & {
|
|
664
|
-
key: string;
|
|
665
|
-
version: number;
|
|
666
|
-
unpublish?: boolean;
|
|
667
|
-
}): Promise<Product>;
|
|
668
|
-
/**
|
|
669
|
-
* Unpublish a product by key
|
|
670
|
-
*
|
|
671
|
-
* Issues an 'unpublish' action for the given product:
|
|
672
|
-
* https://docs.commercetools.com/api/projects/products#unpublish
|
|
673
|
-
*/
|
|
674
|
-
unpublishProductByKey(options: CommonRequestOptions & {
|
|
675
|
-
key: string;
|
|
676
|
-
version: number;
|
|
677
|
-
}): Promise<Product>;
|
|
678
|
-
/**
|
|
679
|
-
* Unpublish a product by id
|
|
680
|
-
*
|
|
681
|
-
* Issues an 'unpublish' action for the given product:
|
|
682
|
-
* https://docs.commercetools.com/api/projects/products#unpublish
|
|
683
|
-
*/
|
|
684
|
-
unpublishProductById(options: CommonRequestOptions & {
|
|
685
|
-
id: string;
|
|
686
|
-
version: number;
|
|
687
|
-
}): Promise<Product>;
|
|
688
|
-
/**
|
|
689
|
-
* Create a category:
|
|
690
|
-
* https://docs.commercetools.com/api/projects/categories#create-a-category
|
|
691
|
-
*/
|
|
692
|
-
createCategory(options: CommonRequestOptions & {
|
|
693
|
-
data: CategoryDraft;
|
|
694
|
-
}): Promise<Category>;
|
|
695
|
-
/**
|
|
696
|
-
* Update a category by key:
|
|
697
|
-
* https://docs.commercetools.com/api/projects/categories#update-category-by-key
|
|
698
|
-
*/
|
|
699
|
-
updateCategoryByKey(options: CommonRequestOptions & {
|
|
700
|
-
key: string;
|
|
701
|
-
data: CategoryUpdate;
|
|
702
|
-
}): Promise<Category>;
|
|
703
|
-
/**
|
|
704
|
-
* Update a category by id:
|
|
705
|
-
* https://docs.commercetools.com/api/projects/categories#update-category-by-id
|
|
706
|
-
*/
|
|
707
|
-
updateCategoryById(options: CommonRequestOptions & {
|
|
708
|
-
id: string;
|
|
709
|
-
data: CategoryUpdate;
|
|
710
|
-
}): Promise<Category>;
|
|
711
|
-
/**
|
|
712
|
-
* Delete a category by id:
|
|
713
|
-
* https://docs.commercetools.com/api/projects/categories#delete-category-by-id
|
|
714
|
-
*/
|
|
715
|
-
deleteCategoryById(options: CommonRequestOptions & {
|
|
716
|
-
id: string;
|
|
717
|
-
version: number;
|
|
718
|
-
}): Promise<Category>;
|
|
719
|
-
/**
|
|
720
|
-
* Delete a category by key:
|
|
721
|
-
* https://docs.commercetools.com/api/projects/categories#delete-category-by-key
|
|
722
|
-
*/
|
|
723
|
-
deleteCategoryByKey(options: CommonRequestOptions & {
|
|
724
|
-
key: string;
|
|
725
|
-
version: number;
|
|
726
|
-
}): Promise<Category>;
|
|
727
|
-
/**
|
|
728
|
-
* Create a customer account:
|
|
729
|
-
* https://docs.commercetools.com/api/projects/customers#create-customer-sign-up
|
|
730
|
-
*/
|
|
731
|
-
createAccount(options: CommonStoreEnabledRequestOptions & {
|
|
732
|
-
data: CustomerDraft;
|
|
733
|
-
}): Promise<CustomerSignInResult>;
|
|
734
|
-
/**
|
|
735
|
-
* Delete a customer account by id
|
|
736
|
-
* https://docs.commercetools.com/api/projects/customers#delete-customer-by-id
|
|
737
|
-
*/
|
|
738
|
-
deleteCustomerById(options: CommonStoreEnabledRequestOptions & {
|
|
739
|
-
id: string;
|
|
740
|
-
version: number;
|
|
741
|
-
dataErasure?: boolean;
|
|
742
|
-
}): Promise<Customer>;
|
|
743
|
-
/**
|
|
744
|
-
* Delete a customer account by key
|
|
745
|
-
* https://docs.commercetools.com/api/projects/customers#delete-customer-by-key
|
|
746
|
-
*/
|
|
747
|
-
deleteCustomerByKey(options: CommonStoreEnabledRequestOptions & {
|
|
748
|
-
key: string;
|
|
749
|
-
version: number;
|
|
750
|
-
dataErasure?: boolean;
|
|
751
|
-
}): Promise<Customer>;
|
|
752
|
-
/**
|
|
753
|
-
* Create a customer account given an (optional) anonymous access token:
|
|
754
|
-
* https://docs.commercetools.com/api/projects/me-profile#create-customer-sign-up
|
|
755
|
-
*/
|
|
756
|
-
createMyAccount(options: CommonStoreEnabledRequestOptions & {
|
|
757
|
-
accessToken?: string;
|
|
758
|
-
data: MyCustomerDraft;
|
|
759
|
-
}): Promise<CustomerSignInResult>;
|
|
760
|
-
/**
|
|
761
|
-
* Login to customer's account given an (optional) anonymous access token:
|
|
762
|
-
* https://docs.commercetools.com/api/projects/me-profile#authenticate-customer-sign-in
|
|
763
|
-
*/
|
|
764
|
-
loginMyAccount(options: CommonStoreEnabledRequestOptions & {
|
|
765
|
-
accessToken?: string;
|
|
766
|
-
data: CustomerSignin;
|
|
767
|
-
}): Promise<CustomerSignInResult>;
|
|
768
|
-
/**
|
|
769
|
-
* Login to customer's account:
|
|
770
|
-
* https://docs.commercetools.com/api/projects/customers#authenticate-customer-sign-in
|
|
771
|
-
*/
|
|
772
|
-
login(options: CommonStoreEnabledRequestOptions & {
|
|
773
|
-
data: CustomerSignin;
|
|
774
|
-
}): Promise<CustomerSignInResult>;
|
|
775
|
-
/**
|
|
776
|
-
* Get a customer's account/profile:
|
|
777
|
-
* https://docs.commercetools.com/api/projects/me-profile#get-customer
|
|
778
|
-
*/
|
|
779
|
-
getMyAccount(options: CommonStoreEnabledRequestOptions & {
|
|
780
|
-
accessToken: string;
|
|
781
|
-
}): Promise<Customer>;
|
|
782
|
-
/**
|
|
783
|
-
* Update a customer's account/profile:
|
|
784
|
-
* https://docs.commercetools.com/api/projects/me-profile#update-customer
|
|
785
|
-
*/
|
|
786
|
-
updateMyAccount(options: CommonStoreEnabledRequestOptions & {
|
|
787
|
-
accessToken: string;
|
|
788
|
-
data: CustomerUpdate;
|
|
789
|
-
}): Promise<Customer>;
|
|
790
|
-
/**
|
|
791
|
-
* Change the customer's password:
|
|
792
|
-
* https://docs.commercetools.com/api/projects/me-profile#change-customers-password
|
|
793
|
-
*/
|
|
794
|
-
changeMyPassword(options: CommonStoreEnabledRequestOptions & {
|
|
795
|
-
accessToken: string;
|
|
796
|
-
data: {
|
|
797
|
-
version: number;
|
|
798
|
-
currentPassword: string;
|
|
799
|
-
newPassword: string;
|
|
800
|
-
};
|
|
801
|
-
}): Promise<Customer>;
|
|
802
|
-
/**
|
|
803
|
-
* Reset the customer's password:
|
|
804
|
-
* https://docs.commercetools.com/api/projects/me-profile#reset-customers-password
|
|
805
|
-
*/
|
|
806
|
-
resetMyPassword(options: CommonStoreEnabledRequestOptions & {
|
|
807
|
-
accessToken: string;
|
|
808
|
-
data: CustomerResetPassword;
|
|
809
|
-
}): Promise<Customer>;
|
|
810
|
-
/**
|
|
811
|
-
* Get a password reset token
|
|
812
|
-
* https://docs.commercetools.com/api/projects/customers#create-a-token-for-resetting-the-customers-password
|
|
813
|
-
*/
|
|
814
|
-
getPasswordResetToken(options: CommonStoreEnabledRequestOptions & {
|
|
815
|
-
data: CustomerCreatePasswordResetToken;
|
|
816
|
-
}): Promise<CustomerToken>;
|
|
817
|
-
/**
|
|
818
|
-
* Get a customer by id:
|
|
819
|
-
* https://docs.commercetools.com/api/projects/customers#get-customer-by-id
|
|
820
|
-
*/
|
|
821
|
-
getCustomerById(options: CommonStoreEnabledRequestOptions & {
|
|
822
|
-
id: string;
|
|
823
|
-
}): Promise<Customer>;
|
|
824
|
-
/**
|
|
825
|
-
* Get a customer by key:
|
|
826
|
-
* https://docs.commercetools.com/api/projects/customers#get-customer-by-key
|
|
827
|
-
*/
|
|
828
|
-
getCustomerByKey(options: CommonStoreEnabledRequestOptions & {
|
|
829
|
-
key: string;
|
|
830
|
-
}): Promise<Customer>;
|
|
831
|
-
/**
|
|
832
|
-
* Get a customer by password token:
|
|
833
|
-
* https://docs.commercetools.com/api/projects/customers#get-customer-by-password-token
|
|
834
|
-
*/
|
|
835
|
-
getCustomerByPasswordToken(options: CommonStoreEnabledRequestOptions & {
|
|
836
|
-
token: string;
|
|
837
|
-
}): Promise<Customer>;
|
|
838
|
-
/**
|
|
839
|
-
* Query customers:
|
|
840
|
-
* https://docs.commercetools.com/api/projects/customers#query-customers
|
|
841
|
-
*/
|
|
842
|
-
queryCustomers(options: CommonStoreEnabledRequestOptions): Promise<CustomerPagedQueryResponse>;
|
|
843
|
-
/**
|
|
844
|
-
* Update a customer by id:
|
|
845
|
-
* https://docs.commercetools.com/api/projects/customers#update-customer-by-id
|
|
846
|
-
*/
|
|
847
|
-
updateCustomerById(options: CommonStoreEnabledRequestOptions & {
|
|
848
|
-
id: string;
|
|
849
|
-
data: CustomerUpdate;
|
|
850
|
-
}): Promise<Customer>;
|
|
851
|
-
/**
|
|
852
|
-
* Update a customer by key:
|
|
853
|
-
* https://docs.commercetools.com/api/projects/customers#update-customer-by-key
|
|
854
|
-
*/
|
|
855
|
-
updateCustomerByKey(options: CommonStoreEnabledRequestOptions & {
|
|
856
|
-
key: string;
|
|
857
|
-
data: CustomerUpdate;
|
|
858
|
-
}): Promise<Customer>;
|
|
859
|
-
/**
|
|
860
|
-
* Get a product type by id:
|
|
861
|
-
* https://docs.commercetools.com/api/projects/productTypes#get-a-producttype-by-id
|
|
862
|
-
*/
|
|
863
|
-
getProductTypeById(options: CommonRequestOptions & {
|
|
864
|
-
id: string;
|
|
865
|
-
}): Promise<ProductType>;
|
|
866
|
-
/**
|
|
867
|
-
* Get a product type by key:
|
|
868
|
-
* https://docs.commercetools.com/api/projects/productTypes#get-a-producttype-by-key
|
|
869
|
-
*/
|
|
870
|
-
getProductTypeByKey(options: CommonRequestOptions & {
|
|
871
|
-
key: string;
|
|
872
|
-
}): Promise<ProductType>;
|
|
873
|
-
/**
|
|
874
|
-
* Get a type by id:
|
|
875
|
-
* https://docs.commercetools.com/api/projects/types#get-type-by-id
|
|
876
|
-
*/
|
|
877
|
-
getTypeById(options: CommonRequestOptions & {
|
|
878
|
-
id: string;
|
|
879
|
-
}): Promise<Type>;
|
|
880
|
-
/**
|
|
881
|
-
* Get a type by key:
|
|
882
|
-
* https://docs.commercetools.com/api/projects/types#get-type-by-key
|
|
883
|
-
*/
|
|
884
|
-
getTypeByKey(options: CommonRequestOptions & {
|
|
885
|
-
key: string;
|
|
886
|
-
}): Promise<Type>;
|
|
887
|
-
/**
|
|
888
|
-
* Get a discount code by id:
|
|
889
|
-
* https://docs.commercetools.com/api/projects/discountCodes#get-discountcode-by-id
|
|
890
|
-
*/
|
|
891
|
-
getDiscountCodeById(options: CommonRequestOptions & {
|
|
892
|
-
id: string;
|
|
893
|
-
}): Promise<DiscountCode>;
|
|
894
|
-
/**
|
|
895
|
-
* Get a cart discount code by id:
|
|
896
|
-
* https://docs.commercetools.com/api/projects/cartDiscounts#get-cartdiscount-by-id
|
|
897
|
-
*/
|
|
898
|
-
getCartDiscountById(options: CommonRequestOptions & {
|
|
899
|
-
id: string;
|
|
900
|
-
}): Promise<CartDiscount>;
|
|
901
|
-
/**
|
|
902
|
-
* Get a cart discount by key:
|
|
903
|
-
* https://docs.commercetools.com/api/projects/cartDiscounts#get-cartdiscount-by-key
|
|
904
|
-
*/
|
|
905
|
-
getCartDiscountByKey(options: CommonRequestOptions & {
|
|
906
|
-
key: string;
|
|
907
|
-
}): Promise<CartDiscount>;
|
|
908
|
-
/**
|
|
909
|
-
* Query cart discounts:
|
|
910
|
-
* https://docs.commercetools.com/api/projects/cartDiscounts#query-cartdiscounts
|
|
911
|
-
*/
|
|
912
|
-
queryCartDiscounts(options?: CommonRequestOptions): Promise<CartDiscountPagedQueryResponse>;
|
|
913
|
-
/**
|
|
914
|
-
* Get a custom object
|
|
915
|
-
* https://docs.commercetools.com/api/projects/custom-objects#get-customobject-by-container-and-key
|
|
916
|
-
*/
|
|
917
|
-
getCustomObject(options: CommonRequestOptions & {
|
|
918
|
-
container: string;
|
|
919
|
-
key: string;
|
|
920
|
-
}): Promise<CustomObject>;
|
|
921
|
-
/**
|
|
922
|
-
* Get a custom object by id
|
|
923
|
-
* https://docs.commercetools.com/api/projects/custom-objects#get-customobject
|
|
924
|
-
*/
|
|
925
|
-
getCustomObjectById(options: CommonRequestOptions & {
|
|
926
|
-
id: string;
|
|
927
|
-
}): Promise<CustomObject>;
|
|
928
|
-
/**
|
|
929
|
-
* Save a custom object
|
|
930
|
-
* https://docs.commercetools.com/api/projects/custom-objects#create-or-update-a-customobject
|
|
931
|
-
*/
|
|
932
|
-
saveCustomObject(options: CommonRequestOptions & {
|
|
933
|
-
data: CustomObjectDraft;
|
|
934
|
-
}): Promise<CustomObject>;
|
|
935
|
-
/**
|
|
936
|
-
* Delete a custom object
|
|
937
|
-
* https://docs.commercetools.com/api/projects/custom-objects#delete-customobject-by-container-and-key
|
|
938
|
-
*/
|
|
939
|
-
deleteCustomObject(options: CommonRequestOptions & {
|
|
940
|
-
container: string;
|
|
941
|
-
key: string;
|
|
942
|
-
}): Promise<CustomObject>;
|
|
943
|
-
/**
|
|
944
|
-
* Get a shipping method by id:
|
|
945
|
-
* https://docs.commercetools.com/api/projects/shippingMethods#get-shippingmethod-by-id
|
|
946
|
-
*/
|
|
947
|
-
getShippingMethodById(options: CommonRequestOptions & {
|
|
948
|
-
id: string;
|
|
949
|
-
}): Promise<ShippingMethod>;
|
|
950
|
-
/**
|
|
951
|
-
* Get a shipping method by key:
|
|
952
|
-
* https://docs.commercetools.com/api/projects/shippingMethods#get-shippingmethod-by-key
|
|
953
|
-
*/
|
|
954
|
-
getShippingMethodByKey(options: CommonRequestOptions & {
|
|
955
|
-
key: string;
|
|
956
|
-
}): Promise<ShippingMethod>;
|
|
957
|
-
/**
|
|
958
|
-
* Get shipping method by location:
|
|
959
|
-
* https://docs.commercetools.com/api/projects/shippingMethods#get-shippingmethods-for-a-location
|
|
960
|
-
*/
|
|
961
|
-
getShippingMethodsForLocation(options: CommonRequestOptions & {
|
|
962
|
-
accessToken?: string;
|
|
963
|
-
country: string;
|
|
964
|
-
state?: string;
|
|
965
|
-
currency?: string;
|
|
966
|
-
}): Promise<ShippingMethodPagedQueryResponse>;
|
|
967
|
-
/**
|
|
968
|
-
* Get shipping methods applicable to a given cart id:
|
|
969
|
-
* https://docs.commercetools.com/api/projects/shippingMethods#get-shippingmethods-for-a-cart
|
|
970
|
-
*/
|
|
971
|
-
getShippingMethodsForCart(options: CommonStoreEnabledRequestOptions & {
|
|
972
|
-
accessToken?: string;
|
|
973
|
-
cartId: string;
|
|
974
|
-
}): Promise<ShippingMethodPagedQueryResponse>;
|
|
975
|
-
/**
|
|
976
|
-
* Query shipping methods:
|
|
977
|
-
* https://docs.commercetools.com/api/projects/shippingMethods#query-shippingmethods
|
|
978
|
-
*/
|
|
979
|
-
queryShippingMethods(options?: CommonRequestOptions): Promise<ShippingMethodPagedQueryResponse>;
|
|
980
|
-
/**
|
|
981
|
-
* Get an individual customer group by id:
|
|
982
|
-
* https://docs.commercetools.com/api/projects/customerGroups#get-customergroup-by-id
|
|
983
|
-
*/
|
|
984
|
-
getCustomerGroupById(options: CommonRequestOptions & {
|
|
985
|
-
id: string;
|
|
986
|
-
}): Promise<CustomerGroup>;
|
|
987
|
-
/**
|
|
988
|
-
* Get an individual customer group by key:
|
|
989
|
-
* https://docs.commercetools.com/api/projects/customerGroups#get-customergroup-by-key
|
|
990
|
-
*/
|
|
991
|
-
getCustomerGroupByKey(options: CommonRequestOptions & {
|
|
992
|
-
key: string;
|
|
993
|
-
}): Promise<CustomerGroup>;
|
|
994
|
-
/**
|
|
995
|
-
* Query customer groups:
|
|
996
|
-
* https://docs.commercetools.com/api/projects/customerGroups#query-customergroups
|
|
997
|
-
*/
|
|
998
|
-
queryCustomerGroups(options?: CommonRequestOptions): Promise<CustomerGroupPagedQueryResponse>;
|
|
999
|
-
/**
|
|
1000
|
-
* Create a customer group:
|
|
1001
|
-
* https://docs.commercetools.com/api/projects/customerGroups#create-a-customergroup
|
|
1002
|
-
*/
|
|
1003
|
-
createCustomerGroup(options: CommonRequestOptions & {
|
|
1004
|
-
data: CustomerGroupDraft;
|
|
1005
|
-
}): Promise<CustomerGroup>;
|
|
1006
|
-
/**
|
|
1007
|
-
* Update a customer group by key:
|
|
1008
|
-
* https://docs.commercetools.com/api/projects/customerGroups#update-customergroup-by-key
|
|
1009
|
-
*/
|
|
1010
|
-
updateCustomerGroupByKey(options: CommonRequestOptions & {
|
|
1011
|
-
key: string;
|
|
1012
|
-
data: CustomerGroupUpdate;
|
|
1013
|
-
}): Promise<CustomerGroup>;
|
|
1014
|
-
/**
|
|
1015
|
-
* Update a customer group by id:
|
|
1016
|
-
* https://docs.commercetools.com/api/projects/customerGroups#update-customergroup-by-id
|
|
1017
|
-
*/
|
|
1018
|
-
updateCustomerGroupById(options: CommonRequestOptions & {
|
|
1019
|
-
id: string;
|
|
1020
|
-
data: CustomerGroupUpdate;
|
|
1021
|
-
}): Promise<CustomerGroup>;
|
|
1022
|
-
/**
|
|
1023
|
-
* Delete a customer group by id:
|
|
1024
|
-
* https://docs.commercetools.com/api/projects/customerGroups#delete-customergroup-by-id
|
|
1025
|
-
*/
|
|
1026
|
-
deleteCustomerGroupById(options: CommonRequestOptions & {
|
|
1027
|
-
id: string;
|
|
1028
|
-
version: number;
|
|
1029
|
-
}): Promise<CustomerGroup>;
|
|
1030
|
-
/**
|
|
1031
|
-
* Delete a customer group by key:
|
|
1032
|
-
* https://docs.commercetools.com/api/projects/customerGroups#delete-customergroup-by-key
|
|
1033
|
-
*/
|
|
1034
|
-
deleteCustomerGroupByKey(options: CommonRequestOptions & {
|
|
1035
|
-
key: string;
|
|
1036
|
-
version: number;
|
|
1037
|
-
}): Promise<CustomerGroup>;
|
|
1038
|
-
/**
|
|
1039
|
-
* Execute a GraphQL statement:
|
|
1040
|
-
* https://docs.commercetools.com/api/graphql
|
|
1041
|
-
*/
|
|
1042
|
-
graphql(options: CommonRequestOptions & {
|
|
1043
|
-
accessToken?: string;
|
|
1044
|
-
data: GraphQLRequest;
|
|
1045
|
-
}): Promise<GraphQLResponse>;
|
|
1046
|
-
/**
|
|
1047
|
-
* Make the request to the commercetools REST API.
|
|
1048
|
-
*/
|
|
1049
|
-
request<T = any, R = any>(options: FetchOptions<T>): Promise<R>;
|
|
1050
|
-
/**
|
|
1051
|
-
* Get the {@see CommercetoolsRetryConfig} for this request.
|
|
1052
|
-
* Uses the class instance's retry config and merges and additional
|
|
1053
|
-
* config passed in via the request options.
|
|
1054
|
-
*/
|
|
1055
|
-
getRetryConfig(methodRetryConfig?: CommercetoolsRetryConfig): CommercetoolsRetryConfig;
|
|
1056
|
-
/**
|
|
1057
|
-
* Generate request options. These are then fed in to axios when
|
|
1058
|
-
* making the request to commercetools.
|
|
1059
|
-
*/
|
|
1060
|
-
getRequestOptions(options: FetchOptions): Promise<any>;
|
|
1061
|
-
/**
|
|
1062
|
-
* Calculate how long to delay before running the request.
|
|
1063
|
-
* For each retry attempt, we increase the time that we delay for.
|
|
1064
|
-
*/
|
|
1065
|
-
calculateDelay(retryCount: number, retryConfig?: CommercetoolsRetryConfig): number;
|
|
1066
|
-
/**
|
|
1067
|
-
* Determine whether the given error means we should allow the request
|
|
1068
|
-
* to be retried (assuming retry config is provided).
|
|
1069
|
-
*/
|
|
1070
|
-
isRetryableError(error: any): boolean;
|
|
1071
|
-
/**
|
|
1072
|
-
* Type-guard against any additional unexpected properties being passed in.
|
|
1073
|
-
*/
|
|
1074
|
-
extractCommonRequestOptions(options?: CommonRequestOptions): CommonRequestOptions;
|
|
1075
|
-
/**
|
|
1076
|
-
* Applies the store key to a given path
|
|
1077
|
-
*/
|
|
1078
|
-
applyStore(path: string, storeKey: string | undefined | null): string;
|
|
1079
|
-
/**
|
|
1080
|
-
* Transform an unknown error in to a {@see CommercetoolsError}
|
|
1081
|
-
* if the error we receive is from axios.
|
|
1082
|
-
*/
|
|
1083
|
-
transformError(lastError: any): any;
|
|
1084
|
-
/**
|
|
1085
|
-
* Ensure that all required properties on the {@see CommercetoolsApiConfig}
|
|
1086
|
-
* object have been populated. These are currently:
|
|
1087
|
-
*
|
|
1088
|
-
* projectKey: string
|
|
1089
|
-
* clientId: string
|
|
1090
|
-
* clientSecret: string
|
|
1091
|
-
* region: Region
|
|
1092
|
-
* clientScopes: string[]
|
|
1093
|
-
*/
|
|
1094
|
-
static validateConfig(config: any): void;
|
|
1095
|
-
}
|
|
1096
|
-
//# sourceMappingURL=CommercetoolsApi.d.ts.map
|