@bzbs/react-api-client 1.2.6 → 1.3.0

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.ts CHANGED
@@ -120,6 +120,10 @@ interface ForgetPasswordResponse {
120
120
  expireinseconds?: number;
121
121
  }
122
122
 
123
+ interface AccessTokenResponse {
124
+ key?: string;
125
+ }
126
+
123
127
  /**
124
128
  * Response model for Apple token authentication
125
129
  */
@@ -544,6 +548,12 @@ interface Dashboard {
544
548
  line2?: string;
545
549
  line3?: string;
546
550
  line4?: string;
551
+ line5?: string;
552
+ line6?: string;
553
+ line7?: string;
554
+ line8?: string;
555
+ line9?: string;
556
+ line10?: string;
547
557
  ga_label?: string;
548
558
  start_date?: number;
549
559
  end_date?: number;
@@ -1401,6 +1411,120 @@ declare class AuthenticateApi extends BaseService {
1401
1411
  [key: string]: unknown;
1402
1412
  };
1403
1413
  }, requestOptions?: RequestOptions): Promise<ServiceResponse<LoginResponse>>;
1414
+ /**
1415
+ * Connect with LINE. If authorization token is provided, it will connect current user with given LINE credentials.
1416
+ * Otherwise, it tries to login with those credentials.
1417
+ *
1418
+ * @param params - The parameters.
1419
+ * @param params.idToken - The LINE id token.
1420
+ * @param params.lineAccessToken - The LINE access token.
1421
+ * @param params.authorizationCode - The LINE authorization code.
1422
+ * @param params.appId - Your application id.
1423
+ * @param params.uuid - The unique device identifier.
1424
+ * @param params.options - (Optional) Additional params for the request.
1425
+ * @param requestOptions - Optional request options.
1426
+ * @returns A promise that resolves to a ServiceResponse containing the login response.
1427
+ */
1428
+ connectLine(params: {
1429
+ idToken: string;
1430
+ lineAccessToken: string;
1431
+ authorizationCode: string;
1432
+ appId: string;
1433
+ uuid: string;
1434
+ deviceLocale: string;
1435
+ os: string;
1436
+ platform: string;
1437
+ deviceNotificationEnabled: boolean;
1438
+ clientVersion: string;
1439
+ deviceToken: string;
1440
+ macAddress: string;
1441
+ options?: {
1442
+ [key: string]: unknown;
1443
+ };
1444
+ }, requestOptions?: RequestOptions): Promise<ServiceResponse<LoginResponse>>;
1445
+ /**
1446
+ * Connect with Facebook. If authorization token is provided, it will connect current user with given Facebook access token.
1447
+ * Otherwise, it tries to login with that access token.
1448
+ *
1449
+ * @param params - The parameters.
1450
+ * @param params.accessToken - The Facebook access token.
1451
+ * @param params.appId - Your application id.
1452
+ * @param params.uuid - The unique device identifier.
1453
+ * @param params.options - (Optional) Additional params for the request.
1454
+ * @param requestOptions - Optional request options.
1455
+ * @returns A promise that resolves to a ServiceResponse containing the login response.
1456
+ */
1457
+ connectFacebook(params: {
1458
+ accessToken: string;
1459
+ appId: string;
1460
+ uuid: string;
1461
+ deviceLocale: string;
1462
+ os: string;
1463
+ platform: string;
1464
+ deviceNotificationEnabled: boolean;
1465
+ clientVersion: string;
1466
+ deviceToken: string;
1467
+ macAddress: string;
1468
+ options?: {
1469
+ [key: string]: unknown;
1470
+ };
1471
+ }, requestOptions?: RequestOptions): Promise<ServiceResponse<LoginResponse>>;
1472
+ /**
1473
+ * Connect with Google. If authorization token is provided, it will connect current user with given Google id token.
1474
+ * Otherwise, it tries to login with that id token.
1475
+ *
1476
+ * @param params - The parameters.
1477
+ * @param params.idToken - The Google id token.
1478
+ * @param params.appId - Your application id.
1479
+ * @param params.uuid - The unique device identifier.
1480
+ * @param params.options - (Optional) Additional params for the request.
1481
+ * @param requestOptions - Optional request options.
1482
+ * @returns A promise that resolves to a ServiceResponse containing the login response.
1483
+ */
1484
+ connectGoogle(params: {
1485
+ idToken: string;
1486
+ appId: string;
1487
+ uuid: string;
1488
+ deviceLocale: string;
1489
+ os: string;
1490
+ platform: string;
1491
+ deviceNotificationEnabled: boolean;
1492
+ clientVersion: string;
1493
+ deviceToken: string;
1494
+ macAddress: string;
1495
+ options?: {
1496
+ [key: string]: unknown;
1497
+ };
1498
+ }, requestOptions?: RequestOptions): Promise<ServiceResponse<LoginResponse>>;
1499
+ /**
1500
+ * Connect with Apple. If authorization token is provided, it will connect current user with given Apple credentials.
1501
+ * Otherwise, it tries to login with those credentials.
1502
+ *
1503
+ * @param params - The parameters.
1504
+ * @param params.idToken - The Apple id token.
1505
+ * @param params.refreshToken - The Apple refresh token from appleToken().
1506
+ * @param params.appId - Your application id.
1507
+ * @param params.uuid - The unique device identifier.
1508
+ * @param params.options - (Optional) Additional params for the request.
1509
+ * @param requestOptions - Optional request options.
1510
+ * @returns A promise that resolves to a ServiceResponse containing the login response.
1511
+ */
1512
+ connectApple(params: {
1513
+ idToken: string;
1514
+ refreshToken: string;
1515
+ appId: string;
1516
+ uuid: string;
1517
+ deviceLocale: string;
1518
+ os: string;
1519
+ platform: string;
1520
+ deviceNotificationEnabled: boolean;
1521
+ clientVersion: string;
1522
+ deviceToken: string;
1523
+ macAddress: string;
1524
+ options?: {
1525
+ [key: string]: unknown;
1526
+ };
1527
+ }, requestOptions?: RequestOptions): Promise<ServiceResponse<LoginResponse>>;
1404
1528
  /**
1405
1529
  * Performs a logout for the user.
1406
1530
  *
@@ -1455,7 +1579,7 @@ declare class AuthenticateApi extends BaseService {
1455
1579
  };
1456
1580
  }, requestOptions?: RequestOptions): Promise<ServiceResponse<StatusResponse>>;
1457
1581
  /**
1458
- * Sends an OTP (One-Time Password) to the user for authentication.
1582
+ * Sends an OTP (One-Time Password) to the user for authentication (GET method).
1459
1583
  *
1460
1584
  * @param params - The parameters.
1461
1585
  * @param params.uuid - The unique device identifier.
@@ -1475,6 +1599,46 @@ declare class AuthenticateApi extends BaseService {
1475
1599
  [key: string]: unknown;
1476
1600
  };
1477
1601
  }, requestOptions?: RequestOptions): Promise<ServiceResponse<OtpResponse>>;
1602
+ /**
1603
+ * Sends an OTP (One-Time Password) to the user for authentication (POST method, V2).
1604
+ *
1605
+ * @param params - The parameters.
1606
+ * @param params.appId - Your application id.
1607
+ * @param params.contactNumber - The contact number for the user.
1608
+ * @param params.channel - (Optional) The channel to use for OTP delivery.
1609
+ * @param params.options - (Optional) Additional params for the request.
1610
+ * @param requestOptions - (Optional) Additional options for the request.
1611
+ * @returns A promise that resolves to a ServiceResponse containing the OTP response.
1612
+ */
1613
+ otpV2(params: {
1614
+ appId: string;
1615
+ contactNumber: string;
1616
+ channel?: string;
1617
+ options?: {
1618
+ [key: string]: unknown;
1619
+ };
1620
+ }, requestOptions?: RequestOptions): Promise<ServiceResponse<OtpResponse>>;
1621
+ /**
1622
+ * Sends an OTP (One-Time Password) via email to the user for authentication.
1623
+ *
1624
+ * @param params - The parameters.
1625
+ * @param params.uuid - The unique device identifier.
1626
+ * @param params.appId - Your application id.
1627
+ * @param params.email - The email address for the user.
1628
+ * @param params.channel - (Optional) The channel to use for OTP delivery.
1629
+ * @param params.options - (Optional) Additional params for the request.
1630
+ * @param requestOptions - (Optional) Additional options for the request.
1631
+ * @returns A promise that resolves to a ServiceResponse containing the OTP response.
1632
+ */
1633
+ otpEmail(params: {
1634
+ uuid: string;
1635
+ appId: string;
1636
+ email: string;
1637
+ channel?: string;
1638
+ options?: {
1639
+ [key: string]: unknown;
1640
+ };
1641
+ }, requestOptions?: RequestOptions): Promise<ServiceResponse<OtpResponse>>;
1478
1642
  /**
1479
1643
  * Confirm the OTP (One-Time Password) for authentication.
1480
1644
  *
@@ -1501,8 +1665,10 @@ declare class AuthenticateApi extends BaseService {
1501
1665
  * @param params.appId - Your application id.
1502
1666
  * @param params.otp - The OTP to validate.
1503
1667
  * @param params.refCode - The reference code for the OTP.
1504
- * @param params.contactNumber - The contact number for the user.
1505
- * @param params.use - Whether to use the OTP after validation.
1668
+ * @param params.type - Type of contact (email or contact_number).
1669
+ * @param params.contactNumber - (Optional) The contact number for the user.
1670
+ * @param params.email - (Optional) The email address for the user.
1671
+ * @param params.use - Whether to use the OTP after validation (default: false).
1506
1672
  * @param params.channel - (Optional) The channel to use for OTP delivery.
1507
1673
  * @param params.options - (Optional) Additional params for the request.
1508
1674
  * @param requestOptions - (Optional) Additional options for the request.
@@ -1512,53 +1678,69 @@ declare class AuthenticateApi extends BaseService {
1512
1678
  appId: string;
1513
1679
  otp: string;
1514
1680
  refCode: string;
1515
- contactNumber: string;
1516
- use: boolean;
1681
+ type: string;
1682
+ contactNumber?: string;
1683
+ email?: string;
1684
+ use?: boolean;
1517
1685
  channel?: string;
1518
1686
  options?: {
1519
1687
  [key: string]: unknown;
1520
1688
  };
1521
1689
  }, requestOptions?: RequestOptions): Promise<ServiceResponse<ValidateOtpResponse>>;
1522
1690
  /**
1523
- * Retrieve a new token and update the current device token.
1691
+ * Refresh buzzebees token and retrieve a new token.
1524
1692
  *
1525
1693
  * @param params - The parameters.
1526
1694
  * @param params.uuid - The unique device identifier.
1527
- * @param params.appId - Your application id.
1528
- * @param params.clientVersion - The version of the client.
1529
- * @param params.deviceToken - The token of the device.
1695
+ * @param params.deviceAppId - Your application id.
1696
+ * @param params.os - Your device operation system + version. Ex. ios 11.2.1, android 9.0
1697
+ * @param params.platform - Your platform. Ex. iPhone, Android
1698
+ * @param params.macAddress - Unique device identifier
1699
+ * @param params.deviceNotificationEnabled - Enable push notification
1700
+ * @param params.clientVersion - Number of version (App Prefix + Your application version, Ex. ios_buzzebeesdemo1.0.1)
1701
+ * @param params.deviceToken - Device token used for send push notification
1530
1702
  * @param params.options - (Optional) Additional params for the request.
1531
1703
  * @param requestOptions - (Optional) Additional options for the request.
1532
1704
  * @returns A promise that resolves to a ServiceResponse containing the resume response.
1533
1705
  */
