@livechat/developer-studio-api 3.0.2 → 3.0.4

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.js CHANGED
@@ -3246,151 +3246,6 @@ function initPlatformDpsClientInstance(baseUrl, token) {
3246
3246
  }
3247
3247
  }
3248
3248
 
3249
- // src/apis/platform/dps/applications/application/authorization/api.ts
3250
- var platformDpsApplicationAuthorizationApi = {
3251
- createAuth(appId, payload, authorization) {
3252
- return __async(this, null, function* () {
3253
- try {
3254
- yield platformDpsClientInstance.post(
3255
- `/v2/applications/${appId}/authorization`,
3256
- payload,
3257
- getPlatformDpsClientConfig(authorization)
3258
- );
3259
- } catch (error) {
3260
- if (error instanceof Error) {
3261
- throw new Error(
3262
- `Authorization couldn't be created. [${error.message}]`
3263
- );
3264
- }
3265
- throw error;
3266
- }
3267
- });
3268
- },
3269
- deleteAuth(appId, authorization) {
3270
- return __async(this, null, function* () {
3271
- try {
3272
- yield platformDpsClientInstance.delete(
3273
- `/v2/applications/${appId}/authorization`,
3274
- getPlatformDpsClientConfig(authorization)
3275
- );
3276
- } catch (error) {
3277
- if (error instanceof Error) {
3278
- throw new Error(
3279
- `Authorization couldn't be created. [${error.message}]`
3280
- );
3281
- }
3282
- throw error;
3283
- }
3284
- });
3285
- }
3286
- };
3287
-
3288
- // src/apis/platform/dps/applications/application/autoReview/_contracts/dtos/autoReview.ts
3289
- var getEmptyAppAutoReview = () => ({
3290
- isReviewed: false,
3291
- recommendations: {
3292
- listingDetails: {
3293
- appName: "",
3294
- shortDescription: "",
3295
- longDescription: "",
3296
- features: "",
3297
- benefits: ""
3298
- },
3299
- auth: {
3300
- hasZeroScopes: false
3301
- }
3302
- },
3303
- errors: {
3304
- listingDetails: {
3305
- appName: "",
3306
- shortDescription: "",
3307
- longDescription: "",
3308
- features: "",
3309
- benefits: ""
3310
- },
3311
- auth: {
3312
- hasAllScopes: false,
3313
- isRedirectUriSafe: false
3314
- },
3315
- links: {
3316
- tutorial: {
3317
- returns200: false,
3318
- isValid: false
3319
- },
3320
- privacyPolicy: {
3321
- returns200: false,
3322
- isValid: false
3323
- }
3324
- },
3325
- images: {
3326
- icon: {
3327
- isNsfw: false,
3328
- isRatioValid: false
3329
- },
3330
- screenshots: {
3331
- areNsfw: false,
3332
- areRatiosValid: false
3333
- }
3334
- }
3335
- }
3336
- });
3337
-
3338
- // src/apis/platform/dps/applications/application/autoReview/_contracts/payloads/autoReview.ts
3339
- var getAppAutoReviewPayload = (value) => {
3340
- return {
3341
- appName: value,
3342
- shortDescription: value,
3343
- longDescription: value,
3344
- features: value,
3345
- benefits: value,
3346
- scopes: value,
3347
- redirect: value,
3348
- tutorial: value,
3349
- privacyPolicy: value,
3350
- icons: value,
3351
- screenshots: value
3352
- };
3353
- };
3354
-
3355
- // src/apis/platform/dps/applications/application/autoReview/api.ts
3356
- var platformDpsApplicationAutoReviewApi = {
3357
- getAutoReview(appId, authorization) {
3358
- return __async(this, null, function* () {
3359
- try {
3360
- const response = yield platformDpsClientInstance.get(
3361
- `/v2/applications/${appId}/auto-review`,
3362
- getPlatformDpsClientConfig(authorization)
3363
- );
3364
- if (response.status === 204) {
3365
- return getEmptyAppAutoReview();
3366
- }
3367
- return response.data;
3368
- } catch (error) {
3369
- if (error instanceof Error) {
3370
- throw new Error(`The review couldn\u2019t be completed. [${error.message}]`);
3371
- }
3372
- throw error;
3373
- }
3374
- });
3375
- },
3376
- submitAutoReview(appId, payload, authorization) {
3377
- return __async(this, null, function* () {
3378
- try {
3379
- yield platformDpsClientInstance.post(
3380
- `/v2/applications/${appId}/auto-review`,
3381
- payload,
3382
- getPlatformDpsClientConfig(authorization)
3383
- );
3384
- } catch (error) {
3385
- if (error instanceof Error) {
3386
- throw new Error(`The review couldn\u2019t be requested. [${error.message}]`);
3387
- }
3388
- throw error;
3389
- }
3390
- });
3391
- }
3392
- };
3393
-
3394
3249
  // src/constants/app/templates/repository.ts
