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