@livechat/developer-studio-api 3.0.1 → 3.0.3

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