@bzbs/react-api-client 2.0.3 → 2.1.1

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.mjs CHANGED
@@ -1019,6 +1019,7 @@ var CampaignApi = class extends BaseService {
1019
1019
  * @param params.contactNumber - The contact number of the user.
1020
1020
  * @param params.options - Additional options for the redemption.
1021
1021
  * @param params.spPoints - Point Per Unit x Quantity (Donate only).
1022
+ * @param params.pointUnit - The point unit of the campaign (Point Service Only).
1022
1023
  * @param requestOptions - The options for the HTTP request.
1023
1024
  * @returns A promise that resolves to a service response containing the redeem response.
1024
1025
  */
@@ -1648,6 +1649,107 @@ var PointLogApi = class extends BaseService {
1648
1649
  }
1649
1650
  };
1650
1651
 
1652
+ // src/api/points/point-api.ts
1653
+ var PointApi = class extends BaseService {
1654
+ constructor(client, baseUrl) {
1655
+ super(client, baseUrl);
1656
+ }
1657
+ /**
1658
+ * Retrieves the current point balance for the authenticated user across the requested point units.
1659
+ *
1660
+ * @param params - The parameters for retrieving the point balance.
1661
+ * @param params.units - (Optional) Point unit codes (e.g. Point, Coin). Omit to use all units configured for the app.
1662
+ * @param params.boxIds - (Optional) Box (sub-bucket) identifiers to filter by.
1663
+ * @param params.onlyVisible - (Optional) When true (default), only units marked visible for the app are considered.
1664
+ * @param params.options - (Optional) Additional options for the request.
1665
+ * @param requestOptions - (Optional) The request options.
1666
+ * @returns A promise that resolves to a service response containing an array of point balances.
1667
+ */
1668
+ balance(params, requestOptions) {
1669
+ return __async(this, null, function* () {
1670
+ return yield this.get(
1671
+ "point/balance",
1672
+ __spreadValues({
1673
+ "units[]": params == null ? void 0 : params.units,
1674
+ "boxIds[]": params == null ? void 0 : params.boxIds,
1675
+ onlyVisible: params == null ? void 0 : params.onlyVisible
1676
+ }, params == null ? void 0 : params.options),
1677
+ requestOptions
1678
+ );
1679
+ });
1680
+ }
1681
+ /**
1682
+ * Retrieves the point balance with Currents and Expires breakdowns keyed by date.
1683
+ *
1684
+ * @param params - The parameters for retrieving the point detail.
1685
+ * @param params.units - (Optional) Point unit codes (e.g. Point, Coin). Omit to use all units configured for the app.
1686
+ * @param params.boxIds - (Optional) Box (sub-bucket) identifiers to filter by.
1687
+ * @param params.onlyVisible - (Optional) When true (default), only units marked visible for the app are considered.
1688
+ * @param params.options - (Optional) Additional options for the request.
1689
+ * @param requestOptions - (Optional) The request options.
1690
+ * @returns A promise that resolves to a service response containing an array of point balances with breakdowns.
1691
+ */
1692
+ detail(params, requestOptions) {
1693
+ return __async(this, null, function* () {
1694
+ return yield this.get(
1695
+ "point/detail",
1696
+ __spreadValues({
1697
+ "units[]": params == null ? void 0 : params.units,
1698
+ "boxIds[]": params == null ? void 0 : params.boxIds,
1699
+ onlyVisible: params == null ? void 0 : params.onlyVisible
1700
+ }, params == null ? void 0 : params.options),
1701
+ requestOptions
1702
+ );
1703
+ });
1704
+ }
1705
+ /**
1706
+ * Retrieves a paginated list of earn/burn/transfer transactions between start and end dates.
1707
+ *
1708
+ * @param params - The parameters for retrieving the point history.
1709
+ * @param params.start - Start of the range (inclusive), ISO-8601 with offset.
1710
+ * @param params.end - End of the range (inclusive), ISO-8601 with offset.
1711
+ * @param params.onlyVisible - (Optional) When true (default), only units marked visible for the app are considered.
1712
+ * @param params.skip - (Optional) Number of records to skip (offset pagination).
1713
+ * @param params.top - (Optional) Maximum number of records to return.
1714
+ * @param params.sortType - (Optional) Sort direction for Timestamp: Asc|Desc.
1715
+ * @param params.units - (Optional) Point unit codes to filter by.
1716
+ * @param params.boxIds - (Optional) Box (sub-bucket) identifiers to filter by.
1717
+ * @param params.references - (Optional) Filter by transaction reference.
1718
+ * @param params.transactionIds - (Optional) Filter by exact transaction IDs.
1719
+ * @param params.includeActions - (Optional) Only include transactions whose Action matches (e.g. Earn, Burn, Transfer).
1720
+ * @param params.excludeActions - (Optional) Exclude transactions whose Action matches.
1721
+ * @param params.includeTypes - (Optional) Only include transactions whose Type matches.
1722
+ * @param params.excludeTypes - (Optional) Exclude transactions whose Type matches.
1723
+ * @param params.options - (Optional) Additional options for the request.
1724
+ * @param requestOptions - (Optional) The request options.
1725
+ * @returns A promise that resolves to a service response containing an array of point history transactions.
1726
+ */
1727
+ history(params, requestOptions) {
1728
+ return __async(this, null, function* () {
1729
+ return yield this.get(
1730
+ "point/history",
1731
+ __spreadValues({
1732
+ start: params.start,
1733
+ end: params.end,
1734
+ onlyVisible: params.onlyVisible,
1735
+ skip: params.skip,
1736
+ top: params.top,
1737
+ sortType: params.sortType,
1738
+ "units[]": params.units,
1739
+ "boxIds[]": params.boxIds,
1740
+ "references[]": params.references,
1741
+ "transactionIds[]": params.transactionIds,
1742
+ "includeActions[]": params.includeActions,
1743
+ "excludeActions[]": params.excludeActions,
1744
+ "includeTypes[]": params.includeTypes,
1745
+ "excludeTypes[]": params.excludeTypes
1746
+ }, params.options),
1747
+ requestOptions
1748
+ );
1749
+ });
1750
+ }
1751
+ };
1752
+
1651
1753
  // src/api/profile/profile-api.ts
