@medusajs/js-sdk 0.0.2-snapshot-20240925105124 → 0.0.2-snapshot-20240926160837

Sign up to get free protection for your applications and to get access to all the features.
Files changed (189) hide show
  1. package/dist/esm/admin/api-key.d.ts +15 -0
  2. package/dist/esm/admin/api-key.d.ts.map +1 -0
  3. package/dist/esm/admin/api-key.js +75 -0
  4. package/dist/esm/admin/api-key.js.map +1 -0
  5. package/dist/esm/admin/campaign.d.ts +14 -0
  6. package/dist/esm/admin/campaign.d.ts.map +1 -0
  7. package/dist/esm/admin/campaign.js +66 -0
  8. package/dist/esm/admin/campaign.js.map +1 -0
  9. package/dist/esm/admin/claim.d.ts +30 -0
  10. package/dist/esm/admin/claim.d.ts.map +1 -0
  11. package/dist/esm/admin/claim.js +223 -0
  12. package/dist/esm/admin/claim.js.map +1 -0
  13. package/dist/esm/admin/currency.d.ts +10 -0
  14. package/dist/esm/admin/currency.d.ts.map +1 -0
  15. package/dist/esm/admin/currency.js +31 -0
  16. package/dist/esm/admin/currency.js.map +1 -0
  17. package/dist/esm/admin/customer-group.d.ts +14 -0
  18. package/dist/esm/admin/customer-group.d.ts.map +1 -0
  19. package/dist/esm/admin/customer-group.js +70 -0
  20. package/dist/esm/admin/customer-group.js.map +1 -0
  21. package/dist/esm/admin/customer.d.ts +21 -0
  22. package/dist/esm/admin/customer.d.ts.map +1 -0
  23. package/dist/esm/admin/customer.js +59 -0
  24. package/dist/esm/admin/customer.js.map +1 -0
  25. package/dist/esm/admin/exchange.d.ts +30 -0
  26. package/dist/esm/admin/exchange.d.ts.map +1 -0
  27. package/dist/esm/admin/exchange.js +223 -0
  28. package/dist/esm/admin/exchange.js.map +1 -0
  29. package/dist/esm/admin/fulfillment-provider.d.ts +9 -0
  30. package/dist/esm/admin/fulfillment-provider.d.ts.map +1 -0
  31. package/dist/esm/admin/fulfillment-provider.js +24 -0
  32. package/dist/esm/admin/fulfillment-provider.js.map +1 -0
  33. package/dist/esm/admin/fulfillment-set.d.ts +13 -0
  34. package/dist/esm/admin/fulfillment-set.d.ts.map +1 -0
  35. package/dist/esm/admin/fulfillment-set.js +60 -0
  36. package/dist/esm/admin/fulfillment-set.js.map +1 -0
  37. package/dist/esm/admin/fulfillment.d.ts +11 -0
  38. package/dist/esm/admin/fulfillment.d.ts.map +1 -0
  39. package/dist/esm/admin/fulfillment.js +44 -0
  40. package/dist/esm/admin/fulfillment.js.map +1 -0
  41. package/dist/esm/admin/index.d.ts +87 -0
  42. package/dist/esm/admin/index.d.ts.map +1 -0
  43. package/dist/esm/admin/index.js +87 -0
  44. package/dist/esm/admin/index.js.map +1 -0
  45. package/dist/esm/admin/inventory-item.d.ts +17 -0
  46. package/dist/esm/admin/inventory-item.d.ts.map +1 -0
  47. package/dist/esm/admin/inventory-item.js +95 -0
  48. package/dist/esm/admin/inventory-item.js.map +1 -0
  49. package/dist/esm/admin/invite.d.ts +26 -0
  50. package/dist/esm/admin/invite.d.ts.map +1 -0
  51. package/dist/esm/admin/invite.js +79 -0
  52. package/dist/esm/admin/invite.js.map +1 -0
  53. package/dist/esm/admin/notification.d.ts +10 -0
  54. package/dist/esm/admin/notification.d.ts.map +1 -0
  55. package/dist/esm/admin/notification.js +33 -0
  56. package/dist/esm/admin/notification.js.map +1 -0
  57. package/dist/esm/admin/order-edit.d.ts +16 -0
  58. package/dist/esm/admin/order-edit.d.ts.map +1 -0
  59. package/dist/esm/admin/order-edit.js +91 -0
  60. package/dist/esm/admin/order-edit.js.map +1 -0
  61. package/dist/esm/admin/order.d.ts +32 -0
  62. package/dist/esm/admin/order.d.ts.map +1 -0
  63. package/dist/esm/admin/order.js +94 -0
  64. package/dist/esm/admin/order.js.map +1 -0
  65. package/dist/esm/admin/payment-collection.d.ts +13 -0
  66. package/dist/esm/admin/payment-collection.d.ts.map +1 -0
  67. package/dist/esm/admin/payment-collection.js +59 -0
  68. package/dist/esm/admin/payment-collection.js.map +1 -0
  69. package/dist/esm/admin/payment.d.ts +13 -0
  70. package/dist/esm/admin/payment.d.ts.map +1 -0
  71. package/dist/esm/admin/payment.js +59 -0
  72. package/dist/esm/admin/payment.js.map +1 -0
  73. package/dist/esm/admin/price-list.d.ts +15 -0
  74. package/dist/esm/admin/price-list.d.ts.map +1 -0
  75. package/dist/esm/admin/price-list.js +81 -0
  76. package/dist/esm/admin/price-list.js.map +1 -0
  77. package/dist/esm/admin/price-preference.d.ts +13 -0
  78. package/dist/esm/admin/price-preference.d.ts.map +1 -0
  79. package/dist/esm/admin/price-preference.js +61 -0
  80. package/dist/esm/admin/price-preference.js.map +1 -0
  81. package/dist/esm/admin/product-category.d.ts +14 -0
  82. package/dist/esm/admin/product-category.d.ts.map +1 -0
  83. package/dist/esm/admin/product-category.js +69 -0
  84. package/dist/esm/admin/product-category.js.map +1 -0
  85. package/dist/esm/admin/product-collection.d.ts +14 -0
  86. package/dist/esm/admin/product-collection.d.ts.map +1 -0
  87. package/dist/esm/admin/product-collection.js +68 -0
  88. package/dist/esm/admin/product-collection.js.map +1 -0
  89. package/dist/esm/admin/product-tag.d.ts +13 -0
  90. package/dist/esm/admin/product-tag.d.ts.map +1 -0
  91. package/dist/esm/admin/product-tag.js +59 -0
  92. package/dist/esm/admin/product-tag.js.map +1 -0
  93. package/dist/esm/admin/product-type.d.ts +13 -0
  94. package/dist/esm/admin/product-type.d.ts.map +1 -0
  95. package/dist/esm/admin/product-type.js +59 -0
  96. package/dist/esm/admin/product-type.js.map +1 -0
  97. package/dist/esm/admin/product-variant.d.ts +9 -0
  98. package/dist/esm/admin/product-variant.d.ts.map +1 -0
  99. package/dist/esm/admin/product-variant.js +23 -0
  100. package/dist/esm/admin/product-variant.js.map +1 -0
  101. package/dist/esm/admin/product.d.ts +29 -0
  102. package/dist/esm/admin/product.d.ts.map +1 -0
  103. package/dist/esm/admin/product.js +211 -0
  104. package/dist/esm/admin/product.js.map +1 -0
  105. package/dist/esm/admin/promotion.d.ts +19 -0
  106. package/dist/esm/admin/promotion.d.ts.map +1 -0
  107. package/dist/esm/admin/promotion.js +110 -0
  108. package/dist/esm/admin/promotion.js.map +1 -0
  109. package/dist/esm/admin/refund-reasons.d.ts +9 -0
  110. package/dist/esm/admin/refund-reasons.d.ts.map +1 -0
  111. package/dist/esm/admin/refund-reasons.js +23 -0
  112. package/dist/esm/admin/refund-reasons.js.map +1 -0
  113. package/dist/esm/admin/region.d.ts +21 -0
  114. package/dist/esm/admin/region.d.ts.map +1 -0
  115. package/dist/esm/admin/region.js +59 -0
  116. package/dist/esm/admin/region.js.map +1 -0
  117. package/dist/esm/admin/reservation.d.ts +14 -0
  118. package/dist/esm/admin/reservation.d.ts.map +1 -0
  119. package/dist/esm/admin/reservation.js +62 -0
  120. package/dist/esm/admin/reservation.js.map +1 -0
  121. package/dist/esm/admin/return-reason.d.ts +13 -0
  122. package/dist/esm/admin/return-reason.d.ts.map +1 -0
  123. package/dist/esm/admin/return-reason.js +60 -0
  124. package/dist/esm/admin/return-reason.js.map +1 -0
  125. package/dist/esm/admin/return.d.ts +30 -0
  126. package/dist/esm/admin/return.d.ts.map +1 -0
  127. package/dist/esm/admin/return.js +224 -0
  128. package/dist/esm/admin/return.js.map +1 -0
  129. package/dist/esm/admin/sales-channel.d.ts +15 -0
  130. package/dist/esm/admin/sales-channel.d.ts.map +1 -0
  131. package/dist/esm/admin/sales-channel.js +79 -0
  132. package/dist/esm/admin/sales-channel.js.map +1 -0
  133. package/dist/esm/admin/shipping-option.d.ts +13 -0
  134. package/dist/esm/admin/shipping-option.d.ts.map +1 -0
  135. package/dist/esm/admin/shipping-option.js +61 -0
  136. package/dist/esm/admin/shipping-option.js.map +1 -0
  137. package/dist/esm/admin/shipping-profile.d.ts +13 -0
  138. package/dist/esm/admin/shipping-profile.d.ts.map +1 -0
  139. package/dist/esm/admin/shipping-profile.js +61 -0
  140. package/dist/esm/admin/shipping-profile.js.map +1 -0
  141. package/dist/esm/admin/stock-location.d.ts +16 -0
  142. package/dist/esm/admin/stock-location.d.ts.map +1 -0
  143. package/dist/esm/admin/stock-location.js +88 -0
  144. package/dist/esm/admin/stock-location.js.map +1 -0
  145. package/dist/esm/admin/store.d.ts +11 -0
  146. package/dist/esm/admin/store.d.ts.map +1 -0
  147. package/dist/esm/admin/store.js +43 -0
  148. package/dist/esm/admin/store.js.map +1 -0
  149. package/dist/esm/admin/tax-rate.d.ts +13 -0
  150. package/dist/esm/admin/tax-rate.d.ts.map +1 -0
  151. package/dist/esm/admin/tax-rate.js +62 -0
  152. package/dist/esm/admin/tax-rate.js.map +1 -0
  153. package/dist/esm/admin/tax-region.d.ts +12 -0
  154. package/dist/esm/admin/tax-region.d.ts.map +1 -0
  155. package/dist/esm/admin/tax-region.js +53 -0
  156. package/dist/esm/admin/tax-region.js.map +1 -0
  157. package/dist/esm/admin/upload.d.ts +15 -0
  158. package/dist/esm/admin/upload.d.ts.map +1 -0
  159. package/dist/esm/admin/upload.js +59 -0
  160. package/dist/esm/admin/upload.js.map +1 -0
  161. package/dist/esm/admin/user.d.ts +14 -0
  162. package/dist/esm/admin/user.d.ts.map +1 -0
  163. package/dist/esm/admin/user.js +67 -0
  164. package/dist/esm/admin/user.js.map +1 -0
  165. package/dist/esm/admin/workflow-execution.d.ts +10 -0
  166. package/dist/esm/admin/workflow-execution.d.ts.map +1 -0
  167. package/dist/esm/admin/workflow-execution.js +30 -0
  168. package/dist/esm/admin/workflow-execution.js.map +1 -0
  169. package/dist/esm/auth/index.d.ts +17 -0
  170. package/dist/esm/auth/index.d.ts.map +1 -0
  171. package/dist/esm/auth/index.js +78 -0
  172. package/dist/esm/auth/index.js.map +1 -0
  173. package/dist/esm/client.d.ts +59 -0
  174. package/dist/esm/client.d.ts.map +1 -0
  175. package/dist/esm/client.js +229 -0
  176. package/dist/esm/client.js.map +1 -0
  177. package/dist/esm/index.d.ts +15 -0
  178. package/dist/esm/index.d.ts.map +1 -0
  179. package/dist/esm/index.js +15 -0
  180. package/dist/esm/index.js.map +1 -0
  181. package/dist/esm/store/index.d.ts +116 -0
  182. package/dist/esm/store/index.d.ts.map +1 -0
  183. package/dist/esm/store/index.js +240 -0
  184. package/dist/esm/store/index.js.map +1 -0
  185. package/dist/esm/types.d.ts +47 -0
  186. package/dist/esm/types.d.ts.map +1 -0
  187. package/dist/esm/types.js +2 -0
  188. package/dist/esm/types.js.map +1 -0
  189. package/package.json +7 -4
