@bzbs/react-api-client 0.0.5 → 0.0.7

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