1534
1706
  resume(params: {
1535
1707
  uuid: string;
1536
- appId: string;
1537
- clientVersion?: string;
1538
- deviceToken?: string;
1539
- macAddress?: string;
1708
+ deviceAppId: string;
1709
+ os: string;
1710
+ platform: string;
1711
+ macAddress: string;
1712
+ deviceNotificationEnabled: boolean;
1713
+ clientVersion: string;
1714
+ deviceToken: string;
1540
1715
  options?: {
1541
1716
  [key: string]: unknown;
1542
1717
  };
1543
1718
  }, requestOptions?: RequestOptions): Promise<ServiceResponse<ResumeResponse>>;
1544
1719
  /**
1545
- * Update the device token for push notification.
1720
+ * Update device token for push notification.
1546
1721
  *
1547
1722
  * @param params - The parameters.
1548
1723
  * @param params.uuid - The unique device identifier.
1549
- * @param params.appId - Your application id.
1550
- * @param params.clientVersion - The version of the client.
1551
- * @param params.deviceToken - The token of the device.
1724
+ * @param params.deviceAppId - Your application id.
1725
+ * @param params.os - Your device operation system + version. Ex. ios 11.2.1, android 9.0
1726
+ * @param params.platform - Your platform. Ex. iPhone, Android
1727
+ * @param params.macAddress - Unique device identifier
1728
+ * @param params.deviceNotificationEnabled - Enable push notification
1729
+ * @param params.clientVersion - Number of version (App Prefix + Your application version, Ex. ios_buzzebeesdemo1.0.1)
1730
+ * @param params.deviceToken - Device token used for send push notification
1552
1731
  * @param params.options - (Optional) Additional params for the request.
1553
1732
  * @param requestOptions - (Optional) Additional options for the request.
1554
1733
  * @returns A promise that resolves to a ServiceResponse containing the resume response.
1555
1734
  */
