@bzbs/react-api-client 2.1.2 → 2.1.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/dist/index.d.mts +37 -6
- package/dist/index.d.ts +37 -6
- package/dist/index.js +60 -11
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +60 -11
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -399,10 +399,10 @@ var AuthenticateApi = class extends BaseService {
|
|
|
399
399
|
* @param params.options - (Optional) Additional params for the request.
|
|
400
400
|
* @returns A promise that resolves to a ServiceResponse containing the login response.
|
|
401
401
|
*/
|
|
402
|
-
usernamePasswordLogin(params, requestOptions
|
|
402
|
+
usernamePasswordLogin(params, requestOptions) {
|
|
403
403
|
return __async(this, null, function* () {
|
|
404
404
|
return yield this.post(
|
|
405
|
-
|
|
405
|
+
"auth/buzzebees_login",
|
|
406
406
|
__spreadValues({
|
|
407
407
|
username: params.username,
|
|
408
408
|
password: params.password,
|
|
@@ -584,10 +584,10 @@ var AuthenticateApi = class extends BaseService {
|
|
|
584
584
|
* @param requestOptions - Optional request options.
|
|
585
585
|
* @returns A promise that resolves to a ServiceResponse containing the forget password response.
|
|
586
586
|
*/
|
|
587
|
-
forgetPassword(params, requestOptions
|
|
587
|
+
forgetPassword(params, requestOptions) {
|
|
588
588
|
return __async(this, null, function* () {
|
|
589
589
|
return yield this.get(
|
|
590
|
-
|
|
590
|
+
"profile/forgot_password",
|
|
591
591
|
__spreadValues({
|
|
592
592
|
id: params.contact,
|
|
593
593
|
type: params.type
|
|
@@ -608,10 +608,10 @@ var AuthenticateApi = class extends BaseService {
|
|
|
608
608
|
* @param requestOptions - (Optional) Additional options for the request.
|
|
609
609
|
* @returns A promise that resolves to a ServiceResponse containing the status response.
|
|
610
610
|
*/
|
|
611
|
-
resetPassword(params, requestOptions
|
|
611
|
+
resetPassword(params, requestOptions) {
|
|
612
612
|
return __async(this, null, function* () {
|
|
613
613
|
return yield this.post(
|
|
614
|
-
|
|
614
|
+
"profile/forgot_password",
|
|
615
615
|
__spreadValues({
|
|
616
616
|
id: params.contact,
|
|
617
617
|
refcode: params.refCode,
|
|
@@ -1081,6 +1081,8 @@ var CartApi = class extends BaseService {
|
|
|
1081
1081
|
* @param params.id - The ID of the item to add to the cart.
|
|
1082
1082
|
* @param params.mode - The mode off adding.
|
|
1083
1083
|
* @param params.qty - The quantity of the item.
|
|
1084
|
+
* @param params.clearCart - Whether to clear the cart before adding the item.
|
|
1085
|
+
* @param params.cartType - The cart type. Defaults to 'normal'.
|
|
1084
1086
|
* @param params.sideCampaignJson - The side campaign JSON.
|
|
1085
1087
|
* @param params.options - Additional options for adding the item to the cart.
|
|
1086
1088
|
* @param requestOptions - The options for the request.
|
|
@@ -1088,11 +1090,58 @@ var CartApi = class extends BaseService {
|
|
|
1088
1090
|
*/
|
|
1089
1091
|
addCart(params, requestOptions) {
|
|
1090
1092
|
return __async(this, null, function* () {
|
|
1093
|
+
var _a;
|
|
1091
1094
|
return yield this.post(
|
|
1092
|
-
`cart
|
|
1095
|
+
`cart/add`,
|
|
1093
1096
|
__spreadValues({
|
|
1094
1097
|
mode: params.mode,
|
|
1095
1098
|
qty: params.qty,
|
|
1099
|
+
clearCart: params.clearCart,
|
|
1100
|
+
cartType: (_a = params.cartType) != null ? _a : "normal",
|
|
1101
|
+
json: [
|
|
1102
|
+
{
|
|
1103
|
+
id: params.id,
|
|
1104
|
+
qty: String(params.qty)
|
|
1105
|
+
}
|
|
1106
|
+
],
|
|
1107
|
+
sideCampaignJson: params.sideCampaignJson
|
|
1108
|
+
}, params.options),
|
|
1109
|
+
{
|
|
1110
|
+
headers: __spreadValues({
|
|
1111
|
+
"Content-Type": "application/x-www-form-urlencoded"
|
|
1112
|
+
}, requestOptions == null ? void 0 : requestOptions.headers),
|
|
1113
|
+
data: requestOptions == null ? void 0 : requestOptions.data,
|
|
1114
|
+
params: requestOptions == null ? void 0 : requestOptions.params
|
|
1115
|
+
}
|
|
1116
|
+
);
|
|
1117
|
+
});
|
|
1118
|
+
}
|
|
1119
|
+
/**
|
|
1120
|
+
* Adds multiple items to the cart.
|
|
1121
|
+
*
|
|
1122
|
+
* @param params - The parameters.
|
|
1123
|
+
* @param params.items - The items to add to the cart.
|
|
1124
|
+
* @param params.mode - The mode of adding.
|
|
1125
|
+
* @param params.clearCart - Whether to clear the cart before adding the items.
|
|
1126
|
+
* @param params.cartType - The cart type. Defaults to 'normal'.
|
|
1127
|
+
* @param params.sideCampaignJson - The side campaign JSON.
|
|
1128
|
+
* @param params.options - Additional options for adding the items to the cart.
|
|
1129
|
+
* @param requestOptions - The options for the request.
|
|
1130
|
+
* @returns A promise that resolves to a ServiceResponse containing the cart count response.
|
|
1131
|
+
*/
|
|
1132
|
+
addCartMultiple(params, requestOptions) {
|
|
1133
|
+
return __async(this, null, function* () {
|
|
1134
|
+
var _a;
|
|
1135
|
+
return yield this.post(
|
|
1136
|
+
`cart/add`,
|
|
1137
|
+
__spreadValues({
|
|
1138
|
+
mode: params.mode,
|
|
1139
|
+
clearCart: params.clearCart,
|
|
1140
|
+
cartType: (_a = params.cartType) != null ? _a : "normal",
|
|
1141
|
+
json: params.items.map((item) => ({
|
|
1142
|
+
id: item.id,
|
|
1143
|
+
qty: String(item.qty)
|
|
1144
|
+
})),
|
|
1096
1145
|
sideCampaignJson: params.sideCampaignJson
|
|
1097
1146
|
}, params.options),
|
|
1098
1147
|
{
|
|
@@ -1846,10 +1895,10 @@ var ProfileApi = class extends BaseService {
|
|
|
1846
1895
|
* @param requestOptions - Optional request options.
|
|
1847
1896
|
* @returns A promise that resolves to a ServiceResponse containing the status response.
|
|
1848
1897
|
*/
|
|
1849
|
-
changePassword(params, requestOptions
|
|
1898
|
+
changePassword(params, requestOptions) {
|
|
1850
1899
|
return __async(this, null, function* () {
|
|
1851
1900
|
return yield this.post(
|
|
1852
|
-
|
|
1901
|
+
"profile/password_change",
|
|
1853
1902
|
__spreadValues({
|
|
1854
1903
|
current: params.current,
|
|
1855
1904
|
change: params.change
|
|
@@ -2112,10 +2161,10 @@ var RegistrationApi = class extends BaseService {
|
|
|
2112
2161
|
* @param requestOptions - The optional request options.
|
|
2113
2162
|
* @returns A promise that resolves to a service response containing the registration response.
|
|
2114
2163
|
*/
|
|
2115
|
-
register(params, requestOptions
|
|
2164
|
+
register(params, requestOptions) {
|
|
2116
2165
|
return __async(this, null, function* () {
|
|
2117
2166
|
return yield this.post(
|
|
2118
|
-
|
|
2167
|
+
"auth/registration",
|
|
2119
2168
|
__spreadValues({
|
|
2120
2169
|
app_id: params.appId,
|
|
2121
2170
|
uuid: params.uuid,
|