1652
1754
  var ProfileApi = class extends BaseService {
1653
1755
  constructor(client, baseUrl) {
@@ -2607,6 +2709,7 @@ var BzbsService = class {
2607
2709
  this.notificationApi = new NotificationApi(this.client, this.baseUrl);
2608
2710
  this.placeApi = new PlaceApi(this.client, this.baseUrl);
2609
2711
  this.pointLogApi = new PointLogApi(this.client, this.baseUrl);
2712
+ this.pointApi = new PointApi(this.client, this.baseUrl);
2610
2713
  this.profileApi = new ProfileApi(this.client, this.baseUrl);
2611
2714
  this.registerApi = new RegistrationApi(this.client, this.baseUrl);
2612
2715
  this.addressApi = new AddressApi(this.client, this.baseUrl);
@@ -2629,6 +2732,7 @@ var BzbsService = class {
2629
2732
  this.notificationApi.setBaseUrl(baseUrl);
2630
2733
  this.placeApi.setBaseUrl(baseUrl);
2631
2734
  this.pointLogApi.setBaseUrl(baseUrl);
2735
+ this.pointApi.setBaseUrl(baseUrl);
2632
2736
  this.profileApi.setBaseUrl(baseUrl);
2633
2737
  this.registerApi.setBaseUrl(baseUrl);
2634
2738
  this.addressApi.setBaseUrl(baseUrl);
@@ -2664,6 +2768,7 @@ export {
2664
2768
  LineApi,
2665
2769
  NotificationApi,
2666
2770
  PlaceApi,
2771
+ PointApi,
2667
2772
  PointLogApi,
2668
2773
  ProfileApi,
2669
2774
  RegistrationApi,