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