@bzbs/react-api-client 0.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/dist/index.mjs ADDED
@@ -0,0 +1,869 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
3
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
4
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
5
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6
+ var __spreadValues = (a, b) => {
7
+ for (var prop in b || (b = {}))
8
+ if (__hasOwnProp.call(b, prop))
9
+ __defNormalProp(a, prop, b[prop]);
10
+ if (__getOwnPropSymbols)
11
+ for (var prop of __getOwnPropSymbols(b)) {
12
+ if (__propIsEnum.call(b, prop))
13
+ __defNormalProp(a, prop, b[prop]);
14
+ }
15
+ return a;
16
+ };
17
+ var __async = (__this, __arguments, generator) => {
18
+ return new Promise((resolve, reject) => {
19
+ var fulfilled = (value) => {
20
+ try {
21
+ step(generator.next(value));
22
+ } catch (e) {
23
+ reject(e);
24
+ }
25
+ };
26
+ var rejected = (value) => {
27
+ try {
28
+ step(generator.throw(value));
29
+ } catch (e) {
30
+ reject(e);
31
+ }
32
+ };
33
+ var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
34
+ step((generator = generator.apply(__this, __arguments)).next());
35
+ });
36
+ };
37
+
38
+ // src/api/base-service.ts
39
+ var BaseService = class {
40
+ constructor(client, baseUrl) {
41
+ this.client = client;
42
+ this.baseUrl = baseUrl;
43
+ if (!this.baseUrl) {
44
+ throw "Please check base_URL";
45
+ }
46
+ if (!this.client) {
47
+ throw "Please check client";
48
+ }
49
+ }
50
+ get(path, params, requestOptions) {
51
+ return __async(this, null, function* () {
52
+ var _a, _b;
53
+ try {
54
+ const response = yield this.client.get(
55
+ this.joinUrl((_a = requestOptions == null ? void 0 : requestOptions.baseUrl) != null ? _a : this.baseUrl, path),
56
+ {
57
+ params: __spreadValues(__spreadValues({}, params ? params : {}), (requestOptions == null ? void 0 : requestOptions.params) ? requestOptions.params : {}),
58
+ headers: requestOptions == null ? void 0 : requestOptions.headers,
59
+ data: requestOptions == null ? void 0 : requestOptions.data
60
+ }
61
+ );
62
+ return {
63
+ model: response == null ? void 0 : response.data,
64
+ response,
65
+ error: void 0
66
+ };
67
+ } catch (error) {
68
+ return {
69
+ model: void 0,
70
+ response: void 0,
71
+ error: error.response ? error.response.data : (_b = error.response) != null ? _b : error
72
+ };
73
+ }
74
+ });
75
+ }
76
+ post(path, data, requestOptions) {
77
+ return __async(this, null, function* () {
78
+ var _a, _b;
79
+ try {
80
+ const response = yield this.client.post(
81
+ this.joinUrl((_a = requestOptions == null ? void 0 : requestOptions.baseUrl) != null ? _a : this.baseUrl, path),
82
+ data,
83
+ requestOptions
84
+ );
85
+ return {
86
+ model: response == null ? void 0 : response.data,
87
+ response,
88
+ error: void 0
89
+ };
90
+ } catch (error) {
91
+ return {
92
+ model: void 0,
93
+ response: void 0,
94
+ error: error.response ? error.response.data : (_b = error.response) != null ? _b : error
95
+ };
96
+ }
97
+ });
98
+ }
99
+ put(path, data, requestOptions) {
100
+ return __async(this, null, function* () {
101
+ var _a, _b;
102
+ try {
103
+ const response = yield this.client.put(
104
+ this.joinUrl((_a = requestOptions == null ? void 0 : requestOptions.baseUrl) != null ? _a : this.baseUrl, path),
105
+ data,
106
+ requestOptions
107
+ );
108
+ return {
109
+ model: response == null ? void 0 : response.data,
110
+ response,
111
+ error: void 0
112
+ };
113
+ } catch (error) {
114
+ return {
115
+ model: void 0,
116
+ response: void 0,
117
+ error: error.response ? error.response.data : (_b = error.response) != null ? _b : error
118
+ };
119
+ }
120
+ });
121
+ }
122
+ delete(path, requestOptions) {
123
+ return __async(this, null, function* () {
124
+ var _a, _b;
125
+ try {
126
+ const response = yield this.client.delete(
127
+ this.joinUrl((_a = requestOptions == null ? void 0 : requestOptions.baseUrl) != null ? _a : this.baseUrl, path),
128
+ requestOptions
129
+ );
130
+ return {
131
+ model: response == null ? void 0 : response.data,
132
+ response,
133
+ error: void 0
134
+ };
135
+ } catch (error) {
136
+ return {
137
+ model: void 0,
138
+ response: void 0,
139
+ error: error.response ? error.response.data : (_b = error.response) != null ? _b : error
140
+ };
141
+ }
142
+ });
143
+ }
144
+ patch(path, data, requestOptions) {
145
+ return __async(this, null, function* () {
146
+ var _a, _b;
147
+ try {
148
+ const response = yield this.client.patch(
149
+ this.joinUrl((_a = requestOptions == null ? void 0 : requestOptions.baseUrl) != null ? _a : this.baseUrl, path),
150
+ data,
151
+ requestOptions
152
+ );
153
+ return {
154
+ model: response == null ? void 0 : response.data,
155
+ response,
156
+ error: void 0
157
+ };
158
+ } catch (error) {
159
+ return {
160
+ model: void 0,
161
+ response: void 0,
162
+ error: error.response ? error.response.data : (_b = error.response) != null ? _b : error
163
+ };
164
+ }
165
+ });
166
+ }
167
+ joinUrl(baseUrl, path) {
168
+ const url = new URL(path, baseUrl);
169
+ return url.toString();
170
+ }
171
+ };
172
+
173
+ // src/api/auth/auth-api.ts
174
+ var AuthenticateApi = class extends BaseService {
175
+ constructor(client, baseUrl) {
176
+ super(client, baseUrl);
177
+ }
178
+ deviceLogin(appId, requestOptions) {
179
+ return __async(this, null, function* () {
180
+ return yield this.post(
181
+ "auth/device_login",
182
+ {
183
+ app_id: appId,
184
+ device_noti_enable: "true"
185
+ },
186
+ requestOptions
187
+ );
188
+ });
189
+ }
190
+ usernamePasswordLogin(username, password, appId, requestOptions) {
191
+ return __async(this, null, function* () {
192
+ return yield this.post(
193
+ "auth/bzbs_login",
194
+ {
195
+ app_id: appId,
196
+ device_noti_enable: "true",
197
+ username,
198
+ password
199
+ },
200
+ requestOptions
201
+ );
202
+ });
203
+ }
204
+ };
205
+
206
+ // src/api/badge/badge-api.ts
207
+ var BadgeApi = class extends BaseService {
208
+ constructor(client, baseUrl) {
209
+ super(client, baseUrl);
210
+ }
211
+ // Get user badge
212
+ getBadge(params, requestOptions) {
213
+ return __async(this, null, function* () {
214
+ var _a;
215
+ return yield this.get(
216
+ "profile/me/badges",
217
+ {
218
+ params: __spreadValues({
219
+ badge_id: (_a = params.badgeId) != null ? _a : ""
220
+ }, params.option ? params.option : {})
221
+ },
222
+ requestOptions
223
+ );
224
+ });
225
+ }
226
+ };
227
+
228
+ // src/api/campaign/campaign-api.ts
229
+ var CampaignApi = class extends BaseService {
230
+ constructor(client, baseUrl) {
231
+ super(client, baseUrl);
232
+ }
233
+ campaign(params, requestOptions) {
234
+ return __async(this, null, function* () {
235
+ return yield this.get(
236
+ "campaign",
237
+ __spreadValues({
238
+ config: params.config,
239
+ cat: params.cat,
240
+ byConfig: params.byConfig,
241
+ skip: params.skip,
242
+ top: params.top,
243
+ device_locale: params.deviceLocale,
244
+ locale: params.locale,
245
+ q: params.keyword,
246
+ startdate: params.startDate,
247
+ sponsorId: params.sponsorId,
248
+ maxpoints: params.maxPoints,
249
+ minpoints: params.minPoints,
250
+ sortBy: params.sortBy,
251
+ center: params.center,
252
+ tags: params.hashTags,
253
+ locationAgencyId: params.locationAgencyId
254
+ }, params.option ? params.option : {}),
255
+ requestOptions
256
+ );
257
+ });
258
+ }
259
+ favoriteCampaigns(params, requestOptions) {
260
+ return __async(this, null, function* () {
261
+ return yield this.get(
262
+ "profile/me/favourite_campaign",
263
+ {
264
+ params: __spreadValues({
265
+ skip: params.skip,
266
+ top: params.top,
267
+ locale: params.locale
268
+ }, params.option ? params.option : {})
269
+ },
270
+ requestOptions
271
+ );
272
+ });
273
+ }
274
+ campaignDetails(param, requestOptions) {
275
+ return __async(this, null, function* () {
276
+ return yield this == null ? void 0 : this.get(
277
+ `campaign/${param.id}`,
278
+ {
279
+ params: {
280
+ device_locale: param.deviceLocale
281
+ }
282
+ },
283
+ requestOptions
284
+ );
285
+ });
286
+ }
287
+ addToFavorite(id, requestOptions) {
288
+ return __async(this, null, function* () {
289
+ return yield this.post(`campaign/${id}/favourite`, {}, requestOptions);
290
+ });
291
+ }
292
+ removeFromFavorite(id, requestOptions) {
293
+ return __async(this, null, function* () {
294
+ return yield this.delete(`campaign/${id}/favourite`, requestOptions);
295
+ });
296
+ }
297
+ redeem(params, requestOptions) {
298
+ return __async(this, null, function* () {
299
+ return yield this.post(
300
+ `campaign/${params.id}/redeem`,
301
+ {
302
+ address_key: params.addressKey,
303
+ contact_number: params.contactNumber
304
+ },
305
+ requestOptions
306
+ );
307
+ });
308
+ }
309
+ bulkRedeem(id, quantity, requestOptions) {
310
+ return __async(this, null, function* () {
311
+ return yield this.post(
312
+ `campaign/${id}/bulkredeem`,
313
+ {
314
+ quantity
315
+ },
316
+ requestOptions
317
+ );
318
+ });
319
+ }
320
+ };
321
+
322
+ // src/api/cart/cart-api.ts
323
+ var CartApi = class extends BaseService {
324
+ constructor(client, baseUrl) {
325
+ super(client, baseUrl);
326
+ }
327
+ // Get user cart
328
+ addCart(params, requestOptions) {
329
+ return __async(this, null, function* () {
330
+ return yield this.post(
331
+ `cart/${params.id}/add`,
332
+ {
333
+ data: {
334
+ mode: params.mode,
335
+ qty: params.qty,
336
+ sideCampaignJson: params.sideCampaignJson
337
+ }
338
+ },
339
+ requestOptions
340
+ );
341
+ });
342
+ }
343
+ /// Get user cart item count
344
+ cartCount(requestOptions) {
345
+ return __async(this, null, function* () {
346
+ return yield this.get(this.baseUrl + "cart/count", {}, requestOptions);
347
+ });
348
+ }
349
+ };
350
+
351
+ // src/api/category/category-api.ts
352
+ var CategoryApi = class extends BaseService {
353
+ constructor(client, baseUrl) {
354
+ super(client, baseUrl);
355
+ }
356
+ // Get category list
357
+ categories(params, requestOptions) {
358
+ return __async(this, null, function* () {
359
+ return yield this.get(
360
+ "campaigncat/menu",
361
+ {
362
+ params: {
363
+ byConfig: params.byConfig,
364
+ config: params.config
365
+ }
366
+ },
367
+ requestOptions
368
+ );
369
+ });
370
+ }
371
+ };
372
+
373
+ // src/api/consent/consent-api.ts
374
+ var ConsentApi = class extends BaseService {
375
+ constructor(client, baseUrl) {
376
+ super(client, baseUrl);
377
+ }
378
+ // Get consent
379
+ getConsent(params, requestOptions) {
380
+ return __async(this, null, function* () {
381
+ return yield this.get(
382
+ "consent",
383
+ {
384
+ data: {
385
+ termandcondition: params.termsAndConditions,
386
+ dataprivacy: params.dataPrivacy,
387
+ marketingoption: params.marketingOption,
388
+ email: params.email,
389
+ sms: params.sms,
390
+ notification: params.notification,
391
+ line: params.line,
392
+ analyticsBuzzebeesCookies: params.analyticsBuzzebeesCookies,
393
+ analyticsFirebaseCookies: params.analyticsFirebaseCookies,
394
+ analyticsGoogleCookies: params.analyticsGoogleCookies,
395
+ analyticsMetaCookies: params.analyticsMetaCookies,
396
+ analyticsOtherCookies: params.analyticsOtherCookies,
397
+ functionalCookies: params.functionalCookies,
398
+ marketingCookies: params.marketingCookies,
399
+ necessaryCookies: params.necessaryCookies
400
+ }
401
+ },
402
+ requestOptions
403
+ );
404
+ });
405
+ }
406
+ // Unconsent
407
+ unconsent(requestOptions) {
408
+ return __async(this, null, function* () {
409
+ return yield this.post("consent/unconsent", {}, requestOptions);
410
+ });
411
+ }
412
+ };
413
+
414
+ // src/api/coupon/coupon-api.ts
415
+ var CouponApi = class extends BaseService {
416
+ constructor(client, baseUrl) {
417
+ super(client, baseUrl);
418
+ }
419
+ // Get coupon list
420
+ processCodes(params, requestOptions) {
421
+ return __async(this, null, function* () {
422
+ return yield this.post(
423
+ "coupon/process",
424
+ {
425
+ data: {
426
+ "codes[]": params.codes
427
+ }
428
+ },
429
+ requestOptions
430
+ );
431
+ });
432
+ }
433
+ };
434
+
435
+ // src/api/dashboard/dashboard-api.ts
436
+ var DashboardApi = class extends BaseService {
437
+ constructor(client, baseUrl) {
438
+ super(client, baseUrl);
439
+ }
440
+ mainDashboard(appName, locale, requestOptions) {
441
+ return __async(this, null, function* () {
442
+ return yield this.get(
443
+ "dashboard/main",
444
+ {
445
+ params: {
446
+ app_name: appName,
447
+ locale
448
+ }
449
+ },
450
+ requestOptions
451
+ );
452
+ });
453
+ }
454
+ subDashboard(params, requestOptions) {
455
+ return __async(this, null, function* () {
456
+ return yield this.get(
457
+ `dashboard/${params.dashboardName}`,
458
+ {
459
+ params: {
460
+ locale: params.locale
461
+ }
462
+ },
463
+ requestOptions
464
+ );
465
+ });
466
+ }
467
+ };
468
+
469
+ // src/api/history/history-api.ts
470
+ var HistoryApi = class extends BaseService {
471
+ constructor(client, baseUrl) {
472
+ super(client, baseUrl);
473
+ }
474
+ redeemHistories(params, requestOptions) {
475
+ return __async(this, null, function* () {
476
+ return yield this.get(
477
+ "redeem",
478
+ {
479
+ params: {
480
+ byConfig: params.byConfig,
481
+ config: params.config,
482
+ skip: params.skip,
483
+ top: params.top,
484
+ locale: params.locale,
485
+ startdate: params.startDate,
486
+ enddate: params.endDate
487
+ }
488
+ },
489
+ requestOptions
490
+ );
491
+ });
492
+ }
493
+ use(params, requestOptions) {
494
+ return __async(this, null, function* () {
495
+ return yield this.post(`redeem/${params.redeemKey}/use`, {}, requestOptions);
496
+ });
497
+ }
498
+ };
499
+
500
+ // src/api/line/line-api.ts
501
+ var LineApi = class extends BaseService {
502
+ constructor(client, baseUrl) {
503
+ super(client, baseUrl);
504
+ }
505
+ //Create Line Auth
506
+ lineAuth(params, requestOptions) {
507
+ return __async(this, null, function* () {
508
+ return yield this.post(
509
+ "oauth2/v2.1/token",
510
+ {
511
+ grant_type: params.grantType,
512
+ code: params.code,
513
+ client_id: params.clientId,
514
+ client_secret: params.clientSecret,
515
+ redirect_uri: params.redirectUrl
516
+ },
517
+ requestOptions
518
+ );
519
+ });
520
+ }
521
+ };
522
+
523
+ // src/api/notification/notification-api.ts
524
+ var NotificationApi = class extends BaseService {
525
+ constructor(client, baseUrl) {
526
+ super(client, baseUrl);
527
+ }
528
+ notifications(params, requestOptions) {
529
+ return __async(this, null, function* () {
530
+ return yield this.get(
531
+ "noti",
532
+ {
533
+ params: {
534
+ mode: params.mode,
535
+ sortBy: params.sortBy
536
+ }
537
+ },
538
+ requestOptions
539
+ );
540
+ });
541
+ }
542
+ read(params, requestOptions) {
543
+ return __async(this, null, function* () {
544
+ return yield this.post(
545
+ "noti/read",
546
+ {
547
+ ids: params.ids
548
+ },
549
+ requestOptions
550
+ );
551
+ });
552
+ }
553
+ };
554
+
555
+ // src/api/place/place-api.ts
556
+ var PlaceApi = class extends BaseService {
557
+ constructor(client, baseUrl) {
558
+ super(client, baseUrl);
559
+ }
560
+ placeList(params, requestOptions) {
561
+ return __async(this, null, function* () {
562
+ return yield this.get(
563
+ "place",
564
+ {
565
+ params: {
566
+ agencyId: params.agencyId,
567
+ center: params.center,
568
+ distance: params.distance,
569
+ top: params.top,
570
+ province_code: params.provinceCode,
571
+ category: params.category,
572
+ mode: params.mode,
573
+ require_campaign: params.requiredCampaign,
574
+ q: params.keyword,
575
+ isFavourite: params.isFavourite
576
+ }
577
+ },
578
+ requestOptions
579
+ );
580
+ });
581
+ }
582
+ //Create api from above snippet
583
+ place(params, requestOptions) {
584
+ return __async(this, null, function* () {
585
+ return yield this.get(
586
+ `place/${params.id}`,
587
+ {
588
+ params: {
589
+ agencyId: params.agencyId,
590
+ require_campaign: params.requiredCampaign,
591
+ isFavourite: params.isFavourite
592
+ }
593
+ },
594
+ requestOptions
595
+ );
596
+ });
597
+ }
598
+ addToFavourite(params, requestOptions) {
599
+ return __async(this, null, function* () {
600
+ return yield this.post(`place/${params.id}/favourite`, {}, requestOptions);
601
+ });
602
+ }
603
+ removeFromFavourite(params, requestOptions) {
604
+ return __async(this, null, function* () {
605
+ return yield this.post(`place/${params.id}/unfavourite`, {}, requestOptions);
606
+ });
607
+ }
608
+ };
609
+
610
+ // src/api/point-log/point-log-api.ts
611
+ var PointLogApi = class extends BaseService {
612
+ constructor(client, baseUrl) {
613
+ super(client, baseUrl);
614
+ }
615
+ getPointLog(month, options, requestOption) {
616
+ return __async(this, null, function* () {
617
+ return yield this.get(
618
+ "log/points",
619
+ {
620
+ params: {
621
+ month,
622
+ type: options == null ? void 0 : options.type,
623
+ lastRowKey: options == null ? void 0 : options.lastRowKey,
624
+ top: options == null ? void 0 : options.top
625
+ }
626
+ },
627
+ requestOption
628
+ );
629
+ });
630
+ }
631
+ };
632
+
633
+ // src/api/profile/profile-api.ts
634
+ var ProfileApi = class extends BaseService {
635
+ constructor(client, baseUrl) {
636
+ super(client, baseUrl);
637
+ }
638
+ updateProfile(params, requestOptions) {
639
+ return __async(this, null, function* () {
640
+ return yield this.post(
641
+ "profile/me",
642
+ {
643
+ data: params.profileImage,
644
+ firstname: params.firstName,
645
+ lastname: params.lastName,
646
+ contact_number: params.contactNumber,
647
+ email: params.email,
648
+ notification: params.notification,
649
+ locale: params.locale,
650
+ title: params.title,
651
+ gender: params.gender,
652
+ birthdate: params.birthDate,
653
+ address: params.address,
654
+ subdistrict_code: params.subdistrictCode,
655
+ subdistrict_name: params.subdistrictName,
656
+ district_code: params.districtCode,
657
+ district_name: params.districtName,
658
+ province_code: params.provinceCode,
659
+ province_name: params.provinceName,
660
+ country_code: params.countryCode,
661
+ country_name: params.countryName,
662
+ Zipcode: params.zipCode,
663
+ idCard: params.idCard,
664
+ passport: params.passport,
665
+ maritalstatus: params.maritalStatus,
666
+ village: params.village,
667
+ building: params.building,
668
+ number: params.number,
669
+ moo: params.moo,
670
+ room: params.room,
671
+ floor: params.floor,
672
+ soi: params.soi,
673
+ city: params.city,
674
+ road: params.road,
675
+ landmark: params.landmark,
676
+ alternate_contact_number: params.alternateContactNumber,
677
+ home_contact_number: params.homeContactNumber,
678
+ nationality: params.nationality,
679
+ religion: params.religion,
680
+ location: params.location,
681
+ latitude: params.latitude,
682
+ longitude: params.longitude,
683
+ income: params.income,
684
+ interests: params.interests,
685
+ region: params.region,
686
+ phonepurchase: params.phonepurchase,
687
+ highesteducation: params.highestEducation,
688
+ occupation: params.occupation,
689
+ remark: params.remark,
690
+ displayname: params.displayName
691
+ },
692
+ {
693
+ headers: __spreadValues({
694
+ "Content-Type": "multipart/form-data"
695
+ }, (requestOptions == null ? void 0 : requestOptions.headers) ? requestOptions.headers : {}),
696
+ params: requestOptions == null ? void 0 : requestOptions.params,
697
+ data: requestOptions == null ? void 0 : requestOptions.data
698
+ }
699
+ );
700
+ });
701
+ }
702
+ changePassword(current, change, requestOptions) {
703
+ return __async(this, null, function* () {
704
+ return yield this.post(
705
+ "profile/me/change_password",
706
+ {
707
+ current,
708
+ change
709
+ },
710
+ requestOptions
711
+ );
712
+ });
713
+ }
714
+ //Create updateShipping api from above snippet
715
+ updateShipping(params, requestOptions) {
716
+ return __async(this, null, function* () {
717
+ return yield this.post(
718
+ "profile/me/shipping",
719
+ {
720
+ shippingfirstname: params.shippingFirstName,
721
+ shippinglastname: params.shippingLastName,
722
+ shipping_province_code: params.shippingProvinceCode,
723
+ shipping_district_code: params.shippingDistrictCode,
724
+ shipping_subdistrict_code: params.shippingSubDistrictCode,
725
+ shipping_zipcode: params.shippingZipCode,
726
+ shipping_address: params.shippingAddress,
727
+ shipping_province_name: params.shippingProvinceName,
728
+ shipping_district_name: params.shippingDistrictName,
729
+ shipping_subdistrict_name: params.shippingSubFDistrictName,
730
+ shipping_contact_number: params.shippingContactNumber
731
+ },
732
+ requestOptions
733
+ );
734
+ });
735
+ }
736
+ //Create changeContactNumber api from above snippet
737
+ changeContactNumber(contactNumber, otp, refCode, idCard, requestOptions) {
738
+ return __async(this, null, function* () {
739
+ return yield this.post(
740
+ "auth/change_authen",
741
+ {
742
+ contact_number: contactNumber,
743
+ otp,
744
+ refcode: refCode,
745
+ idcard: idCard
746
+ },
747
+ requestOptions
748
+ );
749
+ });
750
+ }
751
+ //Create changeContactNumberV2 api from above snippet
752
+ changeContactNumberV2(contactNumber, otp, refCode, requestOptions) {
753
+ return __async(this, null, function* () {
754
+ return yield this.post(
755
+ "profile/me/contact_number",
756
+ {
757
+ contact_number: contactNumber,
758
+ otp,
759
+ refcode: refCode
760
+ },
761
+ requestOptions
762
+ );
763
+ });
764
+ }
765
+ points(requestOptions) {
766
+ return __async(this, null, function* () {
767
+ return yield this.get("profile/me/updated_points", {}, requestOptions);
768
+ });
769
+ }
770
+ expiringPoints(requestOptions) {
771
+ return __async(this, null, function* () {
772
+ return yield this.get("profile/me/allexpiring_points", {}, requestOptions);
773
+ });
774
+ }
775
+ deactivate(requestOptions) {
776
+ return __async(this, null, function* () {
777
+ return yield this.post("profile/me/deactivate", {}, requestOptions);
778
+ });
779
+ }
780
+ };
781
+
782
+ // src/api/registration/registration-api.ts
783
+ var RegistrationApi = class extends BaseService {
784
+ constructor(client, baseUrl) {
785
+ super(client, baseUrl);
786
+ }
787
+ //Create register from above
788
+ register(params, requestOptions) {
789
+ return __async(this, null, function* () {
790
+ return yield this.post(
791
+ "auth/register",
792
+ {
793
+ app_id: params.appId,
794
+ uuid: params.uuid,
795
+ mac_address: params.macAddress,
796
+ os: params.os,
797
+ platform: params.platform,
798
+ client_version: params.clientVersion,
799
+ device_noti_enable: params.deviceNotificationEnable,
800
+ username: params.username,
801
+ password: params.password,
802
+ confirmpassword: params.confirmPassword,
803
+ firstname: params.firstName,
804
+ lastname: params.lastName,
805
+ contact_number: params.contactNumber,
806
+ otp: params.otp,
807
+ refcode: params.refCode,
808
+ address: params.address,
809
+ gender: params.gender,
810
+ birthdate: params.birthdate,
811
+ email: params.email,
812
+ refusercode: params.refUserCode,
813
+ info: params.info,
814
+ termandcondition: params.termAndConditionVersion,
815
+ dataprivacy: params.dataPrivacyVersion,
816
+ marketingOption: params.marketingOptionsVersion,
817
+ mktoption_email: params.emailMarketing,
818
+ mktoption_sms: params.smsMarketing,
819
+ mktoption_notification: params.notificationMarketing,
820
+ mktoption_line: params.lineMarketing,
821
+ mktoption_phone: params.phoneMarketing
822
+ },
823
+ requestOptions
824
+ );
825
+ });
826
+ }
827
+ };
828
+
829
+ // src/api/init-service.ts
830
+ var BzbsService = class {
831
+ constructor(client, baseUrl, baseLineUrl) {
832
+ this.init(client, baseUrl, baseLineUrl);
833
+ }
834
+ init(client, baseUrl, baseLineUrl) {
835
+ var _a;
836
+ this.client = client;
837
+ this.baseUrl = baseUrl;
838
+ this.baseLineUrl = baseLineUrl;
839
+ if (!this.baseUrl) {
840
+ throw "BzbsService Please check baseURL";
841
+ }
842
+ if (!this.baseLineUrl) {
843
+ console.log("BzbsService Please check line lineBaseUrl");
844
+ }
845
+ if (!this.client) {
846
+ throw "BzbsService Please check client";
847
+ }
848
+ this.authApi = new AuthenticateApi(this.client, this.baseUrl);
849
+ this.badgeApi = new BadgeApi(this.client, this.baseUrl);
850
+ this.campaignApi = new CampaignApi(this.client, this.baseUrl);
851
+ this.cartApi = new CartApi(this.client, this.baseUrl);
852
+ this.categoryApi = new CategoryApi(this.client, this.baseUrl);
853
+ this.consentApi = new ConsentApi(this.client, this.baseUrl);
854
+ this.couponApi = new CouponApi(this.client, this.baseUrl);
855
+ this.dashboardApi = new DashboardApi(this.client, this.baseUrl);
856
+ this.historyApi = new HistoryApi(this.client, this.baseUrl);
857
+ this.lineApi = new LineApi(this.client, (_a = this.baseLineUrl) != null ? _a : "");
858
+ this.notificationApi = new NotificationApi(this.client, this.baseUrl);
859
+ this.placeApi = new PlaceApi(this.client, this.baseUrl);
860
+ this.pointLogApi = new PointLogApi(this.client, this.baseUrl);
861
+ this.profileApi = new ProfileApi(this.client, this.baseUrl);
862
+ this.registerApi = new RegistrationApi(this.client, this.baseUrl);
863
+ }
864
+ };
865
+ export {
866
+ BaseService,
867
+ BzbsService
868
+ };
869
+ //# sourceMappingURL=index.mjs.map