@medusajs/js-sdk 2.0.0 → 2.0.1-snapshot-20241025090810
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/admin/api-key.d.ts +8 -8
- package/dist/admin/api-key.js +8 -8
- package/dist/admin/campaign.d.ts +8 -8
- package/dist/admin/campaign.js +8 -8
- package/dist/admin/claim.d.ts +22 -22
- package/dist/admin/claim.js +22 -22
- package/dist/admin/currency.d.ts +4 -4
- package/dist/admin/currency.js +4 -4
- package/dist/admin/customer-group.d.ts +8 -8
- package/dist/admin/customer-group.js +8 -8
- package/dist/admin/customer.d.ts +27 -7
- package/dist/admin/customer.d.ts.map +1 -1
- package/dist/admin/customer.js +33 -7
- package/dist/admin/customer.js.map +1 -1
- package/dist/admin/exchange.d.ts +21 -21
- package/dist/admin/exchange.js +21 -21
- package/dist/admin/fulfillment-provider.d.ts +2 -2
- package/dist/admin/fulfillment-provider.js +2 -2
- package/dist/admin/fulfillment-set.d.ts +6 -6
- package/dist/admin/fulfillment-set.js +6 -6
- package/dist/admin/fulfillment.d.ts +3 -3
- package/dist/admin/fulfillment.js +3 -3
- package/dist/admin/inventory-item.d.ts +12 -12
- package/dist/admin/inventory-item.js +12 -12
- package/dist/admin/invite.d.ts +8 -8
- package/dist/admin/invite.js +8 -8
- package/dist/admin/payment-collection.d.ts +0 -2
- package/dist/admin/payment-collection.d.ts.map +1 -1
- package/dist/admin/payment-collection.js +0 -12
- package/dist/admin/payment-collection.js.map +1 -1
- package/dist/auth/index.d.ts +10 -10
- package/dist/auth/index.js +10 -10
- package/dist/esm/admin/api-key.d.ts +8 -8
- package/dist/esm/admin/api-key.js +8 -8
- package/dist/esm/admin/campaign.d.ts +8 -8
- package/dist/esm/admin/campaign.js +8 -8
- package/dist/esm/admin/claim.d.ts +22 -22
- package/dist/esm/admin/claim.js +22 -22
- package/dist/esm/admin/currency.d.ts +4 -4
- package/dist/esm/admin/currency.js +4 -4
- package/dist/esm/admin/customer-group.d.ts +8 -8
- package/dist/esm/admin/customer-group.js +8 -8
- package/dist/esm/admin/customer.d.ts +27 -7
- package/dist/esm/admin/customer.d.ts.map +1 -1
- package/dist/esm/admin/customer.js +35 -7
- package/dist/esm/admin/customer.js.map +1 -1
- package/dist/esm/admin/exchange.d.ts +21 -21
- package/dist/esm/admin/exchange.js +21 -21
- package/dist/esm/admin/fulfillment-provider.d.ts +2 -2
- package/dist/esm/admin/fulfillment-provider.js +2 -2
- package/dist/esm/admin/fulfillment-set.d.ts +6 -6
- package/dist/esm/admin/fulfillment-set.js +6 -6
- package/dist/esm/admin/fulfillment.d.ts +3 -3
- package/dist/esm/admin/fulfillment.js +3 -3
- package/dist/esm/admin/inventory-item.d.ts +12 -12
- package/dist/esm/admin/inventory-item.js +12 -12
- package/dist/esm/admin/invite.d.ts +8 -8
- package/dist/esm/admin/invite.js +8 -8
- package/dist/esm/admin/payment-collection.d.ts +0 -2
- package/dist/esm/admin/payment-collection.d.ts.map +1 -1
- package/dist/esm/admin/payment-collection.js +0 -16
- package/dist/esm/admin/payment-collection.js.map +1 -1
- package/dist/esm/auth/index.d.ts +10 -10
- package/dist/esm/auth/index.js +10 -10
- package/dist/esm/store/index.d.ts +73 -73
- package/dist/esm/store/index.js +73 -73
- package/dist/store/index.d.ts +73 -73
- package/dist/store/index.js +73 -73
- package/package.json +2 -2
package/dist/store/index.js
CHANGED
@@ -9,9 +9,9 @@ class Store {
|
|
9
9
|
this.region = {
|
10
10
|
/**
|
11
11
|
* This method retrieves the paginated list of regions in the store. It sends a request to the
|
12
|
-
* [List Regions API route](https://docs.medusajs.com/
|
12
|
+
* [List Regions API route](https://docs.medusajs.com/api/store#regions_getregions).
|
13
13
|
*
|
14
|
-
* Related guide: [How to list regions in a storefront](https://docs.medusajs.com/
|
14
|
+
* Related guide: [How to list regions in a storefront](https://docs.medusajs.com/resources/storefront-development/regions/list).
|
15
15
|
*
|
16
16
|
* @param query - Filters and pagination configurations.
|
17
17
|
* @param headers - Headers to pass in the request
|
@@ -53,7 +53,7 @@ class Store {
|
|
53
53
|
* })
|
54
54
|
* ```
|
55
55
|
*
|
56
|
-
* Learn more about the `fields` property in the [API reference](https://docs.medusajs.com/
|
56
|
+
* Learn more about the `fields` property in the [API reference](https://docs.medusajs.com/api/store#select-fields-and-relations).
|
57
57
|
*/
|
58
58
|
list: async (query, headers) => {
|
59
59
|
return this.client.fetch(`/store/regions`, {
|
@@ -62,10 +62,10 @@ class Store {
|
|
62
62
|
});
|
63
63
|
},
|
64
64
|
/**
|
65
|
-
* This method retrieves a region by its ID. It sends a request to the [Get Region](https://docs.medusajs.com/
|
65
|
+
* This method retrieves a region by its ID. It sends a request to the [Get Region](https://docs.medusajs.com/api/store#regions_getregionsid)
|
66
66
|
* API route.
|
67
67
|
*
|
68
|
-
* Related guide: [Store and retrieve regions in a storefront](https://docs.medusajs.com/
|
68
|
+
* Related guide: [Store and retrieve regions in a storefront](https://docs.medusajs.com/resources/storefront-development/regions/store-retrieve-region).
|
69
69
|
*
|
70
70
|
* @param id - The region's ID.
|
71
71
|
* @param query - Configure the fields to retrieve in the region.
|
@@ -96,7 +96,7 @@ class Store {
|
|
96
96
|
* })
|
97
97
|
* ```
|
98
98
|
*
|
99
|
-
* Learn more about the `fields` property in the [API reference](https://docs.medusajs.com/
|
99
|
+
* Learn more about the `fields` property in the [API reference](https://docs.medusajs.com/api/store#select-fields-and-relations).
|
100
100
|
*/
|
101
101
|
retrieve: async (id, query, headers) => {
|
102
102
|
return this.client.fetch(`/store/regions/${id}`, {
|
@@ -108,9 +108,9 @@ class Store {
|
|
108
108
|
this.collection = {
|
109
109
|
/**
|
110
110
|
* This method retrieves a paginated list of product collections. It sends a request to the
|
111
|
-
* [List Collections](https://docs.medusajs.com/
|
111
|
+
* [List Collections](https://docs.medusajs.com/api/store#collections_getcollections) API route.
|
112
112
|
*
|
113
|
-
* Related guide: [How to retrieve collections in a storefront](https://docs.medusajs.com/
|
113
|
+
* Related guide: [How to retrieve collections in a storefront](https://docs.medusajs.com/resources/storefront-development/products/collections/list).
|
114
114
|
*
|
115
115
|
* @param query - Filters and pagination configurations.
|
116
116
|
* @param headers - Headers to pass in the request
|
@@ -152,7 +152,7 @@ class Store {
|
|
152
152
|
* })
|
153
153
|
* ```
|
154
154
|
*
|
155
|
-
* Learn more about the `fields` property in the [API reference](https://docs.medusajs.com/
|
155
|
+
* Learn more about the `fields` property in the [API reference](https://docs.medusajs.com/api/store#select-fields-and-relations).
|
156
156
|
*/
|
157
157
|
list: async (query, headers) => {
|
158
158
|
return this.client.fetch(`/store/collections`, {
|
@@ -161,10 +161,10 @@ class Store {
|
|
161
161
|
});
|
162
162
|
},
|
163
163
|
/**
|
164
|
-
* This method retrieves a collection by its ID. It sends a request to the [Get Collection](https://docs.medusajs.com/
|
164
|
+
* This method retrieves a collection by its ID. It sends a request to the [Get Collection](https://docs.medusajs.com/api/store#collections_getcollectionsid)
|
165
165
|
* API route.
|
166
166
|
*
|
167
|
-
* Related guide: [How to retrieve a collection in a storefront](https://docs.medusajs.com/
|
167
|
+
* Related guide: [How to retrieve a collection in a storefront](https://docs.medusajs.com/resources/storefront-development/products/collections/retrieve).
|
168
168
|
*
|
169
169
|
* @param id - The ID of the collection to retrieve.
|
170
170
|
* @param query - Configure the fields to retrieve in the collection.
|
@@ -192,7 +192,7 @@ class Store {
|
|
192
192
|
* })
|
193
193
|
* ```
|
194
194
|
*
|
195
|
-
* Learn more about the `fields` property in the [API reference](https://docs.medusajs.com/
|
195
|
+
* Learn more about the `fields` property in the [API reference](https://docs.medusajs.com/api/store#select-fields-and-relations).
|
196
196
|
*/
|
197
197
|
retrieve: async (id, query, headers) => {
|
198
198
|
return this.client.fetch(`/store/collections/${id}`, {
|
@@ -204,9 +204,9 @@ class Store {
|
|
204
204
|
this.category = {
|
205
205
|
/**
|
206
206
|
* This method retrieves a paginated list of product categories. It sends a request to the
|
207
|
-
* [List Categories](https://docs.medusajs.com/
|
207
|
+
* [List Categories](https://docs.medusajs.com/api/store#product-categories_getproductcategories) API route.
|
208
208
|
*
|
209
|
-
* Related guide: [How to retrieve list of categories in the storefront](https://docs.medusajs.com/
|
209
|
+
* Related guide: [How to retrieve list of categories in the storefront](https://docs.medusajs.com/resources/storefront-development/products/categories/list).
|
210
210
|
*
|
211
211
|
* @param query - Filters and pagination configurations.
|
212
212
|
* @param headers - Headers to pass in the request.
|
@@ -248,7 +248,7 @@ class Store {
|
|
248
248
|
* })
|
249
249
|
* ```
|
250
250
|
*
|
251
|
-
* Learn more about the `fields` property in the [API reference](https://docs.medusajs.com/
|
251
|
+
* Learn more about the `fields` property in the [API reference](https://docs.medusajs.com/api/store#select-fields-and-relations).
|
252
252
|
*/
|
253
253
|
list: async (query, headers) => {
|
254
254
|
return this.client.fetch(`/store/product-categories`, {
|
@@ -258,9 +258,9 @@ class Store {
|
|
258
258
|
},
|
259
259
|
/**
|
260
260
|
* This method retrieves a category by its ID. It sends a request to the
|
261
|
-
* [Retrieve Product Category](https://docs.medusajs.com/
|
261
|
+
* [Retrieve Product Category](https://docs.medusajs.com/api/store#product-categories_getproductcategoriesid).
|
262
262
|
*
|
263
|
-
* Related guide: [How to retrieve a category in the storefront](https://docs.medusajs.com/
|
263
|
+
* Related guide: [How to retrieve a category in the storefront](https://docs.medusajs.com/resources/storefront-development/products/categories/retrieve).
|
264
264
|
*
|
265
265
|
* @param id - The ID of the category to retrieve.
|
266
266
|
* @param query - Configure the fields to retrieve in the category.
|
@@ -288,7 +288,7 @@ class Store {
|
|
288
288
|
* })
|
289
289
|
* ```
|
290
290
|
*
|
291
|
-
* Learn more about the `fields` property in the [API reference](https://docs.medusajs.com/
|
291
|
+
* Learn more about the `fields` property in the [API reference](https://docs.medusajs.com/api/store#select-fields-and-relations).
|
292
292
|
*/
|
293
293
|
retrieve: async (id, query, headers) => {
|
294
294
|
return this.client.fetch(`/store/product-categories/${id}`, {
|
@@ -300,12 +300,12 @@ class Store {
|
|
300
300
|
this.product = {
|
301
301
|
/**
|
302
302
|
* This method retrieves a list of products. It sends a request to the
|
303
|
-
* [List Products API route](https://docs.medusajs.com/
|
303
|
+
* [List Products API route](https://docs.medusajs.com/api/store#products_getproducts).
|
304
304
|
*
|
305
305
|
* Related guides:
|
306
306
|
*
|
307
|
-
* - [How to list products in a storefront](https://docs.medusajs.com/
|
308
|
-
* - [How to retrieve a product variant's prices in the storefront](https://docs.medusajs.com/
|
307
|
+
* - [How to list products in a storefront](https://docs.medusajs.com/resources/storefront-development/products/list).
|
308
|
+
* - [How to retrieve a product variant's prices in the storefront](https://docs.medusajs.com/resources/storefront-development/products/price)
|
309
309
|
*
|
310
310
|
* @param query - Filters and pagination configurations.
|
311
311
|
* @param headers - Headers to pass in the request.
|
@@ -347,7 +347,7 @@ class Store {
|
|
347
347
|
* })
|
348
348
|
* ```
|
349
349
|
*
|
350
|
-
* Learn more about the `fields` property in the [API reference](https://docs.medusajs.com/
|
350
|
+
* Learn more about the `fields` property in the [API reference](https://docs.medusajs.com/api/store#select-fields-and-relations).
|
351
351
|
*/
|
352
352
|
list: async (query, headers) => {
|
353
353
|
return this.client.fetch(`/store/products`, {
|
@@ -357,12 +357,12 @@ class Store {
|
|
357
357
|
},
|
358
358
|
/**
|
359
359
|
* This method is used to retrieve a product by its ID. It sends a request to the
|
360
|
-
* [Get Product](https://docs.medusajs.com/
|
360
|
+
* [Get Product](https://docs.medusajs.com/api/store#products_getproductsid) API route.
|
361
361
|
*
|
362
362
|
* Related guides:
|
363
363
|
*
|
364
|
-
* - [How to retrieve a product in the storefront](https://docs.medusajs.com/
|
365
|
-
* - [How to retrieve a product variant's prices in the storefront](https://docs.medusajs.com/
|
364
|
+
* - [How to retrieve a product in the storefront](https://docs.medusajs.com/resources/storefront-development/products/retrieve).
|
365
|
+
* - [How to retrieve a product variant's prices in the storefront](https://docs.medusajs.com/resources/storefront-development/products/price)
|
366
366
|
*
|
367
367
|
* @param id - The product's ID.
|
368
368
|
* @param query - Configure the fields to retrieve in the product.
|
@@ -390,7 +390,7 @@ class Store {
|
|
390
390
|
* })
|
391
391
|
* ```
|
392
392
|
*
|
393
|
-
* Learn more about the `fields` property in the [API reference](https://docs.medusajs.com/
|
393
|
+
* Learn more about the `fields` property in the [API reference](https://docs.medusajs.com/api/store#select-fields-and-relations).
|
394
394
|
*/
|
395
395
|
retrieve: async (id, query, headers) => {
|
396
396
|
return this.client.fetch(`/store/products/${id}`, {
|
@@ -400,14 +400,14 @@ class Store {
|
|
400
400
|
},
|
401
401
|
};
|
402
402
|
/**
|
403
|
-
* Related guides: [How to implement carts in the storefront](https://docs.medusajs.com/
|
403
|
+
* Related guides: [How to implement carts in the storefront](https://docs.medusajs.com/resources/storefront-development/cart).
|
404
404
|
*/
|
405
405
|
this.cart = {
|
406
406
|
/**
|
407
|
-
* This method creates a cart. It sends a request to the [Create Cart](https://docs.medusajs.com/
|
407
|
+
* This method creates a cart. It sends a request to the [Create Cart](https://docs.medusajs.com/api/store#carts_postcarts)
|
408
408
|
* API route.
|
409
409
|
*
|
410
|
-
* Related guide: [How to create a cart in the storefront](https://docs.medusajs.com/
|
410
|
+
* Related guide: [How to create a cart in the storefront](https://docs.medusajs.com/resources/storefront-development/cart/create).
|
411
411
|
*
|
412
412
|
* @param body - The details of the cart to create.
|
413
413
|
* @param query - Configure the fields to retrieve in the cart.
|
@@ -432,9 +432,9 @@ class Store {
|
|
432
432
|
},
|
433
433
|
/**
|
434
434
|
* This method updates a cart. It sends a request to the
|
435
|
-
* [Update Cart](https://docs.medusajs.com/
|
435
|
+
* [Update Cart](https://docs.medusajs.com/api/store#carts_postcartsid) API route.
|
436
436
|
*
|
437
|
-
* Related guide: [How to update a cart in the storefront](https://docs.medusajs.com/
|
437
|
+
* Related guide: [How to update a cart in the storefront](https://docs.medusajs.com/resources/storefront-development/cart/update).
|
438
438
|
*
|
439
439
|
* @param id - The cart's ID.
|
440
440
|
* @param body - The data to update in the cart.
|
@@ -460,9 +460,9 @@ class Store {
|
|
460
460
|
},
|
461
461
|
/**
|
462
462
|
* This method retrieves a cart by its ID. It sends a request to the
|
463
|
-
* [Get Cart](https://docs.medusajs.com/
|
463
|
+
* [Get Cart](https://docs.medusajs.com/api/store#carts_getcartsid) API route.
|
464
464
|
*
|
465
|
-
* Related guide: [How to retrieve a cart in the storefront](https://docs.medusajs.com/
|
465
|
+
* Related guide: [How to retrieve a cart in the storefront](https://docs.medusajs.com/resources/storefront-development/cart/retrieve).
|
466
466
|
*
|
467
467
|
* @param id - The cart's ID.
|
468
468
|
* @param query - Configure the fields to retrieve in the cart.
|
@@ -490,7 +490,7 @@ class Store {
|
|
490
490
|
* })
|
491
491
|
* ```
|
492
492
|
*
|
493
|
-
* Learn more about the `fields` property in the [API reference](https://docs.medusajs.com/
|
493
|
+
* Learn more about the `fields` property in the [API reference](https://docs.medusajs.com/api/store#select-fields-and-relations).
|
494
494
|
*/
|
495
495
|
retrieve: async (id, query, headers) => {
|
496
496
|
return this.client.fetch(`/store/carts/${id}`, {
|
@@ -500,9 +500,9 @@ class Store {
|
|
500
500
|
},
|
501
501
|
/**
|
502
502
|
* This methods adds a product variant to the cart as a line item. It sends a request to the
|
503
|
-
* [Add Line Item](https://docs.medusajs.com/
|
503
|
+
* [Add Line Item](https://docs.medusajs.com/api/store#carts_postcartsidlineitems) API route.
|
504
504
|
*
|
505
|
-
* Related guide: [How to manage a cart's line items in the storefront](https://docs.medusajs.com/
|
505
|
+
* Related guide: [How to manage a cart's line items in the storefront](https://docs.medusajs.com/resources/storefront-development/cart/manage-items).
|
506
506
|
*
|
507
507
|
* @param cartId - The cart's ID.
|
508
508
|
* @param body - The details of the item to add.
|
@@ -529,9 +529,9 @@ class Store {
|
|
529
529
|
},
|
530
530
|
/**
|
531
531
|
* This method updates a line item in a cart. It sends a request to the
|
532
|
-
* [Update Line Item](https://docs.medusajs.com/
|
532
|
+
* [Update Line Item](https://docs.medusajs.com/api/store#carts_postcartsidlineitemsline_id) API route.
|
533
533
|
*
|
534
|
-
* Related guide: [How to manage a cart's line items in the storefront](https://docs.medusajs.com/
|
534
|
+
* Related guide: [How to manage a cart's line items in the storefront](https://docs.medusajs.com/resources/storefront-development/cart/manage-items).
|
535
535
|
*
|
536
536
|
* @param cartId - The cart's ID.
|
537
537
|
* @param lineItemId - The line item's ID.
|
@@ -562,9 +562,9 @@ class Store {
|
|
562
562
|
},
|
563
563
|
/**
|
564
564
|
* This method deletes a line item from a cart. It sends a request to the
|
565
|
-
* [Remove Line Item](https://docs.medusajs.com/
|
565
|
+
* [Remove Line Item](https://docs.medusajs.com/api/store#carts_deletecartsidlineitemsline_id) API route.
|
566
566
|
*
|
567
|
-
* Related guide: [How to manage a cart's line items in the storefront](https://docs.medusajs.com/
|
567
|
+
* Related guide: [How to manage a cart's line items in the storefront](https://docs.medusajs.com/resources/storefront-development/cart/manage-items).
|
568
568
|
*
|
569
569
|
* @param cartId - The cart's ID.
|
570
570
|
* @param lineItemId - The item's ID.
|
@@ -588,9 +588,9 @@ class Store {
|
|
588
588
|
},
|
589
589
|
/**
|
590
590
|
* This method adds a shipping method to a cart. It sends a request to
|
591
|
-
* the [Add Shipping Method](https://docs.medusajs.com/
|
591
|
+
* the [Add Shipping Method](https://docs.medusajs.com/api/store#carts_postcartsidshippingmethods) API routes.
|
592
592
|
*
|
593
|
-
* Related guide: [Implement shipping step during checkout](https://docs.medusajs.com/
|
593
|
+
* Related guide: [Implement shipping step during checkout](https://docs.medusajs.com/resources/storefront-development/checkout/shipping).
|
594
594
|
*
|
595
595
|
* @param cartId - The cart's ID.
|
596
596
|
* @param body - The shipping method's details.
|
@@ -619,10 +619,10 @@ class Store {
|
|
619
619
|
},
|
620
620
|
/**
|
621
621
|
* This method completes a cart and places the order. It's the last step of the checkout flow.
|
622
|
-
* The method sends a request to the [Complete Cart](https://docs.medusajs.com/
|
622
|
+
* The method sends a request to the [Complete Cart](https://docs.medusajs.com/api/store#carts_postcartsidcomplete)
|
623
623
|
* API route.
|
624
624
|
*
|
625
|
-
* Related guide: [Learn how to complete cart in checkout flow](https://docs.medusajs.com/
|
625
|
+
* Related guide: [Learn how to complete cart in checkout flow](https://docs.medusajs.com/resources/storefront-development/checkout/complete-cart).
|
626
626
|
*
|
627
627
|
* @param cartId - The cart's ID.
|
628
628
|
* @param query - Configure the fields to retrieve in the created order.
|
@@ -652,10 +652,10 @@ class Store {
|
|
652
652
|
this.fulfillment = {
|
653
653
|
/**
|
654
654
|
* This method retrieves the list of shipping options for a cart. It sends a request to
|
655
|
-
* the [List Shipping Options](https://docs.medusajs.com/
|
655
|
+
* the [List Shipping Options](https://docs.medusajs.com/api/store#shipping-options_getshippingoptions)
|
656
656
|
* API route.
|
657
657
|
*
|
658
|
-
* Related guide: [Implement shipping step during checkout](https://docs.medusajs.com/
|
658
|
+
* Related guide: [Implement shipping step during checkout](https://docs.medusajs.com/resources/storefront-development/checkout/shipping).
|
659
659
|
*
|
660
660
|
* @param query - The cart's details along with configurations of the fields to retrieve in the options.
|
661
661
|
* @param headers - Headers to pass in the request.
|
@@ -679,10 +679,10 @@ class Store {
|
|
679
679
|
this.payment = {
|
680
680
|
/**
|
681
681
|
* This method retrieves the payment providers available in a region, which is useful during checkout.
|
682
|
-
* It sends a request to the [List Payment Providers](https://docs.medusajs.com/
|
682
|
+
* It sends a request to the [List Payment Providers](https://docs.medusajs.com/api/store#payment-providers_getpaymentproviders)
|
683
683
|
* API route.
|
684
684
|
*
|
685
|
-
* Related guide: [Implement payment step during checkout](https://docs.medusajs.com/
|
685
|
+
* Related guide: [Implement payment step during checkout](https://docs.medusajs.com/resources/storefront-development/checkout/payment).
|
686
686
|
*
|
687
687
|
* @param query - The filters to apply on the retrieved providers, along with configurations of the
|
688
688
|
* fields to retrieve in the options.
|
@@ -731,7 +731,7 @@ class Store {
|
|
731
731
|
* })
|
732
732
|
* ```
|
733
733
|
*
|
734
|
-
* Learn more about the `fields` property in the [API reference](https://docs.medusajs.com/
|
734
|
+
* Learn more about the `fields` property in the [API reference](https://docs.medusajs.com/api/store#select-fields-and-relations).
|
735
735
|
*/
|
736
736
|
listPaymentProviders: async (query, headers) => {
|
737
737
|
return this.client.fetch(`/store/payment-providers`, {
|
@@ -741,14 +741,14 @@ class Store {
|
|
741
741
|
},
|
742
742
|
/**
|
743
743
|
* This method creates a payment session of a cart's payment collection, selecting a payment provider.
|
744
|
-
* It sends a request to the [Initialize Payment Session](https://docs.medusajs.com/
|
744
|
+
* It sends a request to the [Initialize Payment Session](https://docs.medusajs.com/api/store#payment-collections_postpaymentcollectionsidpaymentsessions)
|
745
745
|
* API route.
|
746
746
|
*
|
747
747
|
* If the cart doesn't have a payment collection, a payment collection is created for the cart by
|
748
|
-
* sending a request to the [Create Payment Collection](https://docs.medusajs.com/
|
748
|
+
* sending a request to the [Create Payment Collection](https://docs.medusajs.com/api/store#payment-collections_postpaymentcollections)
|
749
749
|
* API route.
|
750
750
|
*
|
751
|
-
* Related guide: [Implement payment step during checkout](https://docs.medusajs.com/
|
751
|
+
* Related guide: [Implement payment step during checkout](https://docs.medusajs.com/resources/storefront-development/checkout/payment).
|
752
752
|
*
|
753
753
|
* @param cart - The cart's details.
|
754
754
|
* @param body - The payment session's details.
|
@@ -793,7 +793,7 @@ class Store {
|
|
793
793
|
this.order = {
|
794
794
|
/**
|
795
795
|
* This method retrieves a paginated list of orders matching the specified filters. It
|
796
|
-
* sends a request to the [List Orders](https://docs.medusajs.com/
|
796
|
+
* sends a request to the [List Orders](https://docs.medusajs.com/api/store#orders_getorders)
|
797
797
|
* API route.
|
798
798
|
*
|
799
799
|
* @param query - Configure the fields to retrieve in the orders.
|
@@ -836,7 +836,7 @@ class Store {
|
|
836
836
|
* })
|
837
837
|
* ```
|
838
838
|
*
|
839
|
-
* Learn more about the `fields` property in the [API reference](https://docs.medusajs.com/
|
839
|
+
* Learn more about the `fields` property in the [API reference](https://docs.medusajs.com/api/store#select-fields-and-relations).
|
840
840
|
*/
|
841
841
|
list: async (query, headers) => {
|
842
842
|
return this.client.fetch(`/store/orders`, {
|
@@ -846,7 +846,7 @@ class Store {
|
|
846
846
|
},
|
847
847
|
/**
|
848
848
|
* This method retrieves an order by its ID. It sends a request to the
|
849
|
-
* [Get Order](https://docs.medusajs.com/
|
849
|
+
* [Get Order](https://docs.medusajs.com/api/store#orders_getordersid) API route.
|
850
850
|
*
|
851
851
|
* @param id - The order's ID.
|
852
852
|
* @param query - Configure the fields to retrieve in the order.
|
@@ -874,7 +874,7 @@ class Store {
|
|
874
874
|
* })
|
875
875
|
* ```
|
876
876
|
*
|
877
|
-
* Learn more about the `fields` property in the [API reference](https://docs.medusajs.com/
|
877
|
+
* Learn more about the `fields` property in the [API reference](https://docs.medusajs.com/api/store#select-fields-and-relations).
|
878
878
|
*/
|
879
879
|
retrieve: async (id, query, headers) => {
|
880
880
|
return this.client.fetch(`/store/orders/${id}`, {
|
@@ -885,13 +885,13 @@ class Store {
|
|
885
885
|
};
|
886
886
|
this.customer = {
|
887
887
|
/**
|
888
|
-
* This method registers a customer. It sends a request to the [Register Customer](https://docs.medusajs.com/
|
888
|
+
* This method registers a customer. It sends a request to the [Register Customer](https://docs.medusajs.com/api/store#customers_postcustomers)
|
889
889
|
* API route.
|
890
890
|
*
|
891
891
|
* You must use the {@link Auth.register} method first to retrieve a registration token. Then, pass that
|
892
892
|
* registration token in the `headers` parameter of this method as an authorization bearer header.
|
893
893
|
*
|
894
|
-
* Related guide: [How to register customer in storefront](https://docs.medusajs.com/
|
894
|
+
* Related guide: [How to register customer in storefront](https://docs.medusajs.com/resources/storefront-development/customers/register)
|
895
895
|
*
|
896
896
|
* @param body - The customer's details.
|
897
897
|
* @param query - Configure the fields to retrieve in the customer.
|
@@ -930,9 +930,9 @@ class Store {
|
|
930
930
|
* first with the {@link Auth.login} method.
|
931
931
|
*
|
932
932
|
* It sends a request to the
|
933
|
-
* [Update Customer](https://docs.medusajs.com/
|
933
|
+
* [Update Customer](https://docs.medusajs.com/api/store#customers_postcustomersme) API route.
|
934
934
|
*
|
935
|
-
* Related guide: [How to edit customer's profile in the storefront](https://docs.medusajs.com/
|
935
|
+
* Related guide: [How to edit customer's profile in the storefront](https://docs.medusajs.com/resources/storefront-development/customers/profile).
|
936
936
|
*
|
937
937
|
* @param body - The customer's details to update.
|
938
938
|
* @param query - Configure the fields to retrieve in the customer.
|
@@ -959,7 +959,7 @@ class Store {
|
|
959
959
|
* This method retrieves the logged-in customer's details. The customer must be logged in
|
960
960
|
* first with the {@link Auth.login} method.
|
961
961
|
*
|
962
|
-
* It sends a request to the [Get Logged-In Customer](https://docs.medusajs.com/
|
962
|
+
* It sends a request to the [Get Logged-In Customer](https://docs.medusajs.com/api/store#customers_getcustomersme)
|
963
963
|
* API route.
|
964
964
|
*
|
965
965
|
* @param query - Configure the fields to retrieve in the customer.
|
@@ -982,10 +982,10 @@ class Store {
|
|
982
982
|
* This method creates an address for the logged-in customer. The customer must be logged in
|
983
983
|
* first with the {@link Auth.login} method.
|
984
984
|
*
|
985
|
-
* It sends a request to the [Create Address](https://docs.medusajs.com/
|
985
|
+
* It sends a request to the [Create Address](https://docs.medusajs.com/api/store#customers_postcustomersmeaddresses)
|
986
986
|
* API route.
|
987
987
|
*
|
988
|
-
* Related guides: [How to manage customer's addresses in the storefront](https://docs.medusajs.com/
|
988
|
+
* Related guides: [How to manage customer's addresses in the storefront](https://docs.medusajs.com/resources/storefront-development/customers/addresses)
|
989
989
|
*
|
990
990
|
* @param body - The address's details.
|
991
991
|
* @param query - Configure the fields to retrieve in the customer.
|
@@ -1012,10 +1012,10 @@ class Store {
|
|
1012
1012
|
* This method updates the address of the logged-in customer. The customer must be logged in
|
1013
1013
|
* first with the {@link Auth.login} method.
|
1014
1014
|
*
|
1015
|
-
* It sends a request to the [Update Address](https://docs.medusajs.com/
|
1015
|
+
* It sends a request to the [Update Address](https://docs.medusajs.com/api/store#customers_postcustomersmeaddressesaddress_id)
|
1016
1016
|
* API route.
|
1017
1017
|
*
|
1018
|
-
* Related guides: [How to manage customer's addresses in the storefront](https://docs.medusajs.com/
|
1018
|
+
* Related guides: [How to manage customer's addresses in the storefront](https://docs.medusajs.com/resources/storefront-development/customers/addresses)
|
1019
1019
|
*
|
1020
1020
|
* @param addressId - The ID of the address to update.
|
1021
1021
|
* @param body - The details to update in the address.
|
@@ -1046,10 +1046,10 @@ class Store {
|
|
1046
1046
|
* This method retrieves the logged-in customer's address. The customer must be logged in
|
1047
1047
|
* first with the {@link Auth.login} method.
|
1048
1048
|
*
|
1049
|
-
* It sends a request to the [List Customer's Address](https://docs.medusajs.com/
|
1049
|
+
* It sends a request to the [List Customer's Address](https://docs.medusajs.com/api/store#customers_getcustomersmeaddresses)
|
1050
1050
|
* API route.
|
1051
1051
|
*
|
1052
|
-
* Related guides: [How to manage customer's addresses in the storefront](https://docs.medusajs.com/
|
1052
|
+
* Related guides: [How to manage customer's addresses in the storefront](https://docs.medusajs.com/resources/storefront-development/customers/addresses)
|
1053
1053
|
*
|
1054
1054
|
* @param query - Configure the fields to retrieve in the addresses.
|
1055
1055
|
* @param headers - Headers to pass in the request.
|
@@ -1091,7 +1091,7 @@ class Store {
|
|
1091
1091
|
* })
|
1092
1092
|
* ```
|
1093
1093
|
*
|
1094
|
-
* Learn more about the `fields` property in the [API reference](https://docs.medusajs.com/
|
1094
|
+
* Learn more about the `fields` property in the [API reference](https://docs.medusajs.com/api/store#select-fields-and-relations).
|
1095
1095
|
*/
|
1096
1096
|
listAddress: async (query, headers) => {
|
1097
1097
|
return this.client.fetch(`/store/customers/me/addresses`, {
|
@@ -1103,10 +1103,10 @@ class Store {
|
|
1103
1103
|
* This method retrieves an address of the logged-in customer. The customer must be logged in
|
1104
1104
|
* first with the {@link Auth.login} method.
|
1105
1105
|
*
|
1106
|
-
* It sends a request to the [Get Address](https://docs.medusajs.com/
|
1106
|
+
* It sends a request to the [Get Address](https://docs.medusajs.com/api/store#customers_getcustomersmeaddressesaddress_id)
|
1107
1107
|
* API route.
|
1108
1108
|
*
|
1109
|
-
* Related guides: [How to manage customer's addresses in the storefront](https://docs.medusajs.com/
|
1109
|
+
* Related guides: [How to manage customer's addresses in the storefront](https://docs.medusajs.com/resources/storefront-development/customers/addresses)
|
1110
1110
|
*
|
1111
1111
|
* @param addressId - The address's ID.
|
1112
1112
|
* @param query - Configure the fields to retrieve in the address.
|
@@ -1139,7 +1139,7 @@ class Store {
|
|
1139
1139
|
* })
|
1140
1140
|
* ```
|
1141
1141
|
*
|
1142
|
-
* Learn more about the `fields` property in the [API reference](https://docs.medusajs.com/
|
1142
|
+
* Learn more about the `fields` property in the [API reference](https://docs.medusajs.com/api/store#select-fields-and-relations).
|
1143
1143
|
*/
|
1144
1144
|
retrieveAddress: async (addressId, query, headers) => {
|
1145
1145
|
return this.client.fetch(`/store/customers/me/addresses/${addressId}`, {
|
@@ -1151,10 +1151,10 @@ class Store {
|
|
1151
1151
|
* This method deletes an address of the logged-in customer. The customer must be logged in
|
1152
1152
|
* first with the {@link Auth.login} method.
|
1153
1153
|
*
|
1154
|
-
* It sends a request to the [Remove Address](https://docs.medusajs.com/
|
1154
|
+
* It sends a request to the [Remove Address](https://docs.medusajs.com/api/store#customers_deletecustomersmeaddressesaddress_id)
|
1155
1155
|
* API route.
|
1156
1156
|
*
|
1157
|
-
* Related guides: [How to manage customer's addresses in the storefront](https://docs.medusajs.com/
|
1157
|
+
* Related guides: [How to manage customer's addresses in the storefront](https://docs.medusajs.com/resources/storefront-development/customers/addresses)
|
1158
1158
|
*
|
1159
1159
|
* @param addressId - The address's ID.
|
1160
1160
|
* @param headers - Headers to pass in the request.
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@medusajs/js-sdk",
|
3
|
-
"version": "2.0.
|
3
|
+
"version": "2.0.1-snapshot-20241025090810",
|
4
4
|
"description": "SDK for the Medusa API",
|
5
5
|
"main": "dist/index.js",
|
6
6
|
"module": "dist/esm/index.js",
|
@@ -35,7 +35,7 @@
|
|
35
35
|
"typescript": "^5.6.2"
|
36
36
|
},
|
37
37
|
"dependencies": {
|
38
|
-
"@medusajs/types": "
|
38
|
+
"@medusajs/types": "2.0.1-snapshot-20241025090810",
|
39
39
|
"fetch-event-stream": "^0.1.5",
|
40
40
|
"qs": "^6.12.1"
|
41
41
|
},
|