1556
1735
  updateDevice(params: {
1557
1736
  uuid: string;
1558
- appId: string;
1559
- clientVersion?: string;
1560
- deviceToken?: string;
1561
- macAddress?: string;
1737
+ deviceAppId: string;
1738
+ os: string;
1739
+ platform: string;
1740
+ macAddress: string;
1741
+ deviceNotificationEnabled: boolean;
1742
+ clientVersion: string;
1743
+ deviceToken: string;
1562
1744
  options?: {
1563
1745
  [key: string]: unknown;
1564
1746
  };
@@ -2791,6 +2973,31 @@ declare class RequestHelpApi extends BaseService {
2791
2973
  }, requestOptions?: RequestOptions): Promise<ServiceResponse<LikeForumResponse>>;
2792
2974
  }
2793
2975
 
2976
+ declare class SettingApi extends BaseService {
2977
+ constructor(client: AxiosInstance, baseUrl: string);
2978
+ /**
2979
+ * Get access key for web landing.
2980
+ *
2981
+ * @param params - The parameters.
2982
+ * @param params.data - JSON string of data. Available data:
2983
+ * - "app_id" (Required, string): App Id
2984
+ * - "campaign_id" (Required, int): Campaign ID
2985
+ * - "locale" (Required, int): User Locale
2986
+ * - "return_url" (Required, string): URL to redirect back to App
2987
+ * - "version" (Required, string): Version of landing interface
2988
+ * - "redeem_key" (Optional, string): Required for case history - Redeem Key from history API (CampaignID_ItemNumber)
2989
+ * @param params.options - (Optional) Additional params for the request.
2990
+ * @param requestOptions - (Optional) Additional options for the request.
2991
+ * @returns A promise that resolves to a ServiceResponse containing the access token response.
2992
+ */
2993
+ accessKey(params: {
2994
+ data: string;
2995
+ options?: {
2996
+ [key: string]: unknown;
2997
+ };
2998
+ }, requestOptions?: RequestOptions): Promise<ServiceResponse<AccessTokenResponse>>;
2999
+ }
3000
+
2794
3001
  declare class Blob extends BaseService {
2795
3002
  constructor(client: AxiosInstance, baseUrl: string);
2796
3003
  consentVersion(appId: string): Promise<ServiceResponse<ConsentVersion>>;
@@ -2821,8 +3028,9 @@ declare class BzbsService {
2821
3028
  addressApi: AddressApi;
2822
3029
  stampApi: StampApi;
2823
3030
  forumApi: RequestHelpApi;
3031
+ settingApi: SettingApi;
2824
3032
  blob: Blob;
2825
3033
  constructor(client: AxiosInstance, baseUrl: string, baseLineUrl: string | "", baseBlobUrl: string);
2826
3034
  }
2827
3035
 
2828
- export { 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 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, 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, 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 };
3036
+ 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 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, 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 };