@bzbs/react-api-client 0.0.5 → 0.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -177,259 +177,300 @@ var AuthenticateApi = class extends BaseService {
177
177
  }
178
178
  /**
179
179
  * Performs a device login using the provided device uuid.
180
- * @param appId - Your application id.
181
- * @param uuid - The unique device identifier.
180
+ *
181
+ * @param params - The parameters.
182
+ * @param params.appId - Your application id.
183
+ * @param params.uuid - The unique device identifier.
184
+ * @param params.options - (Optional) Additional params for the request.
182
185
  * @param requestOptions - Optional request options.
183
186
  * @returns A promise that resolves to a ServiceResponse containing the login response.
184
187
  */
185
- deviceLogin(appId, uuid, requestOptions) {
188
+ deviceLogin(params, requestOptions) {
186
189
  return __async(this, null, function* () {
187
190
  return yield this.post(
188
191
  "auth/device_login",
189
- {
190
- app_id: appId,
191
- uuid,
192
+ __spreadValues({
193
+ app_id: params.appId,
194
+ uuid: params.uuid,
192
195
  device_noti_enable: "true"
193
- },
196
+ }, params.options),
194
197
  requestOptions
195
198
  );
196
199
  });
197
200
  }
198
201
  /**
199
202
  * Performs a Facebook login using the provided Facebook access token.
203
+ *
204
+ * @param params - The parameters.
200
205
  * @param accessToken - The access token obtained from Facebook.
201
206
  * @param appId - Your application id.
202
207
  * @param uuid - The unique device identifier.
208
+ * @param params.options - (Optional) Additional params for the request.
203
209
  * @param requestOptions - Optional request options.
204
210
  * @returns A promise that resolves to a ServiceResponse containing the login response.
205
211
  */
206
- facebookLogin(accessToken, appId, uuid, requestOptions) {
212
+ facebookLogin(params, requestOptions) {
207
213
  return __async(this, null, function* () {
208
214
  return yield this.post(
209
215
  "auth/login",
210
- {
211
- access_token: accessToken,
212
- app_id: appId,
213
- uuid,
216
+ __spreadValues({
217
+ access_token: params.accessToken,
218
+ app_id: params.appId,
219
+ uuid: params.uuid,
214
220
  device_noti_enable: "true"
215
- },
221
+ }, params.options),
216
222
  requestOptions
217
223
  );
218
224
  });
219
225
  }
220
226
  /**
221
227
  * Performs a Google login using the provided id token, app id, and uuid.
222
- * @param idToken - The Google id token.
223
- * @param appId - Your application id.
224
- * @param uuid - The unique device identifier.
228
+ *
229
+ * @param params - The parameters.
230
+ * @param params.idToken - The Google id token.
231
+ * @param params.appId - Your application id.
232
+ * @param params.uuid - The unique device identifier.
233
+ * @param params.options - (Optional) Additional params for the request.
225
234
  * @param requestOptions - Optional request options.
226
235
  * @returns A promise that resolves to a ServiceResponse containing the login response.
227
236
  */
228
- googleLogin(idToken, appId, uuid, requestOptions) {
237
+ googleLogin(params, requestOptions) {
229
238
  return __async(this, null, function* () {
230
239
  return yield this.post(
231
240
  "auth/google_login",
232
- {
233
- id_token: idToken,
234
- app_id: appId,
235
- uuid,
241
+ __spreadValues({
242
+ id_token: params.idToken,
243
+ app_id: params.appId,
244
+ uuid: params.uuid,
236
245
  device_noti_enable: "true"
237
- },
246
+ }, params.options),
238
247
  requestOptions
239
248
  );
240
249
  });
241
250
  }
242
251
  /**
243
252
  * Performs a Line login using the provided id token, Line access token and authorization code.
244
- * @param idToken - The Line id token.
245
- * @param lineAccessToken - The Line access token.
246
- * @param authorizationCode - The authorization code.
247
- * @param appId - Your application id.
248
- * @param uuid - The unique device identifier.
249
- * @param requestOptions - Optional request options.
253
+ *
254
+ * @param params - The parameters.
255
+ * @param params.idToken - The Line id token.
256
+ * @param params.lineAccessToken - The Line access token.
257
+ * @param params.authorizationCode - The Line authorization code.
258
+ * @param params.appId - Your application id.
259
+ * @param params.uuid - The unique device identifier.
260
+ * @param params.options - (Optional) Additional params for the request.
250
261
  * @returns A promise that resolves to a ServiceResponse containing the login response.
251
262
  */
252
- lineLogin(idToken, lineAccessToken, authorizationCode, appId, uuid, requestOptions) {
263
+ lineLogin(params, requestOptions) {
253
264
  return __async(this, null, function* () {
254
265
  return yield this.post(
255
266
  "auth/line_login",
256
- {
257
- id_token: idToken,
258
- line_access_token: lineAccessToken,
259
- authorization_code: authorizationCode,
260
- app_id: appId,
261
- uuid,
267
+ __spreadValues({
268
+ id_token: params.idToken,
269
+ line_access_token: params.lineAccessToken,
270
+ authorization_code: params.authorizationCode,
271
+ app_id: params.appId,
272
+ uuid: params.uuid,
262
273
  device_noti_enable: "true"
263
- },
274
+ }, params.options),
264
275
  requestOptions
265
276
  );
266
277
  });
267
278
  }
268
279
  /**
269
280
  * Performs an Apple login using the provided id token and Apple refresh token.
270
- * @param idToken - The Apple id token.
271
- * @param refreshToken - The Apple access token.
272
- * @param appId - Your application id.
273
- * @param uuid - The unique device identifier.
281
+ *
282
+ * @param params - The parameters.
283
+ * @param params.idToken - The Apple id token.
284
+ * @param params.refreshToken - The Apple refresh token.
285
+ * @param params.appId - Your application id.
286
+ * @param params.uuid - The unique device identifier.
287
+ * @param params.options - (Optional) Additional params for the request.
274
288
  * @param requestOptions - Optional request options.
275
289
  * @returns A promise that resolves to a ServiceResponse containing the login response.
276
290
  */
277
- appleLogin(idToken, refreshToken, appId, uuid, requestOptions) {
291
+ appleLogin(params, requestOptions) {
278
292
  return __async(this, null, function* () {
279
293
  return yield this.post(
280
294
  "auth/apple_login",
281
- {
282
- id_token: idToken,
283
- refresh_token: refreshToken,
284
- app_id: appId,
285
- uuid,
295
+ __spreadValues({
296
+ id_token: params.idToken,
297
+ refresh_token: params.refreshToken,
298
+ app_id: params.appId,
299
+ uuid: params.uuid,
286
300
  device_noti_enable: "true"
287
- },
301
+ }, params.options),
288
302
  requestOptions
289
303
  );
290
304
  });
291
305
  }
292
306
  /**
293
- * Authenticates a user using a username and password.
307
+ * Performs a username and password login using the provided username and password.
294
308
  *
295
- * @param username - The username of the user.
296
- * @param password - The password of the user.
297
- * @param uuid - The unique device identifier.
298
- * @param appId - Your application id.
299
- * @param requestOptions - Optional request options.
309
+ * @param params - The parameters.
310
+ * @param params.username - The username of the user.
311
+ * @param params.password - The password of the user.
312
+ * @param params.uuid - The unique device identifier.
313
+ * @param params.appId - Your application id.
314
+ * @param params.options - (Optional) Additional params for the request.
300
315
  * @returns A promise that resolves to a ServiceResponse containing the login response.
301
316
  */
302
- usernamePasswordLogin(username, password, uuid, appId, requestOptions) {
317
+ usernamePasswordLogin(params, requestOptions) {
303
318
  return __async(this, null, function* () {
304
319
  return yield this.post(
305
320
  "auth/bzbs_login",
306
- {
307
- username,
308
- password,
309
- app_id: appId,
310
- uuid,
321
+ __spreadValues({
322
+ username: params.username,
323
+ password: params.password,
324
+ uuid: params.uuid,
325
+ app_id: params.appId,
311
326
  device_noti_enable: "true"
312
- },
327
+ }, params.options),
313
328
  requestOptions
314
329
  );
315
330
  });
316
331
  }
317
332
  /**
318
- * Logs out the user with the specified UUID.
319
- * @param uuid - The unique device identifier.
333
+ * Performs a logout for the user.
334
+ *
335
+ * @param params - The parameters.
336
+ * @param params.uuid - The unique device identifier.
337
+ * @param params.options - (Optional) Additional params for the request.
320
338
  * @param requestOptions - Optional request options.
321
- * @returns A promise that resolves to a ServiceResponse containing the logout result.
339
+ * @returns A promise that resolves to a ServiceResponse containing the logout response.
322
340
  */
323
- logout(uuid, requestOptions) {
341
+ logout(params, requestOptions) {
324
342
  return __async(this, null, function* () {
325
- return yield this.post("auth/logout", { uuid }, requestOptions);
343
+ return yield this.post(
344
+ "auth/logout",
345
+ __spreadValues({
346
+ uuid: params.uuid
347
+ }, params.options),
348
+ requestOptions
349
+ );
326
350
  });
327
351
  }
328
352
  /**
329
- * Sends a forget password request to the server.
353
+ * Sends a forget password request to the user.
330
354
  *
331
- * @param contact - The contact information for the user (email or contact number).
332
- * @param type - The type of contact information provided ('email' or 'contact_number').
355
+ * @param params - The parameters.
356
+ * @param params.contact - The contact information for the user (email or contact number).
357
+ * @param params.type - The type of contact information.
358
+ * @param params.options - (Optional) Additional params for the request.
333
359
  * @param requestOptions - Optional request options.
334
360
  * @returns A promise that resolves to a ServiceResponse containing the forget password response.
335
361
  */
336
- forgetPassword(contact, type, requestOptions) {
362
+ forgetPassword(params, requestOptions) {
337
363
  return __async(this, null, function* () {
338
- return yield this.get(`profile/${contact}/forget_password`, { type }, requestOptions);
364
+ return yield this.get(
365
+ `profile/${params.contact}/forget_password`,
366
+ __spreadValues({
367
+ type: params.type
368
+ }, params.options),
369
+ requestOptions
370
+ );
339
371
  });
340
372
  }
341
373
  /**
342
374
  * Resets the password for a user.
343
375
  *
344
- * @param contact - The contact information for the user (email or contact number).
345
- * @param refCode - The reference code for password reset.
346
- * @param newPassword - The new password to set.
347
- * @param otp - (Optional) The one-time password.
376
+ * @param params - The parameters.
377
+ * @param params.contact - The contact information for the user (email or contact number).
378
+ * @param params.refCode - The reference code for password reset.
379
+ * @param params.newPassword - The new password to set.
380
+ * @param params.otp - (Optional) The one-time password.
381
+ * @param params.options - (Optional) Additional params for the request.
348
382
  * @param requestOptions - (Optional) Additional options for the request.
349
383
  * @returns A promise that resolves to a ServiceResponse containing the status response.
350
384
  */
351
- resetPassword(contact, refCode, newPassword, otp, requestOptions) {
385
+ resetPassword(params, requestOptions) {
352
386
  return __async(this, null, function* () {
353
387
  return yield this.post(
354
- `profile/${contact}/forget_password`,
355
- {
356
- refcode: refCode,
357
- change: newPassword,
358
- otp
359
- },
388
+ `profile/${params.contact}/forget_password`,
389
+ __spreadValues({
390
+ refcode: params.refCode,
391
+ change: params.newPassword,
392
+ otp: params.otp
393
+ }, params.options),
360
394
  requestOptions
361
395
  );
362
396
  });
363
397
  }
364
398
  /**
365
- * Send an OTP (One-Time Password) to the user for authentication.
399
+ * Sends an OTP (One-Time Password) to the user for authentication.
366
400
  *
367
- * @param uuid - The unique device identifier.
368
- * @param appId - Your application id.
369
- * @param contactNumber - The contact number of the user.
370
- * @param channel - (Optional) The channel through which the OTP should be sent.
401
+ * @param params - The parameters.
402
+ * @param params.uuid - The unique device identifier.
403
+ * @param params.appId - Your application id.
404
+ * @param params.contactNumber - The contact number for the user.
405
+ * @param params.channel - (Optional) The channel to use for OTP delivery.
406
+ * @param params.options - (Optional) Additional params for the request.
371
407
  * @param requestOptions - (Optional) Additional options for the request.
372
408
  * @returns A promise that resolves to a ServiceResponse containing the OTP response.
373
409
  */
374
- getOtp(uuid, appId, contactNumber, channel, requestOptions) {
410
+ getOtp(params, requestOptions) {
375
411
  return __async(this, null, function* () {
376
412
  return yield this.get(
377
413
  "auth/otp",
378
- {
379
- uuid,
380
- app_id: appId,
381
- contact_number: contactNumber,
382
- channel
383
- },
414
+ __spreadValues({
415
+ uuid: params.uuid,
416
+ app_id: params.appId,
417
+ contact_number: params.contactNumber,
418
+ channel: params.channel
419
+ }, params.options),
384
420
  requestOptions
385
421
  );
386
422
  });
387
423
  }
388
424
  /**
389
- * Confirms the OTP (One-Time Password) for authentication.
425
+ * Confirm the OTP (One-Time Password) for authentication.
390
426
  *
391
- * @param otp - The OTP to be confirmed.
392
- * @param refCode - The reference code for the OTP.
393
- * @param contactNumber - The contact number associated with the OTP.
394
- * @param requestOptions - Optional request options.
395
- * @returns A promise that resolves to a ServiceResponse containing the confirmation response.
427
+ * @param params - The parameters.
428
+ * @param params.otp - The OTP to confirm.
429
+ * @param params.refCode - The reference code for the OTP.
430
+ * @param params.contactNumber - The contact number for the user.
431
+ * @param params.options - (Optional) Additional params for the request.
432
+ * @param requestOptions - (Optional) Additional options for the request.
433
+ * @returns A promise that resolves to a ServiceResponse containing the confirm OTP response.
396
434
  */
397
- confirmOtp(otp, refCode, contactNumber, requestOptions) {
435
+ confirmOtp(params, requestOptions) {
398
436
  return __async(this, null, function* () {
399
437
  return yield this.post(
400
438
  "auth/bzbs_authen",
401
- {
402
- otp,
403
- refcode: refCode,
404
- contact_number: contactNumber
405
- },
439
+ __spreadValues({
440
+ otp: params.otp,
441
+ refcode: params.refCode,
442
+ contact_number: params.contactNumber
443
+ }, params.options),
406
444
  requestOptions
407
445
  );
408
446
  });
409
447
  }
410
448
  /**
411
- * Validates the OTP (One-Time Password) for a given app and contact number.
412
- * @param appId - Your application id.
413
- * @param otp - The OTP to validate.
414
- * @param refCode - The reference code.
415
- * @param contactNumber - The contact number.
416
- * @param use - A boolean indicating whether the OTP should be used.
417
- * @param channel - (Optional) The channel to use for OTP validation.
449
+ * Validate the OTP (One-Time Password) for authentication.
450
+ *
451
+ * @param params - The parameters.
452
+ * @param params.appId - Your application id.
453
+ * @param params.otp - The OTP to validate.
454
+ * @param params.refCode - The reference code for the OTP.
455
+ * @param params.contactNumber - The contact number for the user.
456
+ * @param params.use - Whether to use the OTP after validation.
457
+ * @param params.channel - (Optional) The channel to use for OTP delivery.
458
+ * @param params.options - (Optional) Additional params for the request.
418
459
  * @param requestOptions - (Optional) Additional options for the request.
419
- * @returns A promise that resolves to a ServiceResponse containing the validation result.
460
+ * @returns A promise that resolves to a ServiceResponse containing the validate OTP response.
420
461
  */
421
- validateOtp(appId, otp, refCode, contactNumber, use, channel, requestOptions) {
462
+ validateOtp(params, requestOptions) {
422
463
  return __async(this, null, function* () {
423
464
  return yield this.post(
424
465
  "auth/otp",
425
- {
426
- app_id: appId,
427
- otp,
428
- refcode: refCode,
429
- contact_number: contactNumber,
430
- use,
431
- channel
432
- },
466
+ __spreadValues({
467
+ app_id: params.appId,
468
+ otp: params.otp,
469
+ refcode: params.refCode,
470
+ contact_number: params.contactNumber,
471
+ use: params.use,
472
+ channel: params.channel
473
+ }, params.options),
433
474
  requestOptions
434
475
  );
435
476
  });
@@ -437,23 +478,25 @@ var AuthenticateApi = class extends BaseService {
437
478
  /**
438
479
  * Retrieve a new token and update the current device token.
439
480
  *
440
- * @param uuid - The unique device identifier.
441
- * @param appId - Your application id.
442
- * @param clientVersion - The version of the client.
443
- * @param deviceToken - The token of the device.
444
- * @param requestOptions - The options for the request.
481
+ * @param params - The parameters.
482
+ * @param params.uuid - The unique device identifier.
483
+ * @param params.appId - Your application id.
484
+ * @param params.clientVersion - The version of the client.
485
+ * @param params.deviceToken - The token of the device.
486
+ * @param params.options - (Optional) Additional params for the request.
487
+ * @param requestOptions - (Optional) Additional options for the request.
445
488
  * @returns A promise that resolves to a ServiceResponse containing the resume response.
446
489
  */
447
- resume(uuid, appId, clientVersion, deviceToken, requestOptions) {
490
+ resume(params, requestOptions) {
448
491
  return __async(this, null, function* () {
449
492
  return yield this.post(
450
493
  "auth/device_resume",
451
- {
452
- uuid,
453
- app_id: appId,
454
- client_version: clientVersion,
455
- device_token: deviceToken
456
- },
494
+ __spreadValues({
495
+ uuid: params.uuid,
496
+ app_id: params.appId,
497
+ client_version: params.clientVersion,
498
+ device_token: params.deviceToken
499
+ }, params.options),
457
500
  requestOptions
458
501
  );
459
502
  });
@@ -461,23 +504,25 @@ var AuthenticateApi = class extends BaseService {
461
504
  /**
462
505
  * Update the device token for push notification.
463
506
  *
464
- * @param uuid - The unique device identifier.
465
- * @param appId - Your application id.
466
- * @param clientVersion - The version of the client.
467
- * @param deviceToken - The token of the device.
468
- * @param requestOptions - The options for the request.
507
+ * @param params - The parameters.
508
+ * @param params.uuid - The unique device identifier.
509
+ * @param params.appId - Your application id.
510
+ * @param params.clientVersion - The version of the client.
511
+ * @param params.deviceToken - The token of the device.
512
+ * @param params.options - (Optional) Additional params for the request.
513
+ * @param requestOptions - (Optional) Additional options for the request.
469
514
  * @returns A promise that resolves to a ServiceResponse containing the resume response.
470
515
  */
471
- updateDevice(uuid, appId, clientVersion, deviceToken, requestOptions) {
516
+ updateDevice(params, requestOptions) {
472
517
  return __async(this, null, function* () {
473
518
  return yield this.post(
474
- "auth/update_device",
475
- {
476
- uuid,
477
- app_id: appId,
478
- client_version: clientVersion,
479
- device_token: deviceToken
480
- },
519
+ "auth/device_resume",
520
+ __spreadValues({
521
+ uuid: params.uuid,
522
+ app_id: params.appId,
523
+ client_version: params.clientVersion,
524
+ device_token: params.deviceToken
525
+ }, params.options),
481
526
  requestOptions
482
527
  );
483
528
  });
@@ -511,17 +556,22 @@ var BadgeApi = class extends BaseService {
511
556
  constructor(client, baseUrl) {
512
557
  super(client, baseUrl);
513
558
  }
514
- // Get user badge
515
- getBadge(params, requestOptions) {
559
+ /**
560
+ * Retrieves user badges.
561
+ *
562
+ * @param params - The parameters.
563
+ * @param params.badgeId - The ID of the badge to retrieve.
564
+ * @param params.options - (Optional) Additional params for the request.
565
+ * @param requestOptions - (Optional) Additional options for the request.
566
+ * @returns A promise that resolves to a ServiceResponse containing an array of Badge objects.
567
+ */
568
+ getBadges(params, requestOptions) {
516
569
  return __async(this, null, function* () {
517
- var _a;
518
570
  return yield this.get(
519
571
  "profile/me/badges",
520
- {
521
- params: __spreadValues({
522
- badge_id: (_a = params.badgeId) != null ? _a : ""
523
- }, params.option ? params.option : {})
524
- },
572
+ __spreadValues({
573
+ badge_id: params.badgeId
574
+ }, params.options),
525
575
  requestOptions
526
576
  );
527
577
  });
@@ -533,6 +583,30 @@ var CampaignApi = class extends BaseService {
533
583
  constructor(client, baseUrl) {
534
584
  super(client, baseUrl);
535
585
  }
586
+ /**
587
+ * Retrieves a list of campaigns based on the provided parameters.
588
+ *
589
+ * @param params - The parameters for the campaign list.
590
+ * @param params.config - The configuration for the campaign (list name).
591
+ * @param params.cat - The category for the campaign.
592
+ * @param params.byConfig - A boolean indicating whether to filter by configuration.
593
+ * @param params.skip - The number of campaigns to skip.
594
+ * @param params.top - The number of campaigns to retrieve.
595
+ * @param params.deviceLocale - The device locale for the campaigns.
596
+ * @param params.locale - The locale for the campaigns.
597
+ * @param params.keyword - The keyword for the campaigns.
598
+ * @param params.startDate - The start date for the campaigns.
599
+ * @param params.sponsorId - The sponsor ID for the campaigns.
600
+ * @param params.maxPoints - The maximum points for the campaigns.
601
+ * @param params.minPoints - The minimum points for the campaigns.
602
+ * @param params.sortBy - The sort order for the campaigns.
603
+ * @param params.center - The coordinates for the center of the campaigns.
604
+ * @param params.hashTags - The hash tags for the campaigns.
605
+ * @param params.locationAgencyId - The location agency ID for the campaigns.
606
+ * @param params.options - (Optional) Additional params for the request.
607
+ * @param requestOptions - The options for the HTTP request.
608
+ * @returns A promise that resolves to a ServiceResponse containing an array of Campaign objects.
609
+ */
536
610
  campaign(params, requestOptions) {
537
611
  return __async(this, null, function* () {
538
612
  return yield this.get(
@@ -554,11 +628,22 @@ var CampaignApi = class extends BaseService {
554
628
  center: params.center,
555
629
  tags: params.hashTags,
556
630
  locationAgencyId: params.locationAgencyId
557
- }, params.option ? params.option : {}),
631
+ }, params.options),
558
632
  requestOptions
559
633
  );
560
634
  });
561
635
  }
636
+ /**
637
+ * Retrieves a list of user's favorite campaigns.
638
+ *
639
+ * @param params - The parameters.
640
+ * @param params.skip - The number of campaigns to skip.
641
+ * @param params.top - The number of campaigns to retrieve.
642
+ * @param params.locale - The locale for the campaigns.
643
+ * @param params.options - (Optional) Additional params for the request.
644
+ * @param requestOptions - The options for the API request.
645
+ * @returns A promise that resolves to a ServiceResponse containing an array of Campaign objects.
646
+ */
562
647
  favoriteCampaigns(params, requestOptions) {
563
648
  return __async(this, null, function* () {
564
649
  return yield this.get(
@@ -568,54 +653,97 @@ var CampaignApi = class extends BaseService {
568
653
  skip: params.skip,
569
654
  top: params.top,
570
655
  locale: params.locale
571
- }, params.option ? params.option : {})
656
+ }, params.options)
572
657
  },
573
658
  requestOptions
574
659
  );
575
660
  });
576
661
  }
662
+ /**
663
+ * Retrieves the details of a campaign.
664
+ *
665
+ * @param param - The parameters.
666
+ * @param param.id - The ID of the campaign.
667
+ * @param param.deviceLocale - The device locale (optional).
668
+ * @param param.options - Additional options for the request (optional).
669
+ * @param requestOptions - The options for the request (optional).
670
+ * @returns A promise that resolves to a service response containing the campaign details.
671
+ */
577
672
  campaignDetails(param, requestOptions) {
578
673
  return __async(this, null, function* () {
579
674
  return yield this == null ? void 0 : this.get(
580
675
  `campaign/${param.id}`,
581
676
  {
582
- params: {
677
+ params: __spreadValues({
583
678
  device_locale: param.deviceLocale
584
- }
679
+ }, param.options)
585
680
  },
586
681
  requestOptions
587
682
  );
588
683
  });
589
684
  }
685
+ /**
686
+ * Adds a campaign to the user's favorites.
687
+ * @param id - The ID of the campaign to add to favorites.
688
+ * @param requestOptions - Optional request options.
689
+ * @returns A promise that resolves to a ServiceResponse containing the FavoriteResponse.
690
+ */
590
691
  addToFavorite(id, requestOptions) {
591
692
  return __async(this, null, function* () {
592
693
  return yield this.post(`campaign/${id}/favourite`, {}, requestOptions);
593
694
  });
594
695
  }
696
+ /**
697
+ * Removes a campaign from user's favorites.
698
+ * @param id - The ID of the campaign to remove from favorites.
699
+ * @param requestOptions - Optional request options.
700
+ * @returns A promise that resolves to a ServiceResponse containing the FavoriteResponse.
701
+ */
595
702
  removeFromFavorite(id, requestOptions) {
596
703
  return __async(this, null, function* () {
597
704
  return yield this.delete(`campaign/${id}/favourite`, requestOptions);
598
705
  });
599
706
  }
707
+ /**
708
+ * Redeems a campaign.
709
+ *
710
+ * @param params - The parameters for redeeming the campaign.
711
+ * @param params.id - The ID of the campaign to redeem.
712
+ * @param params.addressKey - The address key of a user's address.
713
+ * @param params.contactNumber - The contact number of the user.
714
+ * @param params.options - Additional options for the redemption.
715
+ * @param requestOptions - The options for the HTTP request.
716
+ * @returns A promise that resolves to a service response containing the redeem response.
717
+ */
600
718
  redeem(params, requestOptions) {
601
719
  return __async(this, null, function* () {
602
720
  return yield this.post(
603
721
  `campaign/${params.id}/redeem`,
604
- {
722
+ __spreadValues({
605
723
  address_key: params.addressKey,
606
724
  contact_number: params.contactNumber
607
- },
725
+ }, params.options),
608
726
  requestOptions
609
727
  );
610
728
  });
611
729
  }
612
- bulkRedeem(id, quantity, requestOptions) {
730
+ /**
731
+ * Redeems a campaign in bulk.
732
+ *
733
+ * @param params - The parameters.
734
+ * @param params.id - The ID of the campaign to redeem.
735
+ * @param params.quantity - The quantity to redeem.
736
+ * @param params.options - Additional options for the redemption.
737
+ * @param requestOptions - The options for the HTTP request.
738
+ * @returns A promise that resolves to a service response containing the redeem response.
739
+ */
740
+ bulkRedeem(params, requestOptions) {
613
741
  return __async(this, null, function* () {
614
742
  return yield this.post(
615
- `campaign/${id}/bulkredeem`,
616
- {
617
- quantity
618
- },
743
+ `campaign/${params.id}/bulkredeem`,
744
+ __spreadValues({
745
+ quantity: params.quantity
746
+ }, params.options),
619
747
  requestOptions
620
748
  );
621
749
  });
@@ -627,23 +755,37 @@ var CartApi = class extends BaseService {
627
755
  constructor(client, baseUrl) {
628
756
  super(client, baseUrl);
629
757
  }
630
- // Get user cart
758
+ /**
759
+ * Adds an item to the cart.
760
+ *
761
+ * @param params - The parameters.
762
+ * @param params.id - The ID of the item to add to the cart.
763
+ * @param params.mode - The mode off adding.
764
+ * @param params.qty - The quantity of the item.
765
+ * @param params.sideCampaignJson - The side campaign JSON.
766
+ * @param params.options - Additional options for adding the item to the cart.
767
+ * @param requestOptions - The options for the request.
768
+ * @returns A promise that resolves to a ServiceResponse containing the cart count response.
769
+ */
631
770
  addCart(params, requestOptions) {
632
771
  return __async(this, null, function* () {
633
772
  return yield this.post(
634
773
  `cart/${params.id}/add`,
635
- {
636
- data: {
637
- mode: params.mode,
638
- qty: params.qty,
639
- sideCampaignJson: params.sideCampaignJson
640
- }
641
- },
774
+ __spreadValues({
775
+ mode: params.mode,
776
+ qty: params.qty,
777
+ sideCampaignJson: params.sideCampaignJson
778
+ }, params.options),
642
779
  requestOptions
643
780
  );
644
781
  });
645
782
  }
646
- /// Get user cart item count
783
+ /**
784
+ * Retrieves the count of items in the cart.
785
+ *
786
+ * @param requestOptions - Optional request options.
787
+ * @returns A promise that resolves to a ServiceResponse containing the CartCountResponse.
788
+ */
647
789
  cartCount(requestOptions) {
648
790
  return __async(this, null, function* () {
649
791
  return yield this.get(this.baseUrl + "cart/count", {}, requestOptions);
@@ -656,17 +798,24 @@ var CategoryApi = class extends BaseService {
656
798
  constructor(client, baseUrl) {
657
799
  super(client, baseUrl);
658
800
  }
659
- // Get category list
801
+ /**
802
+ * Retrieves the campaign categories.
803
+ *
804
+ * @param params - The parameters.
805
+ * @param params.config - The configuration string.
806
+ * @param params.byConfig - Optional. Specifies whether to retrieve categories by configuration.
807
+ * @param params.options - Optional. Additional options for retrieving the categories.
808
+ * @param requestOptions - Optional. The request options.
809
+ * @returns A promise that resolves to a service response containing an array of categories.
810
+ */
660
811
  categories(params, requestOptions) {
661
812
  return __async(this, null, function* () {
662
813
  return yield this.get(
663
814
  "campaigncat/menu",
664
- {
665
- params: {
666
- byConfig: params.byConfig,
667
- config: params.config
668
- }
669
- },
815
+ __spreadValues({
816
+ byConfig: params.byConfig,
817
+ config: params.config
818
+ }, params.options),
670
819
  requestOptions
671
820
  );
672
821
  });
@@ -678,35 +827,60 @@ var ConsentApi = class extends BaseService {
678
827
  constructor(client, baseUrl) {
679
828
  super(client, baseUrl);
680
829
  }
681
- // Get consent
830
+ /**
831
+ * Retrieves the user's consent information.
832
+ *
833
+ * @param params - The parameters for the consent request.
834
+ * @param params.termsAndConditions - The terms and conditions consent version.
835
+ * @param params.dataPrivacy - The data privacy consent version.
836
+ * @param params.marketingOption - The marketing option consent version.
837
+ * @param params.email - The email consent (0 for false, 1 for true).
838
+ * @param params.sms - The SMS consent (0 for false, 1 for true).
839
+ * @param params.notification - The notification consent (0 for false, 1 for true).
840
+ * @param params.line - The LINE consent (0 for false, 1 for true).
841
+ * @param params.analyticsBuzzebeesCookies - The analytics Buzzebees cookies consent (0 for false, 1 for true).
842
+ * @param params.analyticsFirebaseCookies - The analytics Firebase cookies consent (0 for false, 1 for true).
843
+ * @param params.analyticsGoogleCookies - The analytics Google cookies consent (0 for false, 1 for true).
844
+ * @param params.analyticsMetaCookies - The analytics Meta cookies consent (0 for false, 1 for true).
845
+ * @param params.analyticsOtherCookies - The analytics other cookies consent (0 for false, 1 for true).
846
+ * @param params.functionalCookies - The functional cookies consent (0 for false, 1 for true).
847
+ * @param params.marketingCookies - The marketing cookies consent (0 for false, 1 for true).
848
+ * @param params.necessaryCookies - The necessary cookies consent (0 for false, 1 for true).
849
+ * @param params.options - Additional params.
850
+ * @param requestOptions - The options for the request.
851
+ * @returns A promise that resolves to a ServiceResponse containing the consent information.
852
+ */
682
853
  getConsent(params, requestOptions) {
683
854
  return __async(this, null, function* () {
684
855
  return yield this.get(
685
856
  "consent",
686
- {
687
- data: {
688
- termandcondition: params.termsAndConditions,
689
- dataprivacy: params.dataPrivacy,
690
- marketingoption: params.marketingOption,
691
- email: params.email,
692
- sms: params.sms,
693
- notification: params.notification,
694
- line: params.line,
695
- analyticsBuzzebeesCookies: params.analyticsBuzzebeesCookies,
696
- analyticsFirebaseCookies: params.analyticsFirebaseCookies,
697
- analyticsGoogleCookies: params.analyticsGoogleCookies,
698
- analyticsMetaCookies: params.analyticsMetaCookies,
699
- analyticsOtherCookies: params.analyticsOtherCookies,
700
- functionalCookies: params.functionalCookies,
701
- marketingCookies: params.marketingCookies,
702
- necessaryCookies: params.necessaryCookies
703
- }
704
- },
857
+ __spreadValues({
858
+ termandcondition: params.termsAndConditions,
859
+ dataprivacy: params.dataPrivacy,
860
+ marketingoption: params.marketingOption,
861
+ email: params.email,
862
+ sms: params.sms,
863
+ notification: params.notification,
864
+ line: params.line,
865
+ analyticsBuzzebeesCookies: params.analyticsBuzzebeesCookies,
866
+ analyticsFirebaseCookies: params.analyticsFirebaseCookies,
867
+ analyticsGoogleCookies: params.analyticsGoogleCookies,
868
+ analyticsMetaCookies: params.analyticsMetaCookies,
869
+ analyticsOtherCookies: params.analyticsOtherCookies,
870
+ functionalCookies: params.functionalCookies,
871
+ marketingCookies: params.marketingCookies,
872
+ necessaryCookies: params.necessaryCookies
873
+ }, params.options),
705
874
  requestOptions
706
875
  );
707
876
  });
708
877
  }
709
- // Unconsent
878
+ /**
879
+ * Unconsents the user.
880
+ *
881
+ * @param requestOptions - The options for the request.
882
+ * @returns A promise that resolves to a ServiceResponse containing the result of the unconsent operation.
883
+ */
710
884
  unconsent(requestOptions) {
711
885
  return __async(this, null, function* () {
712
886
  return yield this.post("consent/unconsent", {}, requestOptions);
@@ -719,16 +893,22 @@ var CouponApi = class extends BaseService {
719
893
  constructor(client, baseUrl) {
720
894
  super(client, baseUrl);
721
895
  }
722
- // Get coupon list
896
+ /**
897
+ * Processes coupon codes.
898
+ *
899
+ * @param params - The parameters.
900
+ * @param params.codes - The coupon codes to process.
901
+ * @param params.options - Additional options for processing coupon codes.
902
+ * @param requestOptions - The options for making the API request.
903
+ * @returns A promise that resolves to a service response containing the coupon response.
904
+ */
723
905
  processCodes(params, requestOptions) {
724
906
  return __async(this, null, function* () {
725
907
  return yield this.post(
726
908
  "coupon/process",
727
- {
728
- data: {
729
- "codes[]": params.codes
730
- }
731
- },
909
+ __spreadValues({
910
+ "codes[]": params.codes
911
+ }, params.options),
732
912
  requestOptions
733
913
  );
734
914
  });
@@ -740,29 +920,45 @@ var DashboardApi = class extends BaseService {
740
920
  constructor(client, baseUrl) {
741
921
  super(client, baseUrl);
742
922
  }
743
- mainDashboard(appName, locale, requestOptions) {
923
+ /**
924
+ * Retrieves the main dashboard data.
925
+ *
926
+ * @param params - The parameters.
927
+ * @param params.appName - The name of the application.
928
+ * @param params.locale - The locale number.
929
+ * @param params.options - Additional options for the request.
930
+ * @param requestOptions - The options for the request.
931
+ * @returns A promise that resolves to a service response containing an array of Dashboard objects.
932
+ */
933
+ mainDashboard(params, requestOptions) {
744
934
  return __async(this, null, function* () {
745
935
  return yield this.get(
746
936
  "dashboard/main",
747
- {
748
- params: {
749
- app_name: appName,
750
- locale
751
- }
752
- },
937
+ __spreadValues({
938
+ app_name: params.appName,
939
+ locale: params.locale
940
+ }, params.options),
753
941
  requestOptions
754
942
  );
755
943
  });
756
944
  }
945
+ /**
946
+ * Retrieves a sub-dashboard data.
947
+ *
948
+ * @param params - The parameters.
949
+ * @param params.dashboardName - The name of the sub-dashboard to retrieve.
950
+ * @param params.locale - The locale of the sub-dashboard.
951
+ * @param params.options - Additional options for retrieving the sub-dashboard.
952
+ * @param requestOptions - Optional request options.
953
+ * @returns A promise that resolves to a service response containing an array of dashboards.
954
+ */
757
955
  subDashboard(params, requestOptions) {
758
956
  return __async(this, null, function* () {
759
957
  return yield this.get(
760
958
  `dashboard/${params.dashboardName}`,
761
- {
762
- params: {
763
- locale: params.locale
764
- }
765
- },
959
+ __spreadValues({
960
+ locale: params.locale
961
+ }, params.options),
766
962
  requestOptions
767
963
  );
768
964
  });
@@ -774,28 +970,54 @@ var HistoryApi = class extends BaseService {
774
970
  constructor(client, baseUrl) {
775
971
  super(client, baseUrl);
776
972
  }
973
+ /**
974
+ * Retrieves the redeem histories based on the specified parameters.
975
+ *
976
+ * @param params - The parameters for retrieving redeem histories.
977
+ * @param params.byConfig - Indicates whether to retrieve redeem histories by config.
978
+ * @param params.config - The config for retrieving redeem histories.
979
+ * @param params.skip - The number of records to skip.
980
+ * @param params.top - The number of records to retrieve.
981
+ * @param params.locale - The locale for retrieving redeem histories (optional).
982
+ * @param params.startDate - The start date for retrieving redeem histories (optional).
983
+ * @param params.endDate - The end date for retrieving redeem histories (optional).
984
+ * @param params.options - Additional options for retrieving redeem histories (optional).
985
+ * @param requestOptions - The options for the request (optional).
986
+ * @returns A promise that resolves to a service response containing an array of purchase objects.
987
+ */
777
988
  redeemHistories(params, requestOptions) {
778
989
  return __async(this, null, function* () {
779
990
  return yield this.get(
780
991
  "redeem",
781
- {
782
- params: {
783
- byConfig: params.byConfig,
784
- config: params.config,
785
- skip: params.skip,
786
- top: params.top,
787
- locale: params.locale,
788
- startdate: params.startDate,
789
- enddate: params.endDate
790
- }
791
- },
992
+ __spreadValues({
993
+ byConfig: params.byConfig,
994
+ config: params.config,
995
+ skip: params.skip,
996
+ top: params.top,
997
+ locale: params.locale,
998
+ startdate: params.startDate,
999
+ enddate: params.endDate
1000
+ }, params.options),
792
1001
  requestOptions
793
1002
  );
794
1003
  });
795
1004
  }
1005
+ /**
1006
+ * Marks the specified redeem key as used.
1007
+ *
1008
+ * @param params - The parameters.
1009
+ * @param params.redeemKey - The redeem key for the campaign.
1010
+ * @param params.options - Additional options for using the campaign.
1011
+ * @param requestOptions - Optional request options.
1012
+ * @returns A promise that resolves to a service response containing the result of the redemption.
1013
+ */
796
1014
  use(params, requestOptions) {
797
1015
  return __async(this, null, function* () {
798
- return yield this.post(`redeem/${params.redeemKey}/use`, {}, requestOptions);
1016
+ return yield this.post(
1017
+ `redeem/${params.redeemKey}/use`,
1018
+ __spreadValues({}, params.options),
1019
+ requestOptions
1020
+ );
799
1021
  });
800
1022
  }
801
1023
  };
@@ -805,18 +1027,30 @@ var LineApi = class extends BaseService {
805
1027
  constructor(client, baseUrl) {
806
1028
  super(client, baseUrl);
807
1029
  }
808
- //Create Line Auth
1030
+ /**
1031
+ * Authenticates with the LINE API.
1032
+ *
1033
+ * @param params - The authentication parameters.
1034
+ * @param params.grantType - The grant type.
1035
+ * @param params.code - The code.
1036
+ * @param params.clientId - The client ID.
1037
+ * @param params.clientSecret - The client secret.
1038
+ * @param params.redirectUrl - The redirect URL.
1039
+ * @param params.options - Additional options for the request.
1040
+ * @param requestOptions - The optional request options.
1041
+ * @returns A promise that resolves to a ServiceResponse containing the LineAuthResponse.
1042
+ */
809
1043
  lineAuth(params, requestOptions) {
810
1044
  return __async(this, null, function* () {
811
1045
  return yield this.post(
812
1046
  "oauth2/v2.1/token",
813
- {
1047
+ __spreadValues({
814
1048
  grant_type: params.grantType,
815
1049
  code: params.code,
816
1050
  client_id: params.clientId,
817
1051
  client_secret: params.clientSecret,
818
1052
  redirect_uri: params.redirectUrl
819
- },
1053
+ }, params.options),
820
1054
  requestOptions
821
1055
  );
822
1056
  });
@@ -828,20 +1062,36 @@ var NotificationApi = class extends BaseService {
828
1062
  constructor(client, baseUrl) {
829
1063
  super(client, baseUrl);
830
1064
  }
1065
+ /**
1066
+ * Retrieves notifications.
1067
+ *
1068
+ * @param params - The parameters for retrieving notifications.
1069
+ * @param params.mode - The mode for retrieving notifications (new or all)
1070
+ * @param params.sortBy - The sort order for the notifications (createdate_desc or createdate_asc)
1071
+ * @param requestOptions - The options for the HTTP request.
1072
+ * @returns A promise that resolves to a service response containing an array of notifications.
1073
+ */
831
1074
  notifications(params, requestOptions) {
832
1075
  return __async(this, null, function* () {
833
1076
  return yield this.get(
834
1077
  "noti",
835
- {
836
- params: {
837
- mode: params.mode,
838
- sortBy: params.sortBy
839
- }
840
- },
1078
+ __spreadValues({
1079
+ mode: params.mode,
1080
+ sortBy: params.sortBy
1081
+ }, params.options),
841
1082
  requestOptions
842
1083
  );
843
1084
  });
844
1085
  }
1086
+ /**
1087
+ * Marks notifications as read.
1088
+ *
1089
+ * @param params - The parameters for marking notifications as read.
1090
+ * @param params.ids - The IDs(RowKeys) of the notifications to mark as read. (RowKey1, RowKey2)
1091
+ * @param params.options - Additional options for marking notifications as read.
1092
+ * @param requestOptions - Optional request options.
1093
+ * @returns A promise that resolves to a service response containing the result of marking notifications as read.
1094
+ */
845
1095
  read(params, requestOptions) {
846
1096
  return __async(this, null, function* () {
847
1097
  return yield this.post(
@@ -860,49 +1110,90 @@ var PlaceApi = class extends BaseService {
860
1110
  constructor(client, baseUrl) {
861
1111
  super(client, baseUrl);
862
1112
  }
1113
+ /**
1114
+ * Retrieves a list of places based on the provided parameters.
1115
+ *
1116
+ * @param params - The parameters for the place list request.
1117
+ * @param params.agencyId - The ID of the agency.
1118
+ * @param params.center - The center of the search area.
1119
+ * @param params.distance - The distance from the center.
1120
+ * @param params.top - The number of places to retrieve.
1121
+ * @param params.provinceCode - The province code (optional).
1122
+ * @param params.category - The category of the place (optional).
1123
+ * @param params.mode - The mode of the place (optional).
1124
+ * @param params.requiredCampaign - Indicates whether the place requires a campaign (optional).
1125
+ * @param params.keyword - The keyword to search for (optional).
1126
+ * @param params.isFavourite - Indicates whether the place is a favourite (optional).
1127
+ * @param params.options - Additional options for the request (optional).
1128
+ * @param requestOptions - The options for the request (optional).
1129
+ * @returns A promise that resolves to a ServiceResponse containing an array of Place objects.
1130
+ */
863
1131
  placeList(params, requestOptions) {
864
1132
  return __async(this, null, function* () {
865
1133
  return yield this.get(
866
1134
  "place",
867
- {
868
- params: {
869
- agencyId: params.agencyId,
870
- center: params.center,
871
- distance: params.distance,
872
- top: params.top,
873
- province_code: params.provinceCode,
874
- category: params.category,
875
- mode: params.mode,
876
- require_campaign: params.requiredCampaign,
877
- q: params.keyword,
878
- isFavourite: params.isFavourite
879
- }
880
- },
1135
+ __spreadValues({
1136
+ agencyId: params.agencyId,
1137
+ center: params.center,
1138
+ distance: params.distance,
1139
+ top: params.top,
1140
+ province_code: params.provinceCode,
1141
+ category: params.category,
1142
+ mode: params.mode,
1143
+ require_campaign: params.requiredCampaign,
1144
+ q: params.keyword,
1145
+ isFavourite: params.isFavourite
1146
+ }, params.options),
881
1147
  requestOptions
882
1148
  );
883
1149
  });
884
1150
  }
885
- //Create api from above snippet
1151
+ /**
1152
+ * Retrieves information about a specific place.
1153
+ *
1154
+ * @param params - The parameters for the place request.
1155
+ * @param params.id - The ID of the place.
1156
+ * @param params.agencyId - The ID of the agency.
1157
+ * @param params.requiredCampaign - (Optional) Indicates if a campaign is required.
1158
+ * @param params.isFavourite - (Optional) Indicates if the place is a favorite.
1159
+ * @param params.options - (Optional) Additional options for the request.
1160
+ * @param requestOptions - (Optional) Additional options for the HTTP request.
1161
+ * @returns A promise that resolves to a ServiceResponse containing the place information.
1162
+ */
886
1163
  place(params, requestOptions) {
887
1164
  return __async(this, null, function* () {
888
1165
  return yield this.get(
889
1166
  `place/${params.id}`,
890
- {
891
- params: {
892
- agencyId: params.agencyId,
893
- require_campaign: params.requiredCampaign,
894
- isFavourite: params.isFavourite
895
- }
896
- },
1167
+ __spreadValues({
1168
+ agencyId: params.agencyId,
1169
+ require_campaign: params.requiredCampaign,
1170
+ isFavourite: params.isFavourite
1171
+ }, params.options),
897
1172
  requestOptions
898
1173
  );
899
1174
  });
900
1175
  }
1176
+ /**
1177
+ * Adds a place to the user's favorites.
1178
+ *
1179
+ * @param params - The parameters.
1180
+ * @param params.id - The ID of the place to be added to favorites.
1181
+ * @param requestOptions - The optional request options.
1182
+ * @returns A promise that resolves to a ServiceResponse containing the result of the operation.
1183
+ */
901
1184
  addToFavourite(params, requestOptions) {
902
1185
  return __async(this, null, function* () {
903
1186
  return yield this.post(`place/${params.id}/favourite`, {}, requestOptions);
904
1187
  });
905
1188
  }
1189
+ /**
1190
+ * Removes a place from the user's favorites.
1191
+ *
1192
+ * @param params - The parameters.
1193
+ * @param params.id - The ID of the place to be removed from favorites.
1194
+ * @param requestOptions - Optional request options.
1195
+ * @returns A promise that resolves to a ServiceResponse containing the result of the operation.
1196
+ */
906
1197
  removeFromFavourite(params, requestOptions) {
907
1198
  return __async(this, null, function* () {
908
1199
  return yield this.post(`place/${params.id}/unfavourite`, {}, requestOptions);
@@ -915,18 +1206,28 @@ var PointLogApi = class extends BaseService {
915
1206
  constructor(client, baseUrl) {
916
1207
  super(client, baseUrl);
917
1208
  }
918
- getPointLog(month, options, requestOption) {
1209
+ /**
1210
+ * Retrieves the point log.
1211
+ *
1212
+ * @param params - The parameters for retrieving the point log.
1213
+ * @param params.month - The month for which to retrieve the point log.
1214
+ * @param params.type - (Optional) The type of point log to retrieve. (earn/burn/etc)
1215
+ * @param params.lastRowKey - (Optional) The last row key for pagination.
1216
+ * @param params.top - (Optional) The maximum number of records to retrieve.
1217
+ * @param params.options - (Optional) Additional options for the request.
1218
+ * @param requestOption - (Optional) The request options.
1219
+ * @returns A promise that resolves to a service response containing an array of point logs.
1220
+ */
1221
+ getPointLog(params, requestOption) {
919
1222
  return __async(this, null, function* () {
920
1223
  return yield this.get(
921
1224
  "log/points",
922
- {
923
- params: {
924
- month,
925
- type: options == null ? void 0 : options.type,
926
- lastRowKey: options == null ? void 0 : options.lastRowKey,
927
- top: options == null ? void 0 : options.top
928
- }
929
- },
1225
+ __spreadValues({
1226
+ month: params.month,
1227
+ type: params == null ? void 0 : params.type,
1228
+ lastRowKey: params == null ? void 0 : params.lastRowKey,
1229
+ top: params == null ? void 0 : params.top
1230
+ }, params.options),
930
1231
  requestOption
931
1232
  );
932
1233
  });
@@ -938,11 +1239,18 @@ var ProfileApi = class extends BaseService {
938
1239
  constructor(client, baseUrl) {
939
1240
  super(client, baseUrl);
940
1241
  }
1242
+ /**
1243
+ * Updates the user profile with the provided parameters.
1244
+ *
1245
+ * @param params - The parameters for updating the profile.
1246
+ * @param requestOptions - The options for the request.
1247
+ * @returns A promise that resolves to a ServiceResponse containing the updated profile.
1248
+ */
941
1249
  updateProfile(params, requestOptions) {
942
1250
  return __async(this, null, function* () {
943
1251
  return yield this.post(
944
1252
  "profile/me",
945
- {
1253
+ __spreadValues({
946
1254
  data: params.profileImage,
947
1255
  firstname: params.firstName,
948
1256
  lastname: params.lastName,
@@ -991,7 +1299,7 @@ var ProfileApi = class extends BaseService {
991
1299
  occupation: params.occupation,
992
1300
  remark: params.remark,
993
1301
  displayname: params.displayName
994
- },
1302
+ }, params.options),
995
1303
  {
996
1304
  headers: __spreadValues({
997
1305
  "Content-Type": "multipart/form-data"
@@ -1002,24 +1310,40 @@ var ProfileApi = class extends BaseService {
1002
1310
  );
1003
1311
  });
1004
1312
  }
1005
- changePassword(current, change, requestOptions) {
1313
+ /**
1314
+ * Changes the user's password.
1315
+ *
1316
+ * @param params - The parameters.
1317
+ * @param params.current - The current password.
1318
+ * @param params.change - The new password.
1319
+ * @param params.options - Optional additional options.
1320
+ * @param requestOptions - Optional request options.
1321
+ * @returns A promise that resolves to a ServiceResponse containing the status response.
1322
+ */
1323
+ changePassword(params, requestOptions) {
1006
1324
  return __async(this, null, function* () {
1007
1325
  return yield this.post(
1008
1326
  "profile/me/change_password",
1009
- {
1010
- current,
1011
- change
1012
- },
1327
+ __spreadValues({
1328
+ current: params.current,
1329
+ change: params.change
1330
+ }, params.options),
1013
1331
  requestOptions
1014
1332
  );
1015
1333
  });
1016
1334
  }
1017
- //Create updateShipping api from above snippet
1335
+ /**
1336
+ * Updates the shipping information for the user.
1337
+ *
1338
+ * @param params - The parameters for updating the shipping information.
1339
+ * @param requestOptions - The options for the HTTP request.
1340
+ * @returns A promise that resolves to a ServiceResponse containing the updated shipping information.
1341
+ */
1018
1342
  updateShipping(params, requestOptions) {
1019
1343
  return __async(this, null, function* () {
1020
1344
  return yield this.post(
1021
1345
  "profile/me/shipping",
1022
- {
1346
+ __spreadValues({
1023
1347
  shippingfirstname: params.shippingFirstName,
1024
1348
  shippinglastname: params.shippingLastName,
1025
1349
  shipping_province_code: params.shippingProvinceCode,
@@ -1031,50 +1355,89 @@ var ProfileApi = class extends BaseService {
1031
1355
  shipping_district_name: params.shippingDistrictName,
1032
1356
  shipping_subdistrict_name: params.shippingSubFDistrictName,
1033
1357
  shipping_contact_number: params.shippingContactNumber
1034
- },
1358
+ }, params.options),
1035
1359
  requestOptions
1036
1360
  );
1037
1361
  });
1038
1362
  }
1039
- //Create changeContactNumber api from above snippet
1040
- changeContactNumber(contactNumber, otp, refCode, idCard, requestOptions) {
1363
+ /**
1364
+ * Changes the contact number of the user.
1365
+ *
1366
+ * @param params - The parameters for changing the contact number.
1367
+ * @param params.contactNumber - The new contact number.
1368
+ * @param params.otp - The one-time password.
1369
+ * @param params.refCode - The reference code.
1370
+ * @param params.idCard - (Optional) The ID card for additional verification.
1371
+ * @param params.options - (Optional) Additional options for the request.
1372
+ * @param requestOptions - (Optional) The options for the request.
1373
+ * @returns A promise that resolves to the response of the request.
1374
+ */
1375
+ changeContactNumber(params, requestOptions) {
1041
1376
  return __async(this, null, function* () {
1042
1377
  return yield this.post(
1043
1378
  "auth/change_authen",
1044
- {
1045
- contact_number: contactNumber,
1046
- otp,
1047
- refcode: refCode,
1048
- idcard: idCard
1049
- },
1379
+ __spreadValues({
1380
+ contact_number: params.contactNumber,
1381
+ otp: params.otp,
1382
+ refcode: params.refCode,
1383
+ idcard: params.idCard
1384
+ }, params.options),
1050
1385
  requestOptions
1051
1386
  );
1052
1387
  });
1053
1388
  }
1054
- //Create changeContactNumberV2 api from above snippet
1055
- changeContactNumberV2(contactNumber, otp, refCode, requestOptions) {
1389
+ /**
1390
+ * Changes the contact number for the current user.
1391
+ *
1392
+ * @param params - The parameters for changing the contact number.
1393
+ * @param params.contactNumber - The new contact number.
1394
+ * @param params.otp - The one-time password for verification.
1395
+ * @param params.refCode - The reference code for verification.
1396
+ * @param params.options - Additional options for the request.
1397
+ * @param requestOptions - The options for the request.
1398
+ * @returns A promise that resolves to a ServiceResponse containing the result of the request.
1399
+ */
1400
+ changeContactNumberV2(params, requestOptions) {
1056
1401
  return __async(this, null, function* () {
1057
1402
  return yield this.post(
1058
1403
  "profile/me/contact_number",
1059
- {
1060
- contact_number: contactNumber,
1061
- otp,
1062
- refcode: refCode
1063
- },
1404
+ __spreadValues({
1405
+ contact_number: params.contactNumber,
1406
+ otp: params.otp,
1407
+ refcode: params.refCode
1408
+ }, params.options),
1064
1409
  requestOptions
1065
1410
  );
1066
1411
  });
1067
1412
  }
1413
+ /**
1414
+ * Retrieves the updated points for the current user's profile.
1415
+ *
1416
+ * @param requestOptions - Optional request options.
1417
+ * @returns A promise that resolves to a ServiceResponse containing the updated points.
1418
+ */
1068
1419
  points(requestOptions) {
1069
1420
  return __async(this, null, function* () {
1070
1421
  return yield this.get("profile/me/updated_points", {}, requestOptions);
1071
1422
  });
1072
1423
  }
1424
+ /**
1425
+ * Retrieves the expiring points for the current user's profile.
1426
+ *
1427
+ * @param requestOptions - Optional request options.
1428
+ * @returns A promise that resolves to a ServiceResponse containing the expiring points.
1429
+ */
1073
1430
  expiringPoints(requestOptions) {
1074
1431
  return __async(this, null, function* () {
1075
1432
  return yield this.get("profile/me/allexpiring_points", {}, requestOptions);
1076
1433
  });
1077
1434
  }
1435
+ /**
1436
+ * Deactivates the user's profile.
1437
+ *
1438
+ * @param requestOptions - Optional request options.
1439
+ * @returns A promise that resolves to a ServiceResponse containing the result of the deactivation.
1440
+ */
1078
1441
  deactivate(requestOptions) {
1079
1442
  return __async(this, null, function* () {
1080
1443
  return yield this.post("profile/me/deactivate", {}, requestOptions);
@@ -1087,12 +1450,18 @@ var RegistrationApi = class extends BaseService {
1087
1450
  constructor(client, baseUrl) {
1088
1451
  super(client, baseUrl);
1089
1452
  }
1090
- //Create register from above
1453
+ /**
1454
+ * Registers a user with the provided registration parameters.
1455
+ *
1456
+ * @param params - The registration parameters.
1457
+ * @param requestOptions - The optional request options.
1458
+ * @returns A promise that resolves to a service response containing the registration response.
1459
+ */
1091
1460
  register(params, requestOptions) {
1092
1461
  return __async(this, null, function* () {
1093
1462
  return yield this.post(
1094
1463
  "auth/register",
1095
- {
1464
+ __spreadValues({
1096
1465
  app_id: params.appId,
1097
1466
  uuid: params.uuid,
1098
1467
  mac_address: params.macAddress,
@@ -1122,7 +1491,7 @@ var RegistrationApi = class extends BaseService {
1122
1491
  mktoption_notification: params.notificationMarketing,
1123
1492
  mktoption_line: params.lineMarketing,
1124
1493
  mktoption_phone: params.phoneMarketing
1125
- },
1494
+ }, params.options),
1126
1495
  requestOptions
1127
1496
  );
1128
1497
  });