3395
3250
  var appRepositoryTemplatesMap = {
3396
3251
  "livechat/developer-app-template-nextjs": "nextjs",
@@ -3594,59 +3449,176 @@ var appTemplates = {
3594
3449
  };
3595
3450
  var allAppTemplates = __spreadValues(__spreadValues(__spreadValues({}, appRepositoryTemplates), appBaseTemplates), appTemplates);
3596
3451
 
3597
- // src/apis/platform/dps/applications/application/chatActions/api.ts
3598
- var platformDpsApplicationChatActionsApi = {
3599
- createChatAction(appId, payload, authorization) {
3452
+ // src/apis/platform/dps/applications/application/authorization/api.ts
3453
+ var platformDpsApplicationAuthorizationApi = {
3454
+ createAuth(appId, payload, authorization) {
3600
3455
  return __async(this, null, function* () {
3601
- try {
3602
- yield platformDpsClientInstance.put(
3603
- `/v2/applications/${appId}/chat-actions/${payload.id}`,
3604
- payload,
3605
- getPlatformDpsClientConfig(authorization)
3456
+ yield platformDpsClientInstance.post(
3457
+ `/v2/applications/${appId}/authorization`,
3458
+ payload,
3459
+ getPlatformDpsClientConfig(authorization)
3460
+ ).catch((error) => {
3461
+ throw error.withCustomMessage(
3462
+ `${API_NOTIFICATIONS.BUILDING_BLOCKS.FAILURE.CREATED} [${error.message}]`
3606
3463
  );
3607
- } catch (error) {
3608
- if (error instanceof Error) {
3609
- throw new Error(
3610
- `${API_NOTIFICATIONS.BUILDING_BLOCKS.FAILURE.CREATED} [${error.message}]`
3611
- );
3612
- }
3613
- throw error;
3614
- }
3464
+ });
3615
3465
  });
3616
3466
  },
3617
- updateChatAction(appId, payload, authorization) {
3467
+ deleteAuth(appId, authorization) {
3468
+ return __async(this, null, function* () {
3469
+ yield platformDpsClientInstance.delete(
3470
+ `/v2/applications/${appId}/authorization`,
3471
+ getPlatformDpsClientConfig(authorization)
3472
+ ).catch((error) => {
3473
+ throw error.withCustomMessage(
3474
+ `${API_NOTIFICATIONS.BUILDING_BLOCKS.FAILURE.DELETED} [${error.message}]`
3475
+ );
3476
+ });
3477
+ });
3478
+ }
3479
+ };
3480
+
3481
+ // src/apis/platform/dps/applications/application/autoReview/_contracts/dtos/autoReview.ts
3482
+ var getEmptyAppAutoReview = () => ({
3483
+ isReviewed: false,
3484
+ recommendations: {
3485
+ listingDetails: {
3486
+ appName: "",
3487
+ shortDescription: "",
3488
+ longDescription: "",
3489
+ features: "",
3490
+ benefits: ""
3491
+ },
3492
+ auth: {
3493
+ hasZeroScopes: false
3494
+ }
3495
+ },
3496
+ errors: {
3497
+ listingDetails: {
3498
+ appName: "",
3499
+ shortDescription: "",
3500
+ longDescription: "",
3501
+ features: "",
3502
+ benefits: ""
3503
+ },
3504
+ auth: {
3505
+ hasAllScopes: false,
3506
+ isRedirectUriSafe: false
3507
+ },
3508
+ links: {
3509
+ tutorial: {
3510
+ returns200: false,
3511
+ isValid: false
3512
+ },
3513
+ privacyPolicy: {
3514
+ returns200: false,
3515
+ isValid: false
3516
+ }
3517
+ },
3518
+ images: {
3519
+ icon: {
3520
+ isNsfw: false,
3521
+ isRatioValid: false
3522
+ },
3523
+ screenshots: {
3524
+ areNsfw: false,
3525
+ areRatiosValid: false
3526
+ }
3527
+ }
3528
+ }
3529
+ });
3530
+
3531
+ // src/apis/platform/dps/applications/application/autoReview/_contracts/payloads/autoReview.ts
3532
+ var getAppAutoReviewPayload = (value) => {
3533
+ return {
3534
+ appName: value,
3535
+ shortDescription: value,
3536
+ longDescription: value,
3537
+ features: value,
3538
+ benefits: value,
3539
+ scopes: value,
3540
+ redirect: value,
3541
+ tutorial: value,
3542
+ privacyPolicy: value,
3543
+ icons: value,
3544
+ screenshots: value
3545
+ };
3546
+ };
3547
+
3548
+ // src/apis/platform/dps/applications/application/autoReview/api.ts
3549
+ var platformDpsApplicationAutoReviewApi = {
3550
+ getAutoReview(appId, authorization) {
3618
3551
  return __async(this, null, function* () {
3619
3552
  try {
3620
- yield platformDpsClientInstance.patch(
3621
- `/v2/applications/${appId}/chat-actions/${payload.id}`,
3622
- payload,
3553
+ const response = yield platformDpsClientInstance.get(
3554
+ `/v2/applications/${appId}/auto-review`,
3623
3555
  getPlatformDpsClientConfig(authorization)
3624
3556
  );
3557
+ if (response.status === 204) {
3558
+ return getEmptyAppAutoReview();
3559
+ }
3560
+ return response.data;
3625
3561
  } catch (error) {
3626
3562
  if (error instanceof Error) {
3627
- throw new Error(
3628
- `${API_NOTIFICATIONS.BUILDING_BLOCKS.FAILURE.UPDATED} [${error.message}]`
3629
- );
3563
+ throw new Error(`The review couldn\u2019t be completed. [${error.message}]`);
3630
3564
  }
3631
3565
  throw error;
3632
3566
  }
3633
3567
  });
3634
3568
  },
3635
- deleteChatAction(appId, chatActionId, authorization) {
3569
+ submitAutoReview(appId, payload, authorization) {
3636
3570
  return __async(this, null, function* () {
3637
- try {
3638
- yield platformDpsClientInstance.delete(
3639
- `/v2/applications/${appId}/chat-actions/${chatActionId}`,
3640
- __spreadValues({}, getPlatformDpsClientConfig(authorization))
3571
+ yield platformDpsClientInstance.post(
3572
+ `/v2/applications/${appId}/auto-review`,
3573
+ payload,
3574
+ getPlatformDpsClientConfig(authorization)
3575
+ ).catch((error) => {
3576
+ throw error.withCustomMessage(
3577
+ `The review couldn\u2019t be requested. [${error.message}]`
3641
3578
  );
3642
- } catch (error) {
3643
- if (error instanceof Error) {
3644
- throw new Error(
3645
- `${API_NOTIFICATIONS.BUILDING_BLOCKS.FAILURE.DELETED} [${error.message}]`
3646
- );
3647
- }
3648
- throw error;
3649
- }
3579
+ });
3580
+ });
3581
+ }
3582
+ };
3583
+
3584
+ // src/apis/platform/dps/applications/application/chatActions/api.ts
3585
+ var platformDpsApplicationChatActionsApi = {
3586
+ createChatAction(appId, payload, authorization) {
3587
+ return __async(this, null, function* () {
3588
+ yield platformDpsClientInstance.put(
3589
+ `/v2/applications/${appId}/chat-actions/${payload.id}`,
3590
+ payload,
3591
+ getPlatformDpsClientConfig(authorization)
3592
+ ).catch((error) => {
3593
+ throw error.withCustomMessage(
3594
+ `${API_NOTIFICATIONS.BUILDING_BLOCKS.FAILURE.CREATED} [${error.message}]`
3595
+ );
3596
+ });
3597
+ });
3598
+ },
3599
+ updateChatAction(appId, payload, authorization) {
3600
+ return __async(this, null, function* () {
3601
+ yield platformDpsClientInstance.patch(
3602
+ `/v2/applications/${appId}/chat-actions/${payload.id}`,
3603
+ payload,
3604
+ getPlatformDpsClientConfig(authorization)
3605
+ ).catch((error) => {
3606
+ throw error.withCustomMessage(
3607
+ `${API_NOTIFICATIONS.BUILDING_BLOCKS.FAILURE.UPDATED} [${error.message}]`
3608
+ );
3609
+ });
3610
+ });
3611
+ },
3612
+ deleteChatAction(appId, chatActionId, authorization) {
3613
+ return __async(this, null, function* () {
3614
+ yield platformDpsClientInstance.delete(
3615
+ `/v2/applications/${appId}/chat-actions/${chatActionId}`,
3616
+ __spreadValues({}, getPlatformDpsClientConfig(authorization))
3617
+ ).catch((error) => {
3618
+ throw error.withCustomMessage(
3619
+ `${API_NOTIFICATIONS.BUILDING_BLOCKS.FAILURE.DELETED} [${error.message}]`
3620
+ );
3621
+ });
3650
3622
  });
3651
3623
  }
3652
3624
  };
@@ -3654,48 +3626,39 @@ var platformDpsApplicationChatActionsApi = {
3654
3626
  // src/apis/platform/dps/applications/application/chatBoosters/api.ts
3655
3627
  var platformDpsApplicationChatBoostersApi = {
3656
3628
  createChatBooster(appId, chatBoosterId, payload, authorization) {
3657
- try {
3658
- return platformDpsClientInstance.put(
3659
- `/v2/applications/${appId}/chat-boosters/${chatBoosterId}`,
3660
- payload,
3661
- getPlatformDpsClientConfig(authorization)
3629
+ return platformDpsClientInstance.put(
3630
+ `/v2/applications/${appId}/chat-boosters/${chatBoosterId}`,
3631
+ payload,
3632
+ getPlatformDpsClientConfig(authorization)
3633
+ ).catch((error) => {
3634
+ throw error.withCustomMessage(
3635
+ `${API_NOTIFICATIONS.BUILDING_BLOCKS.FAILURE.CREATED} [${error.message}]`
3662
3636
  );
3663
- } catch (error) {
3664
- if (error instanceof Error) {
3665
- throw new Error(`Chat Booster couldn't be created. [${error.message}]`);
3666
- }
3667
- throw error;
3668
- }
3637
+ });
3669
3638
  },
3670
3639
  updateChatBooster(appId, chatBoosterId, payload, authorization) {
3671
3640
  return __async(this, null, function* () {
3672
- try {
3673
- return yield platformDpsClientInstance.put(
3674
- `/v2/applications/${appId}/chat-boosters/${chatBoosterId}`,
3675
- payload,
3676
- getPlatformDpsClientConfig(authorization)
3641
+ return platformDpsClientInstance.put(
3642
+ `/v2/applications/${appId}/chat-boosters/${chatBoosterId}`,
3643
+ payload,
3644
+ getPlatformDpsClientConfig(authorization)
3645
+ ).catch((error) => {
3646
+ throw error.withCustomMessage(
3647
+ `${API_NOTIFICATIONS.BUILDING_BLOCKS.FAILURE.UPDATED} [${error.message}]`
3677
3648
  );
3678
- } catch (error) {
3679
- if (error instanceof Error) {
3680
- throw new Error(`Chat Booster couldn't be updated. [${error.message}]`);
3681
- }
3682
- throw error;
3683
- }
3649
+ });
3684
3650
  });
3685
3651
  },
3686
3652
  deleteChatBooster(appId, chatBoosterId, authorization) {
3687
3653
  return __async(this, null, function* () {
3688
- try {
3689
- return yield platformDpsClientInstance.delete(
3690
- `/v2/applications/${appId}/chat-boosters/${chatBoosterId}`,
3691
- getPlatformDpsClientConfig(authorization)
3654
+ return platformDpsClientInstance.delete(
3655
+ `/v2/applications/${appId}/chat-boosters/${chatBoosterId}`,
3656
+ getPlatformDpsClientConfig(authorization)
3657
+ ).catch((error) => {
3658
+ throw error.withCustomMessage(
3659
+ `${API_NOTIFICATIONS.BUILDING_BLOCKS.FAILURE.DELETED} [${error.message}]`
3692
3660
  );
3693
- } catch (error) {
3694
- if (error instanceof Error) {
3695
- throw new Error(`Chat Booster couldn't be deleted. [${error.message}]`);
3696
- }
3697
- throw error;
3698
- }
3661
+ });
3699
3662
  });
3700
3663
  }
3701
3664
  };
@@ -3704,165 +3667,119 @@ var platformDpsApplicationChatBoostersApi = {
3704
3667
  var platformDpsApplicationDisplayApi = {
3705
3668
  updateVersionHistory(appId, payload, authorization) {
3706
3669
  return __async(this, null, function* () {
3707
- try {
3708
- const response = yield platformDpsClientInstance.put(
3709
- `/v2/applications/${appId}/display/changelog`,
3710
- payload,
3711
- getPlatformDpsClientConfig(authorization)
3670
+ yield platformDpsClientInstance.put(
3671
+ `/v2/applications/${appId}/display/changelog`,
3672
+ payload,
3673
+ getPlatformDpsClientConfig(authorization)
3674
+ ).catch((error) => {
3675
+ throw error.withCustomMessage(
3676
+ `Listing details couldn't be updated. [${error.message}]`
3712
3677
  );
3713
- return response.data;
3714
- } catch (error) {
3715
- if (error instanceof Error) {
3716
- throw new Error(
3717
- `Listing details couldn't be updated. [${error.message}]`
3718
- );
3719
- }
3720
- throw error;
3721
- }
3678
+ });
3722
3679
  });
3723
3680
  },
3724
3681
  updateBasicDetails(appId, basicDetails, authorization) {
3725
3682
  return __async(this, null, function* () {
3726
- try {
3727
- yield platformDpsClientInstance.put(
3728
- `/v2/applications/${appId}/display`,
3729
- basicDetails,
3730
- getPlatformDpsClientConfig(authorization)
3683
+ yield platformDpsClientInstance.put(
3684
+ `/v2/applications/${appId}/display`,
3685
+ basicDetails,
3686
+ getPlatformDpsClientConfig(authorization)
3687
+ ).catch((error) => {
3688
+ throw error.withCustomMessage(
3689
+ `Listing details couldn't be updated. [${error.message}]`
3731
3690
  );
3732
- } catch (error) {
3733
- if (error instanceof Error) {
3734
- throw new Error(
3735
- `Listing details couldn't be updated. [${error.message}]`
3736
- );
3737
- }
3738
- throw error;
3739
- }
3691
+ });
3740
3692
  });
3741
3693
  },
3742
3694
  patchBasicDetails(appId, basicDetails, authorization) {
3743
3695
  return __async(this, null, function* () {
3744
- try {
3745
- yield platformDpsClientInstance.patch(
3746
- `/v2/applications/${appId}/display`,
3747
- basicDetails,
3748
- getPlatformDpsClientConfig(authorization)
3696
+ yield platformDpsClientInstance.patch(
3697
+ `/v2/applications/${appId}/display`,
3698
+ basicDetails,
3699
+ getPlatformDpsClientConfig(authorization)
3700
+ ).catch((error) => {
3701
+ throw error.withCustomMessage(
3702
+ `Listing details couldn't be updated. [${error.message}]`
3749
3703
  );
3750
- } catch (error) {
3751
- if (error instanceof Error) {
3752
- throw new Error(
3753
- `Listing details couldn't be updated. [${error.message}]`
3754
- );
3755
- }
3756
- throw error;
3757
- }
3704
+ });
3758
3705
  });
3759
3706
  },
3760
3707
  updateOverview(appId, data, authorization) {
3761
3708
  return __async(this, null, function* () {
3762
- try {
3763
- yield platformDpsClientInstance.put(
3764
- `/v2/applications/${appId}/listing/overview`,
3765
- data,
3766
- getPlatformDpsClientConfig(authorization)
3709
+ yield platformDpsClientInstance.put(
3710
+ `/v2/applications/${appId}/listing/overview`,
3711
+ data,
3712
+ getPlatformDpsClientConfig(authorization)
3713
+ ).catch((error) => {
3714
+ throw error.withCustomMessage(
3715
+ `Listing details couldn't be updated. [${error.message}]`
3767
3716
  );
3768
- } catch (error) {
3769
- if (error instanceof Error) {
3770
- throw new Error(
3771
- `Listing details couldn't be updated. [${error.message}]`
3772
- );
3773
- }
3774
- throw error;
3775
- }
3717
+ });
3776
3718
  });
3777
3719
  },
3778
3720
  updateTutorialAndSupport(appId, data, authorization) {
3779
3721
  return __async(this, null, function* () {
3780
- try {
3781
- yield platformDpsClientInstance.put(
3782
- `/v2/applications/${appId}/listing/support`,
3783
- data,
3784
- getPlatformDpsClientConfig(authorization)
3722
+ yield platformDpsClientInstance.put(
3723
+ `/v2/applications/${appId}/listing/support`,
3724
+ data,
3725
+ getPlatformDpsClientConfig(authorization)
3726
+ ).catch((error) => {
3727
+ throw error.withCustomMessage(
3728
+ `Listing details couldn't be updated. [${error.message}]`
3785
3729
  );
3786
- } catch (error) {
3787
- if (error instanceof Error) {
3788
- throw new Error(
3789
- `Listing details couldn't be updated. [${error.message}]`
3790
- );
3791
- }
3792
- throw error;
3793
- }
3730
+ });
3794
3731
  });
3795
3732
  },
3796
3733
  updateAppIcon(appId, payload, authorization) {
3797
3734
  return __async(this, null, function* () {
3798
- try {
3799
- yield platformDpsClientInstance.put(
3800
- `/v2/applications/${appId}/display/icons`,
3801
- payload,
3802
- getPlatformDpsClientConfig(authorization)
3735
+ yield platformDpsClientInstance.put(
3736
+ `/v2/applications/${appId}/display/icons`,
3737
+ payload,
3738
+ getPlatformDpsClientConfig(authorization)
3739
+ ).catch((error) => {
3740
+ throw error.withCustomMessage(
3741
+ `Listing details couldn't be updated. [${error.message}]`
3803
3742
  );
3804
- } catch (error) {
3805
- if (error instanceof Error) {
3806
- throw new Error(
3807
- `Listing details couldn't be updated. [${error.message}]`
3808
- );
3809
- }
3810
- throw error;
3811
- }
3743
+ });
3812
3744
  });
3813
3745
  },
3814
3746
  updateDisplayImages(appId, screenshots, authorization) {
3815
3747
  return __async(this, null, function* () {
3816
- try {
3817
- yield platformDpsClientInstance.put(
3818
- `/v2/applications/${appId}/screenshots/commit`,
3819
- screenshots,
3820
- getPlatformDpsClientConfig(authorization)
3748
+ yield platformDpsClientInstance.put(
3749
+ `/v2/applications/${appId}/screenshots/commit`,
3750
+ screenshots,
3751
+ getPlatformDpsClientConfig(authorization)
3752
+ ).catch((error) => {
3753
+ throw error.withCustomMessage(
3754
+ `Listing details couldn't be updated. [${error.message}]`
3821
3755
  );
3822
- } catch (error) {
3823
- if (error instanceof Error) {
3824
- throw new Error(
3825
- `Listing details couldn't be updated. [${error.message}]`
3826
- );
3827
- }
3828
- throw error;
3829
- }
3756
+ });
3830
3757
  });
3831
3758
  },
3832
3759
  updateDisplayFeatures(appId, features, authorization) {
3833
3760
  return __async(this, null, function* () {
3834
- try {
3835
- yield platformDpsClientInstance.put(
3836
- `/v2/applications/${appId}/features`,
3837
- features,
3838
- getPlatformDpsClientConfig(authorization)
3761
+ yield platformDpsClientInstance.put(
3762
+ `/v2/applications/${appId}/features`,
3763
+ features,
3764
+ getPlatformDpsClientConfig(authorization)
3765
+ ).catch((error) => {
3766
+ throw error.withCustomMessage(
3767
+ `Listing details couldn't be updated. [${error.message}]`
3839
3768
  );
3840
- } catch (error) {
3841
- if (error instanceof Error) {
3842
- throw new Error(
3843
- `Listing details couldn't be updated. [${error.message}]`
3844
- );
3845
- }
3846
- throw error;
3847
- }
3769
+ });
3848
3770
  });
3849
3771
  },
3850
3772
  updateDisplayBenefits(appId, benefits, authorization) {
3851
3773
  return __async(this, null, function* () {
3852
- try {
3853
- yield platformDpsClientInstance.put(
3854
- `/v2/applications/${appId}/benefits`,
3855
- benefits,
3856
- getPlatformDpsClientConfig(authorization)
3774
+ yield platformDpsClientInstance.put(
3775
+ `/v2/applications/${appId}/benefits`,
3776
+ benefits,
3777
+ getPlatformDpsClientConfig(authorization)
3778
+ ).catch((error) => {
3779
+ throw error.withCustomMessage(
3780
+ `Listing details couldn't be updated. [${error.message}]`
3857
3781
  );
3858
- } catch (error) {
3859
- if (error instanceof Error) {
3860
- throw new Error(
3861
- `Listing details couldn't be updated. [${error.message}]`
3862
- );
3863
- }
3864
- throw error;
3865
- }
3782
+ });
3866
3783
  });
3867
3784
  }
3868
3785
  };
@@ -3871,18 +3788,14 @@ var platformDpsApplicationDisplayApi = {
3871
3788
  var platformDpsApplicationEventApi = {
3872
3789
  getEvents(appId, authorization) {
3873
3790
  return __async(this, null, function* () {
3874
- try {
3875
- const response = yield platformDpsClientInstance.get(
3876
- `/v2/applications/${appId}/events?limit=300`,
3877
- getPlatformDpsClientConfig(authorization)
3791
+ return platformDpsClientInstance.get(
3792
+ `/v2/applications/${appId}/events?limit=300`,
3793
+ getPlatformDpsClientConfig(authorization)
3794
+ ).then(({ data }) => data).catch((error) => {
3795
+ throw error.withCustomMessage(
3796
+ `App Events couldn't be fetched. [${error.message}]`
3878
3797
  );
3879
- return response.data;
3880
- } catch (error) {
3881
- if (error instanceof Error) {
3882
- throw new Error(`App Events couldn't be fetched. [${error.message}]`);
3883
- }
3884
- throw error;
3885
- }
3798
+ });
3886
3799
  });
3887
3800
  }
3888
3801
  };
@@ -3938,7 +3851,6 @@ var platformDpsApplicationInfrastructureBlocksApi = {
3938
3851
  {
3939
3852
  appId,
3940
3853
  deployment: {
3941
- mode: payload.mode,
3942
3854
  provider: payload.provider,
3943
3855
  config
3944
3856
  }
@@ -3972,51 +3884,40 @@ var platformDpsApplicationInfrastructureApi = {
3972
3884
  var platformDpsApplicationInstallApi = {
3973
3885
  install(appId, authorization) {
3974
3886
  return __async(this, null, function* () {
3975
- try {
3976
- yield platformDpsClientInstance.put(
3977
- `/v2/applications/${appId}/install`,
3978
- {},
3979
- getPlatformDpsClientConfig(authorization)
3887
+ yield platformDpsClientInstance.put(
3888
+ `/v2/applications/${appId}/install`,
3889
+ {},
3890
+ getPlatformDpsClientConfig(authorization)
3891
+ ).catch((error) => {
3892
+ throw error.withCustomMessage(
3893
+ `App couldn't be installed. [${error.message}]`
3980
3894
  );
3981
- } catch (error) {
3982
- if (error instanceof Error) {
3983
- throw new Error(`App couldn't be installed. [${error.message}]`);
3984
- }
3985
- throw error;
3986
- }
3895
+ });
3987
3896
  });
3988
3897
  },
3989
3898
  uninstall(appId, authorization) {
3990
3899
  return __async(this, null, function* () {
3991
- try {
3992
- yield platformDpsClientInstance.delete(
3993
- `/v2/applications/${appId}/install`,
3994
- getPlatformDpsClientConfig(authorization)
3900
+ yield platformDpsClientInstance.delete(
3901
+ `/v2/applications/${appId}/install`,
3902
+ getPlatformDpsClientConfig(authorization)
3903
+ ).catch((error) => {
3904
+ throw error.withCustomMessage(
3905
+ `App couldn't be uninstalled. [${error.message}]`
3995
3906
  );
3996
- } catch (error) {
3997
- if (error instanceof Error) {
3998
- throw new Error(`App couldn't be uninstalled. [${error.message}]`);
3999
- }
4000
- throw error;
4001
- }
3907
+ });
4002
3908
  });
4003
3909
  },
4004
3910
  updateDirectInstallationUrl(appId, payload, authorization) {
4005
3911
  return __async(this, null, function* () {
4006
- try {
4007
- yield platformDpsClientInstance.put(
4008
- `/v2/applications/${appId}/install/direct`,
4009
- payload,
4010
- getPlatformDpsClientConfig(authorization)
3912
+ yield platformDpsClientInstance.put(
3913
+ `/v2/applications/${appId}/install/direct`,
3914
+ payload,
3915
+ getPlatformDpsClientConfig(authorization)
3916
+ ).catch((error) => {
3917
+ throw error.withCustomMessage(
3918
+ `Direct installation URL couldn't be updated. [${error.message}]`
4011
3919
  );
4012
- } catch (error) {
4013
- if (error instanceof Error) {
4014
- throw new Error(
4015
- `Direct installation URL couldn't be updated. [${error.message}]`
4016
- );
4017
- }
4018
- throw error;
4019
- }
3920
+ });
4020
3921
  });
4021
3922
  }
4022
3923
  };
@@ -4025,37 +3926,24 @@ var platformDpsApplicationInstallApi = {
4025
3926
  var platformDpsApplicationOnboardingApi = {
4026
3927
  updateOnboarding(appId, payload, authorization) {
4027
3928
  return __async(this, null, function* () {
4028
- try {
4029
- yield platformDpsClientInstance.put(
4030
- `/v2/applications/${appId}/onboarding`,
4031
- payload,
4032
- getPlatformDpsClientConfig(authorization)
3929
+ yield platformDpsClientInstance.put(
3930
+ `/v2/applications/${appId}/onboarding`,
3931
+ payload,
3932
+ getPlatformDpsClientConfig(authorization)
3933
+ ).catch((error) => {
3934
+ throw error.withCustomMessage(
3935
+ `${API_NOTIFICATIONS.BUILDING_BLOCKS.FAILURE.UPDATED} [${error.message}]`
4033
3936
  );
4034
- } catch (error) {
4035
- if (error instanceof Error) {
4036
- throw new Error(
4037
- `${API_NOTIFICATIONS.BUILDING_BLOCKS.FAILURE.UPDATED} [${error.message}]`
4038
- );
4039
- }
4040
- throw error;
4041
- }
3937
+ });
4042
3938
  });
4043
3939
  },
4044
3940
  deleteOnboarding(appId, authorization) {
4045
3941
  return __async(this, null, function* () {
4046
- try {
4047
- yield platformDpsClientInstance.delete(
4048
- `/v2/applications/${appId}/onboarding`,
4049
- __spreadValues({}, getPlatformDpsClientConfig(authorization))
3942
+ yield platformDpsClientInstance.delete(`/v2/applications/${appId}/onboarding`, __spreadValues({}, getPlatformDpsClientConfig(authorization))).catch((error) => {
3943
+ throw error.withCustomMessage(
3944
+ `${API_NOTIFICATIONS.BUILDING_BLOCKS.FAILURE.DELETED} [${error.message}]`
4050
3945
  );
4051
- } catch (error) {
4052
- if (error instanceof Error) {
4053
- throw new Error(
4054
- `${API_NOTIFICATIONS.BUILDING_BLOCKS.FAILURE.DELETED} [${error.message}]`
4055
- );
4056
- }
4057
- throw error;
4058
- }
3946
+ });
4059
3947
  });
4060
3948
  }
4061
3949
  };
@@ -4064,37 +3952,27 @@ var platformDpsApplicationOnboardingApi = {
4064
3952
  var platformDpsApplicationPaymentApi = {
4065
3953
  updatePaymentBlock(appId, payment, authorization) {
4066
3954
  return __async(this, null, function* () {
4067
- try {
4068
- yield platformDpsClientInstance.put(
4069
- `/v2/applications/${appId}/payment`,
4070
- payment,
4071
- getPlatformDpsClientConfig(authorization)
3955
+ yield platformDpsClientInstance.put(
3956
+ `/v2/applications/${appId}/payment`,
3957
+ payment,
3958
+ getPlatformDpsClientConfig(authorization)
3959
+ ).catch((error) => {
3960
+ throw error.withCustomMessage(
3961
+ `${API_NOTIFICATIONS.BUILDING_BLOCKS.FAILURE.UPDATED} [${error.message}]`
4072
3962
  );
4073
- } catch (error) {
4074
- if (error instanceof Error) {
4075
- throw new Error(
4076
- `${API_NOTIFICATIONS.BUILDING_BLOCKS.FAILURE.UPDATED} [${error.message}]`
4077
- );
4078
- }
4079
- throw error;
4080
- }
3963
+ });
4081
3964
  });
4082
3965
  },
4083
3966
  deletePaymentBlock(appId, authorization) {
4084
3967
  return __async(this, null, function* () {
4085
- try {
4086
- yield platformDpsClientInstance.delete(
4087
- `/v2/applications/${appId}/payment`,
4088
- getPlatformDpsClientConfig(authorization)
3968
+ yield platformDpsClientInstance.delete(
3969
+ `/v2/applications/${appId}/payment`,
3970
+ getPlatformDpsClientConfig(authorization)
3971
+ ).catch((error) => {
3972
+ throw error.withCustomMessage(
3973
+ `${API_NOTIFICATIONS.BUILDING_BLOCKS.FAILURE.DELETED} [${error.message}]`
4089
3974
  );
4090
- } catch (error) {
4091
- if (error instanceof Error) {
4092
- throw new Error(
4093
- `${API_NOTIFICATIONS.BUILDING_BLOCKS.FAILURE.DELETED} [${error.message}]`
4094
- );
4095
- }
4096
- throw error;
4097
- }
3975
+ });
4098
3976
  });
4099
3977
  }
4100
3978
  };
@@ -4103,20 +3981,15 @@ var platformDpsApplicationPaymentApi = {
4103
3981
  var platformDpsApplicationProductApi = {
4104
3982
  updateProduct(appId, payload, authorization) {
4105
3983
  return __async(this, null, function* () {
4106
- try {
4107
- yield platformDpsClientInstance.put(
4108
- `/v2/applications/${appId}/product`,
4109
- payload,
4110
- getPlatformDpsClientConfig(authorization)
3984
+ yield platformDpsClientInstance.put(
3985
+ `/v2/applications/${appId}/product`,
3986
+ payload,
3987
+ getPlatformDpsClientConfig(authorization)
3988
+ ).catch((error) => {
3989
+ throw error.withCustomMessage(
3990
+ `${API_NOTIFICATIONS.BUILDING_BLOCKS.FAILURE.UPDATED} [${error.message}]`
4111
3991
  );
4112
- } catch (error) {
4113
- if (error instanceof Error) {
4114
- throw new Error(
4115
- `${API_NOTIFICATIONS.BUILDING_BLOCKS.FAILURE.UPDATED} [${error.message}]`
4116
- );
4117
- }
4118
- throw error;
4119
- }
3992
+ });
4120
3993
  });
4121
3994
  }
4122
3995
  };
@@ -4125,58 +3998,39 @@ var platformDpsApplicationProductApi = {
4125
3998
  var platformDpsApplicationCustomPropsApi = {
4126
3999
  createCustomProps(appId, property, authorization) {
4127
4000
  return __async(this, null, function* () {
4128
- try {
4129
- const response = yield platformDpsClientInstance.post(
4130
- `/v2/applications/${appId}/property`,
4131
- property,
4132
- getPlatformDpsClientConfig(authorization)
4001
+ return platformDpsClientInstance.post(
4002
+ `/v2/applications/${appId}/property`,
4003
+ property,
4004
+ getPlatformDpsClientConfig(authorization)
4005
+ ).then(({ data }) => data).catch((error) => {
4006
+ throw error.withCustomMessage(
4007
+ `${API_NOTIFICATIONS.BUILDING_BLOCKS.FAILURE.CREATED} [${error.message}]`
4133
4008
  );
4134
- return response.data;
4135
- } catch (error) {
4136
- if (error instanceof Error) {
4137
- throw new Error(
4138
- `Listing details couldn't be created. [${error.message}]`
4139
- );
4140
- }
4141
- throw error;
4142
- }
4009
+ });
4143
4010
  });
4144
4011
  },
4145
4012
  updateCustomProps(appId, property, authorization) {
4146
4013
  return __async(this, null, function* () {
4147
- try {
4148
- const response = yield platformDpsClientInstance.put(
4149
- `/v2/applications/${appId}/property`,
4150
- property,
4151
- getPlatformDpsClientConfig(authorization)
4014
+ return platformDpsClientInstance.put(
4015
+ `/v2/applications/${appId}/property`,
4016
+ property,
4017
+ getPlatformDpsClientConfig(authorization)
4018
+ ).then(({ data }) => data).catch((error) => {
4019
+ throw error.withCustomMessage(
4020
+ `${API_NOTIFICATIONS.BUILDING_BLOCKS.FAILURE.UPDATED} [${error.message}]`
4152
4021
  );
4153
- return response.data;
4154
- } catch (error) {
4155
- if (error instanceof Error) {
4156
- throw new Error(
4157
- `Listing details couldn't be updated. [${error.message}]`
4158
- );
4159
- }
4160
- throw error;
4161
- }
4022
+ });
4162
4023
  });
4163
4024
  },
4164
4025
  deleteCustomProps(appId, property, authorization) {
4165
4026
  return __async(this, null, function* () {
4166
- try {
4167
- const response = yield platformDpsClientInstance.delete(
4168
- `/v2/applications/${appId}/property`,
4169
- __spreadValues({ data: property }, getPlatformDpsClientConfig(authorization))
4027
+ return platformDpsClientInstance.delete(`/v2/applications/${appId}/property`, __spreadValues({
4028
+ data: property
4029
+ }, getPlatformDpsClientConfig(authorization))).then(({ data }) => data).catch((error) => {
4030
+ throw error.withCustomMessage(
4031
+ `${API_NOTIFICATIONS.BUILDING_BLOCKS.FAILURE.DELETED} [${error.message}]`
4170
4032
  );
4171
- return response.data;
4172
- } catch (error) {
4173
- if (error instanceof Error) {
4174
- throw new Error(
4175
- `Listing details couldn't be deleted. [${error.message}]`
4176
- );
4177
- }
4178
- throw error;
4179
- }
4033
+ });
4180
4034
  });
4181
4035
  }
4182
4036
  };
@@ -4185,84 +4039,65 @@ var platformDpsApplicationCustomPropsApi = {
4185
4039
  var platformDpsApplicationResourcesApi = {
4186
4040
  getAppUpgrades(appId, authorization) {
4187
4041
  return __async(this, null, function* () {
4188
- try {
4189
- return yield platformDpsClientInstance.get(
4190
- `/v2/applications/${appId}/resources`,
4191
- getPlatformDpsClientConfig(authorization)
4042
+ return platformDpsClientInstance.get(
4043
+ `/v2/applications/${appId}/resources`,
4044
+ getPlatformDpsClientConfig(authorization)
4045
+ ).catch((error) => {
4046
+ throw error.withCustomMessage(
4047
+ `App Resources couldn't be loaded. [${error.message}]`
4192
4048
  );
4193
- } catch (error) {
4194
- if (error instanceof Error) {
4195
- throw new Error(`App Resources couldn't be loaded. [${error.message}]`);
4196
- }
4197
- throw error;
4198
- }
4049
+ });
4199
4050
  });
4200
4051
  },
4201
4052
  createAppUpgrade(appId, body, authorization) {
4202
4053
  return __async(this, null, function* () {
4203
- try {
4204
- return yield platformDpsClientInstance.put(
4205
- `/v2/applications/${appId}/resources`,
4206
- body,
4207
- getPlatformDpsClientConfig(authorization)
4054
+ return platformDpsClientInstance.put(
4055
+ `/v2/applications/${appId}/resources`,
4056
+ body,
4057
+ getPlatformDpsClientConfig(authorization)
4058
+ ).catch((error) => {
4059
+ throw error.withCustomMessage(
4060
+ `App Resources couldn't be created. [${error.message}]`
4208
4061
  );
4209
- } catch (error) {
4210
- if (error instanceof Error) {
4211
- throw new Error(
4212
- `App Resources couldn't be created. [${error.message}]`
4213
- );
4214
- }
4215
- throw error;
4216
- }
4062
+ });
4217
4063
  });
4218
4064
  },
4219
4065
  updateAppUpgrade(appId, body, authorization) {
4220
4066
  return __async(this, null, function* () {
4221
- try {
4222
- return yield platformDpsClientInstance.put(
4223
- `/v2/applications/${appId}/resources`,
4224
- body,
4225
- getPlatformDpsClientConfig(authorization)
4067
+ return platformDpsClientInstance.put(
4068
+ `/v2/applications/${appId}/resources`,
4069
+ body,
4070
+ getPlatformDpsClientConfig(authorization)
4071
+ ).catch((error) => {
4072
+ throw error.withCustomMessage(
4073
+ `App Resources couldn't be updated. [${error.message}]`
4226
4074
  );
4227
- } catch (error) {
4228
- if (error instanceof Error) {
4229
- throw new Error(
4230
- `App Resources couldn't be updated. [${error.message}]`
4231
- );
4232
- }
4233
- throw error;
4234
- }
4075
+ });
4235
4076
  });
4236
4077
  },
4237
4078
  deleteAppUpgrade(appId, resourceId, authorization) {
4238
4079
  return __async(this, null, function* () {
4239
- try {
4240
- return yield platformDpsClientInstance.delete(
4241
- `/v2/applications/${appId}/resources/${resourceId}`,
4242
- getPlatformDpsClientConfig(authorization)
4080
+ return platformDpsClientInstance.delete(
4081
+ `/v2/applications/${appId}/resources/${resourceId}`,
4082
+ getPlatformDpsClientConfig(authorization)
4083
+ ).catch((error) => {
4084
+ throw error.withCustomMessage(
4085
+ `App Resource couldn't be delete. [${error.message}]`
4243
4086
  );
4244
- } catch (error) {
4245
- if (error instanceof Error) {
4246
- throw new Error(`App Resource couldn't be delete. [${error.message}]`);
4247
- }
4248
- throw error;
4249
- }
4087
+ });
4250
4088
  });
4251
4089
  },
4252
4090
  copyUpgrade(sourceAppId, destinationAppId, authorization) {
4253
4091
  return __async(this, null, function* () {
4254
- try {
4255
- return yield platformDpsClientInstance.put(
4256
- `/v2/applications/${sourceAppId}/resources/copy?application=${destinationAppId}`,
4257
- {},
4258
- getPlatformDpsClientConfig(authorization)
4092
+ return platformDpsClientInstance.put(
4093
+ `/v2/applications/${sourceAppId}/resources/copy?application=${destinationAppId}`,
4094
+ {},
4095
+ getPlatformDpsClientConfig(authorization)
4096
+ ).catch((error) => {
4097
+ throw error.withCustomMessage(
4098
+ `App Resources couldn't be copied. [${error.message}]`
4259
4099
  );
4260
- } catch (error) {
4261
- if (error instanceof Error) {
4262
- throw new Error(`App Resources couldn't be copied. [${error.message}]`);
4263
- }
4264
- throw error;
4265
- }
4100
+ });
4266
4101
  });
4267
4102
  }
4268
4103
  };
@@ -4271,37 +4106,27 @@ var platformDpsApplicationResourcesApi = {
4271
4106
  var platformDpsApplicationReviewApi = {
4272
4107
  createSubmission(appId, payload, authorization) {
4273
4108
  return __async(this, null, function* () {
4274
- try {
4275
- const response = yield platformDpsClientInstance.put(
4276
- `/v2/applications/${appId}/review/submit`,
4277
- payload,
4278
- getPlatformDpsClientConfig(authorization)
4109
+ return platformDpsClientInstance.put(
4110
+ `/v2/applications/${appId}/review/submit`,
4111
+ payload,
4112
+ getPlatformDpsClientConfig(authorization)
4113
+ ).then(({ data }) => data).catch((error) => {
4114
+ throw error.withCustomMessage(
4115
+ `App couldn't be submitted for review. [${error.message}]`
4279
4116
  );
4280
- return response.data;
4281
- } catch (error) {
4282
- if (error instanceof Error) {
4283
- throw new Error(
4284
- `App couldn't be submitted for review. [${error.message}]`
4285
- );
4286
- }
4287
- throw error;
4288
- }
4117
+ });
4289
4118
  });
4290
4119
  },
4291
4120
  cancelSubmission(appId, authorization) {
4292
4121
  return __async(this, null, function* () {
4293
- try {
4294
- const response = yield platformDpsClientInstance.put(
4295
- `/v2/applications/${appId}/review/cancel`,
4296
- getPlatformDpsClientConfig(authorization)
4122
+ return platformDpsClientInstance.put(
4123
+ `/v2/applications/${appId}/review/cancel`,
4124
+ getPlatformDpsClientConfig(authorization)
4125
+ ).then(({ data }) => data).catch((error) => {
4126
+ throw error.withCustomMessage(
4127
+ `App review couldn't be cancelled. [${error.message}]`
4297
4128
  );
4298
- return response.data;
4299
- } catch (error) {
4300
- if (error instanceof Error) {
4301
- throw new Error(`App review couldn't be cancelled. [${error.message}]`);
4302
- }
4303
- throw error;
4304
- }
4129
+ });
4305
4130
  });
4306
4131
  }
4307
4132
  };
@@ -4310,18 +4135,14 @@ var platformDpsApplicationReviewApi = {
4310
4135
  var platformDpsApplicationStatsApi = {
4311
4136
  getStats(appId, authorization) {
4312
4137
  return __async(this, null, function* () {
4313
- try {
4314
- const response = yield platformDpsClientInstance.get(
4315
- `/v2/applications/${appId}/stats`,
4316
- getPlatformDpsClientConfig(authorization)
4138
+ return platformDpsClientInstance.get(
4139
+ `/v2/applications/${appId}/stats`,
4140
+ getPlatformDpsClientConfig(authorization)
4141
+ ).catch((error) => {
4142
+ throw error.withCustomMessage(
4143
+ `App Stats couldn't be fetched. [${error.message}]`
4317
4144
  );
4318
- return response.data;
4319
- } catch (error) {
4320
- if (error instanceof Error) {
4321
- throw new Error(`App Stats couldn't be fetched. [${error.message}]`);
4322
- }
4323
- throw error;
4324
- }
4145
+ });
4325
4146
  });
4326
4147
  }
4327
4148
  };
@@ -4330,87 +4151,61 @@ var platformDpsApplicationStatsApi = {
4330
4151
  var platformDpsApplicationWebhooksApi = {
4331
4152
  updateAppWebhooks(appId, payload, authorization) {
4332
4153
  return __async(this, null, function* () {
4333
- try {
4334
- yield platformDpsClientInstance.put(
4335
- `/v2/applications/${appId}/webhook`,
4336
- payload,
4337
- getPlatformDpsClientConfig(authorization)
4154
+ yield platformDpsClientInstance.put(
4155
+ `/v2/applications/${appId}/webhook`,
4156
+ payload,
4157
+ getPlatformDpsClientConfig(authorization)
4158
+ ).catch((error) => {
4159
+ throw error.withCustomMessage(
4160
+ `${API_NOTIFICATIONS.BUILDING_BLOCKS.FAILURE.UPDATED} [${error.message}]`
4338
4161
  );
4339
- } catch (error) {
4340
- if (error instanceof Error) {
4341
- throw new Error(
4342
- `${API_NOTIFICATIONS.BUILDING_BLOCKS.FAILURE.UPDATED} [${error.message}]`
4343
- );
4344
- }
4345
- throw error;
4346
- }
4162
+ });
4347
4163
  });
4348
4164
  },
4349
4165
  deleteAppWebhooks(appId, authorization) {
4350
4166
  return __async(this, null, function* () {
4351
- try {
4352
- yield platformDpsClientInstance.delete(
4353
- `/v2/applications/${appId}/webhook`,
4354
- getPlatformDpsClientConfig(authorization)
4167
+ yield platformDpsClientInstance.delete(
4168
+ `/v2/applications/${appId}/webhook`,
4169
+ getPlatformDpsClientConfig(authorization)
4170
+ ).catch((error) => {
4171
+ throw error.withCustomMessage(
4172
+ `${API_NOTIFICATIONS.BUILDING_BLOCKS.FAILURE.DELETED} [${error.message}]`
4355
4173
  );
4356
- } catch (error) {
4357
- if (error instanceof Error) {
4358
- throw new Error(
4359
- `${API_NOTIFICATIONS.BUILDING_BLOCKS.FAILURE.DELETED} [${error.message}]`
4360
- );
4361
- }
4362
- throw error;
4363
- }
4174
+ });
4364
4175
  });
4365
4176
  },
4366
4177
  getChatWebhook(appId, authorization) {
4367
4178
  return __async(this, null, function* () {
4368
- try {
4369
- return yield platformDpsClientInstance.get(
4370
- `/v2/applications/${appId}/chat-webhooks`,
4371
- getPlatformDpsClientConfig(authorization)
4179
+ return platformDpsClientInstance.get(
4180
+ `/v2/applications/${appId}/chat-webhooks`,
4181
+ getPlatformDpsClientConfig(authorization)
4182
+ ).catch((error) => {
4183
+ throw error.withCustomMessage(
4184
+ `Couldn't get the chat webhook. [${error.message}]`
4372
4185
  );
4373
- } catch (error) {
4374
- if (error instanceof Error) {
4375
- throw new Error(`Couldn't get the chat webhook. [${error.message}]`);
4376
- }
4377
- throw error;
4378
- }
4186
+ });
4379
4187
  });
4380
4188
  },
4381
4189
  updateChatWebhook(appId, payload, authorization) {
4382
4190
  return __async(this, null, function* () {
4383
- try {
4384
- yield platformDpsClientInstance.post(
4385
- `/v2/applications/${appId}/chat-webhooks`,
4386
- payload,
4387
- getPlatformDpsClientConfig(authorization)
4191
+ yield platformDpsClientInstance.post(
4192
+ `/v2/applications/${appId}/chat-webhooks`,
4193
+ payload,
4194
+ getPlatformDpsClientConfig(authorization)
4195
+ ).catch((error) => {
4196
+ throw error.withCustomMessage(
4197
+ `${API_NOTIFICATIONS.BUILDING_BLOCKS.FAILURE.UPDATED} [${error.message}]`
4388
4198
  );
4389
- } catch (error) {
4390
- if (error instanceof Error) {
4391
- throw new Error(
4392
- `${API_NOTIFICATIONS.BUILDING_BLOCKS.FAILURE.UPDATED} [${error.message}]`
4393
- );
4394
- }
4395
- throw error;
4396
- }
4199
+ });
4397
4200
  });
4398
4201
  },
4399
4202
  deleteChatWebhook(appId, authorization) {
4400
4203
  return __async(this, null, function* () {
4401
- try {
4402
- yield platformDpsClientInstance.delete(
4403
- `/v2/applications/${appId}/chat-webhooks`,
4404
- __spreadValues({}, getPlatformDpsClientConfig(authorization))
4204
+ yield platformDpsClientInstance.delete(`/v2/applications/${appId}/chat-webhooks`, __spreadValues({}, getPlatformDpsClientConfig(authorization))).catch((error) => {
4205
+ throw error.withCustomMessage(
4206
+ `${API_NOTIFICATIONS.BUILDING_BLOCKS.FAILURE.DELETED} [${error.message}]`
4405
4207
  );
4406
- } catch (error) {
4407
- if (error instanceof Error) {
4408
- throw new Error(
4409
- `${API_NOTIFICATIONS.BUILDING_BLOCKS.FAILURE.DELETED} [${error.message}]`
4410
- );
4411
- }
4412
- throw error;
4413
- }
4208
+ });
4414
4209
  });
4415
4210
  }
4416
4211
  };
@@ -4419,55 +4214,37 @@ var platformDpsApplicationWebhooksApi = {
4419
4214
  var platformDpsApplicationWidgetsApi = {
4420
4215
  createWidget(appId, widgetId, widget, authorization) {
4421
4216
  return __async(this, null, function* () {
4422
- try {
4423
- yield platformDpsClientInstance.put(
4424
- `/v2/applications/${appId}/widgets/${widgetId}`,
4425
- widget,
4426
- getPlatformDpsClientConfig(authorization)
4217
+ yield platformDpsClientInstance.put(
4218
+ `/v2/applications/${appId}/widgets/${widgetId}`,
4219
+ widget,
4220
+ getPlatformDpsClientConfig(authorization)
4221
+ ).catch((error) => {
4222
+ throw error.withCustomMessage(
4223
+ `${API_NOTIFICATIONS.BUILDING_BLOCKS.FAILURE.CREATED} [${error.message}]`
4427
4224
  );
4428
- } catch (error) {
4429
- if (error instanceof Error) {
4430
- throw new Error(
4431
- `${API_NOTIFICATIONS.BUILDING_BLOCKS.FAILURE.CREATED} [${error.message}]`
4432
- );
4433
- }
4434
- throw error;
4435
- }
4225
+ });
4436
4226
  });
4437
4227
  },
4438
4228
  updateWidget(appId, widgetId, widget, authorization) {
4439
4229
  return __async(this, null, function* () {
4440
- try {
4441
- yield platformDpsClientInstance.patch(
4442
- `/v2/applications/${appId}/widgets/${widgetId}`,
4443
- widget,
4444
- getPlatformDpsClientConfig(authorization)
4230
+ yield platformDpsClientInstance.patch(
4231
+ `/v2/applications/${appId}/widgets/${widgetId}`,
4232
+ widget,
4233
+ getPlatformDpsClientConfig(authorization)
4234
+ ).catch((error) => {
4235
+ throw error.withCustomMessage(
4236
+ `${API_NOTIFICATIONS.BUILDING_BLOCKS.FAILURE.UPDATED} [${error.message}]`
4445
4237
  );
4446
- } catch (error) {
4447
- if (error instanceof Error) {
4448
- throw new Error(
4449
- `${API_NOTIFICATIONS.BUILDING_BLOCKS.FAILURE.UPDATED} [${error.message}]`
4450
- );
4451
- }
4452
- throw error;
4453
- }
4238
+ });
4454
4239
  });
4455
4240
  },
4456
4241
  deleteWidget(appId, widgetId, authorization) {
4457
4242
  return __async(this, null, function* () {
4458
- try {
4459
- yield platformDpsClientInstance.delete(
4460
- `/v2/applications/${appId}/widgets/${widgetId}`,
4461
- __spreadValues({}, getPlatformDpsClientConfig(authorization))
4243
+ yield platformDpsClientInstance.delete(`/v2/applications/${appId}/widgets/${widgetId}`, __spreadValues({}, getPlatformDpsClientConfig(authorization))).catch((error) => {
4244
+ throw error.withCustomMessage(
4245
+ `${API_NOTIFICATIONS.BUILDING_BLOCKS.FAILURE.DELETED} [${error.message}]`
4462
4246
  );
4463
- } catch (error) {
4464
- if (error instanceof Error) {
4465
- throw new Error(
4466
- `${API_NOTIFICATIONS.BUILDING_BLOCKS.FAILURE.DELETED} [${error.message}]`
4467
- );
4468
- }
4469
- throw error;
4470
- }
4247
+ });
4471
4248
  });
4472
4249
  }
4473
4250
  };