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.
- package/README.md +50 -25
- package/docs/sdks/auth/README.md +75 -0
- package/docs/sdks/customers/README.md +1 -80
- package/docs/sdks/customersapi/README.md +322 -0
- package/funcs/authLoginAnonymously.d.ts +16 -0
- package/funcs/authLoginAnonymously.d.ts.map +1 -0
- package/funcs/authLoginAnonymously.js +88 -0
- package/funcs/authLoginAnonymously.js.map +1 -0
- package/funcs/{ordersReturnsList.d.ts → customersAPIGetCustomersId.d.ts} +4 -4
- package/funcs/customersAPIGetCustomersId.d.ts.map +1 -0
- package/funcs/{ordersReturnsList.js → customersAPIGetCustomersId.js} +10 -13
- package/funcs/customersAPIGetCustomersId.js.map +1 -0
- package/funcs/{customersGetRecommendedProducts.d.ts → customersAPIGetRecommendedProducts.d.ts} +3 -3
- package/funcs/customersAPIGetRecommendedProducts.d.ts.map +1 -0
- package/funcs/{customersGetRecommendedProducts.js → customersAPIGetRecommendedProducts.js} +20 -7
- package/funcs/customersAPIGetRecommendedProducts.js.map +1 -0
- package/funcs/customersAPIPostCustomers.d.ts +17 -0
- package/funcs/customersAPIPostCustomers.d.ts.map +1 -0
- package/funcs/customersAPIPostCustomers.js +96 -0
- package/funcs/customersAPIPostCustomers.js.map +1 -0
- package/funcs/customersAPIPutCustomersId.d.ts +16 -0
- package/funcs/customersAPIPutCustomersId.d.ts.map +1 -0
- package/funcs/customersAPIPutCustomersId.js +98 -0
- package/funcs/customersAPIPutCustomersId.js.map +1 -0
- package/lib/config.d.ts +2 -2
- package/lib/config.js +2 -2
- package/models/components/business.d.ts +31 -0
- package/models/components/business.d.ts.map +1 -0
- package/models/components/business.js +71 -0
- package/models/components/business.js.map +1 -0
- package/models/components/cart.d.ts +1 -1
- package/models/components/cart.d.ts.map +1 -1
- package/models/components/cart.js +5 -5
- package/models/components/cart.js.map +1 -1
- package/models/components/createcustomer.d.ts +29 -0
- package/models/components/createcustomer.d.ts.map +1 -0
- package/models/components/createcustomer.js +54 -0
- package/models/components/createcustomer.js.map +1 -0
- package/models/components/{customeraddress.d.ts → customeraddressinput.d.ts} +29 -29
- package/models/components/customeraddressinput.d.ts.map +1 -0
- package/models/components/{customeraddress.js → customeraddressinput.js} +30 -30
- package/models/components/customeraddressinput.js.map +1 -0
- package/models/components/customerdetail.d.ts +51 -0
- package/models/components/customerdetail.d.ts.map +1 -0
- package/models/components/customerdetail.js +88 -0
- package/models/components/customerdetail.js.map +1 -0
- package/models/components/index.d.ts +6 -3
- package/models/components/index.d.ts.map +1 -1
- package/models/components/index.js +6 -3
- package/models/components/index.js.map +1 -1
- package/models/components/orderdetail.d.ts +1 -1
- package/models/components/orderdetail.d.ts.map +1 -1
- package/models/components/orderdetail.js +5 -5
- package/models/components/orderdetail.js.map +1 -1
- package/models/components/recommendedproduct.d.ts +149 -0
- package/models/components/recommendedproduct.d.ts.map +1 -0
- package/models/components/recommendedproduct.js +230 -0
- package/models/components/recommendedproduct.js.map +1 -0
- package/models/components/updatecustomer.d.ts +26 -0
- package/models/components/updatecustomer.d.ts.map +1 -0
- package/models/components/updatecustomer.js +51 -0
- package/models/components/updatecustomer.js.map +1 -0
- package/models/operations/getcustomersid.d.ts +82 -0
- package/models/operations/getcustomersid.d.ts.map +1 -0
- package/models/operations/getcustomersid.js +106 -0
- package/models/operations/getcustomersid.js.map +1 -0
- package/models/operations/getrecommendedproducts.d.ts +82 -0
- package/models/operations/getrecommendedproducts.d.ts.map +1 -0
- package/models/operations/getrecommendedproducts.js +93 -0
- package/models/operations/getrecommendedproducts.js.map +1 -0
- package/models/operations/index.d.ts +5 -2
- package/models/operations/index.d.ts.map +1 -1
- package/models/operations/index.js +5 -2
- package/models/operations/index.js.map +1 -1
- package/models/operations/postauthanonymous.d.ts +101 -0
- package/models/operations/postauthanonymous.d.ts.map +1 -0
- package/models/operations/postauthanonymous.js +124 -0
- package/models/operations/postauthanonymous.js.map +1 -0
- package/models/operations/postcustomers.d.ts +56 -0
- package/models/operations/postcustomers.d.ts.map +1 -0
- package/models/operations/postcustomers.js +87 -0
- package/models/operations/postcustomers.js.map +1 -0
- package/models/operations/putcustomersid.d.ts +84 -0
- package/models/operations/putcustomersid.d.ts.map +1 -0
- package/models/operations/putcustomersid.js +120 -0
- package/models/operations/putcustomersid.js.map +1 -0
- package/package.json +1 -1
- package/sdk/auth.d.ts +8 -0
- package/sdk/auth.d.ts.map +1 -1
- package/sdk/auth.js +11 -0
- package/sdk/auth.js.map +1 -1
- package/sdk/customers.d.ts +1 -9
- package/sdk/customers.d.ts.map +1 -1
- package/sdk/customers.js +0 -11
- package/sdk/customers.js.map +1 -1
- package/sdk/customersapi.d.ts +34 -0
- package/sdk/customersapi.d.ts.map +1 -0
- package/sdk/customersapi.js +52 -0
- package/sdk/customersapi.js.map +1 -0
- package/sdk/orders.d.ts +0 -3
- package/sdk/orders.d.ts.map +1 -1
- package/sdk/orders.js +0 -5
- package/sdk/orders.js.map +1 -1
- package/sdk/sdk.d.ts +5 -2
- package/sdk/sdk.d.ts.map +1 -1
- package/sdk/sdk.js +7 -2
- package/sdk/sdk.js.map +1 -1
- package/src/funcs/authLoginAnonymously.ts +112 -0
- package/src/funcs/{ordersReturnsList.ts → customersAPIGetCustomersId.ts} +11 -14
- package/src/funcs/{customersGetRecommendedProducts.ts → customersAPIGetRecommendedProducts.ts} +28 -7
- package/src/funcs/customersAPIPostCustomers.ts +133 -0
- package/src/funcs/customersAPIPutCustomersId.ts +136 -0
- package/src/lib/config.ts +2 -2
- package/src/models/components/business.ts +64 -0
- package/src/models/components/cart.ts +1 -1
- package/src/models/components/createcustomer.ts +58 -0
- package/src/models/components/customerdetail.ts +109 -0
- package/src/models/components/index.ts +6 -3
- package/src/models/components/orderdetail.ts +1 -1
- package/src/models/components/recommendedproduct.ts +359 -0
- package/src/models/components/updatecustomer.ts +48 -0
- package/src/models/operations/getcustomersid.ts +153 -0
- package/src/models/operations/getrecommendedproducts.ts +140 -0
- package/src/models/operations/index.ts +5 -2
- package/src/models/operations/postauthanonymous.ts +190 -0
- package/src/models/operations/postcustomers.ts +110 -0
- package/src/models/operations/putcustomersid.ts +169 -0
- package/src/sdk/auth.ts +15 -0
- package/src/sdk/customers.ts +1 -16
- package/src/sdk/customersapi.ts +66 -0
- package/src/sdk/orders.ts +0 -6
- package/src/sdk/sdk.ts +9 -3
- package/docs/sdks/returns/README.md +0 -84
- package/funcs/customersGetRecommendedProducts.d.ts.map +0 -1
- package/funcs/customersGetRecommendedProducts.js.map +0 -1
- package/funcs/ordersReturnsList.d.ts.map +0 -1
- package/funcs/ordersReturnsList.js.map +0 -1
- package/models/components/customeraddress.d.ts.map +0 -1
- package/models/components/customeraddress.js.map +0 -1
- package/models/components/orderreturn.d.ts +0 -59
- package/models/components/orderreturn.d.ts.map +0 -1
- package/models/components/orderreturn.js +0 -165
- package/models/components/orderreturn.js.map +0 -1
- package/models/components/orderreturnitem.d.ts +0 -91
- package/models/components/orderreturnitem.d.ts.map +0 -1
- package/models/components/orderreturnitem.js +0 -130
- package/models/components/orderreturnitem.js.map +0 -1
- package/models/operations/getordersordernumberreturn.d.ts +0 -59
- package/models/operations/getordersordernumberreturn.d.ts.map +0 -1
- package/models/operations/getordersordernumberreturn.js +0 -99
- package/models/operations/getordersordernumberreturn.js.map +0 -1
- package/models/operations/getrecommended.d.ts +0 -56
- package/models/operations/getrecommended.d.ts.map +0 -1
- package/models/operations/getrecommended.js +0 -74
- package/models/operations/getrecommended.js.map +0 -1
- package/sdk/returns.d.ts +0 -12
- package/sdk/returns.d.ts.map +0 -1
- package/sdk/returns.js +0 -22
- package/sdk/returns.js.map +0 -1
- package/src/models/components/orderreturn.ts +0 -198
- package/src/models/components/orderreturnitem.ts +0 -152
- package/src/models/operations/getordersordernumberreturn.ts +0 -125
- package/src/models/operations/getrecommended.ts +0 -97
- package/src/sdk/returns.ts +0 -23
- 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
|
-
### [
|
|
95
|
+
### [customersAPI](docs/sdks/customersapi/README.md)
|
|
96
96
|
|
|
97
|
-
* [getRecommendedProducts](docs/sdks/
|
|
98
|
-
|
|
99
|
-
|
|
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
|
|
package/docs/sdks/auth/README.md
CHANGED
|
@@ -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 | */* |
|