@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/README.md +69 -1
- package/dist/index.d.mts +111 -1
- package/dist/index.d.ts +111 -1
- package/dist/index.js +106 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +105 -0
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
A TypeScript library providing a type-safe API client for Buzzebees loyalty and reward services. Supports authentication, campaigns, user profiles, shopping carts, notifications, stamps, consent management, and more.
|
|
4
4
|
|
|
5
|
-
**Version:** 1.
|
|
5
|
+
**Version:** 2.1.0 | **License:** ISC | **Author:** Buzzebees Co., Ltd.
|
|
6
6
|
**Repository:** [Azure DevOps](https://dev.azure.com/buzzebees/Buzzebees/_git/React_API_Client)
|
|
7
7
|
|
|
8
8
|
---
|
|
@@ -34,6 +34,7 @@ A TypeScript library providing a type-safe API client for Buzzebees loyalty and
|
|
|
34
34
|
- [LineApi](#lineapi)
|
|
35
35
|
- [PlaceApi](#placeapi)
|
|
36
36
|
- [PointLogApi](#pointlogapi)
|
|
37
|
+
- [PointApi](#pointapi)
|
|
37
38
|
- [StampApi](#stampapi)
|
|
38
39
|
- [RequestHelpApi (Forum)](#requesthelpapi-forum)
|
|
39
40
|
- [SettingApi](#settingapi)
|
|
@@ -180,6 +181,7 @@ BzbsService (entry point)
|
|
|
180
181
|
├── NotificationApi → notification/
|
|
181
182
|
├── PlaceApi → place/
|
|
182
183
|
├── PointLogApi → log/points
|
|
184
|
+
├── PointApi → point/
|
|
183
185
|
├── ProfileApi → profile/
|
|
184
186
|
├── RegistrationApi → auth/register
|
|
185
187
|
├── AddressApi → profile/address, address/
|
|
@@ -224,6 +226,7 @@ src/
|
|
|
224
226
|
│ ├── notification/notification-api.ts
|
|
225
227
|
│ ├── place/place-api.ts
|
|
226
228
|
│ ├── point-log/point-log-api.ts
|
|
229
|
+
│ ├── points/point-api.ts
|
|
227
230
|
│ ├── profile/profile-api.ts
|
|
228
231
|
│ ├── registration/registration-api.ts
|
|
229
232
|
│ ├── request-help/request-help-api.ts
|
|
@@ -252,6 +255,7 @@ src/
|
|
|
252
255
|
| `notificationApi` | `NotificationApi` | Push notifications |
|
|
253
256
|
| `placeApi` | `PlaceApi` | Locations / stores |
|
|
254
257
|
| `pointLogApi` | `PointLogApi` | Point transaction logs |
|
|
258
|
+
| `pointApi` | `PointApi` | Multi-unit point balances and transaction history |
|
|
255
259
|
| `profileApi` | `ProfileApi` | User profile, points, account |
|
|
256
260
|
| `registerApi` | `RegistrationApi` | User registration |
|
|
257
261
|
| `addressApi` | `AddressApi` | Addresses, provinces, districts |
|
|
@@ -396,6 +400,9 @@ const response = await bzbsService.profileApi.profile(undefined, {
|
|
|
396
400
|
| `placeApi` | `addToFavourite` | POST | `place/{id}/favourite` | id | `unknown` | `#place` |
|
|
397
401
|
| `placeApi` | `removeFromFavourite` | POST | `place/{id}/unfavourite` | id | `unknown` | `#place` |
|
|
398
402
|
| `pointLogApi` | `getPointLog` | GET | `log/points` | month; opt: type, lastRowKey, top | `PointLog[]` | `#points #profile` |
|
|
403
|
+
| `pointApi` | `balance` | GET | `point/balance` | opt: units, boxIds, onlyVisible | `PointBalance[]` | `#points` |
|
|
404
|
+
| `pointApi` | `detail` | GET | `point/detail` | opt: units, boxIds, onlyVisible | `PointBalance[]` | `#points` |
|
|
405
|
+
| `pointApi` | `history` | GET | `point/history` | start, end; opt: onlyVisible, skip, top, sortType, units, boxIds, references, transactionIds, includeActions, excludeActions, includeTypes, excludeTypes | `PointHistory[]` | `#points` |
|
|
399
406
|
| `profileApi` | `profile` | GET | `profile/info` | opt: options | `ProfileResponse` | `#profile` |
|
|
400
407
|
| `profileApi` | `updateProfile` | POST | `profile/info` | opt: firstName, lastName, contactNumber, email, notification, locale, title, gender, birthDate, address, subdistrictCode, districtCode, provinceCode, countryCode, zipCode, idCard, passport, maritalStatus, displayName, latitude, longitude, income, interests, region, occupation, remark, ... (JSON body) | `ProfileResponse` | `#profile` |
|
|
401
408
|
| `profileApi` | `updateProfileImage` | POST | `profile/picture` | image (File or `{uri, name, type}`, sent as `multipart/form-data` with key `data`) | `ProfileResponse` | `#profile` |
|
|
@@ -910,6 +917,65 @@ const logs = await bzbsService.pointLogApi.getPointLog({
|
|
|
910
917
|
|
|
911
918
|
---
|
|
912
919
|
|
|
920
|
+
### PointApi
|
|
921
|
+
|
|
922
|
+
`bzbsService.pointApi` — Multi-unit point balances, breakdowns, and transaction history (earn/burn/transfer).
|
|
923
|
+
|
|
924
|
+
| Method | Description | Returns |
|
|
925
|
+
|---|---|---|
|
|
926
|
+
| `balance(params?)` | Current point balance for the user across requested units | `PointBalance[]` |
|
|
927
|
+
| `detail(params?)` | Point balance with `Currents` and `Expires` breakdowns keyed by date | `PointBalance[]` |
|
|
928
|
+
| `history(params)` | Paginated list of earn/burn/transfer transactions in a date range | `PointHistory[]` |
|
|
929
|
+
|
|
930
|
+
**Common params (`balance` / `detail`):**
|
|
931
|
+
|
|
932
|
+
| Param | Type | Required | Description |
|
|
933
|
+
|---|---|---|---|
|
|
934
|
+
| `units` | `string` | No | Point unit codes (e.g. `Point`, `Coin`). Omit for all configured units. Sent as `units[]`. |
|
|
935
|
+
| `boxIds` | `string` | No | Box (sub-bucket) identifiers. Sent as `boxIds[]`. |
|
|
936
|
+
| `onlyVisible` | `boolean` | No | When `true` (default), only units marked visible for the app are considered. |
|
|
937
|
+
|
|
938
|
+
**`history` params:**
|
|
939
|
+
|
|
940
|
+
| Param | Type | Required | Description |
|
|
941
|
+
|---|---|---|---|
|
|
942
|
+
| `start` | `string` | Yes | Start of the range (inclusive), ISO-8601 with offset |
|
|
943
|
+
| `end` | `string` | Yes | End of the range (inclusive), ISO-8601 with offset |
|
|
944
|
+
| `skip` | `number` | No | Offset pagination |
|
|
945
|
+
| `top` | `number` | No | Maximum records to return |
|
|
946
|
+
| `sortType` | `'Asc' \| 'Desc'` | No | Sort direction by `Timestamp` |
|
|
947
|
+
| `units` | `string` | No | Filter by point unit codes (sent as `units[]`) |
|
|
948
|
+
| `boxIds` | `string` | No | Filter by box ids (sent as `boxIds[]`) |
|
|
949
|
+
| `references` | `string` | No | Filter by transaction reference (sent as `references[]`) |
|
|
950
|
+
| `transactionIds` | `string` | No | Filter by exact transaction ids (sent as `transactionIds[]`) |
|
|
951
|
+
| `includeActions` | `string` | No | Only include actions (e.g. `Earn`, `Burn`, `Transfer`) — sent as `includeActions[]` |
|
|
952
|
+
| `excludeActions` | `string` | No | Exclude actions — sent as `excludeActions[]` |
|
|
953
|
+
| `includeTypes` | `string` | No | Only include types — sent as `includeTypes[]` |
|
|
954
|
+
| `excludeTypes` | `string` | No | Exclude types — sent as `excludeTypes[]` |
|
|
955
|
+
| `onlyVisible` | `boolean` | No | Restrict to visible units (default `true`) |
|
|
956
|
+
|
|
957
|
+
```typescript
|
|
958
|
+
// Current balance across all configured units
|
|
959
|
+
const balance = await bzbsService.pointApi.balance();
|
|
960
|
+
|
|
961
|
+
// Specific units only
|
|
962
|
+
const coinBalance = await bzbsService.pointApi.balance({ units: 'Coin' });
|
|
963
|
+
|
|
964
|
+
// Balance with current/expiring breakdowns
|
|
965
|
+
const detail = await bzbsService.pointApi.detail({ onlyVisible: true });
|
|
966
|
+
|
|
967
|
+
// Paginated transaction history
|
|
968
|
+
const history = await bzbsService.pointApi.history({
|
|
969
|
+
start: '2025-01-01T00:00:00+07:00',
|
|
970
|
+
end: '2025-01-31T23:59:59+07:00',
|
|
971
|
+
top: 50,
|
|
972
|
+
sortType: 'Desc',
|
|
973
|
+
includeActions: 'Earn',
|
|
974
|
+
});
|
|
975
|
+
```
|
|
976
|
+
|
|
977
|
+
---
|
|
978
|
+
|
|
913
979
|
### StampApi
|
|
914
980
|
|
|
915
981
|
`bzbsService.stampApi` — Stamp card system.
|
|
@@ -1064,6 +1130,8 @@ import {
|
|
|
1064
1130
|
| `Badge` | badgeId, name, description, imageUrl, missions (Mission[]) |
|
|
1065
1131
|
| `Mission` | missionId, name, current, target, isCompleted |
|
|
1066
1132
|
| `PointLog` | UserId, Info, Detail, Points, Type, Timestamp |
|
|
1133
|
+
| `PointBalance` | Unit, Balance, Currents (date → amount map), Expires (date → amount map) |
|
|
1134
|
+
| `PointHistory` | Unit, TransactionId, Reference, Timestamp, TotalChange, Action, Type, Message, Data |
|
|
1067
1135
|
|
|
1068
1136
|
### Address & Location Models
|
|
1069
1137
|
|
package/dist/index.d.mts
CHANGED
|
@@ -1252,6 +1252,31 @@ interface ConsentVersionValue {
|
|
|
1252
1252
|
current_version: string;
|
|
1253
1253
|
}
|
|
1254
1254
|
|
|
1255
|
+
interface PointBalance {
|
|
1256
|
+
Unit: string;
|
|
1257
|
+
Balance: number;
|
|
1258
|
+
Currents?: {
|
|
1259
|
+
[date: string]: number;
|
|
1260
|
+
};
|
|
1261
|
+
Expires?: {
|
|
1262
|
+
[date: string]: number;
|
|
1263
|
+
};
|
|
1264
|
+
}
|
|
1265
|
+
|
|
1266
|
+
interface PointHistory {
|
|
1267
|
+
Unit: string;
|
|
1268
|
+
TransactionId: string;
|
|
1269
|
+
Reference: string;
|
|
1270
|
+
Timestamp: number;
|
|
1271
|
+
TotalChange: number;
|
|
1272
|
+
Action: string;
|
|
1273
|
+
Type: string;
|
|
1274
|
+
Message: string | null;
|
|
1275
|
+
Data: {
|
|
1276
|
+
[key: string]: any;
|
|
1277
|
+
} | null;
|
|
1278
|
+
}
|
|
1279
|
+
|
|
1255
1280
|
declare class AuthenticateApi extends BaseService {
|
|
1256
1281
|
constructor(client: AxiosInstance, baseUrl: string);
|
|
1257
1282
|
/**
|
|
@@ -1935,6 +1960,7 @@ declare class CampaignApi extends BaseService {
|
|
|
1935
1960
|
* @param params.contactNumber - The contact number of the user.
|
|
1936
1961
|
* @param params.options - Additional options for the redemption.
|
|
1937
1962
|
* @param params.spPoints - Point Per Unit x Quantity (Donate only).
|
|
1963
|
+
* @param params.pointUnit - The point unit of the campaign (Point Service Only).
|
|
1938
1964
|
* @param requestOptions - The options for the HTTP request.
|
|
1939
1965
|
* @returns A promise that resolves to a service response containing the redeem response.
|
|
1940
1966
|
*/
|
|
@@ -2402,6 +2428,89 @@ declare class PointLogApi extends BaseService {
|
|
|
2402
2428
|
}, requestOption?: RequestOptions): Promise<ServiceResponse<PointLog[]>>;
|
|
2403
2429
|
}
|
|
2404
2430
|
|
|
2431
|
+
declare class PointApi extends BaseService {
|
|
2432
|
+
constructor(client: AxiosInstance, baseUrl: string);
|
|
2433
|
+
/**
|
|
2434
|
+
* Retrieves the current point balance for the authenticated user across the requested point units.
|
|
2435
|
+
*
|
|
2436
|
+
* @param params - The parameters for retrieving the point balance.
|
|
2437
|
+
* @param params.units - (Optional) Point unit codes (e.g. Point, Coin). Omit to use all units configured for the app.
|
|
2438
|
+
* @param params.boxIds - (Optional) Box (sub-bucket) identifiers to filter by.
|
|
2439
|
+
* @param params.onlyVisible - (Optional) When true (default), only units marked visible for the app are considered.
|
|
2440
|
+
* @param params.options - (Optional) Additional options for the request.
|
|
2441
|
+
* @param requestOptions - (Optional) The request options.
|
|
2442
|
+
* @returns A promise that resolves to a service response containing an array of point balances.
|
|
2443
|
+
*/
|
|
2444
|
+
balance(params?: {
|
|
2445
|
+
units?: string;
|
|
2446
|
+
boxIds?: string;
|
|
2447
|
+
onlyVisible?: boolean;
|
|
2448
|
+
options?: {
|
|
2449
|
+
[key: string]: unknown;
|
|
2450
|
+
};
|
|
2451
|
+
}, requestOptions?: RequestOptions): Promise<ServiceResponse<PointBalance[]>>;
|
|
2452
|
+
/**
|
|
2453
|
+
* Retrieves the point balance with Currents and Expires breakdowns keyed by date.
|
|
2454
|
+
*
|
|
2455
|
+
* @param params - The parameters for retrieving the point detail.
|
|
2456
|
+
* @param params.units - (Optional) Point unit codes (e.g. Point, Coin). Omit to use all units configured for the app.
|
|
2457
|
+
* @param params.boxIds - (Optional) Box (sub-bucket) identifiers to filter by.
|
|
2458
|
+
* @param params.onlyVisible - (Optional) When true (default), only units marked visible for the app are considered.
|
|
2459
|
+
* @param params.options - (Optional) Additional options for the request.
|
|
2460
|
+
* @param requestOptions - (Optional) The request options.
|
|
2461
|
+
* @returns A promise that resolves to a service response containing an array of point balances with breakdowns.
|
|
2462
|
+
*/
|
|
2463
|
+
detail(params?: {
|
|
2464
|
+
units?: string;
|
|
2465
|
+
boxIds?: string;
|
|
2466
|
+
onlyVisible?: boolean;
|
|
2467
|
+
options?: {
|
|
2468
|
+
[key: string]: unknown;
|
|
2469
|
+
};
|
|
2470
|
+
}, requestOptions?: RequestOptions): Promise<ServiceResponse<PointBalance[]>>;
|
|
2471
|
+
/**
|
|
2472
|
+
* Retrieves a paginated list of earn/burn/transfer transactions between start and end dates.
|
|
2473
|
+
*
|
|
2474
|
+
* @param params - The parameters for retrieving the point history.
|
|
2475
|
+
* @param params.start - Start of the range (inclusive), ISO-8601 with offset.
|
|
2476
|
+
* @param params.end - End of the range (inclusive), ISO-8601 with offset.
|
|
2477
|
+
* @param params.onlyVisible - (Optional) When true (default), only units marked visible for the app are considered.
|
|
2478
|
+
* @param params.skip - (Optional) Number of records to skip (offset pagination).
|
|
2479
|
+
* @param params.top - (Optional) Maximum number of records to return.
|
|
2480
|
+
* @param params.sortType - (Optional) Sort direction for Timestamp: Asc|Desc.
|
|
2481
|
+
* @param params.units - (Optional) Point unit codes to filter by.
|
|
2482
|
+
* @param params.boxIds - (Optional) Box (sub-bucket) identifiers to filter by.
|
|
2483
|
+
* @param params.references - (Optional) Filter by transaction reference.
|
|
2484
|
+
* @param params.transactionIds - (Optional) Filter by exact transaction IDs.
|
|
2485
|
+
* @param params.includeActions - (Optional) Only include transactions whose Action matches (e.g. Earn, Burn, Transfer).
|
|
2486
|
+
* @param params.excludeActions - (Optional) Exclude transactions whose Action matches.
|
|
2487
|
+
* @param params.includeTypes - (Optional) Only include transactions whose Type matches.
|
|
2488
|
+
* @param params.excludeTypes - (Optional) Exclude transactions whose Type matches.
|
|
2489
|
+
* @param params.options - (Optional) Additional options for the request.
|
|
2490
|
+
* @param requestOptions - (Optional) The request options.
|
|
2491
|
+
* @returns A promise that resolves to a service response containing an array of point history transactions.
|
|
2492
|
+
*/
|
|
2493
|
+
history(params: {
|
|
2494
|
+
start: string;
|
|
2495
|
+
end: string;
|
|
2496
|
+
onlyVisible?: boolean;
|
|
2497
|
+
skip?: number;
|
|
2498
|
+
top?: number;
|
|
2499
|
+
sortType?: 'Asc' | 'Desc';
|
|
2500
|
+
units?: string;
|
|
2501
|
+
boxIds?: string;
|
|
2502
|
+
references?: string;
|
|
2503
|
+
transactionIds?: string;
|
|
2504
|
+
includeActions?: string;
|
|
2505
|
+
excludeActions?: string;
|
|
2506
|
+
includeTypes?: string;
|
|
2507
|
+
excludeTypes?: string;
|
|
2508
|
+
options?: {
|
|
2509
|
+
[key: string]: unknown;
|
|
2510
|
+
};
|
|
2511
|
+
}, requestOptions?: RequestOptions): Promise<ServiceResponse<PointHistory[]>>;
|
|
2512
|
+
}
|
|
2513
|
+
|
|
2405
2514
|
declare class ProfileApi extends BaseService {
|
|
2406
2515
|
constructor(client: AxiosInstance, baseUrl: string);
|
|
2407
2516
|
/**
|
|
@@ -3143,6 +3252,7 @@ declare class BzbsService {
|
|
|
3143
3252
|
notificationApi: NotificationApi;
|
|
3144
3253
|
placeApi: PlaceApi;
|
|
3145
3254
|
pointLogApi: PointLogApi;
|
|
3255
|
+
pointApi: PointApi;
|
|
3146
3256
|
profileApi: ProfileApi;
|
|
3147
3257
|
registerApi: RegistrationApi;
|
|
3148
3258
|
addressApi: AddressApi;
|
|
@@ -3156,4 +3266,4 @@ declare class BzbsService {
|
|
|
3156
3266
|
setLineUrl(lineUrl: string): this;
|
|
3157
3267
|
}
|
|
3158
3268
|
|
|
3159
|
-
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, 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 };
|
|
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 };
|
package/dist/index.d.ts
CHANGED
|
@@ -1252,6 +1252,31 @@ interface ConsentVersionValue {
|
|
|
1252
1252
|
current_version: string;
|
|
1253
1253
|
}
|
|
1254
1254
|
|
|
1255
|
+
interface PointBalance {
|
|
1256
|
+
Unit: string;
|
|
1257
|
+
Balance: number;
|
|
1258
|
+
Currents?: {
|
|
1259
|
+
[date: string]: number;
|
|
1260
|
+
};
|
|
1261
|
+
Expires?: {
|
|
1262
|
+
[date: string]: number;
|
|
1263
|
+
};
|
|
1264
|
+
}
|
|
1265
|
+
|
|
1266
|
+
interface PointHistory {
|
|
1267
|
+
Unit: string;
|
|
1268
|
+
TransactionId: string;
|
|
1269
|
+
Reference: string;
|
|
1270
|
+
Timestamp: number;
|
|
1271
|
+
TotalChange: number;
|
|
1272
|
+
Action: string;
|
|
1273
|
+
Type: string;
|
|
1274
|
+
Message: string | null;
|
|
1275
|
+
Data: {
|
|
1276
|
+
[key: string]: any;
|
|
1277
|
+
} | null;
|
|
1278
|
+
}
|
|
1279
|
+
|
|
1255
1280
|
declare class AuthenticateApi extends BaseService {
|
|
1256
1281
|
constructor(client: AxiosInstance, baseUrl: string);
|
|
1257
1282
|
/**
|
|
@@ -1935,6 +1960,7 @@ declare class CampaignApi extends BaseService {
|
|
|
1935
1960
|
* @param params.contactNumber - The contact number of the user.
|
|
1936
1961
|
* @param params.options - Additional options for the redemption.
|
|
1937
1962
|
* @param params.spPoints - Point Per Unit x Quantity (Donate only).
|
|
1963
|
+
* @param params.pointUnit - The point unit of the campaign (Point Service Only).
|
|
1938
1964
|
* @param requestOptions - The options for the HTTP request.
|
|
1939
1965
|
* @returns A promise that resolves to a service response containing the redeem response.
|
|
1940
1966
|
*/
|
|
@@ -2402,6 +2428,89 @@ declare class PointLogApi extends BaseService {
|
|
|
2402
2428
|
}, requestOption?: RequestOptions): Promise<ServiceResponse<PointLog[]>>;
|
|
2403
2429
|
}
|
|
2404
2430
|
|
|
2431
|
+
declare class PointApi extends BaseService {
|
|
2432
|
+
constructor(client: AxiosInstance, baseUrl: string);
|
|
2433
|
+
/**
|
|
2434
|
+
* Retrieves the current point balance for the authenticated user across the requested point units.
|
|
2435
|
+
*
|
|
2436
|
+
* @param params - The parameters for retrieving the point balance.
|
|
2437
|
+
* @param params.units - (Optional) Point unit codes (e.g. Point, Coin). Omit to use all units configured for the app.
|
|
2438
|
+
* @param params.boxIds - (Optional) Box (sub-bucket) identifiers to filter by.
|
|
2439
|
+
* @param params.onlyVisible - (Optional) When true (default), only units marked visible for the app are considered.
|
|
2440
|
+
* @param params.options - (Optional) Additional options for the request.
|
|
2441
|
+
* @param requestOptions - (Optional) The request options.
|
|
2442
|
+
* @returns A promise that resolves to a service response containing an array of point balances.
|
|
2443
|
+
*/
|
|
2444
|
+
balance(params?: {
|
|
2445
|
+
units?: string;
|
|
2446
|
+
boxIds?: string;
|
|
2447
|
+
onlyVisible?: boolean;
|
|
2448
|
+
options?: {
|
|
2449
|
+
[key: string]: unknown;
|
|
2450
|
+
};
|
|
2451
|
+
}, requestOptions?: RequestOptions): Promise<ServiceResponse<PointBalance[]>>;
|
|
2452
|
+
/**
|
|
2453
|
+
* Retrieves the point balance with Currents and Expires breakdowns keyed by date.
|
|
2454
|
+
*
|
|
2455
|
+
* @param params - The parameters for retrieving the point detail.
|
|
2456
|
+
* @param params.units - (Optional) Point unit codes (e.g. Point, Coin). Omit to use all units configured for the app.
|
|
2457
|
+
* @param params.boxIds - (Optional) Box (sub-bucket) identifiers to filter by.
|
|
2458
|
+
* @param params.onlyVisible - (Optional) When true (default), only units marked visible for the app are considered.
|
|
2459
|
+
* @param params.options - (Optional) Additional options for the request.
|
|
2460
|
+
* @param requestOptions - (Optional) The request options.
|
|
2461
|
+
* @returns A promise that resolves to a service response containing an array of point balances with breakdowns.
|
|
2462
|
+
*/
|
|
2463
|
+
detail(params?: {
|
|
2464
|
+
units?: string;
|
|
2465
|
+
boxIds?: string;
|
|
2466
|
+
onlyVisible?: boolean;
|
|
2467
|
+
options?: {
|
|
2468
|
+
[key: string]: unknown;
|
|
2469
|
+
};
|
|
2470
|
+
}, requestOptions?: RequestOptions): Promise<ServiceResponse<PointBalance[]>>;
|
|
2471
|
+
/**
|
|
2472
|
+
* Retrieves a paginated list of earn/burn/transfer transactions between start and end dates.
|
|
2473
|
+
*
|
|
2474
|
+
* @param params - The parameters for retrieving the point history.
|
|
2475
|
+
* @param params.start - Start of the range (inclusive), ISO-8601 with offset.
|
|
2476
|
+
* @param params.end - End of the range (inclusive), ISO-8601 with offset.
|
|
2477
|
+
* @param params.onlyVisible - (Optional) When true (default), only units marked visible for the app are considered.
|
|
2478
|
+
* @param params.skip - (Optional) Number of records to skip (offset pagination).
|
|
2479
|
+
* @param params.top - (Optional) Maximum number of records to return.
|
|
2480
|
+
* @param params.sortType - (Optional) Sort direction for Timestamp: Asc|Desc.
|
|
2481
|
+
* @param params.units - (Optional) Point unit codes to filter by.
|
|
2482
|
+
* @param params.boxIds - (Optional) Box (sub-bucket) identifiers to filter by.
|
|
2483
|
+
* @param params.references - (Optional) Filter by transaction reference.
|
|
2484
|
+
* @param params.transactionIds - (Optional) Filter by exact transaction IDs.
|
|
2485
|
+
* @param params.includeActions - (Optional) Only include transactions whose Action matches (e.g. Earn, Burn, Transfer).
|
|
2486
|
+
* @param params.excludeActions - (Optional) Exclude transactions whose Action matches.
|
|
2487
|
+
* @param params.includeTypes - (Optional) Only include transactions whose Type matches.
|
|
2488
|
+
* @param params.excludeTypes - (Optional) Exclude transactions whose Type matches.
|
|
2489
|
+
* @param params.options - (Optional) Additional options for the request.
|
|
2490
|
+
* @param requestOptions - (Optional) The request options.
|
|
2491
|
+
* @returns A promise that resolves to a service response containing an array of point history transactions.
|
|
2492
|
+
*/
|
|
2493
|
+
history(params: {
|
|
2494
|
+
start: string;
|
|
2495
|
+
end: string;
|
|
2496
|
+
onlyVisible?: boolean;
|
|
2497
|
+
skip?: number;
|
|
2498
|
+
top?: number;
|
|
2499
|
+
sortType?: 'Asc' | 'Desc';
|
|
2500
|
+
units?: string;
|
|
2501
|
+
boxIds?: string;
|
|
2502
|
+
references?: string;
|
|
2503
|
+
transactionIds?: string;
|
|
2504
|
+
includeActions?: string;
|
|
2505
|
+
excludeActions?: string;
|
|
2506
|
+
includeTypes?: string;
|
|
2507
|
+
excludeTypes?: string;
|
|
2508
|
+
options?: {
|
|
2509
|
+
[key: string]: unknown;
|
|
2510
|
+
};
|
|
2511
|
+
}, requestOptions?: RequestOptions): Promise<ServiceResponse<PointHistory[]>>;
|
|
2512
|
+
}
|
|
2513
|
+
|
|
2405
2514
|
declare class ProfileApi extends BaseService {
|
|
2406
2515
|
constructor(client: AxiosInstance, baseUrl: string);
|
|
2407
2516
|
/**
|
|
@@ -3143,6 +3252,7 @@ declare class BzbsService {
|
|
|
3143
3252
|
notificationApi: NotificationApi;
|
|
3144
3253
|
placeApi: PlaceApi;
|
|
3145
3254
|
pointLogApi: PointLogApi;
|
|
3255
|
+
pointApi: PointApi;
|
|
3146
3256
|
profileApi: ProfileApi;
|
|
3147
3257
|
registerApi: RegistrationApi;
|
|
3148
3258
|
addressApi: AddressApi;
|
|
@@ -3156,4 +3266,4 @@ declare class BzbsService {
|
|
|
3156
3266
|
setLineUrl(lineUrl: string): this;
|
|
3157
3267
|
}
|
|
3158
3268
|
|
|
3159
|
-
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, 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 };
|
|
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 };
|
package/dist/index.js
CHANGED
|
@@ -73,6 +73,7 @@ __export(index_exports, {
|
|
|
73
73
|
LineApi: () => LineApi,
|
|
74
74
|
NotificationApi: () => NotificationApi,
|
|
75
75
|
PlaceApi: () => PlaceApi,
|
|
76
|
+
PointApi: () => PointApi,
|
|
76
77
|
PointLogApi: () => PointLogApi,
|
|
77
78
|
ProfileApi: () => ProfileApi,
|
|
78
79
|
RegistrationApi: () => RegistrationApi,
|
|
@@ -1063,6 +1064,7 @@ var CampaignApi = class extends BaseService {
|
|
|
1063
1064
|
* @param params.contactNumber - The contact number of the user.
|
|
1064
1065
|
* @param params.options - Additional options for the redemption.
|
|
1065
1066
|
* @param params.spPoints - Point Per Unit x Quantity (Donate only).
|
|
1067
|
+
* @param params.pointUnit - The point unit of the campaign (Point Service Only).
|
|
1066
1068
|
* @param requestOptions - The options for the HTTP request.
|
|
1067
1069
|
* @returns A promise that resolves to a service response containing the redeem response.
|
|
1068
1070
|
*/
|
|
@@ -1692,6 +1694,107 @@ var PointLogApi = class extends BaseService {
|
|
|
1692
1694
|
}
|
|
1693
1695
|
};
|
|
1694
1696
|
|
|
1697
|
+
// src/api/points/point-api.ts
|
|
1698
|
+
var PointApi = class extends BaseService {
|
|
1699
|
+
constructor(client, baseUrl) {
|
|
1700
|
+
super(client, baseUrl);
|
|
1701
|
+
}
|
|
1702
|
+
/**
|
|
1703
|
+
* Retrieves the current point balance for the authenticated user across the requested point units.
|
|
1704
|
+
*
|
|
1705
|
+
* @param params - The parameters for retrieving the point balance.
|
|
1706
|
+
* @param params.units - (Optional) Point unit codes (e.g. Point, Coin). Omit to use all units configured for the app.
|
|
1707
|
+
* @param params.boxIds - (Optional) Box (sub-bucket) identifiers to filter by.
|
|
1708
|
+
* @param params.onlyVisible - (Optional) When true (default), only units marked visible for the app are considered.
|
|
1709
|
+
* @param params.options - (Optional) Additional options for the request.
|
|
1710
|
+
* @param requestOptions - (Optional) The request options.
|
|
1711
|
+
* @returns A promise that resolves to a service response containing an array of point balances.
|
|
1712
|
+
*/
|
|
1713
|
+
balance(params, requestOptions) {
|
|
1714
|
+
return __async(this, null, function* () {
|
|
1715
|
+
return yield this.get(
|
|
1716
|
+
"point/balance",
|
|
1717
|
+
__spreadValues({
|
|
1718
|
+
"units[]": params == null ? void 0 : params.units,
|
|
1719
|
+
"boxIds[]": params == null ? void 0 : params.boxIds,
|
|
1720
|
+
onlyVisible: params == null ? void 0 : params.onlyVisible
|
|
1721
|
+
}, params == null ? void 0 : params.options),
|
|
1722
|
+
requestOptions
|
|
1723
|
+
);
|
|
1724
|
+
});
|
|
1725
|
+
}
|
|
1726
|
+
/**
|
|
1727
|
+
* Retrieves the point balance with Currents and Expires breakdowns keyed by date.
|
|
1728
|
+
*
|
|
1729
|
+
* @param params - The parameters for retrieving the point detail.
|
|
1730
|
+
* @param params.units - (Optional) Point unit codes (e.g. Point, Coin). Omit to use all units configured for the app.
|
|
1731
|
+
* @param params.boxIds - (Optional) Box (sub-bucket) identifiers to filter by.
|
|
1732
|
+
* @param params.onlyVisible - (Optional) When true (default), only units marked visible for the app are considered.
|
|
1733
|
+
* @param params.options - (Optional) Additional options for the request.
|
|
1734
|
+
* @param requestOptions - (Optional) The request options.
|
|
1735
|
+
* @returns A promise that resolves to a service response containing an array of point balances with breakdowns.
|
|
1736
|
+
*/
|
|
1737
|
+
detail(params, requestOptions) {
|
|
1738
|
+
return __async(this, null, function* () {
|
|
1739
|
+
return yield this.get(
|
|
1740
|
+
"point/detail",
|
|
1741
|
+
__spreadValues({
|
|
1742
|
+
"units[]": params == null ? void 0 : params.units,
|
|
1743
|
+
"boxIds[]": params == null ? void 0 : params.boxIds,
|
|
1744
|
+
onlyVisible: params == null ? void 0 : params.onlyVisible
|
|
1745
|
+
}, params == null ? void 0 : params.options),
|
|
1746
|
+
requestOptions
|
|
1747
|
+
);
|
|
1748
|
+
});
|
|
1749
|
+
}
|
|
1750
|
+
/**
|
|
1751
|
+
* Retrieves a paginated list of earn/burn/transfer transactions between start and end dates.
|
|
1752
|
+
*
|
|
1753
|
+
* @param params - The parameters for retrieving the point history.
|
|
1754
|
+
* @param params.start - Start of the range (inclusive), ISO-8601 with offset.
|
|
1755
|
+
* @param params.end - End of the range (inclusive), ISO-8601 with offset.
|
|
1756
|
+
* @param params.onlyVisible - (Optional) When true (default), only units marked visible for the app are considered.
|
|
1757
|
+
* @param params.skip - (Optional) Number of records to skip (offset pagination).
|
|
1758
|
+
* @param params.top - (Optional) Maximum number of records to return.
|
|
1759
|
+
* @param params.sortType - (Optional) Sort direction for Timestamp: Asc|Desc.
|
|
1760
|
+
* @param params.units - (Optional) Point unit codes to filter by.
|
|
1761
|
+
* @param params.boxIds - (Optional) Box (sub-bucket) identifiers to filter by.
|
|
1762
|
+
* @param params.references - (Optional) Filter by transaction reference.
|
|
1763
|
+
* @param params.transactionIds - (Optional) Filter by exact transaction IDs.
|
|
1764
|
+
* @param params.includeActions - (Optional) Only include transactions whose Action matches (e.g. Earn, Burn, Transfer).
|
|
1765
|
+
* @param params.excludeActions - (Optional) Exclude transactions whose Action matches.
|
|
1766
|
+
* @param params.includeTypes - (Optional) Only include transactions whose Type matches.
|
|
1767
|
+
* @param params.excludeTypes - (Optional) Exclude transactions whose Type matches.
|
|
1768
|
+
* @param params.options - (Optional) Additional options for the request.
|
|
1769
|
+
* @param requestOptions - (Optional) The request options.
|
|
1770
|
+
* @returns A promise that resolves to a service response containing an array of point history transactions.
|
|
1771
|
+
*/
|
|
1772
|
+
history(params, requestOptions) {
|
|
1773
|
+
return __async(this, null, function* () {
|
|
1774
|
+
return yield this.get(
|
|
1775
|
+
"point/history",
|
|
1776
|
+
__spreadValues({
|
|
1777
|
+
start: params.start,
|
|
1778
|
+
end: params.end,
|
|
1779
|
+
onlyVisible: params.onlyVisible,
|
|
1780
|
+
skip: params.skip,
|
|
1781
|
+
top: params.top,
|
|
1782
|
+
sortType: params.sortType,
|
|
1783
|
+
"units[]": params.units,
|
|
1784
|
+
"boxIds[]": params.boxIds,
|
|
1785
|
+
"references[]": params.references,
|
|
1786
|
+
"transactionIds[]": params.transactionIds,
|
|
1787
|
+
"includeActions[]": params.includeActions,
|
|
1788
|
+
"excludeActions[]": params.excludeActions,
|
|
1789
|
+
"includeTypes[]": params.includeTypes,
|
|
1790
|
+
"excludeTypes[]": params.excludeTypes
|
|
1791
|
+
}, params.options),
|
|
1792
|
+
requestOptions
|
|
1793
|
+
);
|
|
1794
|
+
});
|
|
1795
|
+
}
|
|
1796
|
+
};
|
|
1797
|
+
|
|
1695
1798
|
// src/api/profile/profile-api.ts
|
|
1696
1799
|
var ProfileApi = class extends BaseService {
|
|
1697
1800
|
constructor(client, baseUrl) {
|
|
@@ -2651,6 +2754,7 @@ var BzbsService = class {
|
|
|
2651
2754
|
this.notificationApi = new NotificationApi(this.client, this.baseUrl);
|
|
2652
2755
|
this.placeApi = new PlaceApi(this.client, this.baseUrl);
|
|
2653
2756
|
this.pointLogApi = new PointLogApi(this.client, this.baseUrl);
|
|
2757
|
+
this.pointApi = new PointApi(this.client, this.baseUrl);
|
|
2654
2758
|
this.profileApi = new ProfileApi(this.client, this.baseUrl);
|
|
2655
2759
|
this.registerApi = new RegistrationApi(this.client, this.baseUrl);
|
|
2656
2760
|
this.addressApi = new AddressApi(this.client, this.baseUrl);
|
|
@@ -2673,6 +2777,7 @@ var BzbsService = class {
|
|
|
2673
2777
|
this.notificationApi.setBaseUrl(baseUrl);
|
|
2674
2778
|
this.placeApi.setBaseUrl(baseUrl);
|
|
2675
2779
|
this.pointLogApi.setBaseUrl(baseUrl);
|
|
2780
|
+
this.pointApi.setBaseUrl(baseUrl);
|
|
2676
2781
|
this.profileApi.setBaseUrl(baseUrl);
|
|
2677
2782
|
this.registerApi.setBaseUrl(baseUrl);
|
|
2678
2783
|
this.addressApi.setBaseUrl(baseUrl);
|
|
@@ -2709,6 +2814,7 @@ var BzbsService = class {
|
|
|
2709
2814
|
LineApi,
|
|
2710
2815
|
NotificationApi,
|
|
2711
2816
|
PlaceApi,
|
|
2817
|
+
PointApi,
|
|
2712
2818
|
PointLogApi,
|
|
2713
2819
|
ProfileApi,
|
|
2714
2820
|
RegistrationApi,
|