@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 CHANGED
@@ -1471,7 +1471,7 @@ declare class AuthenticateApi extends BaseService {
1471
1471
  options?: {
1472
1472
  [key: string]: unknown;
1473
1473
  };
1474
- }, requestOptions?: RequestOptions, version?: number): Promise<ServiceResponse<LoginResponse>>;
1474
+ }, requestOptions?: RequestOptions): Promise<ServiceResponse<LoginResponse>>;
1475
1475
  /**
1476
1476
  * Connect with LINE. If authorization token is provided, it will connect current user with given LINE credentials.
1477
1477
  * Otherwise, it tries to login with those credentials.
@@ -1617,7 +1617,7 @@ declare class AuthenticateApi extends BaseService {
1617
1617
  options?: {
1618
1618
  [key: string]: unknown;
1619
1619
  };
1620
- }, requestOptions?: RequestOptions, version?: number): Promise<ServiceResponse<ForgetPasswordResponse>>;
1620
+ }, requestOptions?: RequestOptions): Promise<ServiceResponse<ForgetPasswordResponse>>;
1621
1621
  /**
1622
1622
  * Resets the password for a user.
1623
1623
  *
@@ -1638,7 +1638,7 @@ declare class AuthenticateApi extends BaseService {
1638
1638
  options?: {
1639
1639
  [key: string]: unknown;
1640
1640
  };
1641
- }, requestOptions?: RequestOptions, version?: number): Promise<ServiceResponse<StatusResponse>>;
1641
+ }, requestOptions?: RequestOptions): Promise<ServiceResponse<StatusResponse>>;
1642
1642
  /**
1643
1643
  * Sends an OTP (One-Time Password) to the user for authentication (GET method).
1644
1644
  *
@@ -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
  /**
@@ -2010,6 +2011,8 @@ declare class CartApi extends BaseService {
2010
2011
  * @param params.id - The ID of the item to add to the cart.
2011
2012
  * @param params.mode - The mode off adding.
2012
2013
  * @param params.qty - The quantity of the item.
2014
+ * @param params.clearCart - Whether to clear the cart before adding the item.
2015
+ * @param params.cartType - The cart type. Defaults to 'normal'.
2013
2016
  * @param params.sideCampaignJson - The side campaign JSON.
2014
2017
  * @param params.options - Additional options for adding the item to the cart.
2015
2018
  * @param requestOptions - The options for the request.
@@ -2019,6 +2022,34 @@ declare class CartApi extends BaseService {
2019
2022
  id: string;
2020
2023
  mode?: string;
2021
2024
  qty?: number;
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;
2022
2053
  sideCampaignJson?: string;
2023
2054
  options?: {
2024
2055
  [key: string]: unknown;
@@ -2599,7 +2630,7 @@ declare class ProfileApi extends BaseService {
2599
2630
  options?: {
2600
2631
  [key: string]: unknown;
2601
2632
  };
2602
- }, requestOptions?: RequestOptions, version?: number): Promise<ServiceResponse<StatusResponse>>;
2633
+ }, requestOptions?: RequestOptions): Promise<ServiceResponse<StatusResponse>>;
2603
2634
  /**
2604
2635
  * Updates the shipping information for the user.
2605
2636
  *
@@ -2831,7 +2862,7 @@ declare class RegistrationApi extends BaseService {
2831
2862
  options: {
2832
2863
  [key: string]: unknown;
2833
2864
  };
2834
- }, requestOptions?: RequestOptions, version?: number): Promise<ServiceResponse<RegistrationResponse>>;
2865
+ }, requestOptions?: RequestOptions): Promise<ServiceResponse<RegistrationResponse>>;
2835
2866
  }
2836
2867
 
2837
2868
  declare class AddressApi extends BaseService {
@@ -3266,4 +3297,4 @@ declare class BzbsService {
3266
3297
  setLineUrl(lineUrl: string): this;
3267
3298
  }
3268
3299
 
3269
- 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
@@ -1471,7 +1471,7 @@ declare class AuthenticateApi extends BaseService {
1471
1471
  options?: {
1472
1472
  [key: string]: unknown;
1473
1473
  };
1474
- }, requestOptions?: RequestOptions, version?: number): Promise<ServiceResponse<LoginResponse>>;
1474
+ }, requestOptions?: RequestOptions): Promise<ServiceResponse<LoginResponse>>;
1475
1475
  /**
1476
1476
  * Connect with LINE. If authorization token is provided, it will connect current user with given LINE credentials.
1477
1477
  * Otherwise, it tries to login with those credentials.
@@ -1617,7 +1617,7 @@ declare class AuthenticateApi extends BaseService {
1617
1617
  options?: {
1618
1618
  [key: string]: unknown;
1619
1619
  };
1620
- }, requestOptions?: RequestOptions, version?: number): Promise<ServiceResponse<ForgetPasswordResponse>>;
1620
+ }, requestOptions?: RequestOptions): Promise<ServiceResponse<ForgetPasswordResponse>>;
1621
1621
  /**
1622
1622
  * Resets the password for a user.
1623
1623
  *
@@ -1638,7 +1638,7 @@ declare class AuthenticateApi extends BaseService {
1638
1638
  options?: {
1639
1639
  [key: string]: unknown;
1640
1640
  };
1641
- }, requestOptions?: RequestOptions, version?: number): Promise<ServiceResponse<StatusResponse>>;
1641
+ }, requestOptions?: RequestOptions): Promise<ServiceResponse<StatusResponse>>;
1642
1642
  /**
1643
1643
  * Sends an OTP (One-Time Password) to the user for authentication (GET method).
1644
1644
  *
@@ -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
  /**
@@ -2010,6 +2011,8 @@ declare class CartApi extends BaseService {
2010
2011
  * @param params.id - The ID of the item to add to the cart.
2011
2012
  * @param params.mode - The mode off adding.
2012
2013
  * @param params.qty - The quantity of the item.
2014
+ * @param params.clearCart - Whether to clear the cart before adding the item.
2015
+ * @param params.cartType - The cart type. Defaults to 'normal'.
2013
2016
  * @param params.sideCampaignJson - The side campaign JSON.
2014
2017
  * @param params.options - Additional options for adding the item to the cart.
2015
2018
  * @param requestOptions - The options for the request.
@@ -2019,6 +2022,34 @@ declare class CartApi extends BaseService {
2019
2022
  id: string;
2020
2023
  mode?: string;
2021
2024
  qty?: number;
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;
2022
2053
  sideCampaignJson?: string;
2023
2054
  options?: {
2024
2055
  [key: string]: unknown;
@@ -2599,7 +2630,7 @@ declare class ProfileApi extends BaseService {
2599
2630
  options?: {
2600
2631
  [key: string]: unknown;
2601
2632
  };
2602
- }, requestOptions?: RequestOptions, version?: number): Promise<ServiceResponse<StatusResponse>>;
2633
+ }, requestOptions?: RequestOptions): Promise<ServiceResponse<StatusResponse>>;
2603
2634
  /**
2604
2635
  * Updates the shipping information for the user.
2605
2636
  *
@@ -2831,7 +2862,7 @@ declare class RegistrationApi extends BaseService {
2831
2862
  options: {
2832
2863
  [key: string]: unknown;
2833
2864
  };
2834
- }, requestOptions?: RequestOptions, version?: number): Promise<ServiceResponse<RegistrationResponse>>;
2865
+ }, requestOptions?: RequestOptions): Promise<ServiceResponse<RegistrationResponse>>;
2835
2866
  }
2836
2867
 
2837
2868
  declare class AddressApi extends BaseService {
@@ -3266,4 +3297,4 @@ declare class BzbsService {
3266
3297
  setLineUrl(lineUrl: string): this;
3267
3298
  }
3268
3299
 
3269
- 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
@@ -444,10 +444,10 @@ var AuthenticateApi = class extends BaseService {
444
444
  * @param params.options - (Optional) Additional params for the request.
445
445
  * @returns A promise that resolves to a ServiceResponse containing the login response.
446
446
  */
