@shopkit/data-layer 1.1.0 → 1.2.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.
- package/README.md +53 -0
- package/dist/adapters/index.d.mts +2 -1
- package/dist/adapters/index.d.ts +2 -1
- package/dist/index.d.mts +3 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +136 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +133 -2
- package/dist/index.mjs.map +1 -1
- package/dist/interface-NJcjuqaL.d.mts +236 -0
- package/dist/interface-dqoKc63z.d.ts +236 -0
- package/dist/{service-Dw9qj17-.d.ts → service-BHCLUEim.d.ts} +2 -234
- package/dist/{service-Cnm8tn7H.d.mts → service-DBKEK2oS.d.mts} +2 -234
- package/dist/static-params/index.d.mts +65 -0
- package/dist/static-params/index.d.ts +65 -0
- package/dist/static-params/index.js +275 -0
- package/dist/static-params/index.js.map +1 -0
- package/dist/static-params/index.mjs +270 -0
- package/dist/static-params/index.mjs.map +1 -0
- package/package.json +6 -1
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
import { ISingleProductRequest, IOptionsRequest, IResponse, IProductQueryReqest, IProductsByHandlesRequest, IProductRecommendationsRequest, ISingleCollectionRequest, ICollectionQueryRequest, ICollectionsByhandlesRequest, ICollectionFilterRequest, ISingleOrderRequest, IOrderQueryRequest, IOrderRequest, IUpdateOrderRequest, IOrderHistoryRequest, IOrderByIdRequest, ISingleCustomerRequest, ICustomerQueryRequest, ICustomerRequest, IUpdateCustomerRequest, ISingleCartRequest, IUpdateCartRequest, IAddToCartRequest, IRemoveFromCartRequest, ICreateCheckoutRequest, IGetArticleRequest, IBlogArticleRequest, ITrendingArticleRequest, IArticleByHandleRequest, IGraphqlRequest, IFetchRequest } from './models/index.mjs';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Core interface that all platform adapters will implement
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
interface ICommerceClient {
|
|
8
|
+
/**
|
|
9
|
+
* Retrieve a single product by ID or handle
|
|
10
|
+
* @param params - Product identifier (id or handle)
|
|
11
|
+
* @param options - Request options (headers, timeout, etc.)
|
|
12
|
+
* @returns Promise resolving to product data
|
|
13
|
+
*/
|
|
14
|
+
getProduct(params: ISingleProductRequest, options?: IOptionsRequest): Promise<IResponse>;
|
|
15
|
+
/**
|
|
16
|
+
* Retrieve multiple products with filtering and pagination
|
|
17
|
+
* @param params - Query parameters for filtering, sorting, and pagination
|
|
18
|
+
* @param options - Request options (headers, timeout, etc.)
|
|
19
|
+
* @returns Promise resolving to paginated products response
|
|
20
|
+
*/
|
|
21
|
+
getProducts(params: IProductQueryReqest, options?: IOptionsRequest): Promise<IResponse>;
|
|
22
|
+
/**
|
|
23
|
+
* Retrieve multiple products by their handles
|
|
24
|
+
* @param params - Object containing array of product handles
|
|
25
|
+
* @param options - Request options (headers, timeout, etc.)
|
|
26
|
+
* @returns Promise resolving to array of products
|
|
27
|
+
*/
|
|
28
|
+
getProductsByHandles(params: IProductsByHandlesRequest, options?: IOptionsRequest): Promise<IResponse>;
|
|
29
|
+
/**
|
|
30
|
+
* Retrieve product recommendations for a given product
|
|
31
|
+
* Uses platform-specific recommendation algorithms (e.g., Shopify's productRecommendations)
|
|
32
|
+
* @param params - Object containing productId to get recommendations for
|
|
33
|
+
* @param options - Request options (headers, timeout, etc.)
|
|
34
|
+
* @returns Promise resolving to array of recommended products
|
|
35
|
+
*/
|
|
36
|
+
getProductRecommendations(params: IProductRecommendationsRequest, options?: IOptionsRequest): Promise<IResponse>;
|
|
37
|
+
/**
|
|
38
|
+
* Retrieve a single collection by ID or handle
|
|
39
|
+
* @param params - Collection identifier (id or handle)
|
|
40
|
+
* @param options - Request options (headers, timeout, etc.)
|
|
41
|
+
* @returns Promise resolving to collection data
|
|
42
|
+
*/
|
|
43
|
+
getCollection(params: ISingleCollectionRequest, options?: IOptionsRequest): Promise<IResponse>;
|
|
44
|
+
/**
|
|
45
|
+
* Retrieve multiple collections with filtering and pagination
|
|
46
|
+
* @param params - Query parameters for filtering, sorting, and pagination
|
|
47
|
+
* @param options - Request options (headers, timeout, etc.)
|
|
48
|
+
* @returns Promise resolving to paginated collections response
|
|
49
|
+
*/
|
|
50
|
+
getCollections(params: ICollectionQueryRequest, options?: IOptionsRequest): Promise<IResponse>;
|
|
51
|
+
/**
|
|
52
|
+
* Retrieve multiple collections by their handles with individual query parameters
|
|
53
|
+
* Each collection can have its own specific filtering, pagination, and sorting options
|
|
54
|
+
* @param params - Array of collection objects, each containing:
|
|
55
|
+
* - handle: Collection handle (required)
|
|
56
|
+
* - query: Search query string (optional)
|
|
57
|
+
* - after/before: Pagination cursors (optional)
|
|
58
|
+
* - first/last: Number of items to return (optional)
|
|
59
|
+
* - reverse: Sort order reversal (optional)
|
|
60
|
+
* - sortKey: Collection sorting key (optional)
|
|
61
|
+
* - productLimit: Max products per collection (optional)
|
|
62
|
+
* - productSortKey: Product sorting within collection (optional)
|
|
63
|
+
* - productReverse: Product sort order reversal (optional)
|
|
64
|
+
* - filters: Product filtering options including price, availability, type, vendor, tags (optional)
|
|
65
|
+
* @param options - Request options (headers, timeout, etc.)
|
|
66
|
+
* @returns Promise resolving to collections data with individual query results
|
|
67
|
+
* @example
|
|
68
|
+
* ```typescript
|
|
69
|
+
* const result = await client.getCollectionsByHandles([
|
|
70
|
+
* { handle: 'featured', first: 10, sortKey: 'UPDATED_AT' },
|
|
71
|
+
* { handle: 'sale', productLimit: 5, filters: [{ available: true }] }
|
|
72
|
+
* ]);
|
|
73
|
+
* ```
|
|
74
|
+
*/
|
|
75
|
+
getCollectionsByHandles(params: ICollectionsByhandlesRequest, options?: IOptionsRequest): Promise<IResponse>;
|
|
76
|
+
/**
|
|
77
|
+
* Retrieve available filters for collections
|
|
78
|
+
* @param params - Collection identifier (id or handle) to get filters for
|
|
79
|
+
* @param options - Request options (headers, timeout, etc.)
|
|
80
|
+
* @returns Promise resolving to available filter options (price ranges, brands, categories, etc.)
|
|
81
|
+
*/
|
|
82
|
+
getCollectionFilters(params: ICollectionFilterRequest, options?: IOptionsRequest): Promise<IResponse>;
|
|
83
|
+
/**
|
|
84
|
+
* Retrieve a single order by ID
|
|
85
|
+
* @param params - Order identifier
|
|
86
|
+
* @param options - Request options (headers, timeout, etc.)
|
|
87
|
+
* @returns Promise resolving to order data
|
|
88
|
+
*/
|
|
89
|
+
getOrder(params: ISingleOrderRequest, options?: IOptionsRequest): Promise<IResponse>;
|
|
90
|
+
/**
|
|
91
|
+
* Retrieve multiple orders with filtering and pagination
|
|
92
|
+
* @param params - Query parameters for filtering, sorting, and pagination
|
|
93
|
+
* @param options - Request options (headers, timeout, etc.)
|
|
94
|
+
* @returns Promise resolving to paginated orders response
|
|
95
|
+
*/
|
|
96
|
+
getOrders(params: IOrderQueryRequest, options?: IOptionsRequest): Promise<IResponse>;
|
|
97
|
+
/**
|
|
98
|
+
* Create a new order
|
|
99
|
+
* @param params - Order data to create
|
|
100
|
+
* @param options - Request options (headers, timeout, etc.)
|
|
101
|
+
* @returns Promise resolving to created order
|
|
102
|
+
*/
|
|
103
|
+
createOrder(params: IOrderRequest, options?: IOptionsRequest): Promise<IResponse>;
|
|
104
|
+
/**
|
|
105
|
+
* Update an existing order
|
|
106
|
+
* @param params - Object containing id and data to update
|
|
107
|
+
* @param options - Request options (headers, timeout, etc.)
|
|
108
|
+
* @returns Promise resolving to updated order
|
|
109
|
+
*/
|
|
110
|
+
updateOrder(params: IUpdateOrderRequest, options?: IOptionsRequest): Promise<IResponse>;
|
|
111
|
+
/**
|
|
112
|
+
* Retrieve order history for a customer
|
|
113
|
+
* @param params - Object containing customerAccessToken, page, and limit
|
|
114
|
+
* @param options - Request options (headers, timeout, etc.)
|
|
115
|
+
* @returns Promise resolving to order history
|
|
116
|
+
*/
|
|
117
|
+
getOrderHistory(params: IOrderHistoryRequest, options?: IOptionsRequest): Promise<IResponse>;
|
|
118
|
+
/**
|
|
119
|
+
* Retrieve a specific order for a customer
|
|
120
|
+
* @param params - Object containing customerAccessToken and orderId
|
|
121
|
+
* @param options - Request options (headers, timeout, etc.)
|
|
122
|
+
* @returns Promise resolving to order data
|
|
123
|
+
*/
|
|
124
|
+
getOrderById(params: IOrderByIdRequest, options?: IOptionsRequest): Promise<IResponse>;
|
|
125
|
+
/**
|
|
126
|
+
* Retrieve a single customer by ID
|
|
127
|
+
* @param params - Customer identifier
|
|
128
|
+
* @param options - Request options (headers, timeout, etc.)
|
|
129
|
+
* @returns Promise resolving to customer data
|
|
130
|
+
*/
|
|
131
|
+
getCustomer(params: ISingleCustomerRequest, options?: IOptionsRequest): Promise<IResponse>;
|
|
132
|
+
/**
|
|
133
|
+
* Retrieve multiple customers with filtering and pagination
|
|
134
|
+
* @param params - Query parameters for filtering, sorting, and pagination
|
|
135
|
+
* @param options - Request options (headers, timeout, etc.)
|
|
136
|
+
* @returns Promise resolving to paginated customers response
|
|
137
|
+
*/
|
|
138
|
+
getCustomers(params: ICustomerQueryRequest, options?: IOptionsRequest): Promise<IResponse>;
|
|
139
|
+
/**
|
|
140
|
+
* Create a new customer account
|
|
141
|
+
* @param params - Customer data to create
|
|
142
|
+
* @param options - Request options (headers, timeout, etc.)
|
|
143
|
+
* @returns Promise resolving to created customer
|
|
144
|
+
*/
|
|
145
|
+
createCustomer(params: ICustomerRequest, options?: IOptionsRequest): Promise<IResponse>;
|
|
146
|
+
/**
|
|
147
|
+
* Update an existing customer account
|
|
148
|
+
* @param params - Object containing id and data to update
|
|
149
|
+
* @param options - Request options (headers, timeout, etc.)
|
|
150
|
+
* @returns Promise resolving to updated customer
|
|
151
|
+
*/
|
|
152
|
+
updateCustomer(params: IUpdateCustomerRequest, options?: IOptionsRequest): Promise<IResponse>;
|
|
153
|
+
/**
|
|
154
|
+
* Retrieve a shopping cart by ID
|
|
155
|
+
* @param params - Cart identifier
|
|
156
|
+
* @param options - Request options (headers, timeout, etc.)
|
|
157
|
+
* @returns Promise resolving to standardized response with cart data
|
|
158
|
+
*/
|
|
159
|
+
getCart(params: ISingleCartRequest, options?: IOptionsRequest): Promise<IResponse>;
|
|
160
|
+
/**
|
|
161
|
+
* Create a new shopping cart
|
|
162
|
+
* @param options - Request options (headers, timeout, etc.)
|
|
163
|
+
* @returns Promise resolving to standardized response with created cart
|
|
164
|
+
*/
|
|
165
|
+
createCart(options?: IOptionsRequest): Promise<IResponse>;
|
|
166
|
+
/**
|
|
167
|
+
* Update an existing shopping cart
|
|
168
|
+
* @param params - Object containing id and data to update
|
|
169
|
+
* @param options - Request options (headers, timeout, etc.)
|
|
170
|
+
* @returns Promise resolving to standardized response with updated cart
|
|
171
|
+
*/
|
|
172
|
+
updateCart(params: IUpdateCartRequest, options?: IOptionsRequest): Promise<IResponse>;
|
|
173
|
+
/**
|
|
174
|
+
* Add items to a shopping cart
|
|
175
|
+
* @param params - Object containing cart id and items to add
|
|
176
|
+
* @param options - Request options (headers, timeout, etc.)
|
|
177
|
+
* @returns Promise resolving to standardized response with updated cart
|
|
178
|
+
*/
|
|
179
|
+
addToCart(params: IAddToCartRequest, options?: IOptionsRequest): Promise<IResponse>;
|
|
180
|
+
/**
|
|
181
|
+
* Remove items from a shopping cart
|
|
182
|
+
* @param params - Object containing cart id and item IDs to remove
|
|
183
|
+
* @param options - Request options (headers, timeout, etc.)
|
|
184
|
+
* @returns Promise resolving to standardized response with updated cart
|
|
185
|
+
*/
|
|
186
|
+
removeFromCart(params: IRemoveFromCartRequest, options?: IOptionsRequest): Promise<IResponse>;
|
|
187
|
+
/**
|
|
188
|
+
* Create a new checkout session
|
|
189
|
+
* @param params - Checkout data
|
|
190
|
+
* @param options - Request options (headers, timeout, etc.)
|
|
191
|
+
* @returns Promise resolving to checkout session
|
|
192
|
+
*/
|
|
193
|
+
createCheckout(params: ICreateCheckoutRequest, options?: IOptionsRequest): Promise<IResponse>;
|
|
194
|
+
/**
|
|
195
|
+
* Retrieve a single article
|
|
196
|
+
* @param params - Query parameters for filtering articles
|
|
197
|
+
* @param options - Request options (headers, timeout, etc.)
|
|
198
|
+
* @returns Promise resolving to article data
|
|
199
|
+
*/
|
|
200
|
+
getArticle(params?: IGetArticleRequest, options?: IOptionsRequest): Promise<IResponse>;
|
|
201
|
+
/**
|
|
202
|
+
* Retrieve blog articles with optional filtering
|
|
203
|
+
* @param params - Query parameters for category and limit
|
|
204
|
+
* @param options - Request options (headers, timeout, etc.)
|
|
205
|
+
* @returns Promise resolving to articles array
|
|
206
|
+
*/
|
|
207
|
+
getBlogArticles(params: IBlogArticleRequest, options?: IOptionsRequest): Promise<IResponse>;
|
|
208
|
+
/**
|
|
209
|
+
* Retrieve trending articles with optional filtering
|
|
210
|
+
* @param params - Query parameters for category
|
|
211
|
+
* @param options - Request options (headers, timeout, etc.)
|
|
212
|
+
* @returns Promise resolving to trending articles
|
|
213
|
+
*/
|
|
214
|
+
getTrendingArticles(params: ITrendingArticleRequest, options?: IOptionsRequest): Promise<IResponse>;
|
|
215
|
+
/**
|
|
216
|
+
* Retrieve a specific article by handle
|
|
217
|
+
* @param params - Article parameters including category and handle
|
|
218
|
+
* @param options - Request options (headers, timeout, etc.)
|
|
219
|
+
* @returns Promise resolving to article data
|
|
220
|
+
*/
|
|
221
|
+
getArticleByHandle(params: IArticleByHandleRequest, options?: IOptionsRequest): Promise<IResponse>;
|
|
222
|
+
/**
|
|
223
|
+
* Utility method to make GraphQL requests
|
|
224
|
+
* @param params - Object containing query string and optional variables
|
|
225
|
+
* @returns Promise resolving to standardized response
|
|
226
|
+
*/
|
|
227
|
+
graphqlRequest(params: IGraphqlRequest): Promise<IResponse>;
|
|
228
|
+
/**
|
|
229
|
+
* Utility method to make custom fetch requests to any endpoint
|
|
230
|
+
* @param params - Object containing url and optional fetch options
|
|
231
|
+
* @returns Promise resolving to standardized response
|
|
232
|
+
*/
|
|
233
|
+
fetchRequest(params: IFetchRequest): Promise<IResponse>;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
export type { ICommerceClient as I };
|
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
import { ISingleProductRequest, IOptionsRequest, IResponse, IProductQueryReqest, IProductsByHandlesRequest, IProductRecommendationsRequest, ISingleCollectionRequest, ICollectionQueryRequest, ICollectionsByhandlesRequest, ICollectionFilterRequest, ISingleOrderRequest, IOrderQueryRequest, IOrderRequest, IUpdateOrderRequest, IOrderHistoryRequest, IOrderByIdRequest, ISingleCustomerRequest, ICustomerQueryRequest, ICustomerRequest, IUpdateCustomerRequest, ISingleCartRequest, IUpdateCartRequest, IAddToCartRequest, IRemoveFromCartRequest, ICreateCheckoutRequest, IGetArticleRequest, IBlogArticleRequest, ITrendingArticleRequest, IArticleByHandleRequest, IGraphqlRequest, IFetchRequest } from './models/index.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Core interface that all platform adapters will implement
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
interface ICommerceClient {
|
|
8
|
+
/**
|
|
9
|
+
* Retrieve a single product by ID or handle
|
|
10
|
+
* @param params - Product identifier (id or handle)
|
|
11
|
+
* @param options - Request options (headers, timeout, etc.)
|
|
12
|
+
* @returns Promise resolving to product data
|
|
13
|
+
*/
|
|
14
|
+
getProduct(params: ISingleProductRequest, options?: IOptionsRequest): Promise<IResponse>;
|
|
15
|
+
/**
|
|
16
|
+
* Retrieve multiple products with filtering and pagination
|
|
17
|
+
* @param params - Query parameters for filtering, sorting, and pagination
|
|
18
|
+
* @param options - Request options (headers, timeout, etc.)
|
|
19
|
+
* @returns Promise resolving to paginated products response
|
|
20
|
+
*/
|
|
21
|
+
getProducts(params: IProductQueryReqest, options?: IOptionsRequest): Promise<IResponse>;
|
|
22
|
+
/**
|
|
23
|
+
* Retrieve multiple products by their handles
|
|
24
|
+
* @param params - Object containing array of product handles
|
|
25
|
+
* @param options - Request options (headers, timeout, etc.)
|
|
26
|
+
* @returns Promise resolving to array of products
|
|
27
|
+
*/
|
|
28
|
+
getProductsByHandles(params: IProductsByHandlesRequest, options?: IOptionsRequest): Promise<IResponse>;
|
|
29
|
+
/**
|
|
30
|
+
* Retrieve product recommendations for a given product
|
|
31
|
+
* Uses platform-specific recommendation algorithms (e.g., Shopify's productRecommendations)
|
|
32
|
+
* @param params - Object containing productId to get recommendations for
|
|
33
|
+
* @param options - Request options (headers, timeout, etc.)
|
|
34
|
+
* @returns Promise resolving to array of recommended products
|
|
35
|
+
*/
|
|
36
|
+
getProductRecommendations(params: IProductRecommendationsRequest, options?: IOptionsRequest): Promise<IResponse>;
|
|
37
|
+
/**
|
|
38
|
+
* Retrieve a single collection by ID or handle
|
|
39
|
+
* @param params - Collection identifier (id or handle)
|
|
40
|
+
* @param options - Request options (headers, timeout, etc.)
|
|
41
|
+
* @returns Promise resolving to collection data
|
|
42
|
+
*/
|
|
43
|
+
getCollection(params: ISingleCollectionRequest, options?: IOptionsRequest): Promise<IResponse>;
|
|
44
|
+
/**
|
|
45
|
+
* Retrieve multiple collections with filtering and pagination
|
|
46
|
+
* @param params - Query parameters for filtering, sorting, and pagination
|
|
47
|
+
* @param options - Request options (headers, timeout, etc.)
|
|
48
|
+
* @returns Promise resolving to paginated collections response
|
|
49
|
+
*/
|
|
50
|
+
getCollections(params: ICollectionQueryRequest, options?: IOptionsRequest): Promise<IResponse>;
|
|
51
|
+
/**
|
|
52
|
+
* Retrieve multiple collections by their handles with individual query parameters
|
|
53
|
+
* Each collection can have its own specific filtering, pagination, and sorting options
|
|
54
|
+
* @param params - Array of collection objects, each containing:
|
|
55
|
+
* - handle: Collection handle (required)
|
|
56
|
+
* - query: Search query string (optional)
|
|
57
|
+
* - after/before: Pagination cursors (optional)
|
|
58
|
+
* - first/last: Number of items to return (optional)
|
|
59
|
+
* - reverse: Sort order reversal (optional)
|
|
60
|
+
* - sortKey: Collection sorting key (optional)
|
|
61
|
+
* - productLimit: Max products per collection (optional)
|
|
62
|
+
* - productSortKey: Product sorting within collection (optional)
|
|
63
|
+
* - productReverse: Product sort order reversal (optional)
|
|
64
|
+
* - filters: Product filtering options including price, availability, type, vendor, tags (optional)
|
|
65
|
+
* @param options - Request options (headers, timeout, etc.)
|
|
66
|
+
* @returns Promise resolving to collections data with individual query results
|
|
67
|
+
* @example
|
|
68
|
+
* ```typescript
|
|
69
|
+
* const result = await client.getCollectionsByHandles([
|
|
70
|
+
* { handle: 'featured', first: 10, sortKey: 'UPDATED_AT' },
|
|
71
|
+
* { handle: 'sale', productLimit: 5, filters: [{ available: true }] }
|
|
72
|
+
* ]);
|
|
73
|
+
* ```
|
|
74
|
+
*/
|
|
75
|
+
getCollectionsByHandles(params: ICollectionsByhandlesRequest, options?: IOptionsRequest): Promise<IResponse>;
|
|
76
|
+
/**
|
|
77
|
+
* Retrieve available filters for collections
|
|
78
|
+
* @param params - Collection identifier (id or handle) to get filters for
|
|
79
|
+
* @param options - Request options (headers, timeout, etc.)
|
|
80
|
+
* @returns Promise resolving to available filter options (price ranges, brands, categories, etc.)
|
|
81
|
+
*/
|
|
82
|
+
getCollectionFilters(params: ICollectionFilterRequest, options?: IOptionsRequest): Promise<IResponse>;
|
|
83
|
+
/**
|
|
84
|
+
* Retrieve a single order by ID
|
|
85
|
+
* @param params - Order identifier
|
|
86
|
+
* @param options - Request options (headers, timeout, etc.)
|
|
87
|
+
* @returns Promise resolving to order data
|
|
88
|
+
*/
|
|
89
|
+
getOrder(params: ISingleOrderRequest, options?: IOptionsRequest): Promise<IResponse>;
|
|
90
|
+
/**
|
|
91
|
+
* Retrieve multiple orders with filtering and pagination
|
|
92
|
+
* @param params - Query parameters for filtering, sorting, and pagination
|
|
93
|
+
* @param options - Request options (headers, timeout, etc.)
|
|
94
|
+
* @returns Promise resolving to paginated orders response
|
|
95
|
+
*/
|
|
96
|
+
getOrders(params: IOrderQueryRequest, options?: IOptionsRequest): Promise<IResponse>;
|
|
97
|
+
/**
|
|
98
|
+
* Create a new order
|
|
99
|
+
* @param params - Order data to create
|
|
100
|
+
* @param options - Request options (headers, timeout, etc.)
|
|
101
|
+
* @returns Promise resolving to created order
|
|
102
|
+
*/
|
|
103
|
+
createOrder(params: IOrderRequest, options?: IOptionsRequest): Promise<IResponse>;
|
|
104
|
+
/**
|
|
105
|
+
* Update an existing order
|
|
106
|
+
* @param params - Object containing id and data to update
|
|
107
|
+
* @param options - Request options (headers, timeout, etc.)
|
|
108
|
+
* @returns Promise resolving to updated order
|
|
109
|
+
*/
|
|
110
|
+
updateOrder(params: IUpdateOrderRequest, options?: IOptionsRequest): Promise<IResponse>;
|
|
111
|
+
/**
|
|
112
|
+
* Retrieve order history for a customer
|
|
113
|
+
* @param params - Object containing customerAccessToken, page, and limit
|
|
114
|
+
* @param options - Request options (headers, timeout, etc.)
|
|
115
|
+
* @returns Promise resolving to order history
|
|
116
|
+
*/
|
|
117
|
+
getOrderHistory(params: IOrderHistoryRequest, options?: IOptionsRequest): Promise<IResponse>;
|
|
118
|
+
/**
|
|
119
|
+
* Retrieve a specific order for a customer
|
|
120
|
+
* @param params - Object containing customerAccessToken and orderId
|
|
121
|
+
* @param options - Request options (headers, timeout, etc.)
|
|
122
|
+
* @returns Promise resolving to order data
|
|
123
|
+
*/
|
|
124
|
+
getOrderById(params: IOrderByIdRequest, options?: IOptionsRequest): Promise<IResponse>;
|
|
125
|
+
/**
|
|
126
|
+
* Retrieve a single customer by ID
|
|
127
|
+
* @param params - Customer identifier
|
|
128
|
+
* @param options - Request options (headers, timeout, etc.)
|
|
129
|
+
* @returns Promise resolving to customer data
|
|
130
|
+
*/
|
|
131
|
+
getCustomer(params: ISingleCustomerRequest, options?: IOptionsRequest): Promise<IResponse>;
|
|
132
|
+
/**
|
|
133
|
+
* Retrieve multiple customers with filtering and pagination
|
|
134
|
+
* @param params - Query parameters for filtering, sorting, and pagination
|
|
135
|
+
* @param options - Request options (headers, timeout, etc.)
|
|
136
|
+
* @returns Promise resolving to paginated customers response
|
|
137
|
+
*/
|
|
138
|
+
getCustomers(params: ICustomerQueryRequest, options?: IOptionsRequest): Promise<IResponse>;
|
|
139
|
+
/**
|
|
140
|
+
* Create a new customer account
|
|
141
|
+
* @param params - Customer data to create
|
|
142
|
+
* @param options - Request options (headers, timeout, etc.)
|
|
143
|
+
* @returns Promise resolving to created customer
|
|
144
|
+
*/
|
|
145
|
+
createCustomer(params: ICustomerRequest, options?: IOptionsRequest): Promise<IResponse>;
|
|
146
|
+
/**
|
|
147
|
+
* Update an existing customer account
|
|
148
|
+
* @param params - Object containing id and data to update
|
|
149
|
+
* @param options - Request options (headers, timeout, etc.)
|
|
150
|
+
* @returns Promise resolving to updated customer
|
|
151
|
+
*/
|
|
152
|
+
updateCustomer(params: IUpdateCustomerRequest, options?: IOptionsRequest): Promise<IResponse>;
|
|
153
|
+
/**
|
|
154
|
+
* Retrieve a shopping cart by ID
|
|
155
|
+
* @param params - Cart identifier
|
|
156
|
+
* @param options - Request options (headers, timeout, etc.)
|
|
157
|
+
* @returns Promise resolving to standardized response with cart data
|
|
158
|
+
*/
|
|
159
|
+
getCart(params: ISingleCartRequest, options?: IOptionsRequest): Promise<IResponse>;
|
|
160
|
+
/**
|
|
161
|
+
* Create a new shopping cart
|
|
162
|
+
* @param options - Request options (headers, timeout, etc.)
|
|
163
|
+
* @returns Promise resolving to standardized response with created cart
|
|
164
|
+
*/
|
|
165
|
+
createCart(options?: IOptionsRequest): Promise<IResponse>;
|
|
166
|
+
/**
|
|
167
|
+
* Update an existing shopping cart
|
|
168
|
+
* @param params - Object containing id and data to update
|
|
169
|
+
* @param options - Request options (headers, timeout, etc.)
|
|
170
|
+
* @returns Promise resolving to standardized response with updated cart
|
|
171
|
+
*/
|
|
172
|
+
updateCart(params: IUpdateCartRequest, options?: IOptionsRequest): Promise<IResponse>;
|
|
173
|
+
/**
|
|
174
|
+
* Add items to a shopping cart
|
|
175
|
+
* @param params - Object containing cart id and items to add
|
|
176
|
+
* @param options - Request options (headers, timeout, etc.)
|
|
177
|
+
* @returns Promise resolving to standardized response with updated cart
|
|
178
|
+
*/
|
|
179
|
+
addToCart(params: IAddToCartRequest, options?: IOptionsRequest): Promise<IResponse>;
|
|
180
|
+
/**
|
|
181
|
+
* Remove items from a shopping cart
|
|
182
|
+
* @param params - Object containing cart id and item IDs to remove
|
|
183
|
+
* @param options - Request options (headers, timeout, etc.)
|
|
184
|
+
* @returns Promise resolving to standardized response with updated cart
|
|
185
|
+
*/
|
|
186
|
+
removeFromCart(params: IRemoveFromCartRequest, options?: IOptionsRequest): Promise<IResponse>;
|
|
187
|
+
/**
|
|
188
|
+
* Create a new checkout session
|
|
189
|
+
* @param params - Checkout data
|
|
190
|
+
* @param options - Request options (headers, timeout, etc.)
|
|
191
|
+
* @returns Promise resolving to checkout session
|
|
192
|
+
*/
|
|
193
|
+
createCheckout(params: ICreateCheckoutRequest, options?: IOptionsRequest): Promise<IResponse>;
|
|
194
|
+
/**
|
|
195
|
+
* Retrieve a single article
|
|
196
|
+
* @param params - Query parameters for filtering articles
|
|
197
|
+
* @param options - Request options (headers, timeout, etc.)
|
|
198
|
+
* @returns Promise resolving to article data
|
|
199
|
+
*/
|
|
200
|
+
getArticle(params?: IGetArticleRequest, options?: IOptionsRequest): Promise<IResponse>;
|
|
201
|
+
/**
|
|
202
|
+
* Retrieve blog articles with optional filtering
|
|
203
|
+
* @param params - Query parameters for category and limit
|
|
204
|
+
* @param options - Request options (headers, timeout, etc.)
|
|
205
|
+
* @returns Promise resolving to articles array
|
|
206
|
+
*/
|
|
207
|
+
getBlogArticles(params: IBlogArticleRequest, options?: IOptionsRequest): Promise<IResponse>;
|
|
208
|
+
/**
|
|
209
|
+
* Retrieve trending articles with optional filtering
|
|
210
|
+
* @param params - Query parameters for category
|
|
211
|
+
* @param options - Request options (headers, timeout, etc.)
|
|
212
|
+
* @returns Promise resolving to trending articles
|
|
213
|
+
*/
|
|
214
|
+
getTrendingArticles(params: ITrendingArticleRequest, options?: IOptionsRequest): Promise<IResponse>;
|
|
215
|
+
/**
|
|
216
|
+
* Retrieve a specific article by handle
|
|
217
|
+
* @param params - Article parameters including category and handle
|
|
218
|
+
* @param options - Request options (headers, timeout, etc.)
|
|
219
|
+
* @returns Promise resolving to article data
|
|
220
|
+
*/
|
|
221
|
+
getArticleByHandle(params: IArticleByHandleRequest, options?: IOptionsRequest): Promise<IResponse>;
|
|
222
|
+
/**
|
|
223
|
+
* Utility method to make GraphQL requests
|
|
224
|
+
* @param params - Object containing query string and optional variables
|
|
225
|
+
* @returns Promise resolving to standardized response
|
|
226
|
+
*/
|
|
227
|
+
graphqlRequest(params: IGraphqlRequest): Promise<IResponse>;
|
|
228
|
+
/**
|
|
229
|
+
* Utility method to make custom fetch requests to any endpoint
|
|
230
|
+
* @param params - Object containing url and optional fetch options
|
|
231
|
+
* @returns Promise resolving to standardized response
|
|
232
|
+
*/
|
|
233
|
+
fetchRequest(params: IFetchRequest): Promise<IResponse>;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
export type { ICommerceClient as I };
|