@bzbs/react-api-client 2.1.4 → 2.1.6
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 +30 -1
- package/dist/index.d.ts +30 -1
- package/dist/index.js +49 -8
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +49 -8
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -2001,6 +2001,7 @@ declare class CampaignApi extends BaseService {
|
|
|
2001
2001
|
}, requestOptions?: RequestOptions): Promise<ServiceResponse<RedeemResponse>>;
|
|
2002
2002
|
}
|
|
2003
2003
|
|
|
2004
|
+
type CartType = 'normal' | 'subscription' | 'evoucher' | 'marketplaceprivilege' | 'c2ptopup' | 'beesbooking' | 'dealshop';
|
|
2004
2005
|
declare class CartApi extends BaseService {
|
|
2005
2006
|
constructor(client: AxiosInstance, baseUrl: string);
|
|
2006
2007
|
/**
|
|
@@ -2011,6 +2012,7 @@ declare class CartApi extends BaseService {
|
|
|
2011
2012
|
* @param params.mode - The mode off adding.
|
|
2012
2013
|
* @param params.qty - The quantity of the item.
|
|
2013
2014
|
* @param params.clearCart - Whether to clear the cart before adding the item.
|
|
2015
|
+
* @param params.cartType - The cart type. Defaults to 'normal'.
|
|
2014
2016
|
* @param params.sideCampaignJson - The side campaign JSON.
|
|
2015
2017
|
* @param params.options - Additional options for adding the item to the cart.
|
|
2016
2018
|
* @param requestOptions - The options for the request.
|
|
@@ -2021,6 +2023,33 @@ declare class CartApi extends BaseService {
|
|
|
2021
2023
|
mode?: string;
|
|
2022
2024
|
qty?: number;
|
|
2023
2025
|
clearCart?: boolean;
|
|
2026
|
+
cartType?: CartType;
|
|
2027
|
+
sideCampaignJson?: string;
|
|
2028
|
+
options?: {
|
|
2029
|
+
[key: string]: unknown;
|
|
2030
|
+
};
|
|
2031
|
+
}, requestOptions?: RequestOptions): Promise<ServiceResponse<CartCountResponse>>;
|
|
2032
|
+
/**
|
|
2033
|
+
* Adds multiple items to the cart.
|
|
2034
|
+
*
|
|
2035
|
+
* @param params - The parameters.
|
|
2036
|
+
* @param params.items - The items to add to the cart.
|
|
2037
|
+
* @param params.mode - The mode of adding.
|
|
2038
|
+
* @param params.clearCart - Whether to clear the cart before adding the items.
|
|
2039
|
+
* @param params.cartType - The cart type. Defaults to 'normal'.
|
|
2040
|
+
* @param params.sideCampaignJson - The side campaign JSON.
|
|
2041
|
+
* @param params.options - Additional options for adding the items to the cart.
|
|
2042
|
+
* @param requestOptions - The options for the request.
|
|
2043
|
+
* @returns A promise that resolves to a ServiceResponse containing the cart count response.
|
|
2044
|
+
*/
|
|
2045
|
+
addCartMultiple(params: {
|
|
2046
|
+
items: {
|
|
2047
|
+
id: string;
|
|
2048
|
+
qty: number;
|
|
2049
|
+
}[];
|
|
2050
|
+
mode?: string;
|
|
2051
|
+
clearCart?: boolean;
|
|
2052
|
+
cartType?: CartType;
|
|
2024
2053
|
sideCampaignJson?: string;
|
|
2025
2054
|
options?: {
|
|
2026
2055
|
[key: string]: unknown;
|
|
@@ -3268,4 +3297,4 @@ declare class BzbsService {
|
|
|
3268
3297
|
setLineUrl(lineUrl: string): this;
|
|
3269
3298
|
}
|
|
3270
3299
|
|
|
3271
|
-
export { type AccessTokenResponse, type Address, AddressApi, type ApiResponse, type AppleToken, AuthenticateApi, type Badge, BadgeApi, BaseService, Blob, type Buzzebees, type BzbsErrorResponse, BzbsService, type Campaign, CampaignApi, type CampaignDetail, type CartAccessResponse, CartApi, type CartCountResponse, type Category, CategoryApi, type ChatMessage, type ClientError, type ConfirmOtpResponse, type Consent, ConsentApi, type ConsentVersion, type ConsentVersionValue, CouponApi, type CouponResponse, type CouponResponseData, type CreateStampResponse, type CrossPlatformFile, type Dashboard, DashboardApi, type Detail, type District, type ErrorResponse, type ExpiringPoints, type FavoriteResponse, type ForgetPasswordResponse, HistoryApi, type LikeForumResponse, LineApi, type LineAuthResponse, type LoginResponse, type Maintenance, type Mission, type Notification, NotificationApi, type OtpResponse, type Picture, type Place, PlaceApi, type PlaceService, PointApi, type PointBalance, type PointHistory, type PointLog, PointLogApi, type PointUnit, ProfileApi, type ProfileResponse, type Province, type Purchase, type RedeemResponse, RegistrationApi, type RegistrationResponse, RequestHelpApi, type RequestHelpCode, type RequestOptions, type ResumeResponse, type ServerError, type ServiceResponse, SettingApi, type Stamp, StampApi, type StampCampaign, type StampHistory, type StampProfileResponse, type StatusResponse, type Style, type SubCampaign, type SubCampaignStyle, type SubDistrict, type SuccessResponse, type Trace, type UpdatedPoints, type UseCampaignResponse, type ValidateOtpResponse, type Version, type ZipCode };
|
|
3300
|
+
export { type AccessTokenResponse, type Address, AddressApi, type ApiResponse, type AppleToken, AuthenticateApi, type Badge, BadgeApi, BaseService, Blob, type Buzzebees, type BzbsErrorResponse, BzbsService, type Campaign, CampaignApi, type CampaignDetail, type CartAccessResponse, CartApi, type CartCountResponse, type CartType, type Category, CategoryApi, type ChatMessage, type ClientError, type ConfirmOtpResponse, type Consent, ConsentApi, type ConsentVersion, type ConsentVersionValue, CouponApi, type CouponResponse, type CouponResponseData, type CreateStampResponse, type CrossPlatformFile, type Dashboard, DashboardApi, type Detail, type District, type ErrorResponse, type ExpiringPoints, type FavoriteResponse, type ForgetPasswordResponse, HistoryApi, type LikeForumResponse, LineApi, type LineAuthResponse, type LoginResponse, type Maintenance, type Mission, type Notification, NotificationApi, type OtpResponse, type Picture, type Place, PlaceApi, type PlaceService, PointApi, type PointBalance, type PointHistory, type PointLog, PointLogApi, type PointUnit, ProfileApi, type ProfileResponse, type Province, type Purchase, type RedeemResponse, RegistrationApi, type RegistrationResponse, RequestHelpApi, type RequestHelpCode, type RequestOptions, type ResumeResponse, type ServerError, type ServiceResponse, SettingApi, type Stamp, StampApi, type StampCampaign, type StampHistory, type StampProfileResponse, type StatusResponse, type Style, type SubCampaign, type SubCampaignStyle, type SubDistrict, type SuccessResponse, type Trace, type UpdatedPoints, type UseCampaignResponse, type ValidateOtpResponse, type Version, type ZipCode };
|
package/dist/index.d.ts
CHANGED
|
@@ -2001,6 +2001,7 @@ declare class CampaignApi extends BaseService {
|
|
|
2001
2001
|
}, requestOptions?: RequestOptions): Promise<ServiceResponse<RedeemResponse>>;
|
|
2002
2002
|
}
|
|
2003
2003
|
|
|
2004
|
+
type CartType = 'normal' | 'subscription' | 'evoucher' | 'marketplaceprivilege' | 'c2ptopup' | 'beesbooking' | 'dealshop';
|
|
2004
2005
|
declare class CartApi extends BaseService {
|
|
2005
2006
|
constructor(client: AxiosInstance, baseUrl: string);
|
|
2006
2007
|
/**
|
|
@@ -2011,6 +2012,7 @@ declare class CartApi extends BaseService {
|
|
|
2011
2012
|
* @param params.mode - The mode off adding.
|
|
2012
2013
|
* @param params.qty - The quantity of the item.
|
|
2013
2014
|
* @param params.clearCart - Whether to clear the cart before adding the item.
|
|
2015
|
+
* @param params.cartType - The cart type. Defaults to 'normal'.
|
|
2014
2016
|
* @param params.sideCampaignJson - The side campaign JSON.
|
|
2015
2017
|
* @param params.options - Additional options for adding the item to the cart.
|
|
2016
2018
|
* @param requestOptions - The options for the request.
|
|
@@ -2021,6 +2023,33 @@ declare class CartApi extends BaseService {
|
|
|
2021
2023
|
mode?: string;
|
|
2022
2024
|
qty?: number;
|
|
2023
2025
|
clearCart?: boolean;
|
|
2026
|
+
cartType?: CartType;
|
|
2027
|
+
sideCampaignJson?: string;
|
|
2028
|
+
options?: {
|
|
2029
|
+
[key: string]: unknown;
|
|
2030
|
+
};
|
|
2031
|
+
}, requestOptions?: RequestOptions): Promise<ServiceResponse<CartCountResponse>>;
|
|
2032
|
+
/**
|
|
2033
|
+
* Adds multiple items to the cart.
|
|
2034
|
+
*
|
|
2035
|
+
* @param params - The parameters.
|
|
2036
|
+
* @param params.items - The items to add to the cart.
|
|
2037
|
+
* @param params.mode - The mode of adding.
|
|
2038
|
+
* @param params.clearCart - Whether to clear the cart before adding the items.
|
|
2039
|
+
* @param params.cartType - The cart type. Defaults to 'normal'.
|
|
2040
|
+
* @param params.sideCampaignJson - The side campaign JSON.
|
|
2041
|
+
* @param params.options - Additional options for adding the items to the cart.
|
|
2042
|
+
* @param requestOptions - The options for the request.
|
|
2043
|
+
* @returns A promise that resolves to a ServiceResponse containing the cart count response.
|
|
2044
|
+
*/
|
|
2045
|
+
addCartMultiple(params: {
|
|
2046
|
+
items: {
|
|
2047
|
+
id: string;
|
|
2048
|
+
qty: number;
|
|
2049
|
+
}[];
|
|
2050
|
+
mode?: string;
|
|
2051
|
+
clearCart?: boolean;
|
|
2052
|
+
cartType?: CartType;
|
|
2024
2053
|
sideCampaignJson?: string;
|
|
2025
2054
|
options?: {
|
|
2026
2055
|
[key: string]: unknown;
|
|
@@ -3268,4 +3297,4 @@ declare class BzbsService {
|
|
|
3268
3297
|
setLineUrl(lineUrl: string): this;
|
|
3269
3298
|
}
|
|
3270
3299
|
|
|
3271
|
-
export { type AccessTokenResponse, type Address, AddressApi, type ApiResponse, type AppleToken, AuthenticateApi, type Badge, BadgeApi, BaseService, Blob, type Buzzebees, type BzbsErrorResponse, BzbsService, type Campaign, CampaignApi, type CampaignDetail, type CartAccessResponse, CartApi, type CartCountResponse, type Category, CategoryApi, type ChatMessage, type ClientError, type ConfirmOtpResponse, type Consent, ConsentApi, type ConsentVersion, type ConsentVersionValue, CouponApi, type CouponResponse, type CouponResponseData, type CreateStampResponse, type CrossPlatformFile, type Dashboard, DashboardApi, type Detail, type District, type ErrorResponse, type ExpiringPoints, type FavoriteResponse, type ForgetPasswordResponse, HistoryApi, type LikeForumResponse, LineApi, type LineAuthResponse, type LoginResponse, type Maintenance, type Mission, type Notification, NotificationApi, type OtpResponse, type Picture, type Place, PlaceApi, type PlaceService, PointApi, type PointBalance, type PointHistory, type PointLog, PointLogApi, type PointUnit, ProfileApi, type ProfileResponse, type Province, type Purchase, type RedeemResponse, RegistrationApi, type RegistrationResponse, RequestHelpApi, type RequestHelpCode, type RequestOptions, type ResumeResponse, type ServerError, type ServiceResponse, SettingApi, type Stamp, StampApi, type StampCampaign, type StampHistory, type StampProfileResponse, type StatusResponse, type Style, type SubCampaign, type SubCampaignStyle, type SubDistrict, type SuccessResponse, type Trace, type UpdatedPoints, type UseCampaignResponse, type ValidateOtpResponse, type Version, type ZipCode };
|
|
3300
|
+
export { type AccessTokenResponse, type Address, AddressApi, type ApiResponse, type AppleToken, AuthenticateApi, type Badge, BadgeApi, BaseService, Blob, type Buzzebees, type BzbsErrorResponse, BzbsService, type Campaign, CampaignApi, type CampaignDetail, type CartAccessResponse, CartApi, type CartCountResponse, type CartType, type Category, CategoryApi, type ChatMessage, type ClientError, type ConfirmOtpResponse, type Consent, ConsentApi, type ConsentVersion, type ConsentVersionValue, CouponApi, type CouponResponse, type CouponResponseData, type CreateStampResponse, type CrossPlatformFile, type Dashboard, DashboardApi, type Detail, type District, type ErrorResponse, type ExpiringPoints, type FavoriteResponse, type ForgetPasswordResponse, HistoryApi, type LikeForumResponse, LineApi, type LineAuthResponse, type LoginResponse, type Maintenance, type Mission, type Notification, NotificationApi, type OtpResponse, type Picture, type Place, PlaceApi, type PlaceService, PointApi, type PointBalance, type PointHistory, type PointLog, PointLogApi, type PointUnit, ProfileApi, type ProfileResponse, type Province, type Purchase, type RedeemResponse, RegistrationApi, type RegistrationResponse, RequestHelpApi, type RequestHelpCode, type RequestOptions, type ResumeResponse, type ServerError, type ServiceResponse, SettingApi, type Stamp, StampApi, type StampCampaign, type StampHistory, type StampProfileResponse, type StatusResponse, type Style, type SubCampaign, type SubCampaignStyle, type SubDistrict, type SuccessResponse, type Trace, type UpdatedPoints, type UseCampaignResponse, type ValidateOtpResponse, type Version, type ZipCode };
|
package/dist/index.js
CHANGED
|
@@ -1127,6 +1127,7 @@ var CartApi = class extends BaseService {
|
|
|
1127
1127
|
* @param params.mode - The mode off adding.
|
|
1128
1128
|
* @param params.qty - The quantity of the item.
|
|
1129
1129
|
* @param params.clearCart - Whether to clear the cart before adding the item.
|
|
1130
|
+
* @param params.cartType - The cart type. Defaults to 'normal'.
|
|
1130
1131
|
* @param params.sideCampaignJson - The side campaign JSON.
|
|
1131
1132
|
* @param params.options - Additional options for adding the item to the cart.
|
|
1132
1133
|
* @param requestOptions - The options for the request.
|
|
@@ -1134,18 +1135,60 @@ var CartApi = class extends BaseService {
|
|
|
1134
1135
|
*/
|
|
1135
1136
|
addCart(params, requestOptions) {
|
|
1136
1137
|
return __async(this, null, function* () {
|
|
1138
|
+
var _a;
|
|
1137
1139
|
return yield this.post(
|
|
1138
|
-
`cart
|
|
1140
|
+
`cart/add`,
|
|
1139
1141
|
__spreadValues({
|
|
1140
1142
|
mode: params.mode,
|
|
1141
1143
|
qty: params.qty,
|
|
1142
1144
|
clearCart: params.clearCart,
|
|
1145
|
+
cartType: (_a = params.cartType) != null ? _a : "normal",
|
|
1146
|
+
json: [
|
|
1147
|
+
{
|
|
1148
|
+
id: params.id,
|
|
1149
|
+
qty: String(params.qty)
|
|
1150
|
+
}
|
|
1151
|
+
],
|
|
1143
1152
|
sideCampaignJson: params.sideCampaignJson
|
|
1144
1153
|
}, params.options),
|
|
1145
1154
|
{
|
|
1146
|
-
headers:
|
|
1147
|
-
|
|
1148
|
-
|
|
1155
|
+
headers: requestOptions == null ? void 0 : requestOptions.headers,
|
|
1156
|
+
data: requestOptions == null ? void 0 : requestOptions.data,
|
|
1157
|
+
params: requestOptions == null ? void 0 : requestOptions.params
|
|
1158
|
+
}
|
|
1159
|
+
);
|
|
1160
|
+
});
|
|
1161
|
+
}
|
|
1162
|
+
/**
|
|
1163
|
+
* Adds multiple items to the cart.
|
|
1164
|
+
*
|
|
1165
|
+
* @param params - The parameters.
|
|
1166
|
+
* @param params.items - The items to add to the cart.
|
|
1167
|
+
* @param params.mode - The mode of adding.
|
|
1168
|
+
* @param params.clearCart - Whether to clear the cart before adding the items.
|
|
1169
|
+
* @param params.cartType - The cart type. Defaults to 'normal'.
|
|
1170
|
+
* @param params.sideCampaignJson - The side campaign JSON.
|
|
1171
|
+
* @param params.options - Additional options for adding the items to the cart.
|
|
1172
|
+
* @param requestOptions - The options for the request.
|
|
1173
|
+
* @returns A promise that resolves to a ServiceResponse containing the cart count response.
|
|
1174
|
+
*/
|
|
1175
|
+
addCartMultiple(params, requestOptions) {
|
|
1176
|
+
return __async(this, null, function* () {
|
|
1177
|
+
var _a;
|
|
1178
|
+
return yield this.post(
|
|
1179
|
+
`cart/add`,
|
|
1180
|
+
__spreadValues({
|
|
1181
|
+
mode: params.mode,
|
|
1182
|
+
clearCart: params.clearCart,
|
|
1183
|
+
cartType: (_a = params.cartType) != null ? _a : "normal",
|
|
1184
|
+
json: params.items.map((item) => ({
|
|
1185
|
+
id: item.id,
|
|
1186
|
+
qty: String(item.qty)
|
|
1187
|
+
})),
|
|
1188
|
+
sideCampaignJson: params.sideCampaignJson
|
|
1189
|
+
}, params.options),
|
|
1190
|
+
{
|
|
1191
|
+
headers: requestOptions == null ? void 0 : requestOptions.headers,
|
|
1149
1192
|
data: requestOptions == null ? void 0 : requestOptions.data,
|
|
1150
1193
|
params: requestOptions == null ? void 0 : requestOptions.params
|
|
1151
1194
|
}
|
|
@@ -1184,14 +1227,12 @@ var CartApi = class extends BaseService {
|
|
|
1184
1227
|
cartAccess(params, requestOptions) {
|
|
1185
1228
|
return __async(this, null, function* () {
|
|
1186
1229
|
return yield this.post(
|
|
1187
|
-
"setting",
|
|
1230
|
+
"setting/add",
|
|
1188
1231
|
{
|
|
1189
1232
|
data: JSON.stringify(params)
|
|
1190
1233
|
},
|
|
1191
1234
|
{
|
|
1192
|
-
headers:
|
|
1193
|
-
"Content-Type": "application/x-www-form-urlencoded"
|
|
1194
|
-
}, requestOptions == null ? void 0 : requestOptions.headers),
|
|
1235
|
+
headers: requestOptions == null ? void 0 : requestOptions.headers,
|
|
1195
1236
|
data: requestOptions == null ? void 0 : requestOptions.data,
|
|
1196
1237
|
params: requestOptions == null ? void 0 : requestOptions.params
|
|
1197
1238
|
}
|