ce-storefront 0.0.2 → 0.0.5

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.
Files changed (165) hide show
  1. package/README.md +50 -25
  2. package/docs/sdks/auth/README.md +75 -0
  3. package/docs/sdks/customers/README.md +1 -80
  4. package/docs/sdks/customersapi/README.md +322 -0
  5. package/funcs/authLoginAnonymously.d.ts +16 -0
  6. package/funcs/authLoginAnonymously.d.ts.map +1 -0
  7. package/funcs/authLoginAnonymously.js +88 -0
  8. package/funcs/authLoginAnonymously.js.map +1 -0
  9. package/funcs/{ordersReturnsList.d.ts → customersAPIGetCustomersId.d.ts} +4 -4
  10. package/funcs/customersAPIGetCustomersId.d.ts.map +1 -0
  11. package/funcs/{ordersReturnsList.js → customersAPIGetCustomersId.js} +10 -13
  12. package/funcs/customersAPIGetCustomersId.js.map +1 -0
  13. package/funcs/{customersGetRecommendedProducts.d.ts → customersAPIGetRecommendedProducts.d.ts} +3 -3
  14. package/funcs/customersAPIGetRecommendedProducts.d.ts.map +1 -0
  15. package/funcs/{customersGetRecommendedProducts.js → customersAPIGetRecommendedProducts.js} +20 -7
  16. package/funcs/customersAPIGetRecommendedProducts.js.map +1 -0
  17. package/funcs/customersAPIPostCustomers.d.ts +17 -0
  18. package/funcs/customersAPIPostCustomers.d.ts.map +1 -0
  19. package/funcs/customersAPIPostCustomers.js +96 -0
  20. package/funcs/customersAPIPostCustomers.js.map +1 -0
  21. package/funcs/customersAPIPutCustomersId.d.ts +16 -0
  22. package/funcs/customersAPIPutCustomersId.d.ts.map +1 -0
  23. package/funcs/customersAPIPutCustomersId.js +98 -0
  24. package/funcs/customersAPIPutCustomersId.js.map +1 -0
  25. package/lib/config.d.ts +2 -2
  26. package/lib/config.js +2 -2
  27. package/models/components/business.d.ts +31 -0
  28. package/models/components/business.d.ts.map +1 -0
  29. package/models/components/business.js +71 -0
  30. package/models/components/business.js.map +1 -0
  31. package/models/components/cart.d.ts +1 -1
  32. package/models/components/cart.d.ts.map +1 -1
  33. package/models/components/cart.js +5 -5
  34. package/models/components/cart.js.map +1 -1
  35. package/models/components/createcustomer.d.ts +29 -0
  36. package/models/components/createcustomer.d.ts.map +1 -0
  37. package/models/components/createcustomer.js +54 -0
  38. package/models/components/createcustomer.js.map +1 -0
  39. package/models/components/{customeraddress.d.ts → customeraddressinput.d.ts} +29 -29
  40. package/models/components/customeraddressinput.d.ts.map +1 -0
  41. package/models/components/{customeraddress.js → customeraddressinput.js} +30 -30
  42. package/models/components/customeraddressinput.js.map +1 -0
  43. package/models/components/customerdetail.d.ts +51 -0
  44. package/models/components/customerdetail.d.ts.map +1 -0
  45. package/models/components/customerdetail.js +88 -0
  46. package/models/components/customerdetail.js.map +1 -0
  47. package/models/components/index.d.ts +6 -3
  48. package/models/components/index.d.ts.map +1 -1
  49. package/models/components/index.js +6 -3
  50. package/models/components/index.js.map +1 -1
  51. package/models/components/orderdetail.d.ts +1 -1
  52. package/models/components/orderdetail.d.ts.map +1 -1
  53. package/models/components/orderdetail.js +5 -5
  54. package/models/components/orderdetail.js.map +1 -1
  55. package/models/components/recommendedproduct.d.ts +149 -0
  56. package/models/components/recommendedproduct.d.ts.map +1 -0
  57. package/models/components/recommendedproduct.js +230 -0
  58. package/models/components/recommendedproduct.js.map +1 -0
  59. package/models/components/updatecustomer.d.ts +26 -0
  60. package/models/components/updatecustomer.d.ts.map +1 -0
  61. package/models/components/updatecustomer.js +51 -0
  62. package/models/components/updatecustomer.js.map +1 -0
  63. package/models/operations/getcustomersid.d.ts +82 -0
  64. package/models/operations/getcustomersid.d.ts.map +1 -0
  65. package/models/operations/getcustomersid.js +106 -0
  66. package/models/operations/getcustomersid.js.map +1 -0
  67. package/models/operations/getrecommendedproducts.d.ts +82 -0
  68. package/models/operations/getrecommendedproducts.d.ts.map +1 -0
  69. package/models/operations/getrecommendedproducts.js +93 -0
  70. package/models/operations/getrecommendedproducts.js.map +1 -0
  71. package/models/operations/index.d.ts +5 -2
  72. package/models/operations/index.d.ts.map +1 -1
  73. package/models/operations/index.js +5 -2
  74. package/models/operations/index.js.map +1 -1
  75. package/models/operations/postauthanonymous.d.ts +101 -0
  76. package/models/operations/postauthanonymous.d.ts.map +1 -0
  77. package/models/operations/postauthanonymous.js +124 -0
  78. package/models/operations/postauthanonymous.js.map +1 -0
  79. package/models/operations/postcustomers.d.ts +56 -0
  80. package/models/operations/postcustomers.d.ts.map +1 -0
  81. package/models/operations/postcustomers.js +87 -0
  82. package/models/operations/postcustomers.js.map +1 -0
  83. package/models/operations/putcustomersid.d.ts +84 -0
  84. package/models/operations/putcustomersid.d.ts.map +1 -0
  85. package/models/operations/putcustomersid.js +120 -0
  86. package/models/operations/putcustomersid.js.map +1 -0
  87. package/package.json +1 -1
  88. package/sdk/auth.d.ts +8 -0
  89. package/sdk/auth.d.ts.map +1 -1
  90. package/sdk/auth.js +11 -0
  91. package/sdk/auth.js.map +1 -1
  92. package/sdk/customers.d.ts +1 -9
  93. package/sdk/customers.d.ts.map +1 -1
  94. package/sdk/customers.js +0 -11
  95. package/sdk/customers.js.map +1 -1
  96. package/sdk/customersapi.d.ts +34 -0
  97. package/sdk/customersapi.d.ts.map +1 -0
  98. package/sdk/customersapi.js +52 -0
  99. package/sdk/customersapi.js.map +1 -0
  100. package/sdk/orders.d.ts +0 -3
  101. package/sdk/orders.d.ts.map +1 -1
  102. package/sdk/orders.js +0 -5
  103. package/sdk/orders.js.map +1 -1
  104. package/sdk/sdk.d.ts +5 -2
  105. package/sdk/sdk.d.ts.map +1 -1
  106. package/sdk/sdk.js +7 -2
  107. package/sdk/sdk.js.map +1 -1
  108. package/src/funcs/authLoginAnonymously.ts +112 -0
  109. package/src/funcs/{ordersReturnsList.ts → customersAPIGetCustomersId.ts} +11 -14
  110. package/src/funcs/{customersGetRecommendedProducts.ts → customersAPIGetRecommendedProducts.ts} +28 -7
  111. package/src/funcs/customersAPIPostCustomers.ts +133 -0
  112. package/src/funcs/customersAPIPutCustomersId.ts +136 -0
  113. package/src/lib/config.ts +2 -2
  114. package/src/models/components/business.ts +64 -0
  115. package/src/models/components/cart.ts +1 -1
  116. package/src/models/components/createcustomer.ts +58 -0
  117. package/src/models/components/customerdetail.ts +109 -0
  118. package/src/models/components/index.ts +6 -3
  119. package/src/models/components/orderdetail.ts +1 -1
  120. package/src/models/components/recommendedproduct.ts +359 -0
  121. package/src/models/components/updatecustomer.ts +48 -0
  122. package/src/models/operations/getcustomersid.ts +153 -0
  123. package/src/models/operations/getrecommendedproducts.ts +140 -0
  124. package/src/models/operations/index.ts +5 -2
  125. package/src/models/operations/postauthanonymous.ts +190 -0
  126. package/src/models/operations/postcustomers.ts +110 -0
  127. package/src/models/operations/putcustomersid.ts +169 -0
  128. package/src/sdk/auth.ts +15 -0
  129. package/src/sdk/customers.ts +1 -16
  130. package/src/sdk/customersapi.ts +66 -0
  131. package/src/sdk/orders.ts +0 -6
  132. package/src/sdk/sdk.ts +9 -3
  133. package/docs/sdks/returns/README.md +0 -84
  134. package/funcs/customersGetRecommendedProducts.d.ts.map +0 -1
  135. package/funcs/customersGetRecommendedProducts.js.map +0 -1
  136. package/funcs/ordersReturnsList.d.ts.map +0 -1
  137. package/funcs/ordersReturnsList.js.map +0 -1
  138. package/models/components/customeraddress.d.ts.map +0 -1
  139. package/models/components/customeraddress.js.map +0 -1
  140. package/models/components/orderreturn.d.ts +0 -59
  141. package/models/components/orderreturn.d.ts.map +0 -1
  142. package/models/components/orderreturn.js +0 -165
  143. package/models/components/orderreturn.js.map +0 -1
  144. package/models/components/orderreturnitem.d.ts +0 -91
  145. package/models/components/orderreturnitem.d.ts.map +0 -1
  146. package/models/components/orderreturnitem.js +0 -130
  147. package/models/components/orderreturnitem.js.map +0 -1
  148. package/models/operations/getordersordernumberreturn.d.ts +0 -59
  149. package/models/operations/getordersordernumberreturn.d.ts.map +0 -1
  150. package/models/operations/getordersordernumberreturn.js +0 -99
  151. package/models/operations/getordersordernumberreturn.js.map +0 -1
  152. package/models/operations/getrecommended.d.ts +0 -56
  153. package/models/operations/getrecommended.d.ts.map +0 -1
  154. package/models/operations/getrecommended.js +0 -74
  155. package/models/operations/getrecommended.js.map +0 -1
  156. package/sdk/returns.d.ts +0 -12
  157. package/sdk/returns.d.ts.map +0 -1
  158. package/sdk/returns.js +0 -22
  159. package/sdk/returns.js.map +0 -1
  160. package/src/models/components/orderreturn.ts +0 -198
  161. package/src/models/components/orderreturnitem.ts +0 -152
  162. package/src/models/operations/getordersordernumberreturn.ts +0 -125
  163. package/src/models/operations/getrecommended.ts +0 -97
  164. package/src/sdk/returns.ts +0 -23
  165. package/src/models/components/{customeraddress.ts → customeraddressinput.ts} +46 -46
