@bzbs/react-api-client 1.4.15 → 2.0.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 +78 -53
- package/dist/index.d.mts +38 -11
- package/dist/index.d.ts +38 -11
- package/dist/index.js +152 -300
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +152 -300
- 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.4.
|
|
5
|
+
**Version:** 1.4.15 | **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
|
---
|
|
@@ -11,6 +11,7 @@ A TypeScript library providing a type-safe API client for Buzzebees loyalty and
|
|
|
11
11
|
|
|
12
12
|
- [Installation](#installation)
|
|
13
13
|
- [Quick Start](#quick-start)
|
|
14
|
+
- [API Version](#api-version)
|
|
14
15
|
- [Configuration](#configuration)
|
|
15
16
|
- [Architecture](#architecture)
|
|
16
17
|
- [BzbsService Properties](#bzbsservice-properties)
|
|
@@ -98,6 +99,18 @@ if (result.type === 'success') {
|
|
|
98
99
|
|
|
99
100
|
---
|
|
100
101
|
|
|
102
|
+
## API Version
|
|
103
|
+
|
|
104
|
+
This library targets **Buzzebees API v2**. Key differences from v1:
|
|
105
|
+
|
|
106
|
+
- All POST request bodies use **JSON** (`application/json`) — no more `application/x-www-form-urlencoded`
|
|
107
|
+
- Profile image upload uses `multipart/form-data` via the dedicated `updateProfileImage()` method
|
|
108
|
+
- Flat endpoint paths replace REST-style path parameters (e.g. `campaign/detail?campaignId=123` replaces `campaign/123`)
|
|
109
|
+
- `profile/me/` prefix removed — the auth token identifies the user (e.g. `profile/info` replaces `profile/me`)
|
|
110
|
+
- Address lookups moved from `main/` to `address/` prefix
|
|
111
|
+
|
|
112
|
+
---
|
|
113
|
+
|
|
101
114
|
## Configuration
|
|
102
115
|
|
|
103
116
|
### Constructor
|
|
@@ -158,21 +171,21 @@ BzbsService (entry point)
|
|
|
158
171
|
├── BadgeApi → profile/me/badges
|
|
159
172
|
├── CampaignApi → campaign/
|
|
160
173
|
├── CartApi → cart/
|
|
161
|
-
├── CategoryApi →
|
|
174
|
+
├── CategoryApi → category/
|
|
162
175
|
├── ConsentApi → consent/
|
|
163
176
|
├── CouponApi → coupon/
|
|
164
|
-
├── DashboardApi → dashboard/
|
|
177
|
+
├── DashboardApi → dashboard/config
|
|
165
178
|
├── HistoryApi → redeem/
|
|
166
179
|
├── LineApi → LINE OAuth (optional)
|
|
167
|
-
├── NotificationApi →
|
|
180
|
+
├── NotificationApi → notification/
|
|
168
181
|
├── PlaceApi → place/
|
|
169
182
|
├── PointLogApi → log/points
|
|
170
|
-
├── ProfileApi → profile/
|
|
183
|
+
├── ProfileApi → profile/
|
|
171
184
|
├── RegistrationApi → auth/register
|
|
172
|
-
├── AddressApi → profile/
|
|
185
|
+
├── AddressApi → profile/address, address/
|
|
173
186
|
├── StampApi → stamp/
|
|
174
187
|
├── RequestHelpApi → buzz/, profile/me/help
|
|
175
|
-
├── SettingApi → setting/
|
|
188
|
+
├── SettingApi → setting/add
|
|
176
189
|
└── Blob → blob storage
|
|
177
190
|
│
|
|
178
191
|
▼
|
|
@@ -344,8 +357,8 @@ const response = await bzbsService.profileApi.profile(undefined, {
|
|
|
344
357
|
| `authApi` | `connectGoogle` | POST | `auth/google_login` | idToken, appId, uuid, os, platform, deviceToken, macAddress | `LoginResponse` | `#auth` |
|
|
345
358
|
| `authApi` | `connectApple` | POST | `auth/apple_login` | idToken, refreshToken, appId, uuid, os, platform, deviceToken, macAddress | `LoginResponse` | `#auth` |
|
|
346
359
|
| `authApi` | `logout` | POST | `auth/logout` | uuid | `unknown` | `#auth` |
|
|
347
|
-
| `authApi` | `forgetPassword` | GET | `profile/
|
|
348
|
-
| `authApi` | `resetPassword` | POST | `profile/
|
|
360
|
+
| `authApi` | `forgetPassword` | GET | `profile/forget_password` | contact (as `id` param), type (`email`\|`contact_number`\|`email_otp`) | `ForgetPasswordResponse` | `#auth #profile` |
|
|
361
|
+
| `authApi` | `resetPassword` | POST | `profile/forget_password` | contact (as `id`), refCode, newPassword; opt: otp | `StatusResponse` | `#auth #profile` |
|
|
349
362
|
| `authApi` | `otp` | GET | `auth/otp` | uuid, appId, contactNumber; opt: channel | `OtpResponse` | `#auth` |
|
|
350
363
|
| `authApi` | `otpV2` | POST | `auth/otp` | appId, contactNumber; opt: channel | `OtpResponse` | `#auth` |
|
|
351
364
|
| `authApi` | `otpEmail` | GET | `auth/otp_email` | uuid, appId, email; opt: channel | `OtpResponse` | `#auth` |
|
|
@@ -356,55 +369,56 @@ const response = await bzbsService.profileApi.profile(undefined, {
|
|
|
356
369
|
| `authApi` | `version` | GET | `auth/version` | clientVersion | `Version` | `#auth` |
|
|
357
370
|
| `authApi` | `versionRaw` | GET | `auth/version` | clientVersion | `any` | `#auth` |
|
|
358
371
|
| `badgeApi` | `badges` | GET | `profile/me/badges` | opt: badgeId | `Badge[]` | `#profile` |
|
|
359
|
-
| `campaignApi` | `campaigns` | GET | `campaign` | config; opt: cat, byConfig, skip, top, locale, keyword, startDate, sponsorId, maxPoints, minPoints, sortBy, center, hashTags, locationAgencyId | `Campaign[]` | `#campaign` |
|
|
360
|
-
| `campaignApi` | `favoriteCampaigns` | GET | `profile/
|
|
361
|
-
| `campaignApi` | `campaignDetails` | GET | `campaign/
|
|
362
|
-
| `campaignApi` | `addToFavorite` | POST | `campaign/
|
|
363
|
-
| `campaignApi` | `removeFromFavorite` | DELETE | `campaign/
|
|
364
|
-
| `campaignApi` | `redeem` | POST | `campaign/
|
|
372
|
+
| `campaignApi` | `campaigns` | GET | `campaign/list` | config; opt: cat, byConfig, skip, top, locale, keyword, startDate, sponsorId, maxPoints, minPoints, sortBy, center, hashTags, locationAgencyId | `Campaign[]` | `#campaign` |
|
|
373
|
+
| `campaignApi` | `favoriteCampaigns` | GET | `profile/favourite_campaign` | opt: skip, top, locale | `Campaign[]` | `#campaign #profile` |
|
|
374
|
+
| `campaignApi` | `campaignDetails` | GET | `campaign/detail` | id (as `campaignId`); opt: deviceLocale | `CampaignDetail` | `#campaign` |
|
|
375
|
+
| `campaignApi` | `addToFavorite` | POST | `campaign/favourite` | id (as body `id`, `favourite: true`) | `FavoriteResponse` | `#campaign` |
|
|
376
|
+
| `campaignApi` | `removeFromFavorite` | DELETE | `campaign/favourite` | id (as query param) | `FavoriteResponse` | `#campaign` |
|
|
377
|
+
| `campaignApi` | `redeem` | POST | `campaign/redeem` | id (as `campaignid`); opt: addressKey, contactNumber, pointUnit, spPoints | `RedeemResponse` | `#campaign #points` |
|
|
365
378
|
| `campaignApi` | `bulkRedeem` | POST | `campaign/{id}/bulkredeem` | id, quantity; opt: addressKey, contactNumber, pointUnit, spPoints | `RedeemResponse` | `#campaign #points` |
|
|
366
379
|
| `cartApi` | `addCart` | POST | `cart/{id}/add` | id; opt: mode, qty, sideCampaignJson | `CartCountResponse` | `#cart #campaign` |
|
|
367
380
|
| `cartApi` | `cartCount` | GET | `cart/count` | opt: options | `CartCountResponse` | `#cart` |
|
|
368
|
-
| `cartApi` | `cartAccess` | POST | `setting` | errorUrl, successUrl, returnUrl, appId, appName | `CartAccessResponse` | `#cart #setting` |
|
|
369
|
-
| `categoryApi` | `categories` | GET | `
|
|
370
|
-
| `consentApi` | `consent` | GET | `consent` | opt: options | `Consent` | `#consent` |
|
|
371
|
-
| `consentApi` | `updateConsent` | POST | `consent` | opt: termsAndConditions, dataPrivacy, marketingOption, consentAge, email, sms, notification, line, analyticsBuzzebeesCookies, analyticsFirebaseCookies, analyticsGoogleCookies, analyticsMetaCookies, analyticsOtherCookies, functionalCookies, marketingCookies, necessaryCookies | `Consent` | `#consent` |
|
|
381
|
+
| `cartApi` | `cartAccess` | POST | `setting/add` | errorUrl, successUrl, returnUrl, appId, appName | `CartAccessResponse` | `#cart #setting` |
|
|
382
|
+
| `categoryApi` | `categories` | GET | `category/menu` | config; opt: byConfig | `Category[]` | `#category #campaign` |
|
|
383
|
+
| `consentApi` | `consent` | GET | `consent/status` | opt: options | `Consent` | `#consent` |
|
|
384
|
+
| `consentApi` | `updateConsent` | POST | `consent/consent` | opt: termsAndConditions, dataPrivacy, marketingOption, consentAge, email, sms, notification, line, analyticsBuzzebeesCookies, analyticsFirebaseCookies, analyticsGoogleCookies, analyticsMetaCookies, analyticsOtherCookies, functionalCookies, marketingCookies, necessaryCookies | `Consent` | `#consent` |
|
|
372
385
|
| `consentApi` | `unconsent` | POST | `consent/unconsent` | opt: options | `unknown` | `#consent` |
|
|
373
|
-
| `couponApi` | `processCodes` | POST | `coupon/process` | codes (string) | `CouponResponse` | `#coupon #campaign` |
|
|
374
|
-
| `dashboardApi` | `mainDashboard` | GET | `dashboard/
|
|
375
|
-
| `dashboardApi` | `subDashboard` | GET | `dashboard/
|
|
376
|
-
| `historyApi` | `redeemHistories` | GET | `redeem` | byConfig, config, skip, top; opt: locale, startDate, endDate | `Purchase[]` | `#history #campaign` |
|
|
377
|
-
| `historyApi` | `use` | POST | `redeem/
|
|
386
|
+
| `couponApi` | `processCodes` | POST | `coupon/process` | codes (string or string[], sent as JSON array) | `CouponResponse` | `#coupon #campaign` |
|
|
387
|
+
| `dashboardApi` | `mainDashboard` | GET | `dashboard/config` | appName (as `config`), locale | `Dashboard[]` | `#dashboard` |
|
|
388
|
+
| `dashboardApi` | `subDashboard` | GET | `dashboard/config` | dashboardName (as `config`), locale | `Dashboard[]` | `#dashboard` |
|
|
389
|
+
| `historyApi` | `redeemHistories` | GET | `redeem/list` | byConfig, config, skip, top; opt: locale, startDate, endDate | `Purchase[]` | `#history #campaign` |
|
|
390
|
+
| `historyApi` | `use` | POST | `redeem/use` | redeemKey (as `redeemkey` in body) | `UseCampaignResponse` | `#history #campaign` |
|
|
378
391
|
| `lineApi` | `lineAuth` | POST | `oauth2/v2.1/token` _(baseLineUrl)_ | grantType, code, clientId, clientSecret, redirectUrl | `LineAuthResponse` | `#line #auth` |
|
|
379
|
-
| `notificationApi` | `notifications` | GET | `
|
|
380
|
-
| `notificationApi` | `read` | POST | `
|
|
392
|
+
| `notificationApi` | `notifications` | GET | `notification/list` | mode (`new`\|`all`), sortBy (`createdate_desc`\|`createdate_asc`); opt: top, skip | `Notification[]` | `#notification` |
|
|
393
|
+
| `notificationApi` | `read` | POST | `notification/read` | ids (comma-separated, sent as JSON body) | `unknown` | `#notification` |
|
|
381
394
|
| `placeApi` | `placeList` | GET | `place` | agencyId, center, distance, top; opt: provinceCode, category, mode, requiredCampaign, keyword, isFavourite | `Place[]` | `#place` |
|
|
382
395
|
| `placeApi` | `place` | GET | `place/{id}` | id, agencyId; opt: requiredCampaign, isFavourite | `Place` | `#place` |
|
|
383
396
|
| `placeApi` | `addToFavourite` | POST | `place/{id}/favourite` | id | `unknown` | `#place` |
|
|
384
397
|
| `placeApi` | `removeFromFavourite` | POST | `place/{id}/unfavourite` | id | `unknown` | `#place` |
|
|
385
398
|
| `pointLogApi` | `getPointLog` | GET | `log/points` | month; opt: type, lastRowKey, top | `PointLog[]` | `#points #profile` |
|
|
386
|
-
| `profileApi` | `profile` | GET | `profile/
|
|
387
|
-
| `profileApi` | `updateProfile` | POST | `profile/
|
|
388
|
-
| `profileApi` | `
|
|
389
|
-
| `profileApi` | `
|
|
399
|
+
| `profileApi` | `profile` | GET | `profile/info` | opt: options | `ProfileResponse` | `#profile` |
|
|
400
|
+
| `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
|
+
| `profileApi` | `updateProfileImage` | POST | `profile/picture` | image (File or `{uri, name, type}`, sent as `multipart/form-data` with key `data`) | `ProfileResponse` | `#profile` |
|
|
402
|
+
| `profileApi` | `changePassword` | POST | `profile/change_password` | current, change | `StatusResponse` | `#profile #auth` |
|
|
403
|
+
| `profileApi` | `updateShipping` | POST | `profile/shipping` | opt: shippingFirstName, shippingLastName, shippingProvinceCode, shippingDistrictCode, shippingSubDistrictCode, shippingZipCode, shippingAddress, shippingContactNumber, ... | `unknown` | `#profile #address` |
|
|
390
404
|
| `profileApi` | `changeContactNumber` | POST | `auth/change_authen` | contactNumber, otp, refCode; opt: idCard | `ConfirmOtpResponse` | `#profile #auth` |
|
|
391
|
-
| `profileApi` | `changeContactNumberV2` | POST | `profile/
|
|
392
|
-
| `profileApi` | `changeContactNumberV3` | POST | `profile/
|
|
393
|
-
| `profileApi` | `points` | GET | `profile/
|
|
394
|
-
| `profileApi` | `expiringPoints` | GET | `profile/
|
|
395
|
-
| `profileApi` | `deactivate` | POST | `profile/
|
|
405
|
+
| `profileApi` | `changeContactNumberV2` | POST | `profile/contact_number` | contactNumber, otp, refCode | `any` | `#profile #auth` |
|
|
406
|
+
| `profileApi` | `changeContactNumberV3` | POST | `profile/contact_number` | userId (as `userid` in body), contactNumber, otp, refCode | `any` | `#profile #auth` |
|
|
407
|
+
| `profileApi` | `points` | GET | `profile/updated_points` | opt: options | `UpdatedPoints` | `#profile #points` |
|
|
408
|
+
| `profileApi` | `expiringPoints` | GET | `profile/allexpiring_points` | opt: options | `ExpiringPoints` | `#profile #points` |
|
|
409
|
+
| `profileApi` | `deactivate` | POST | `profile/deactivate` | opt: options | `unknown` | `#profile` |
|
|
396
410
|
| `registerApi` | `validateRegister` | POST | `auth/validate_register` | appId, username, email, contactNumber | `OtpResponse` | `#registration #auth` |
|
|
397
411
|
| `registerApi` | `register` | POST | `auth/register` | appId, uuid, macAddress, os, platform, clientVersion, deviceNotificationEnable, username, password, confirmPassword, firstName, lastName, contactNumber, otp, refCode, options; opt: address, gender, birthdate, email, refUserCode, termAndConditionVersion, dataPrivacyVersion, marketingOptionsVersion, consentAge, emailMarketing, smsMarketing, notificationMarketing, lineMarketing, phoneMarketing | `RegistrationResponse` | `#registration #auth` |
|
|
398
|
-
| `addressApi` | `zipCodes` | GET | `
|
|
399
|
-
| `addressApi` | `provinces` | GET | `
|
|
400
|
-
| `addressApi` | `districts` | GET | `
|
|
401
|
-
| `addressApi` | `subDistricts` | GET | `
|
|
402
|
-
| `addressApi` | `userAddresses` | GET | `profile/
|
|
403
|
-
| `addressApi` | `updateAddress` | POST | `profile/
|
|
404
|
-
| `addressApi` | `deleteAddress` | DELETE | `profile/
|
|
405
|
-
| `addressApi` | `userTaxAddresses` | GET | `profile/
|
|
406
|
-
| `addressApi` | `updateTaxAddress` | POST | `profile/
|
|
407
|
-
| `addressApi` | `deleteTaxAddress` | DELETE | `profile/
|
|
412
|
+
| `addressApi` | `zipCodes` | GET | `address/postcode` | opt: zipCode | `ZipCode[]` | `#address` |
|
|
413
|
+
| `addressApi` | `provinces` | GET | `address/province` | opt: options | `Province[]` | `#address` |
|
|
414
|
+
| `addressApi` | `districts` | GET | `address/district` | opt: provinceCode | `District[]` | `#address` |
|
|
415
|
+
| `addressApi` | `subDistricts` | GET | `address/subdistrict` | opt: provinceCode, districtCode | `SubDistrict[]` | `#address` |
|
|
416
|
+
| `addressApi` | `userAddresses` | GET | `profile/addresses` | opt: options | `Address[]` | `#address #profile` |
|
|
417
|
+
| `addressApi` | `updateAddress` | POST | `profile/address` | opt: name, addressName, firstName, lastName, address, zipcode, provinceCode, provinceName, districtCode, districtName, subDistrictCode, subDistrictName, contactNumber, countryCode, countryName, latitude, longitude, landmark, isDefault, rowKey | `Address` | `#address #profile` |
|
|
418
|
+
| `addressApi` | `deleteAddress` | DELETE | `profile/address` | opt: rowKey | `unknown` | `#address #profile` |
|
|
419
|
+
| `addressApi` | `userTaxAddresses` | GET | `profile/taxes` | opt: options | `Address[]` | `#address #profile` |
|
|
420
|
+
| `addressApi` | `updateTaxAddress` | POST | `profile/tax` | opt: rowKey, taxId, isDefault, personType, title, name, firstName, lastName, email, contactNumber, brnachId, branchName, companyName, address, addressName, floor, building, moo, road, room, soi, village, districtCode, provinceName, subDistrictCode, zipcode | `Address` | `#address #profile` |
|
|
421
|
+
| `addressApi` | `deleteTaxAddress` | DELETE | `profile/tax` | opt: rowKey | `unknown` | `#address #profile` |
|
|
408
422
|
| `stampApi` | `createStamp` | POST | `stamp/create` | opt: imei, issuer, os, platform | `CreateStampResponse` | `#stamp` |
|
|
409
423
|
| `stampApi` | `stamps` | GET | `stamp` | options | `Stamp[]` | `#stamp` |
|
|
410
424
|
| `stampApi` | `stampProfile` | GET | `stamp/{id}/profile` | id, cardId | `StampProfileResponse` | `#stamp` |
|
|
@@ -416,7 +430,7 @@ const response = await bzbsService.profileApi.profile(undefined, {
|
|
|
416
430
|
| `forumApi` | `postComment` | POST | `buzz/{buzzKey}/comments` | buzzKey, message; opt: image (File) | `ChatMessage` | `#forum` |
|
|
417
431
|
| `forumApi` | `like` | POST | `buzz/{buzzKey}/like` | buzzKey | `LikeForumResponse` | `#forum` |
|
|
418
432
|
| `forumApi` | `unlike` | DELETE | `buzz/{buzzKey}/like` | buzzKey | `LikeForumResponse` | `#forum` |
|
|
419
|
-
| `settingApi` | `accessKey` | POST | `setting` | data (JSON: app_id, campaign_id, locale, return_url, version; opt: redeem_key) | `AccessTokenResponse` | `#setting #campaign` |
|
|
433
|
+
| `settingApi` | `accessKey` | POST | `setting/add` | data (JSON: app_id, campaign_id, locale, return_url, version; opt: redeem_key) | `AccessTokenResponse` | `#setting #campaign` |
|
|
420
434
|
| `blob` | `consentVersion` | GET | `pdpaconsent/{appId}/version` _(baseBlobUrl)_ | appId | `ConsentVersion` | `#blob #consent` |
|
|
421
435
|
| `blob` | `maintenance` | GET | `config/maintenance/{appId}.json` _(baseBlobUrl)_ | appId | `Maintenance` | `#blob` |
|
|
422
436
|
| `blob` | `blob` | GET | `{path}` _(baseBlobUrl)_ | path | `unknown` | `#blob` |
|
|
@@ -551,7 +565,8 @@ const redeem = await bzbsService.campaignApi.redeem({
|
|
|
551
565
|
| Method | Description | Returns |
|
|
552
566
|
|---|---|---|
|
|
553
567
|
| `profile()` | Get current user profile | `ProfileResponse` |
|
|
554
|
-
| `updateProfile(params)` | Update user profile (
|
|
568
|
+
| `updateProfile(params)` | Update user profile fields (JSON body) | `ProfileResponse` |
|
|
569
|
+
| `updateProfileImage(params)` | Upload profile picture (multipart/form-data) | `ProfileResponse` |
|
|
555
570
|
| `changePassword(params)` | Change user password | `StatusResponse` |
|
|
556
571
|
| `updateShipping(params)` | Update shipping information | `unknown` |
|
|
557
572
|
| `changeContactNumber(params)` | Change contact number (v1) | `ConfirmOtpResponse` |
|
|
@@ -562,15 +577,19 @@ const redeem = await bzbsService.campaignApi.redeem({
|
|
|
562
577
|
| `deactivate()` | Deactivate user account | `unknown` |
|
|
563
578
|
|
|
564
579
|
```typescript
|
|
565
|
-
// Update profile
|
|
580
|
+
// Update profile fields (JSON)
|
|
566
581
|
const result = await bzbsService.profileApi.updateProfile({
|
|
567
582
|
firstName: 'John',
|
|
568
583
|
lastName: 'Doe',
|
|
569
584
|
email: 'john@example.com',
|
|
570
585
|
contactNumber: '0812345678',
|
|
571
586
|
gender: 'male',
|
|
572
|
-
birthDate: 946684800,
|
|
573
|
-
|
|
587
|
+
birthDate: 946684800, // Unix timestamp in seconds
|
|
588
|
+
});
|
|
589
|
+
|
|
590
|
+
// Upload profile picture (multipart/form-data, field key: "data")
|
|
591
|
+
await bzbsService.profileApi.updateProfileImage({
|
|
592
|
+
image: imageFile, // File | { uri: string; name: string; type: string }
|
|
574
593
|
});
|
|
575
594
|
```
|
|
576
595
|
|
|
@@ -775,6 +794,8 @@ const badge = await bzbsService.badgeApi.badges({ badgeId: '123' });
|
|
|
775
794
|
|
|
776
795
|
`bzbsService.consentApi` — PDPA and marketing consent management.
|
|
777
796
|
|
|
797
|
+
> **v2 change:** `consent()` now calls `consent/status`; `updateConsent()` now calls `consent/consent`.
|
|
798
|
+
|
|
778
799
|
| Method | Description | Returns |
|
|
779
800
|
|---|---|---|
|
|
780
801
|
| `consent()` | Get user's consent status | `Consent` |
|
|
@@ -805,6 +826,8 @@ await bzbsService.consentApi.updateConsent({
|
|
|
805
826
|
|
|
806
827
|
`bzbsService.dashboardApi` — Dashboard content configuration.
|
|
807
828
|
|
|
829
|
+
> **v2 change:** Both `mainDashboard` and `subDashboard` now call `dashboard/config`. The `appName`/`dashboardName` param is sent as `config`.
|
|
830
|
+
|
|
808
831
|
| Method | Description | Returns |
|
|
809
832
|
|---|---|---|
|
|
810
833
|
| `mainDashboard(params)` | Get main dashboard data | `Dashboard[]` |
|
|
@@ -812,12 +835,12 @@ await bzbsService.consentApi.updateConsent({
|
|
|
812
835
|
|
|
813
836
|
```typescript
|
|
814
837
|
const dashboard = await bzbsService.dashboardApi.mainDashboard({
|
|
815
|
-
appName: 'buzzebeesdemo',
|
|
816
|
-
locale: 1054,
|
|
838
|
+
appName: 'buzzebeesdemo', // sent as `config` query param
|
|
839
|
+
locale: 1054,
|
|
817
840
|
});
|
|
818
841
|
|
|
819
842
|
const sub = await bzbsService.dashboardApi.subDashboard({
|
|
820
|
-
dashboardName: 'featured',
|
|
843
|
+
dashboardName: 'featured', // sent as `config` query param
|
|
821
844
|
locale: 1054,
|
|
822
845
|
});
|
|
823
846
|
```
|
|
@@ -943,6 +966,8 @@ await bzbsService.forumApi.postRequestHelp({
|
|
|
943
966
|
|
|
944
967
|
`bzbsService.settingApi` — Web landing page access tokens.
|
|
945
968
|
|
|
969
|
+
> **v2 change:** Endpoint changed from `setting` to `setting/add`.
|
|
970
|
+
|
|
946
971
|
| Method | Description | Returns |
|
|
947
972
|
|---|---|---|
|
|
948
973
|
| `accessKey(params)` | Get access key for web landing pages | `AccessTokenResponse` |
|
package/dist/index.d.mts
CHANGED
|
@@ -1583,7 +1583,7 @@ declare class AuthenticateApi extends BaseService {
|
|
|
1583
1583
|
*/
|
|
1584
1584
|
forgetPassword(params: {
|
|
1585
1585
|
contact: string;
|
|
1586
|
-
type: 'email' | 'contact_number';
|
|
1586
|
+
type: 'email' | 'contact_number' | 'email_otp';
|
|
1587
1587
|
options?: {
|
|
1588
1588
|
[key: string]: unknown;
|
|
1589
1589
|
};
|
|
@@ -1825,14 +1825,18 @@ declare class CampaignApi extends BaseService {
|
|
|
1825
1825
|
* @param params.deviceLocale - The device locale for the campaigns.
|
|
1826
1826
|
* @param params.locale - The locale for the campaigns.
|
|
1827
1827
|
* @param params.keyword - The keyword for the campaigns.
|
|
1828
|
-
* @param params.startDate - The start date for the campaigns.
|
|
1828
|
+
* @param params.startDate - The start date for the campaigns. Example: 2017-07-21T17:32:28Z
|
|
1829
1829
|
* @param params.sponsorId - The sponsor ID for the campaigns.
|
|
1830
1830
|
* @param params.maxPoints - The maximum points for the campaigns.
|
|
1831
1831
|
* @param params.minPoints - The minimum points for the campaigns.
|
|
1832
|
+
* @param params.minPrice - The minimum price for the campaigns.
|
|
1833
|
+
* @param params.maxPrice - The maximum price for the campaigns.
|
|
1832
1834
|
* @param params.sortBy - The sort order for the campaigns.
|
|
1833
1835
|
* @param params.center - The coordinates for the center of the campaigns.
|
|
1834
1836
|
* @param params.hashTags - The hash tags for the campaigns.
|
|
1835
1837
|
* @param params.locationAgencyId - The location agency ID for the campaigns.
|
|
1838
|
+
* @param params.campaignservice - Use campaign service.
|
|
1839
|
+
* @param params.mode - The mode for the campaigns.
|
|
1836
1840
|
* @param params.options - (Optional) Additional params for the request.
|
|
1837
1841
|
* @param requestOptions - The options for the HTTP request.
|
|
1838
1842
|
* @returns A promise that resolves to a ServiceResponse containing an array of Campaign objects.
|
|
@@ -1850,10 +1854,14 @@ declare class CampaignApi extends BaseService {
|
|
|
1850
1854
|
sponsorId?: string;
|
|
1851
1855
|
maxPoints?: string;
|
|
1852
1856
|
minPoints?: string;
|
|
1857
|
+
minPrice?: string;
|
|
1858
|
+
maxPrice?: string;
|
|
1853
1859
|
sortBy?: string;
|
|
1854
1860
|
center?: string;
|
|
1855
1861
|
hashTags?: string;
|
|
1856
1862
|
locationAgencyId?: string;
|
|
1863
|
+
campaignservice?: boolean;
|
|
1864
|
+
mode?: string | 'hot' | 'all' | 'bzbs' | 'sponsor' | 'draw' | 'free' | 'deal' | 'buy' | 'ads' | 'full' | 'cart';
|
|
1857
1865
|
options?: {
|
|
1858
1866
|
[key: string]: unknown;
|
|
1859
1867
|
};
|
|
@@ -2054,7 +2062,7 @@ declare class ConsentApi extends BaseService {
|
|
|
2054
2062
|
[key: string]: unknown;
|
|
2055
2063
|
}, requestOptions?: RequestOptions): Promise<ServiceResponse<Consent>>;
|
|
2056
2064
|
/**
|
|
2057
|
-
*
|
|
2065
|
+
* Update the user's consent information.
|
|
2058
2066
|
*
|
|
2059
2067
|
* @param params - The parameters for the consent request.
|
|
2060
2068
|
* @param params.termsAndConditions - The terms and conditions consent version.
|
|
@@ -2099,10 +2107,10 @@ declare class ConsentApi extends BaseService {
|
|
|
2099
2107
|
};
|
|
2100
2108
|
}, requestOptions?: RequestOptions): Promise<ServiceResponse<Consent>>;
|
|
2101
2109
|
/**
|
|
2102
|
-
*
|
|
2110
|
+
* Revoke user consent.
|
|
2103
2111
|
*
|
|
2104
2112
|
* @param requestOptions - The options for the request.
|
|
2105
|
-
* @returns A promise that resolves to a ServiceResponse containing the result of the
|
|
2113
|
+
* @returns A promise that resolves to a ServiceResponse containing the result of the revoke consent operation.
|
|
2106
2114
|
*/
|
|
2107
2115
|
unconsent(options?: {
|
|
2108
2116
|
[key: string]: unknown;
|
|
@@ -2112,7 +2120,7 @@ declare class ConsentApi extends BaseService {
|
|
|
2112
2120
|
declare class CouponApi extends BaseService {
|
|
2113
2121
|
constructor(client: AxiosInstance, baseUrl: string);
|
|
2114
2122
|
/**
|
|
2115
|
-
*
|
|
2123
|
+
* Process coupon codes to earn points.
|
|
2116
2124
|
*
|
|
2117
2125
|
* @param params - The parameters.
|
|
2118
2126
|
* @param params.codes - The coupon codes to process.
|
|
@@ -2410,11 +2418,6 @@ declare class ProfileApi extends BaseService {
|
|
|
2410
2418
|
* @returns A promise that resolves to a ServiceResponse containing the updated profile.
|
|
2411
2419
|
*/
|
|
2412
2420
|
updateProfile(params: {
|
|
2413
|
-
profileImage?: File | {
|
|
2414
|
-
uri: string;
|
|
2415
|
-
name: string;
|
|
2416
|
-
type: string;
|
|
2417
|
-
} | object;
|
|
2418
2421
|
firstName?: string;
|
|
2419
2422
|
lastName?: string;
|
|
2420
2423
|
contactNumber?: string;
|
|
@@ -2586,6 +2589,25 @@ declare class ProfileApi extends BaseService {
|
|
|
2586
2589
|
expiringPoints(options?: {
|
|
2587
2590
|
[key: string]: unknown;
|
|
2588
2591
|
}, requestOptions?: RequestOptions): Promise<ServiceResponse<ExpiringPoints>>;
|
|
2592
|
+
/**
|
|
2593
|
+
* Updates the user's profile picture.
|
|
2594
|
+
*
|
|
2595
|
+
* @param params - The parameters.
|
|
2596
|
+
* @param params.image - The image file to upload (File or cross-platform file object with uri, name, type).
|
|
2597
|
+
* @param params.options - Optional additional parameters.
|
|
2598
|
+
* @param requestOptions - Optional request options.
|
|
2599
|
+
* @returns A promise that resolves to a ServiceResponse containing the updated profile.
|
|
2600
|
+
*/
|
|
2601
|
+
updateProfileImage(params: {
|
|
2602
|
+
image: File | {
|
|
2603
|
+
uri: string;
|
|
2604
|
+
name: string;
|
|
2605
|
+
type: string;
|
|
2606
|
+
} | object;
|
|
2607
|
+
options?: {
|
|
2608
|
+
[key: string]: unknown;
|
|
2609
|
+
};
|
|
2610
|
+
}, requestOptions?: RequestOptions): Promise<ServiceResponse<ProfileResponse>>;
|
|
2589
2611
|
/**
|
|
2590
2612
|
* Deactivates the user's profile.
|
|
2591
2613
|
*
|
|
@@ -2788,6 +2810,9 @@ declare class AddressApi extends BaseService {
|
|
|
2788
2810
|
contactNumber?: string;
|
|
2789
2811
|
countryCode?: string;
|
|
2790
2812
|
countryName?: string;
|
|
2813
|
+
latitude?: number;
|
|
2814
|
+
longitude?: number;
|
|
2815
|
+
landmark?: string;
|
|
2791
2816
|
isDefault?: boolean;
|
|
2792
2817
|
rowKey?: string;
|
|
2793
2818
|
options?: {
|
|
@@ -2837,6 +2862,8 @@ declare class AddressApi extends BaseService {
|
|
|
2837
2862
|
lastName?: string;
|
|
2838
2863
|
email?: string;
|
|
2839
2864
|
contactNumber?: string;
|
|
2865
|
+
brnachId?: string;
|
|
2866
|
+
branchName?: string;
|
|
2840
2867
|
companyName?: string;
|
|
2841
2868
|
address?: string;
|
|
2842
2869
|
addressName?: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -1583,7 +1583,7 @@ declare class AuthenticateApi extends BaseService {
|
|
|
1583
1583
|
*/
|
|
1584
1584
|
forgetPassword(params: {
|
|
1585
1585
|
contact: string;
|
|
1586
|
-
type: 'email' | 'contact_number';
|
|
1586
|
+
type: 'email' | 'contact_number' | 'email_otp';
|
|
1587
1587
|
options?: {
|
|
1588
1588
|
[key: string]: unknown;
|
|
1589
1589
|
};
|
|
@@ -1825,14 +1825,18 @@ declare class CampaignApi extends BaseService {
|
|
|
1825
1825
|
* @param params.deviceLocale - The device locale for the campaigns.
|
|
1826
1826
|
* @param params.locale - The locale for the campaigns.
|
|
1827
1827
|
* @param params.keyword - The keyword for the campaigns.
|
|
1828
|
-
* @param params.startDate - The start date for the campaigns.
|
|
1828
|
+
* @param params.startDate - The start date for the campaigns. Example: 2017-07-21T17:32:28Z
|
|
1829
1829
|
* @param params.sponsorId - The sponsor ID for the campaigns.
|
|
1830
1830
|
* @param params.maxPoints - The maximum points for the campaigns.
|
|
1831
1831
|
* @param params.minPoints - The minimum points for the campaigns.
|
|
1832
|
+
* @param params.minPrice - The minimum price for the campaigns.
|
|
1833
|
+
* @param params.maxPrice - The maximum price for the campaigns.
|
|
1832
1834
|
* @param params.sortBy - The sort order for the campaigns.
|
|
1833
1835
|
* @param params.center - The coordinates for the center of the campaigns.
|
|
1834
1836
|
* @param params.hashTags - The hash tags for the campaigns.
|
|
1835
1837
|
* @param params.locationAgencyId - The location agency ID for the campaigns.
|
|
1838
|
+
* @param params.campaignservice - Use campaign service.
|
|
1839
|
+
* @param params.mode - The mode for the campaigns.
|
|
1836
1840
|
* @param params.options - (Optional) Additional params for the request.
|
|
1837
1841
|
* @param requestOptions - The options for the HTTP request.
|
|
1838
1842
|
* @returns A promise that resolves to a ServiceResponse containing an array of Campaign objects.
|
|
@@ -1850,10 +1854,14 @@ declare class CampaignApi extends BaseService {
|
|
|
1850
1854
|
sponsorId?: string;
|
|
1851
1855
|
maxPoints?: string;
|
|
1852
1856
|
minPoints?: string;
|
|
1857
|
+
minPrice?: string;
|
|
1858
|
+
maxPrice?: string;
|
|
1853
1859
|
sortBy?: string;
|
|
1854
1860
|
center?: string;
|
|
1855
1861
|
hashTags?: string;
|
|
1856
1862
|
locationAgencyId?: string;
|
|
1863
|
+
campaignservice?: boolean;
|
|
1864
|
+
mode?: string | 'hot' | 'all' | 'bzbs' | 'sponsor' | 'draw' | 'free' | 'deal' | 'buy' | 'ads' | 'full' | 'cart';
|
|
1857
1865
|
options?: {
|
|
1858
1866
|
[key: string]: unknown;
|
|
1859
1867
|
};
|
|
@@ -2054,7 +2062,7 @@ declare class ConsentApi extends BaseService {
|
|
|
2054
2062
|
[key: string]: unknown;
|
|
2055
2063
|
}, requestOptions?: RequestOptions): Promise<ServiceResponse<Consent>>;
|
|
2056
2064
|
/**
|
|
2057
|
-
*
|
|
2065
|
+
* Update the user's consent information.
|
|
2058
2066
|
*
|
|
2059
2067
|
* @param params - The parameters for the consent request.
|
|
2060
2068
|
* @param params.termsAndConditions - The terms and conditions consent version.
|
|
@@ -2099,10 +2107,10 @@ declare class ConsentApi extends BaseService {
|
|
|
2099
2107
|
};
|
|
2100
2108
|
}, requestOptions?: RequestOptions): Promise<ServiceResponse<Consent>>;
|
|
2101
2109
|
/**
|
|
2102
|
-
*
|
|
2110
|
+
* Revoke user consent.
|
|
2103
2111
|
*
|
|
2104
2112
|
* @param requestOptions - The options for the request.
|
|
2105
|
-
* @returns A promise that resolves to a ServiceResponse containing the result of the
|
|
2113
|
+
* @returns A promise that resolves to a ServiceResponse containing the result of the revoke consent operation.
|
|
2106
2114
|
*/
|
|
2107
2115
|
unconsent(options?: {
|
|
2108
2116
|
[key: string]: unknown;
|
|
@@ -2112,7 +2120,7 @@ declare class ConsentApi extends BaseService {
|
|
|
2112
2120
|
declare class CouponApi extends BaseService {
|
|
2113
2121
|
constructor(client: AxiosInstance, baseUrl: string);
|
|
2114
2122
|
/**
|
|
2115
|
-
*
|
|
2123
|
+
* Process coupon codes to earn points.
|
|
2116
2124
|
*
|
|
2117
2125
|
* @param params - The parameters.
|
|
2118
2126
|
* @param params.codes - The coupon codes to process.
|
|
@@ -2410,11 +2418,6 @@ declare class ProfileApi extends BaseService {
|
|
|
2410
2418
|
* @returns A promise that resolves to a ServiceResponse containing the updated profile.
|
|
2411
2419
|
*/
|
|
2412
2420
|
updateProfile(params: {
|
|
2413
|
-
profileImage?: File | {
|
|
2414
|
-
uri: string;
|
|
2415
|
-
name: string;
|
|
2416
|
-
type: string;
|
|
2417
|
-
} | object;
|
|
2418
2421
|
firstName?: string;
|
|
2419
2422
|
lastName?: string;
|
|
2420
2423
|
contactNumber?: string;
|
|
@@ -2586,6 +2589,25 @@ declare class ProfileApi extends BaseService {
|
|
|
2586
2589
|
expiringPoints(options?: {
|
|
2587
2590
|
[key: string]: unknown;
|
|
2588
2591
|
}, requestOptions?: RequestOptions): Promise<ServiceResponse<ExpiringPoints>>;
|
|
2592
|
+
/**
|
|
2593
|
+
* Updates the user's profile picture.
|
|
2594
|
+
*
|
|
2595
|
+
* @param params - The parameters.
|
|
2596
|
+
* @param params.image - The image file to upload (File or cross-platform file object with uri, name, type).
|
|
2597
|
+
* @param params.options - Optional additional parameters.
|
|
2598
|
+
* @param requestOptions - Optional request options.
|
|
2599
|
+
* @returns A promise that resolves to a ServiceResponse containing the updated profile.
|
|
2600
|
+
*/
|
|
2601
|
+
updateProfileImage(params: {
|
|
2602
|
+
image: File | {
|
|
2603
|
+
uri: string;
|
|
2604
|
+
name: string;
|
|
2605
|
+
type: string;
|
|
2606
|
+
} | object;
|
|
2607
|
+
options?: {
|
|
2608
|
+
[key: string]: unknown;
|
|
2609
|
+
};
|
|
2610
|
+
}, requestOptions?: RequestOptions): Promise<ServiceResponse<ProfileResponse>>;
|
|
2589
2611
|
/**
|
|
2590
2612
|
* Deactivates the user's profile.
|
|
2591
2613
|
*
|
|
@@ -2788,6 +2810,9 @@ declare class AddressApi extends BaseService {
|
|
|
2788
2810
|
contactNumber?: string;
|
|
2789
2811
|
countryCode?: string;
|
|
2790
2812
|
countryName?: string;
|
|
2813
|
+
latitude?: number;
|
|
2814
|
+
longitude?: number;
|
|
2815
|
+
landmark?: string;
|
|
2791
2816
|
isDefault?: boolean;
|
|
2792
2817
|
rowKey?: string;
|
|
2793
2818
|
options?: {
|
|
@@ -2837,6 +2862,8 @@ declare class AddressApi extends BaseService {
|
|
|
2837
2862
|
lastName?: string;
|
|
2838
2863
|
email?: string;
|
|
2839
2864
|
contactNumber?: string;
|
|
2865
|
+
brnachId?: string;
|
|
2866
|
+
branchName?: string;
|
|
2840
2867
|
companyName?: string;
|
|
2841
2868
|
address?: string;
|
|
2842
2869
|
addressName?: string;
|