447
- usernamePasswordLogin(params, requestOptions, version = 2) {
447
+ usernamePasswordLogin(params, requestOptions) {
448
448
  return __async(this, null, function* () {
449
449
  return yield this.post(
450
- `auth/bzbs_login${version}`,
450
+ "auth/buzzebees_login",
451
451
  __spreadValues({
452
452
  username: params.username,
453
453
  password: params.password,
@@ -629,10 +629,10 @@ var AuthenticateApi = class extends BaseService {
629
629
  * @param requestOptions - Optional request options.
630
630
  * @returns A promise that resolves to a ServiceResponse containing the forget password response.
631
631
  */
632
- forgetPassword(params, requestOptions, version = 2) {
632
+ forgetPassword(params, requestOptions) {
633
633
  return __async(this, null, function* () {
634
634
  return yield this.get(
635
- `profile/forget_password${version}`,
635
+ "profile/forgot_password",
636
636
  __spreadValues({
637
637
  id: params.contact,
638
638
  type: params.type
@@ -653,10 +653,10 @@ var AuthenticateApi = class extends BaseService {
653
653
  * @param requestOptions - (Optional) Additional options for the request.
654
654
  * @returns A promise that resolves to a ServiceResponse containing the status response.
655
655
  */
656
- resetPassword(params, requestOptions, version = 2) {
656
+ resetPassword(params, requestOptions) {
657
657
  return __async(this, null, function* () {
658
658
  return yield this.post(
659
- `profile/forget_password${version}`,
659
+ "profile/forgot_password",
660
660
  __spreadValues({
661
661
  id: params.contact,
662
662
  refcode: params.refCode,
@@ -1126,6 +1126,8 @@ var CartApi = class extends BaseService {
1126
1126
  * @param params.id - The ID of the item to add to the cart.
1127
1127
  * @param params.mode - The mode off adding.
1128
1128
  * @param params.qty - The quantity of the item.
1129
+ * @param params.clearCart - Whether to clear the cart before adding the item.
1130
+ * @param params.cartType - The cart type. Defaults to 'normal'.
1129
1131
  * @param params.sideCampaignJson - The side campaign JSON.
1130
1132
  * @param params.options - Additional options for adding the item to the cart.
1131
1133
  * @param requestOptions - The options for the request.
@@ -1133,11 +1135,58 @@ var CartApi = class extends BaseService {
1133
1135
  */
1134
1136
  addCart(params, requestOptions) {
1135
1137
  return __async(this, null, function* () {
1138
+ var _a;
1136
1139
  return yield this.post(
1137
- `cart/${params.id}/add`,
1140
+ `cart/add`,
1138
1141
  __spreadValues({
1139
1142
  mode: params.mode,
1140
1143
  qty: params.qty,
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
+ ],
1152
+ sideCampaignJson: params.sideCampaignJson
1153
+ }, params.options),
1154
+ {
1155
+ headers: __spreadValues({
1156
+ "Content-Type": "application/x-www-form-urlencoded"
1157
+ }, requestOptions == null ? void 0 : requestOptions.headers),
1158
+ data: requestOptions == null ? void 0 : requestOptions.data,
1159
+ params: requestOptions == null ? void 0 : requestOptions.params
1160
+ }
1161
+ );
1162
+ });
1163
+ }
1164
+ /**
1165
+ * Adds multiple items to the cart.
1166
+ *
1167
+ * @param params - The parameters.
1168
+ * @param params.items - The items to add to the cart.
1169
+ * @param params.mode - The mode of adding.
1170
+ * @param params.clearCart - Whether to clear the cart before adding the items.
1171
+ * @param params.cartType - The cart type. Defaults to 'normal'.
1172
+ * @param params.sideCampaignJson - The side campaign JSON.
1173
+ * @param params.options - Additional options for adding the items to the cart.
1174
+ * @param requestOptions - The options for the request.
1175
+ * @returns A promise that resolves to a ServiceResponse containing the cart count response.
1176
+ */
1177
+ addCartMultiple(params, requestOptions) {
1178
+ return __async(this, null, function* () {
1179
+ var _a;
1180
+ return yield this.post(
1181
+ `cart/add`,
1182
+ __spreadValues({
1183
+ mode: params.mode,
1184
+ clearCart: params.clearCart,
1185
+ cartType: (_a = params.cartType) != null ? _a : "normal",
1186
+ json: params.items.map((item) => ({
1187
+ id: item.id,
1188
+ qty: String(item.qty)
1189
+ })),
1141
1190
  sideCampaignJson: params.sideCampaignJson
1142
1191
  }, params.options),
1143
1192
  {
@@ -1891,10 +1940,10 @@ var ProfileApi = class extends BaseService {
1891
1940
  * @param requestOptions - Optional request options.
1892
1941
  * @returns A promise that resolves to a ServiceResponse containing the status response.
1893
1942
  */
1894
- changePassword(params, requestOptions, version = 2) {
1943
+ changePassword(params, requestOptions) {
1895
1944
  return __async(this, null, function* () {
1896
1945
  return yield this.post(
1897
- `profile/change_password${version}`,
1946
+ "profile/password_change",
1898
1947
  __spreadValues({
1899
1948
  current: params.current,
1900
1949
  change: params.change
@@ -2157,10 +2206,10 @@ var RegistrationApi = class extends BaseService {
2157
2206
  * @param requestOptions - The optional request options.
2158
2207
  * @returns A promise that resolves to a service response containing the registration response.
2159
2208
  */
2160
- register(params, requestOptions, version = 2) {
2209
+ register(params, requestOptions) {
2161
2210
  return __async(this, null, function* () {
2162
2211
  return yield this.post(
2163
- `auth/register${version}`,
2212
+ "auth/registration",
2164
2213
  __spreadValues({
2165
2214
  app_id: params.appId,
2166
2215
  uuid: params.uuid,