@@ -0,0 +1,116 @@
1
+ import { FindParams, HttpTypes, SelectParams } from "@medusajs/types";
2
+ import { Client } from "../client";
3
+ import { ClientHeaders } from "../types";
4
+ export declare class Store {
5
+ private client;
6
+ constructor(client: Client);
7
+ region: {
8
+ list: (query?: FindParams & HttpTypes.StoreRegionFilters, headers?: ClientHeaders) => Promise<HttpTypes.PaginatedResponse<{
9
+ regions: HttpTypes.StoreRegion[];
10
+ }>>;
11
+ retrieve: (id: string, query?: SelectParams, headers?: ClientHeaders) => Promise<{
12
+ region: HttpTypes.StoreRegion;
13
+ }>;
14
+ };
15
+ collection: {
16
+ list: (query?: FindParams & HttpTypes.StoreCollectionFilters, headers?: ClientHeaders) => Promise<HttpTypes.PaginatedResponse<{
17
+ collections: HttpTypes.StoreCollection[];
18
+ }>>;
19
+ retrieve: (id: string, query?: SelectParams, headers?: ClientHeaders) => Promise<{
20
+ collection: HttpTypes.StoreCollection;
21
+ }>;
22
+ };
23
+ category: {
24
+ list: (query?: HttpTypes.StoreProductCategoryParams, headers?: ClientHeaders) => Promise<HttpTypes.PaginatedResponse<{
25
+ product_categories: HttpTypes.StoreProductCategory[];
26
+ }>>;
27
+ retrieve: (id: string, query?: SelectParams, headers?: ClientHeaders) => Promise<{
28
+ product_category: HttpTypes.StoreProductCategory;
29
+ }>;
30
+ };
31
+ product: {
32
+ list: (query?: HttpTypes.StoreProductParams, headers?: ClientHeaders) => Promise<HttpTypes.StoreProductListResponse>;
33
+ retrieve: (id: string, query?: SelectParams, headers?: ClientHeaders) => Promise<HttpTypes.StoreProductResponse>;
34
+ };
35
+ cart: {
36
+ create: (body: HttpTypes.StoreCreateCart, query?: SelectParams, headers?: ClientHeaders) => Promise<{
37
+ cart: HttpTypes.StoreCart;
38
+ }>;
39
+ update: (id: string, body: HttpTypes.StoreUpdateCart, query?: SelectParams, headers?: ClientHeaders) => Promise<{
40
+ cart: HttpTypes.StoreCart;
41
+ }>;
42
+ retrieve: (id: string, query?: SelectParams, headers?: ClientHeaders) => Promise<{
43
+ cart: HttpTypes.StoreCart;
44
+ }>;
45
+ createLineItem: (cartId: string, body: HttpTypes.StoreAddCartLineItem, query?: SelectParams, headers?: ClientHeaders) => Promise<{
46
+ cart: HttpTypes.StoreCart;
47
+ }>;
48
+ updateLineItem: (cartId: string, lineItemId: string, body: HttpTypes.StoreUpdateCartLineItem, query?: SelectParams, headers?: ClientHeaders) => Promise<{
49
+ cart: HttpTypes.StoreCart;
50
+ }>;
51
+ deleteLineItem: (cartId: string, lineItemId: string, headers?: ClientHeaders) => Promise<HttpTypes.StoreLineItemDeleteResponse>;
52
+ addShippingMethod: (cartId: string, body: HttpTypes.StoreAddCartShippingMethods, query?: SelectParams, headers?: ClientHeaders) => Promise<{
53
+ cart: HttpTypes.StoreCart;
54
+ }>;
55
+ complete: (cartId: string, query?: SelectParams, headers?: ClientHeaders) => Promise<{
56
+ type: "order";
57
+ order: HttpTypes.StoreOrder;
58
+ } | {
59
+ type: "cart";
60
+ cart: HttpTypes.StoreCart;
61
+ error: {
62
+ message: string;
63
+ name: string;
64
+ type: string;
65
+ };
66
+ }>;
67
+ };
68
+ fulfillment: {
69
+ listCartOptions: (query?: FindParams & {
70
+ cart_id: string;
71
+ }, headers?: ClientHeaders) => Promise<{
72
+ shipping_options: HttpTypes.StoreCartShippingOption[];
73
+ }>;
74
+ };
75
+ payment: {
76
+ listPaymentProviders: (query?: FindParams & HttpTypes.StorePaymentProviderFilters, headers?: ClientHeaders) => Promise<{
77
+ payment_providers: HttpTypes.StorePaymentProvider[];
78
+ }>;
79
+ initiatePaymentSession: (cart: HttpTypes.StoreCart, body: Record<string, any>, query?: SelectParams, headers?: ClientHeaders) => Promise<{
80
+ payment_collection: HttpTypes.StorePaymentCollection;
81
+ }>;
82
+ };
83
+ order: {
84
+ list: (query?: FindParams & HttpTypes.StoreOrderFilters, headers?: ClientHeaders) => Promise<HttpTypes.PaginatedResponse<{
85
+ orders: HttpTypes.StoreOrder[];
86
+ }>>;
87
+ retrieve: (id: string, query?: SelectParams, headers?: ClientHeaders) => Promise<{
88
+ order: HttpTypes.StoreOrder;
89
+ }>;
90
+ };
91
+ customer: {
92
+ create: (body: HttpTypes.StoreCreateCustomer, query?: SelectParams, headers?: ClientHeaders) => Promise<{
93
+ customer: HttpTypes.StoreCustomer;
94
+ }>;
95
+ update: (body: HttpTypes.StoreUpdateCustomer, query?: SelectParams, headers?: ClientHeaders) => Promise<{
96
+ customer: HttpTypes.StoreCustomer;
97
+ }>;
98
+ retrieve: (query?: SelectParams, headers?: ClientHeaders) => Promise<{
99
+ customer: HttpTypes.StoreCustomer;
100
+ }>;
101
+ createAddress: (body: HttpTypes.StoreCreateCustomerAddress, query?: SelectParams, headers?: ClientHeaders) => Promise<{
102
+ customer: HttpTypes.StoreCustomer;
103
+ }>;
104
+ updateAddress: (addressId: string, body: HttpTypes.StoreUpdateCustomerAddress, query?: SelectParams, headers?: ClientHeaders) => Promise<{
105
+ customer: HttpTypes.StoreCustomer;
106
+ }>;
107
+ listAddress: (query?: FindParams & HttpTypes.StoreCustomerAddressFilters, headers?: ClientHeaders) => Promise<HttpTypes.PaginatedResponse<{
108
+ addresses: HttpTypes.StoreCustomerAddress[];
109
+ }>>;
110
+ retrieveAddress: (addressId: string, query?: SelectParams, headers?: ClientHeaders) => Promise<{
111
+ address: HttpTypes.StoreCustomerAddress;
112
+ }>;
113
+ deleteAddress: (addressId: string, headers?: ClientHeaders) => Promise<HttpTypes.StoreCustomerAddressDeleteResponse>;
114
+ };
115
+ }
116
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/store/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,U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V,aAAa;sBAEc,SAAS,CAAC,aAAa;;8BAWpD,UAAU,GAAG,SAAS,CAAC,2BAA2B,YAChD,aAAa;uBAGU,SAAS,CAAC,oBAAoB,EAAE;;qCAOtD,MAAM,UACT,YAAY,YACV,aAAa;qBAEa,SAAS,CAAC,oBAAoB;;mCAQnC,MAAM,YAAY,aAAa;MAQjE;CACF"}
@@ -0,0 +1,240 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ export class Store {
11
+ constructor(client) {
12
+ this.region = {
13
+ list: (query, headers) => __awaiter(this, void 0, void 0, function* () {
14
+ return this.client.fetch(`/store/regions`, {
15
+ query,
16
+ headers,
17
+ });
18
+ }),
19
+ retrieve: (id, query, headers) => __awaiter(this, void 0, void 0, function* () {
20
+ return this.client.fetch(`/store/regions/${id}`, {
21
+ query,
22
+ headers,
23
+ });
24
+ }),
25
+ };
26
+ this.collection = {
27
+ list: (query, headers) => __awaiter(this, void 0, void 0, function* () {
28
+ return this.client.fetch(`/store/collections`, {
29
+ query,
30
+ headers,
31
+ });
32
+ }),
33
+ retrieve: (id, query, headers) => __awaiter(this, void 0, void 0, function* () {
34
+ return this.client.fetch(`/store/collections/${id}`, {
35
+ query,
36
+ headers,
37
+ });
38
+ }),
39
+ };
40
+ this.category = {
41
+ list: (query, headers) => __awaiter(this, void 0, void 0, function* () {
42
+ return this.client.fetch(`/store/product-categories`, {
43
+ query,
44
+ headers,
45
+ });
46
+ }),
47
+ retrieve: (id, query, headers) => __awaiter(this, void 0, void 0, function* () {
48
+ return this.client.fetch(`/store/product-categories/${id}`, {
49
+ query,
50
+ headers,
51
+ });
52
+ }),
53
+ };
54
+ this.product = {
55
+ list: (query, headers) => __awaiter(this, void 0, void 0, function* () {
56
+ return this.client.fetch(`/store/products`, {
57
+ query,
58
+ headers,
59
+ });
60
+ }),
61
+ retrieve: (id, query, headers) => __awaiter(this, void 0, void 0, function* () {
62
+ return this.client.fetch(`/store/products/${id}`, {
63
+ query,
64
+ headers,
65
+ });
66
+ }),
67
+ };
68
+ this.cart = {
69
+ create: (body, query, headers) => __awaiter(this, void 0, void 0, function* () {
70
+ return this.client.fetch(`/store/carts`, {
71
+ method: "POST",
72
+ headers,
73
+ body,
74
+ query,
75
+ });
76
+ }),
77
+ update: (id, body, query, headers) => __awaiter(this, void 0, void 0, function* () {
78
+ return this.client.fetch(`/store/carts/${id}`, {
79
+ method: "POST",
80
+ headers,
81
+ body,
82
+ query,
83
+ });
84
+ }),
85
+ retrieve: (id, query, headers) => __awaiter(this, void 0, void 0, function* () {
86
+ return this.client.fetch(`/store/carts/${id}`, {
87
+ headers,
88
+ query,
89
+ });
90
+ }),
91
+ createLineItem: (cartId, body, query, headers) => __awaiter(this, void 0, void 0, function* () {
92
+ return this.client.fetch(`/store/carts/${cartId}/line-items`, {
93
+ method: "POST",
94
+ headers,
95
+ body,
96
+ query,
97
+ });
98
+ }),
99
+ updateLineItem: (cartId, lineItemId, body, query, headers) => __awaiter(this, void 0, void 0, function* () {
100
+ return this.client.fetch(`/store/carts/${cartId}/line-items/${lineItemId}`, {
101
+ method: "POST",
102
+ headers,
103
+ body,
104
+ query,
105
+ });
106
+ }),
107
+ deleteLineItem: (cartId, lineItemId, headers) => __awaiter(this, void 0, void 0, function* () {
108
+ return this.client.fetch(`/store/carts/${cartId}/line-items/${lineItemId}`, {
109
+ method: "DELETE",
110
+ headers,
111
+ });
112
+ }),
113
+ addShippingMethod: (cartId, body, query, headers) => __awaiter(this, void 0, void 0, function* () {
114
+ return this.client.fetch(`/store/carts/${cartId}/shipping-methods`, {
115
+ method: "POST",
116
+ headers,
117
+ body,
118
+ query,
119
+ });
120
+ }),
121
+ complete: (cartId, query, headers) => __awaiter(this, void 0, void 0, function* () {
122
+ return this.client.fetch(`/store/carts/${cartId}/complete`, {
123
+ method: "POST",
124
+ headers,
125
+ query,
126
+ });
127
+ }),
128
+ };
129
+ this.fulfillment = {
130
+ listCartOptions: (query, headers) => __awaiter(this, void 0, void 0, function* () {
131
+ return this.client.fetch(`/store/shipping-options`, {
132
+ headers,
133
+ query,
134
+ });
135
+ }),
136
+ };
137
+ this.payment = {
138
+ listPaymentProviders: (query, headers) => __awaiter(this, void 0, void 0, function* () {
139
+ return this.client.fetch(`/store/payment-providers`, {
140
+ headers,
141
+ query,
142
+ });
143
+ }),
144
+ initiatePaymentSession: (cart, body, query, headers) => __awaiter(this, void 0, void 0, function* () {
145
+ var _a;
146
+ let paymentCollectionId = (_a = cart.payment_collection) === null || _a === void 0 ? void 0 : _a.id;
147
+ if (!paymentCollectionId) {
148
+ const collectionBody = {
149
+ cart_id: cart.id,
150
+ };
151
+ paymentCollectionId = (yield this.client.fetch(`/store/payment-collections`, {
152
+ method: "POST",
153
+ headers,
154
+ body: collectionBody,
155
+ })).payment_collection.id;
156
+ }
157
+ return this.client.fetch(`/store/payment-collections/${paymentCollectionId}/payment-sessions`, {
158
+ method: "POST",
159
+ headers,
160
+ body,
161
+ query,
162
+ });
163
+ }),
164
+ };
165
+ this.order = {
166
+ list: (query, headers) => __awaiter(this, void 0, void 0, function* () {
167
+ return this.client.fetch(`/store/orders`, {
168
+ query,
169
+ headers,
170
+ });
171
+ }),
172
+ retrieve: (id, query, headers) => __awaiter(this, void 0, void 0, function* () {
173
+ return this.client.fetch(`/store/orders/${id}`, {
174
+ headers,
175
+ query,
176
+ });
177
+ }),
178
+ };
179
+ this.customer = {
180
+ create: (body, query, headers) => __awaiter(this, void 0, void 0, function* () {
181
+ return this.client.fetch(`/store/customers`, {
182
+ method: "POST",
183
+ headers,
184
+ body,
185
+ query,
186
+ });
187
+ }),
188
+ update: (body, query, headers) => __awaiter(this, void 0, void 0, function* () {
189
+ return this.client.fetch(`/store/customers/me`, {
190
+ method: "POST",
191
+ headers,
192
+ body,
193
+ query,
194
+ });
195
+ }),
196
+ retrieve: (query, headers) => __awaiter(this, void 0, void 0, function* () {
197
+ return this.client.fetch(`/store/customers/me`, {
198
+ query,
199
+ headers,
200
+ });
201
+ }),
202
+ createAddress: (body, query, headers) => __awaiter(this, void 0, void 0, function* () {
203
+ return this.client.fetch(`/store/customers/me/addresses`, {
204
+ method: "POST",
205
+ headers,
206
+ body,
207
+ query,
208
+ });
209
+ }),
210
+ updateAddress: (addressId, body, query, headers) => __awaiter(this, void 0, void 0, function* () {
211
+ return this.client.fetch(`/store/customers/me/addresses/${addressId}`, {
212
+ method: "POST",
213
+ headers,
214
+ body,
215
+ query,
216
+ });
217
+ }),
218
+ listAddress: (query, headers) => __awaiter(this, void 0, void 0, function* () {
219
+ return this.client.fetch(`/store/customers/me/addresses`, {
220
+ query,
221
+ headers,
222
+ });
223
+ }),
224
+ retrieveAddress: (addressId, query, headers) => __awaiter(this, void 0, void 0, function* () {
225
+ return this.client.fetch(`/store/customers/me/addresses/${addressId}`, {
226
+ query,
227
+ headers,
228
+ });
229
+ }),
230
+ deleteAddress: (addressId, headers) => __awaiter(this, void 0, void 0, function* () {
231
+ return this.client.fetch(`/store/customers/me/addresses/${addressId}`, {
232
+ method: "DELETE",
233
+ headers,
234
+ });
235
+ }),
236
+ };
237
+ this.client = client;
238
+ }
239
+ }
240
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/store/index.ts"],"names":[],"mappings":";;;;;;;;;AASA,MAAM,OAAO,KAAK;IAGhB,YAAY,MAAc;QAInB,WAAM,GAAG;YACd,IAAI,EAAE,CACJ,KAAiD,EACjD,OAAuB,EACvB,EAAE;gBACF,OAA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,EACvB,EAAE;gBACF,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CAEtB,+BAA+B,EAAE;oBACjC,KAAK;oBACL,OAAO;iBACR,CAAC,CAAA;YACJ,CAAC,CAAA;YACD,eAAe,EAAE,CACf,SAAiB,EACjB,KAAoB,EACpB,OAAuB,EACvB,EAAE;gBACF,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CACtB,iCAAiC,SAAS,EAAE,EAC5C;oBACE,KAAK;oBACL,OAAO;iBACR,CACF,CAAA;YACH,CAAC,CAAA;YACD,aAAa,EAAE,CAAO,SAAiB,EAAE,OAAuB,EAAE,EAAE;gBAClE,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CAEtB,iCAAiC,SAAS,EAAE,EAAE;oBAC9C,MAAM,EAAE,QAAQ;oBAChB,OAAO;iBACR,CAAC,CAAA;YACJ,CAAC,CAAA;SACF,CAAA;QA5aC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;IACtB,CAAC;CA4aF"}
@@ -0,0 +1,47 @@
1
+ export type Logger = {
2
+ error: (...messages: string[]) => void;
3
+ warn: (...messages: string[]) => void;
4
+ info: (...messages: string[]) => void;
5
+ debug: (...messages: string[]) => void;
6
+ };
7
+ export type Config = {
8
+ baseUrl: string;
9
+ globalHeaders?: ClientHeaders;
10
+ publishableKey?: string;
11
+ apiKey?: string;
12
+ auth?: {
13
+ type?: "jwt" | "session";
14
+ jwtTokenStorageKey?: string;
15
+ jwtTokenStorageMethod?: "local" | "session" | "memory";
16
+ };
17
+ logger?: Logger;
18
+ debug?: boolean;
19
+ };
20
+ export type FetchParams = Parameters<typeof fetch>;
21
+ export type ClientHeaders = Record<string, string | null | {
22
+ tags: string[];
23
+ }>;
24
+ export type FetchInput = FetchParams[0];
25
+ export type FetchArgs = Omit<RequestInit, "headers" | "body"> & {
26
+ query?: Record<string, any>;
27
+ headers?: ClientHeaders;
28
+ body?: RequestInit["body"] | Record<string, any>;
29
+ };
30
+ export type ClientFetch = (input: FetchInput, init?: FetchArgs) => Promise<Response>;
31
+ export interface ServerSentEventMessage {
32
+ /** Ignored by the client. */
33
+ comment?: string;
34
+ /** A string identifying the type of event described. */
35
+ event?: string;
36
+ /** The data field for the message. Split by new lines. */
37
+ data?: string;
38
+ /** The event ID to set the {@linkcode EventSource} object's last event ID value. */
39
+ id?: string | number;
40
+ /** The reconnection time. */
41
+ retry?: number;
42
+ }
43
+ export interface FetchStreamResponse {
44
+ stream: AsyncGenerator<ServerSentEventMessage, void, unknown> | null;
45
+ abort: () => void;
46
+ }
47
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,MAAM,GAAG;IACnB,KAAK,EAAE,CAAC,GAAG,QAAQ,EAAE,MAAM,EAAE,KAAK,IAAI,CAAA;IACtC,IAAI,EAAE,CAAC,GAAG,QAAQ,EAAE,MAAM,EAAE,KAAK,IAAI,CAAA;IACrC,IAAI,EAAE,CAAC,GAAG,QAAQ,EAAE,MAAM,EAAE,KAAK,IAAI,CAAA;IACrC,KAAK,EAAE,CAAC,GAAG,QAAQ,EAAE,MAAM,EAAE,KAAK,IAAI,CAAA;CACvC,CAAA;AAED,MAAM,MAAM,MAAM,GAAG;IACnB,OAAO,EAAE,MAAM,CAAA;IACf,aAAa,CAAC,EAAE,aAAa,CAAA;IAC7B,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,IAAI,CAAC,EAAE;QACL,IAAI,CAAC,EAAE,KAAK,GAAG,SAAS,CAAA;QACxB,kBAAkB,CAAC,EAAE,MAAM,CAAA;QAC3B,qBAAqB,CAAC,EAAE,OAAO,GAAG,SAAS,GAAG,QAAQ,CAAA;KACvD,CAAA;IACD,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,KAAK,CAAC,EAAE,OAAO,CAAA;CAChB,CAAA;AAED,M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":["../../src/types.ts"],"names":[],"mappings":""}
package/package.json CHANGED
@@ -1,10 +1,13 @@
1
1
  {
2
2
  "name": "@medusajs/js-sdk",
3
- "version": "0.0.2-snapshot-20240925105124",
3
+ "version": "0.0.2-snapshot-20240926160837",
4
4
  "description": "SDK for the Medusa API",
5
5
  "main": "dist/index.js",
6
+ "module": "dist/esm/index.js",
7
+ "types": "dist/index.d.ts",
6
8
  "exports": {
7
- ".": "./dist/index.js"
9
+ "import": "./dist/esm/index.js",
10
+ "require": "./dist/index.js"
8
11
  },
9
12
  "repository": {
10
13
  "type": "git",
@@ -32,12 +35,12 @@
32
35
  "typescript": "^5.6.2"
33
36
  },
34
37
  "dependencies": {
35
- "@medusajs/types": "1.12.0-snapshot-20240925105124",
38
+ "@medusajs/types": "1.12.0-snapshot-20240926160837",
36
39
  "fetch-event-stream": "^0.1.5",
37
40
  "qs": "^6.12.1"
38
41
  },
39
42
  "scripts": {
40
- "build": "rimraf dist && tsc --build",
43
+ "build": "rimraf dist && tsc -p tsconfig.json && tsc -p tsconfig.esm.json",
41
44
  "test": "jest --passWithNoTests --runInBand --bail --forceExit",
42
45
  "watch": "tsc --build --watch"
43
46
  }