package/README.md CHANGED
@@ -92,26 +92,12 @@ run();
92
92
 
93
93
  * [list](docs/sdks/categories/README.md#list) - List all categories
94
94
 
95
- ### [customers](docs/sdks/customers/README.md)
95
+ ### [customersAPI](docs/sdks/customersapi/README.md)
96
96
 
97
- * [getRecommendedProducts](docs/sdks/customers/README.md#getrecommendedproducts) - Retrieve recommended products
98
-
99
- ### [customers.addresses](docs/sdks/addresses/README.md)
100
-
101
- * [list](docs/sdks/addresses/README.md#list) - Retrieve all addresses
102
- * [add](docs/sdks/addresses/README.md#add) - Add address
103
- * [get](docs/sdks/addresses/README.md#get) - Retrieve particular address
104
- * [update](docs/sdks/addresses/README.md#update) - Update particular address
105
- * [delete](docs/sdks/addresses/README.md#delete) - Remove particular address
106
-
107
- ### [customers.loyalty](docs/sdks/loyalty/README.md)
108
-
109
- * [get](docs/sdks/loyalty/README.md#get) - Retrieve loyalty details
110
- * [listActivities](docs/sdks/loyalty/README.md#listactivities) - List all loyalty points activity
111
-
112
- ### [customers.reviews](docs/sdks/reviews/README.md)
113
-
114
- * [list](docs/sdks/reviews/README.md#list) - Retrieve all reviews
97
+ * [getRecommendedProducts](docs/sdks/customersapi/README.md#getrecommendedproducts) - List all recommended products
98
+ * [postCustomers](docs/sdks/customersapi/README.md#postcustomers) - Create customer
99
+ * [getCustomersId](docs/sdks/customersapi/README.md#getcustomersid) - Retrieve customer detail
100
+ * [putCustomersId](docs/sdks/customersapi/README.md#putcustomersid) - Update customer detail
115
101
 
116
102
  ### [carts](docs/sdks/carts/README.md)
117
103
 
@@ -146,6 +132,24 @@ run();
146
132
  * [add](docs/sdks/wishlist/README.md#add) - Add product to wishlist
147
133
  * [delete](docs/sdks/wishlist/README.md#delete) - Delete product from wishlist
148
134
 
135
+
136
+ ### [customers.addresses](docs/sdks/addresses/README.md)
137
+
138
+ * [list](docs/sdks/addresses/README.md#list) - Retrieve all addresses
139
+ * [add](docs/sdks/addresses/README.md#add) - Add address
140
+ * [get](docs/sdks/addresses/README.md#get) - Retrieve particular address
141
+ * [update](docs/sdks/addresses/README.md#update) - Update particular address
142
+ * [delete](docs/sdks/addresses/README.md#delete) - Remove particular address
143
+
144
+ ### [customers.loyalty](docs/sdks/loyalty/README.md)
145
+
146
+ * [get](docs/sdks/loyalty/README.md#get) - Retrieve loyalty details
147
+ * [listActivities](docs/sdks/loyalty/README.md#listactivities) - List all loyalty points activity
148
+
149
+ ### [customers.reviews](docs/sdks/reviews/README.md)
150
+
151
+ * [list](docs/sdks/reviews/README.md#list) - Retrieve all reviews
152
+
149
153
  ### [orders](docs/sdks/orders/README.md)
150
154
 
151
155
  * [create](docs/sdks/orders/README.md#create) - Create order
@@ -166,16 +170,13 @@ run();
166
170
 
167
171
  * [list](docs/sdks/cestorefrontpayments/README.md#list) - Retrieve order payments
168
172
 
169
- ### [orders.returns](docs/sdks/returns/README.md)
170
-
171
- * [list](docs/sdks/returns/README.md#list) - List all order returns
172
-
173
173
  ### [shipping](docs/sdks/shipping/README.md)
174
174
 
175
175
  * [checkPincodeServiceability](docs/sdks/shipping/README.md#checkpincodeserviceability) - Check pincode serviceability
176
176
 
177
177
  ### [auth](docs/sdks/auth/README.md)
178
178
 
179
+ * [loginAnonymously](docs/sdks/auth/README.md#loginanonymously) - Anonymous user
179
180
  * [loginWithPhone](docs/sdks/auth/README.md#loginwithphone) - Login with phone
180
181
  * [loginWithEmail](docs/sdks/auth/README.md#loginwithemail) - Login with email
181
182
  * [loginWithWhatsapp](docs/sdks/auth/README.md#loginwithwhatsapp) - Login with whatsapp
@@ -248,6 +249,7 @@ To read more about standalone functions, check [FUNCTIONS.md](./FUNCTIONS.md).
248
249
 
249
250
  - [analyticsTrack](docs/sdks/analytics/README.md#track)
250
251
  - [authGenerateOtp](docs/sdks/auth/README.md#generateotp)
252
+ - [authLoginAnonymously](docs/sdks/auth/README.md#loginanonymously)
251
253
  - [authLoginWithEmail](docs/sdks/auth/README.md#loginwithemail)
252
254
  - [authLoginWithPassword](docs/sdks/auth/README.md#loginwithpassword)
253
255
  - [authLoginWithPhone](docs/sdks/auth/README.md#loginwithphone)
@@ -294,12 +296,15 @@ To read more about standalone functions, check [FUNCTIONS.md](./FUNCTIONS.md).
294
296
  - [checkoutRemoveLoyaltyPoints](docs/sdks/checkout/README.md#removeloyaltypoints)
295
297
  - [checkoutUpdateAddress](docs/sdks/checkout/README.md#updateaddress)
296
298
  - [checkoutUseCreditBalance](docs/sdks/checkout/README.md#usecreditbalance)
299
+ - [customersAPIGetCustomersId](docs/sdks/customersapi/README.md#getcustomersid)
300
+ - [customersAPIGetRecommendedProducts](docs/sdks/customersapi/README.md#getrecommendedproducts)
301
+ - [customersAPIPostCustomers](docs/sdks/customersapi/README.md#postcustomers)
302
+ - [customersAPIPutCustomersId](docs/sdks/customersapi/README.md#putcustomersid)
297
303
  - [customersAddressesAdd](docs/sdks/addresses/README.md#add)
298
304
  - [customersAddressesDelete](docs/sdks/addresses/README.md#delete)
299
305
  - [customersAddressesGet](docs/sdks/addresses/README.md#get)
300
306
  - [customersAddressesList](docs/sdks/addresses/README.md#list)
301
307
  - [customersAddressesUpdate](docs/sdks/addresses/README.md#update)
302
- - [customersGetRecommendedProducts](docs/sdks/customers/README.md#getrecommendedproducts)
303
308
  - [customersLoyaltyGet](docs/sdks/loyalty/README.md#get)
304
309
  - [customersLoyaltyListActivities](docs/sdks/loyalty/README.md#listactivities)
305
310
  - [customersReviewsList](docs/sdks/reviews/README.md#list)
@@ -312,7 +317,6 @@ To read more about standalone functions, check [FUNCTIONS.md](./FUNCTIONS.md).
312
317
  - [ordersPaymentsList](docs/sdks/cestorefrontpayments/README.md#list)
313
318
  - [ordersRefundsList](docs/sdks/refunds/README.md#list)
314
319
  - [ordersRetryPayment](docs/sdks/orders/README.md#retrypayment)
315
- - [ordersReturnsList](docs/sdks/returns/README.md#list)
316
320
  - [ordersShipmentsList](docs/sdks/shipments/README.md#list)
317
321
  - [paymentsGenerateHash](docs/sdks/payments/README.md#generatehash)
318
322
  - [paymentsGetMethods](docs/sdks/payments/README.md#getmethods)
@@ -641,6 +645,27 @@ async function run() {
641
645
 
642
646
  run();
643
647
 
648
+ ```
649
+
650
+ ### Per-Operation Security Schemes
651
+
652
+ Some operations in this SDK require the security scheme to be specified at the request level. For example:
653
+ ```typescript
654
+ import { CeStorefront } from "ce-storefront";
655
+
656
+ const ceStorefront = new CeStorefront();
657
+
658
+ async function run() {
659
+ const result = await ceStorefront.auth.loginAnonymously({
660
+ xApiKey: "<YOUR_API_KEY_HERE>",
661
+ });
662
+
663
+ // Handle the result
664
+ console.log(result);
665
+ }
666
+
667
+ run();
668
+
644
669
  ```
645
670
  <!-- End Authentication [security] -->
646
671
 
@@ -5,6 +5,7 @@
5
5
 
6
6
  ### Available Operations
7
7
 
8
+ * [loginAnonymously](#loginanonymously) - Anonymous user
8
9
  * [loginWithPhone](#loginwithphone) - Login with phone
9
10
  * [loginWithEmail](#loginwithemail) - Login with email
10
11
  * [loginWithWhatsapp](#loginwithwhatsapp) - Login with whatsapp
@@ -18,6 +19,80 @@
18
19
  * [generateOtp](#generateotp) - Generate OTP
19
20
  * [verifyEmailPhone](#verifyemailphone) - Check verified email phone
20
21
 
22
+ ## loginAnonymously
23
+
24
+ This API’s focus is on anonymous users who have not undergone the formal account creation process. These anonymous users are associated with a unique identifier called a ULID, ensuring that even in the absence of a fully realized account, there is a distinct and trackable identity for each user.
25
+ To interact with the system, each anonymous user is issued an access token. This access token plays a dual role in the system: it serves as a means of authenticating the user and it also acts as a tool for authorization, determining what actions the authenticated user is permitted to perform.
26
+
27
+ ### Example Usage
28
+
29
+ ```typescript
30
+ import { CeStorefront } from "ce-storefront";
31
+
32
+ const ceStorefront = new CeStorefront();
33
+
34
+ async function run() {
35
+ const result = await ceStorefront.auth.loginAnonymously({
36
+ xApiKey: "<YOUR_API_KEY_HERE>",
37
+ });
38
+
39
+ // Handle the result
40
+ console.log(result)
41
+ }
42
+
43
+ run();
44
+ ```
45
+
46
+ ### Standalone function
47
+
48
+ The standalone function version of this method:
49
+
50
+ ```typescript
51
+ import { CeStorefrontCore } from "ce-storefront/core.js";
52
+ import { authLoginAnonymously } from "ce-storefront/funcs/authLoginAnonymously.js";
53
+
54
+ // Use `CeStorefrontCore` for best tree-shaking performance.
55
+ // You can create one instance of it to use across an application.
56
+ const ceStorefront = new CeStorefrontCore();
57
+
58
+ async function run() {
59
+ const res = await authLoginAnonymously(ceStorefront, {
60
+ xApiKey: "<YOUR_API_KEY_HERE>",
61
+ });
62
+
63
+ if (!res.ok) {
64
+ throw res.error;
65
+ }
66
+
67
+ const { value: result } = res;
68
+
69
+ // Handle the result
70
+ console.log(result)
71
+ }
72
+
73
+ run();
74
+ ```
75
+
76
+ ### Parameters
77
+
78
+ | Parameter | Type | Required | Description |
79
+ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
80
+ | `security` | [operations.PostAuthAnonymousSecurity](../../models/operations/postauthanonymoussecurity.md) | :heavy_check_mark: | The security requirements to use for the request. |
81
+ | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
82
+ | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
83
+ | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
84
+
85
+ ### Response
86
+
87
+ **Promise\<[operations.PostAuthAnonymousResponseBody](../../models/operations/postauthanonymousresponsebody.md)\>**
88
+
89
+ ### Errors
90
+
91
+ | Error Object | Status Code | Content Type |
92
+ | --------------- | --------------- | --------------- |
93
+ | errors.SDKError | 4xx-5xx | */* |
94
+
95
+
21
96
  ## loginWithPhone
22
97
 
23
98
  This API enables users to authenticate into the system using their phone number. It provides a secure way for users to log in by verifying their identity through a one-time password (OTP) sent to their registered phone.
@@ -1,81 +1,2 @@
1
1
  # Customers
2
- (*customers*)
3
-
4
- ## Overview
5
-
6
- ### Available Operations
7
-
8
- * [getRecommendedProducts](#getrecommendedproducts) - Retrieve recommended products
9
-
10
- ## getRecommendedProducts
11
-
12
- Retrieves a list of recommended products for a specified user based on their browsing history, past purchases, and indicated preferences. The recommended products are returned sorted by relevance, providing a personalized shopping experience for each user.
13
-
14
- ### Example Usage
15
-
16
- ```typescript
17
- import { CeStorefront } from "ce-storefront";
18
-
19
- const ceStorefront = new CeStorefront({
20
- authorization: "<YOUR_BEARER_TOKEN_HERE>",
21
- });
22
-
23
- async function run() {
24
- const result = await ceStorefront.customers.getRecommendedProducts();
25
-
26
- // Handle the result
27
- console.log(result)
28
- }
29
-
30
- run();
31
- ```
32
-
33
- ### Standalone function
34
-
35
- The standalone function version of this method:
36
-
37
- ```typescript
38
- import { CeStorefrontCore } from "ce-storefront/core.js";
39
- import { customersGetRecommendedProducts } from "ce-storefront/funcs/customersGetRecommendedProducts.js";
40
-
41
- // Use `CeStorefrontCore` for best tree-shaking performance.
42
- // You can create one instance of it to use across an application.
43
- const ceStorefront = new CeStorefrontCore({
44
- authorization: "<YOUR_BEARER_TOKEN_HERE>",
45
- });
46
-
47
- async function run() {
48
- const res = await customersGetRecommendedProducts(ceStorefront);
49
-
50
- if (!res.ok) {
51
- throw res.error;
52
- }
53
-
54
- const { value: result } = res;
55
-
56
- // Handle the result
57
- console.log(result)
58
- }
59
-
60
- run();
61
- ```
62
-
63
- ### Parameters
64
-
65
- | Parameter | Type | Required | Description |
66
- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
67
- | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
68
- | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
69
- | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
70
-
71
- ### Response
72
-
73
- **Promise\<[operations.GetRecommendedResponseBody](../../models/operations/getrecommendedresponsebody.md)\>**
74
-
75
- ### Errors
76
-
77
- | Error Object | Status Code | Content Type |
78
- | ------------------- | ------------------- | ------------------- |
79
- | errors.Unauthorized | 401 | application/json |
80
- | errors.NotFound | 404 | application/json |
81
- | errors.SDKError | 4xx-5xx | */* |
2
+ (*customers*)
@@ -0,0 +1,322 @@
1
+ # CustomersAPI
2
+ (*customersAPI*)
3
+
4
+ ## Overview
5
+
6
+ Customers API
7
+
8
+ ### Available Operations
9
+
10
+ * [getRecommendedProducts](#getrecommendedproducts) - List all recommended products
11
+ * [postCustomers](#postcustomers) - Create customer
12
+ * [getCustomersId](#getcustomersid) - Retrieve customer detail
13
+ * [putCustomersId](#putcustomersid) - Update customer detail
14
+
15
+ ## getRecommendedProducts
16
+
17
+ Retrieves a list of recommended products for a specified user based on their browsing history, past purchases, and indicated preferences. The recommended products are returned sorted by relevance, providing a personalized shopping experience for each user.
18
+
19
+ ### Example Usage
20
+
21
+ ```typescript
22
+ import { CeStorefront } from "ce-storefront";
23
+
24
+ const ceStorefront = new CeStorefront({
25
+ authorization: "<YOUR_BEARER_TOKEN_HERE>",
26
+ });
27
+
28
+ async function run() {
29
+ const result = await ceStorefront.customersAPI.getRecommendedProducts({
30
+ id: "<id>",
31
+ });
32
+
33
+ // Handle the result
34
+ console.log(result)
35
+ }
36
+
37
+ run();
38
+ ```
39
+
40
+ ### Standalone function
41
+
42
+ The standalone function version of this method:
43
+
44
+ ```typescript
45
+ import { CeStorefrontCore } from "ce-storefront/core.js";
46
+ import { customersAPIGetRecommendedProducts } from "ce-storefront/funcs/customersAPIGetRecommendedProducts.js";
47
+
48
+ // Use `CeStorefrontCore` for best tree-shaking performance.
49
+ // You can create one instance of it to use across an application.
50
+ const ceStorefront = new CeStorefrontCore({
51
+ authorization: "<YOUR_BEARER_TOKEN_HERE>",
52
+ });
53
+
54
+ async function run() {
55
+ const res = await customersAPIGetRecommendedProducts(ceStorefront, {
56
+ id: "<id>",
57
+ });
58
+
59
+ if (!res.ok) {
60
+ throw res.error;
61
+ }
62
+
63
+ const { value: result } = res;
64
+
65
+ // Handle the result
66
+ console.log(result)
67
+ }
68
+
69
+ run();
70
+ ```
71
+
72
+ ### Parameters
73
+
74
+ | Parameter | Type | Required | Description |
75
+ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
76
+ | `request` | [operations.GetRecommendedProductsRequest](../../models/operations/getrecommendedproductsrequest.md) | :heavy_check_mark: | The request object to use for the request. |
77
+ | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
78
+ | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
79
+ | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
80
+
81
+ ### Response
82
+
83
+ **Promise\<[operations.GetRecommendedProductsResponseBody](../../models/operations/getrecommendedproductsresponsebody.md)\>**
84
+
85
+ ### Errors
86
+
87
+ | Error Object | Status Code | Content Type |
88
+ | ------------------- | ------------------- | ------------------- |
89
+ | errors.Unauthorized | 401 | application/json |
90
+ | errors.NotFound | 404 | application/json |
91
+ | errors.SDKError | 4xx-5xx | */* |
92
+
93
+
94
+ ## postCustomers
95
+
96
+ Create customer
97
+
98
+ ### Example Usage
99
+
100
+ ```typescript
101
+ import { CeStorefront } from "ce-storefront";
102
+
103
+ const ceStorefront = new CeStorefront({
104
+ authorization: "<YOUR_BEARER_TOKEN_HERE>",
105
+ });
106
+
107
+ async function run() {
108
+ const result = await ceStorefront.customersAPI.postCustomers();
109
+
110
+ // Handle the result
111
+ console.log(result)
112
+ }
113
+
114
+ run();
115
+ ```
116
+
117
+ ### Standalone function
118
+
119
+ The standalone function version of this method:
120
+
121
+ ```typescript
122
+ import { CeStorefrontCore } from "ce-storefront/core.js";
123
+ import { customersAPIPostCustomers } from "ce-storefront/funcs/customersAPIPostCustomers.js";
124
+
125
+ // Use `CeStorefrontCore` for best tree-shaking performance.
126
+ // You can create one instance of it to use across an application.
127
+ const ceStorefront = new CeStorefrontCore({
128
+ authorization: "<YOUR_BEARER_TOKEN_HERE>",
129
+ });
130
+
131
+ async function run() {
132
+ const res = await customersAPIPostCustomers(ceStorefront);
133
+
134
+ if (!res.ok) {
135
+ throw res.error;
136
+ }
137
+
138
+ const { value: result } = res;
139
+
140
+ // Handle the result
141
+ console.log(result)
142
+ }
143
+
144
+ run();
145
+ ```
146
+
147
+ ### Parameters
148
+
149
+ | Parameter | Type | Required | Description |
150
+ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
151
+ | `request` | [components.CreateCustomer](../../models/components/createcustomer.md) | :heavy_check_mark: | The request object to use for the request. |
152
+ | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
153
+ | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
154
+ | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
155
+
156
+ ### Response
157
+
158
+ **Promise\<[operations.PostCustomersResponseBody](../../models/operations/postcustomersresponsebody.md)\>**
159
+
160
+ ### Errors
161
+
162
+ | Error Object | Status Code | Content Type |
163
+ | ------------------- | ------------------- | ------------------- |
164
+ | errors.BadRequest | 400 | application/json |
165
+ | errors.Unauthorized | 401 | application/json |
166
+ | errors.SDKError | 4xx-5xx | */* |
167
+
168
+
169
+ ## getCustomersId
170
+
171
+ Retrieve customer detail.
172
+
173
+ ### Example Usage
174
+
175
+ ```typescript
176
+ import { CeStorefront } from "ce-storefront";
177
+
178
+ const ceStorefront = new CeStorefront({
179
+ authorization: "<YOUR_BEARER_TOKEN_HERE>",
180
+ });
181
+
182
+ async function run() {
183
+ const result = await ceStorefront.customersAPI.getCustomersId({
184
+ id: "<id>",
185
+ });
186
+
187
+ // Handle the result
188
+ console.log(result)
189
+ }
190
+
191
+ run();
192
+ ```
193
+
194
+ ### Standalone function
195
+
196
+ The standalone function version of this method:
197
+
198
+ ```typescript
199
+ import { CeStorefrontCore } from "ce-storefront/core.js";
200
+ import { customersAPIGetCustomersId } from "ce-storefront/funcs/customersAPIGetCustomersId.js";
201
+
202
+ // Use `CeStorefrontCore` for best tree-shaking performance.
203
+ // You can create one instance of it to use across an application.
204
+ const ceStorefront = new CeStorefrontCore({
205
+ authorization: "<YOUR_BEARER_TOKEN_HERE>",
206
+ });
207
+
208
+ async function run() {
209
+ const res = await customersAPIGetCustomersId(ceStorefront, {
210
+ id: "<id>",
211
+ });
212
+
213
+ if (!res.ok) {
214
+ throw res.error;
215
+ }
216
+
217
+ const { value: result } = res;
218
+
219
+ // Handle the result
220
+ console.log(result)
221
+ }
222
+
223
+ run();
224
+ ```
225
+
226
+ ### Parameters
227
+
228
+ | Parameter | Type | Required | Description |
229
+ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
230
+ | `request` | [operations.GetCustomersIdRequest](../../models/operations/getcustomersidrequest.md) | :heavy_check_mark: | The request object to use for the request. |
231
+ | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
232
+ | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
233
+ | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
234
+
235
+ ### Response
236
+
237
+ **Promise\<[operations.GetCustomersIdResponseBody](../../models/operations/getcustomersidresponsebody.md)\>**
238
+
239
+ ### Errors
240
+
241
+ | Error Object | Status Code | Content Type |
242
+ | --------------- | --------------- | --------------- |
243
+ | errors.SDKError | 4xx-5xx | */* |
244
+
245
+
246
+ ## putCustomersId
247
+
248
+ Update customer detail
249
+
250
+ ### Example Usage
251
+
252
+ ```typescript
253
+ import { CeStorefront } from "ce-storefront";
254
+
255
+ const ceStorefront = new CeStorefront({
256
+ authorization: "<YOUR_BEARER_TOKEN_HERE>",
257
+ });
258
+
259
+ async function run() {
260
+ const result = await ceStorefront.customersAPI.putCustomersId({
261
+ id: "<id>",
262
+ });
263
+
264
+ // Handle the result
265
+ console.log(result)
266
+ }
267
+
268
+ run();
269
+ ```
270
+
271
+ ### Standalone function
272
+
273
+ The standalone function version of this method:
274
+
275
+ ```typescript
276
+ import { CeStorefrontCore } from "ce-storefront/core.js";
277
+ import { customersAPIPutCustomersId } from "ce-storefront/funcs/customersAPIPutCustomersId.js";
278
+
279
+ // Use `CeStorefrontCore` for best tree-shaking performance.
280
+ // You can create one instance of it to use across an application.
281
+ const ceStorefront = new CeStorefrontCore({
282
+ authorization: "<YOUR_BEARER_TOKEN_HERE>",
283
+ });
284
+
285
+ async function run() {
286
+ const res = await customersAPIPutCustomersId(ceStorefront, {
287
+ id: "<id>",
288
+ });
289
+
290
+ if (!res.ok) {
291
+ throw res.error;
292
+ }
293
+
294
+ const { value: result } = res;
295
+
296
+ // Handle the result
297
+ console.log(result)
298
+ }
299
+
300
+ run();
301
+ ```
302
+
303
+ ### Parameters
304
+
305
+ | Parameter | Type | Required | Description |
306
+ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
307
+ | `request` | [operations.PutCustomersIdRequest](../../models/operations/putcustomersidrequest.md) | :heavy_check_mark: | The request object to use for the request. |
308
+ | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
309
+ | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
310
+ | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
311
+
312
+ ### Response
313
+
314
+ **Promise\<[operations.PutCustomersIdResponseBody](../../models/operations/putcustomersidresponsebody.md)\>**
315
+
316
+ ### Errors
317
+
318
+ | Error Object | Status Code | Content Type |
319
+ | ------------------- | ------------------- | ------------------- |
320
+ | errors.BadRequest | 400 | application/json |
321
+ | errors.Unauthorized | 401 | application/json |
322
+ | errors.SDKError | 4xx-5xx | */* |