@livechat/developer-studio-api 2.3.13 → 2.3.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -2229,24 +2229,24 @@ declare const api: {
2229
2229
  };
2230
2230
  configuration: {
2231
2231
  property: {
2232
- getProperties(clientId: string, isAgent?: boolean | undefined): Promise<axios.AxiosResponse<PropertiesDto>>;
2233
- registerProperty(property: Property): Promise<axios.AxiosResponse<undefined>>;
2234
- unregisterProperty(propertyId: string, clientId: string, properties?: PropertyDto[] | undefined): Promise<axios.AxiosResponse<undefined>>;
2235
- publishProperty(propertyId: string, clientId: string, accessType: PropertyAccessItemDto): Promise<axios.AxiosResponse<undefined>>;
2236
- publishProperties(properties: Property[]): Promise<axios.AxiosResponse<undefined>[]>;
2237
- registerProperties(properties: Property[]): Promise<axios.AxiosResponse<undefined>[]>;
2238
- unregisterProperties(clientId: string): Promise<void>;
2232
+ getProperties(clientId: string, isAgent?: boolean | undefined, authorization?: LiveChatClientInstanceAuthorization | undefined): Promise<axios.AxiosResponse<PropertiesDto>>;
2233
+ registerProperty(property: Property, authorization?: LiveChatClientInstanceAuthorization | undefined): Promise<axios.AxiosResponse<undefined>>;
2234
+ unregisterProperty(propertyId: string, clientId: string, properties?: PropertyDto[] | undefined, authorization?: LiveChatClientInstanceAuthorization | undefined): Promise<axios.AxiosResponse<undefined>>;
2235
+ publishProperty(propertyId: string, clientId: string, accessType: PropertyAccessItemDto, authorization?: LiveChatClientInstanceAuthorization | undefined): Promise<axios.AxiosResponse<undefined>>;
2236
+ publishProperties(properties: Property[], authorization?: LiveChatClientInstanceAuthorization | undefined): Promise<axios.AxiosResponse<undefined>[]>;
2237
+ registerProperties(properties: Property[], authorization?: LiveChatClientInstanceAuthorization | undefined): Promise<axios.AxiosResponse<undefined>[]>;
2238
+ unregisterProperties(clientId: string, authorization?: LiveChatClientInstanceAuthorization | undefined): Promise<void>;
2239
2239
  };
2240
2240
  webhook: {
2241
- getWebhooks(clientId: string, isAgent?: boolean | undefined): Promise<axios.AxiosResponse<WebhookDto[]>>;
2242
- unregisterWebhook(clientId: string, webhookId: string): Promise<axios.AxiosResponse<undefined>>;
2243
- unregisterWebhooks(clientId: string): Promise<void>;
2244
- registerWebhooks(webhooks: Webhook[]): Promise<void>;
2245
- migrateWebhooks(webhooks: Webhook[], clientId: string): Promise<void>;
2246
- getLicenseWebhooksList(isAgent: boolean): Promise<axios.AxiosResponse<any> | {
2241
+ getWebhooks(clientId: string, isAgent?: boolean | undefined, authorization?: LiveChatClientInstanceAuthorization | undefined): Promise<axios.AxiosResponse<WebhookDto[]>>;
2242
+ unregisterWebhook(clientId: string, webhookId: string, authorization?: LiveChatClientInstanceAuthorization | undefined): Promise<axios.AxiosResponse<undefined>>;
2243
+ unregisterWebhooks(clientId: string, authorization?: LiveChatClientInstanceAuthorization | undefined): Promise<void>;
2244
+ registerWebhooks(webhooks: Webhook[], authorization?: LiveChatClientInstanceAuthorization | undefined): Promise<void>;
2245
+ migrateWebhooks(webhooks: Webhook[], clientId: string, authorization?: LiveChatClientInstanceAuthorization | undefined): Promise<void>;
2246
+ getLicenseWebhooksList(isAgent: boolean, authorization?: LiveChatClientInstanceAuthorization | undefined): Promise<axios.AxiosResponse<any> | {
2247
2247
  data: never[];
2248
2248
  }>;
2249
- deleteLicenseWebhook(id: string): Promise<axios.AxiosResponse<undefined>>;
2249
+ deleteLicenseWebhook(id: string, authorization?: LiveChatClientInstanceAuthorization | undefined): Promise<axios.AxiosResponse<undefined>>;
2250
2250
  };
2251
2251
  };
2252
2252
  };
package/dist/index.d.ts CHANGED
@@ -2229,24 +2229,24 @@ declare const api: {
2229
2229
  };
2230
2230
  configuration: {
2231
2231
  property: {
2232
- getProperties(clientId: string, isAgent?: boolean | undefined): Promise<axios.AxiosResponse<PropertiesDto>>;
2233
- registerProperty(property: Property): Promise<axios.AxiosResponse<undefined>>;
2234
- unregisterProperty(propertyId: string, clientId: string, properties?: PropertyDto[] | undefined): Promise<axios.AxiosResponse<undefined>>;
2235
- publishProperty(propertyId: string, clientId: string, accessType: PropertyAccessItemDto): Promise<axios.AxiosResponse<undefined>>;
2236
- publishProperties(properties: Property[]): Promise<axios.AxiosResponse<undefined>[]>;
2237
- registerProperties(properties: Property[]): Promise<axios.AxiosResponse<undefined>[]>;
2238
- unregisterProperties(clientId: string): Promise<void>;
2232
+ getProperties(clientId: string, isAgent?: boolean | undefined, authorization?: LiveChatClientInstanceAuthorization | undefined): Promise<axios.AxiosResponse<PropertiesDto>>;
2233
+ registerProperty(property: Property, authorization?: LiveChatClientInstanceAuthorization | undefined): Promise<axios.AxiosResponse<undefined>>;
2234
+ unregisterProperty(propertyId: string, clientId: string, properties?: PropertyDto[] | undefined, authorization?: LiveChatClientInstanceAuthorization | undefined): Promise<axios.AxiosResponse<undefined>>;
2235
+ publishProperty(propertyId: string, clientId: string, accessType: PropertyAccessItemDto, authorization?: LiveChatClientInstanceAuthorization | undefined): Promise<axios.AxiosResponse<undefined>>;
2236
+ publishProperties(properties: Property[], authorization?: LiveChatClientInstanceAuthorization | undefined): Promise<axios.AxiosResponse<undefined>[]>;
2237
+ registerProperties(properties: Property[], authorization?: LiveChatClientInstanceAuthorization | undefined): Promise<axios.AxiosResponse<undefined>[]>;
2238
+ unregisterProperties(clientId: string, authorization?: LiveChatClientInstanceAuthorization | undefined): Promise<void>;
2239
2239
  };
2240
2240
  webhook: {
2241
- getWebhooks(clientId: string, isAgent?: boolean | undefined): Promise<axios.AxiosResponse<WebhookDto[]>>;
2242
- unregisterWebhook(clientId: string, webhookId: string): Promise<axios.AxiosResponse<undefined>>;
2243
- unregisterWebhooks(clientId: string): Promise<void>;
2244
- registerWebhooks(webhooks: Webhook[]): Promise<void>;
2245
- migrateWebhooks(webhooks: Webhook[], clientId: string): Promise<void>;
2246
- getLicenseWebhooksList(isAgent: boolean): Promise<axios.AxiosResponse<any> | {
2241
+ getWebhooks(clientId: string, isAgent?: boolean | undefined, authorization?: LiveChatClientInstanceAuthorization | undefined): Promise<axios.AxiosResponse<WebhookDto[]>>;
2242
+ unregisterWebhook(clientId: string, webhookId: string, authorization?: LiveChatClientInstanceAuthorization | undefined): Promise<axios.AxiosResponse<undefined>>;
2243
+ unregisterWebhooks(clientId: string, authorization?: LiveChatClientInstanceAuthorization | undefined): Promise<void>;
2244
+ registerWebhooks(webhooks: Webhook[], authorization?: LiveChatClientInstanceAuthorization | undefined): Promise<void>;
2245
+ migrateWebhooks(webhooks: Webhook[], clientId: string, authorization?: LiveChatClientInstanceAuthorization | undefined): Promise<void>;
2246
+ getLicenseWebhooksList(isAgent: boolean, authorization?: LiveChatClientInstanceAuthorization | undefined): Promise<axios.AxiosResponse<any> | {
2247
2247
  data: never[];
2248
2248
  }>;
2249
- deleteLicenseWebhook(id: string): Promise<axios.AxiosResponse<undefined>>;
2249
+ deleteLicenseWebhook(id: string, authorization?: LiveChatClientInstanceAuthorization | undefined): Promise<axios.AxiosResponse<undefined>>;
2250
2250
  };
2251
2251
  };
2252
2252
  };
package/dist/index.js CHANGED
@@ -2565,7 +2565,7 @@ var API_NOTIFICATIONS = {
2565
2565
 
2566
2566
  // src/apis/products/livechat/configuration/properties/api.ts
2567
2567
  var livechatPropertyApi = {
2568
- getProperties(clientId, isAgent) {
2568
+ getProperties(clientId, isAgent, authorization) {
2569
2569
  return __async(this, null, function* () {
2570
2570
  if (isAgent) {
2571
2571
  return {
@@ -2577,7 +2577,8 @@ var livechatPropertyApi = {
2577
2577
  `/v3.3/configuration/action/list_properties`,
2578
2578
  {
2579
2579
  owner_client_id: clientId
2580
- }
2580
+ },
2581
+ getLiveChatClientConfig(authorization)
2581
2582
  );
2582
2583
  return response;
2583
2584
  } catch (error) {
@@ -2589,7 +2590,7 @@ var livechatPropertyApi = {
2589
2590
  }
2590
2591
  });
2591
2592
  },
2592
- registerProperty(property) {
2593
+ registerProperty(property, authorization) {
2593
2594
  return __async(this, null, function* () {
2594
2595
  try {
2595
2596
  const response = yield livechatClientInstance.post(
@@ -2603,7 +2604,8 @@ var livechatPropertyApi = {
2603
2604
  domain: property.domain,
2604
2605
  range: property.range,
2605
2606
  default_value: property.default_value
2606
- }
2607
+ },
2608
+ getLiveChatClientConfig(authorization)
2607
2609
  );
2608
2610
  return response;
2609
2611
  } catch (error) {
@@ -2615,7 +2617,7 @@ var livechatPropertyApi = {
2615
2617
  }
2616
2618
  });
2617
2619
  },
2618
- unregisterProperty(propertyId, clientId, properties) {
2620
+ unregisterProperty(propertyId, clientId, properties, authorization) {
2619
2621
  return __async(this, null, function* () {
2620
2622
  try {
2621
2623
  const response = yield livechatClientInstance.post(
@@ -2623,7 +2625,8 @@ var livechatPropertyApi = {
2623
2625
  {
2624
2626
  name: propertyId,
2625
2627
  owner_client_id: clientId
2626
- }
2628
+ },
2629
+ getLiveChatClientConfig(authorization)
2627
2630
  );
2628
2631
  return response;
2629
2632
  } catch (error) {
@@ -2641,7 +2644,7 @@ var livechatPropertyApi = {
2641
2644
  }
2642
2645
  });
2643
2646
  },
2644
- publishProperty(propertyId, clientId, accessType) {
2647
+ publishProperty(propertyId, clientId, accessType, authorization) {
2645
2648
  return __async(this, null, function* () {
2646
2649
  try {
2647
2650
  const response = yield livechatClientInstance.post(
@@ -2650,7 +2653,8 @@ var livechatPropertyApi = {
2650
2653
  name: propertyId,
2651
2654
  owner_client_id: clientId,
2652
2655
  access_type: accessType
2653
- }
2656
+ },
2657
+ getLiveChatClientConfig(authorization)
2654
2658
  );
2655
2659
  return response;
2656
2660
  } catch (error) {
@@ -2662,7 +2666,7 @@ var livechatPropertyApi = {
2662
2666
  }
2663
2667
  });
2664
2668
  },
2665
- publishProperties(properties) {
2669
+ publishProperties(properties, authorization) {
2666
2670
  return __async(this, null, function* () {
2667
2671
  try {
2668
2672
  const response = yield Promise.all(
@@ -2673,7 +2677,8 @@ var livechatPropertyApi = {
2673
2677
  name: property.name,
2674
2678
  owner_client_id: property.owner_client_id,
2675
2679
  access_type: property.public_access
2676
- }
2680
+ },
2681
+ getLiveChatClientConfig(authorization)
2677
2682
  );
2678
2683
  }))
2679
2684
  );
@@ -2687,7 +2692,7 @@ var livechatPropertyApi = {
2687
2692
  }
2688
2693
  });
2689
2694
  },
2690
- registerProperties(properties) {
2695
+ registerProperties(properties, authorization) {
2691
2696
  return __async(this, null, function* () {
2692
2697
  try {
2693
2698
  const response = yield Promise.all(
@@ -2702,7 +2707,8 @@ var livechatPropertyApi = {
2702
2707
  range: property.range,
2703
2708
  access: property.access,
2704
2709
  default_value: property.default_value
2705
- }
2710
+ },
2711
+ getLiveChatClientConfig(authorization)
2706
2712
  );
2707
2713
  }))
2708
2714
  );
@@ -2716,7 +2722,7 @@ var livechatPropertyApi = {
2716
2722
  }
2717
2723
  });
2718
2724
  },
2719
- unregisterProperties(clientId) {
2725
+ unregisterProperties(clientId, authorization) {
2720
2726
  return __async(this, null, function* () {
2721
2727
  const { data: properties } = yield this.getProperties(clientId);
2722
2728
  try {
@@ -2728,7 +2734,8 @@ var livechatPropertyApi = {
2728
2734
  {
2729
2735
  name: property,
2730
2736
  owner_client_id: clientId
2731
- }
2737
+ },
2738
+ getLiveChatClientConfig(authorization)
2732
2739
  );
2733
2740
  }
2734
2741
  }))
@@ -2746,7 +2753,7 @@ var livechatPropertyApi = {
2746
2753
 
2747
2754
  // src/apis/products/livechat/configuration/webhooks/api.ts
2748
2755
  var livechatWebhookApi = {
2749
- getWebhooks(clientId, isAgent) {
2756
+ getWebhooks(clientId, isAgent, authorization) {
2750
2757
  return __async(this, null, function* () {
2751
2758
  if (isAgent) {
2752
2759
  return {
@@ -2758,7 +2765,8 @@ var livechatWebhookApi = {
2758
2765
  `/v3.5/configuration/action/list_webhooks`,
2759
2766
  {
2760
2767
  owner_client_id: clientId
2761
- }
2768
+ },
2769
+ getLiveChatClientConfig(authorization)
2762
2770
  );
2763
2771
  return response;
2764
2772
  } catch (error) {
@@ -2772,7 +2780,7 @@ var livechatWebhookApi = {
2772
2780
  }
2773
2781
  });
2774
2782
  },
2775
- unregisterWebhook(clientId, webhookId) {
2783
+ unregisterWebhook(clientId, webhookId, authorization) {
2776
2784
  return __async(this, null, function* () {
2777
2785
  try {
2778
2786
  const response = yield livechatClientInstance.post(
@@ -2780,7 +2788,8 @@ var livechatWebhookApi = {
2780
2788
  {
2781
2789
  id: webhookId,
2782
2790
  owner_client_id: clientId
2783
- }
2791
+ },
2792
+ getLiveChatClientConfig(authorization)
2784
2793
  );
2785
2794
  return response;
2786
2795
  } catch (error) {
@@ -2794,7 +2803,7 @@ var livechatWebhookApi = {
2794
2803
  }
2795
2804
  });
2796
2805
  },
2797
- unregisterWebhooks(clientId) {
2806
+ unregisterWebhooks(clientId, authorization) {
2798
2807
  return __async(this, null, function* () {
2799
2808
  try {
2800
2809
  const { data: webhooks } = yield this.getWebhooks(clientId);
@@ -2805,7 +2814,8 @@ var livechatWebhookApi = {
2805
2814
  {
2806
2815
  id: webhook.id,
2807
2816
  owner_client_id: clientId
2808
- }
2817
+ },
2818
+ getLiveChatClientConfig(authorization)
2809
2819
  );
2810
2820
  }))
2811
2821
  );
@@ -2820,7 +2830,7 @@ var livechatWebhookApi = {
2820
2830
  }
2821
2831
  });
2822
2832
  },
2823
- registerWebhooks(webhooks) {
2833
+ registerWebhooks(webhooks, authorization) {
2824
2834
  return __async(this, null, function* () {
2825
2835
  try {
2826
2836
  yield this.unregisterWebhooks(webhooks[0].owner_client_id);
@@ -2836,7 +2846,8 @@ var livechatWebhookApi = {
2836
2846
  type: webhook.type,
2837
2847
  description: webhook.description,
2838
2848
  filters: webhook.filters
2839
- }
2849
+ },
2850
+ getLiveChatClientConfig(authorization)
2840
2851
  );
2841
2852
  }))
2842
2853
  );
@@ -2851,7 +2862,7 @@ var livechatWebhookApi = {
2851
2862
  }
2852
2863
  });
2853
2864
  },
2854
- migrateWebhooks(webhooks, clientId) {
2865
+ migrateWebhooks(webhooks, clientId, authorization) {
2855
2866
  return __async(this, null, function* () {
2856
2867
  try {
2857
2868
  const webhooksToCheck = webhooks.map((webhook) => {
@@ -2861,9 +2872,11 @@ var livechatWebhookApi = {
2861
2872
  filters: webhook.filters
2862
2873
  };
2863
2874
  });
2864
- const { data: verifiedWebhooks } = yield livechatClientInstance.post(`/v3.3/configuration/action/check_webhooks_migration`, [
2865
- ...webhooksToCheck
2866
- ]);
2875
+ const { data: verifiedWebhooks } = yield livechatClientInstance.post(
2876
+ `/v3.3/configuration/action/check_webhooks_migration`,
2877
+ [...webhooksToCheck],
2878
+ getLiveChatClientConfig(authorization)
2879
+ );
2867
2880
  const updatedWebhooks = webhooks.map((webhook, index) => {
2868
2881
  return __spreadProps(__spreadValues({}, webhook), {
2869
2882
  action: verifiedWebhooks[index].action
@@ -2874,7 +2887,8 @@ var livechatWebhookApi = {
2874
2887
  {
2875
2888
  owner_client_id: clientId,
2876
2889
  webhooks: updatedWebhooks
2877
- }
2890
+ },
2891
+ getLiveChatClientConfig(authorization)
2878
2892
  );
2879
2893
  } catch (error) {
2880
2894
  if (error instanceof Error) {
@@ -2887,7 +2901,7 @@ var livechatWebhookApi = {
2887
2901
  }
2888
2902
  });
2889
2903
  },
2890
- getLicenseWebhooksList(isAgent) {
2904
+ getLicenseWebhooksList(isAgent, authorization) {
2891
2905
  return __async(this, null, function* () {
2892
2906
  if (isAgent) {
2893
2907
  return {
@@ -2897,7 +2911,8 @@ var livechatWebhookApi = {
2897
2911
  try {
2898
2912
  const response = yield livechatClientInstance.post(
2899
2913
  `/v3.2/configuration/action/list_registered_webhooks`,
2900
- {}
2914
+ {},
2915
+ getLiveChatClientConfig(authorization)
2901
2916
  );
2902
2917
  return response;
2903
2918
  } catch (error) {
@@ -2911,12 +2926,13 @@ var livechatWebhookApi = {
2911
2926
  }
2912
2927
  });
2913
2928
  },
2914
- deleteLicenseWebhook(id) {
2929
+ deleteLicenseWebhook(id, authorization) {
2915
2930
  return __async(this, null, function* () {
2916
2931
  try {
2917
2932
  const response = yield livechatClientInstance.post(
2918
2933
  `/v3.2/configuration/action/unregister_webhook`,
2919
- { webhook_id: id }
2934
+ { webhook_id: id },
2935
+ getLiveChatClientConfig(authorization)
2920
2936
  );
2921
2937
  return response;
2922
2938
  } catch (error) {
package/dist/index.mjs CHANGED
@@ -2474,7 +2474,7 @@ var API_NOTIFICATIONS = {
2474
2474
 
2475
2475
  // src/apis/products/livechat/configuration/properties/api.ts
2476
2476
  var livechatPropertyApi = {
2477
- getProperties(clientId, isAgent) {
2477
+ getProperties(clientId, isAgent, authorization) {
2478
2478
  return __async(this, null, function* () {
2479
2479
  if (isAgent) {
2480
2480
  return {
@@ -2486,7 +2486,8 @@ var livechatPropertyApi = {
2486
2486
  `/v3.3/configuration/action/list_properties`,
2487
2487
  {
2488
2488
  owner_client_id: clientId
2489
- }
2489
+ },
2490
+ getLiveChatClientConfig(authorization)
2490
2491
  );
2491
2492
  return response;
2492
2493
  } catch (error) {
@@ -2498,7 +2499,7 @@ var livechatPropertyApi = {
2498
2499
  }
2499
2500
  });
2500
2501
  },
2501
- registerProperty(property) {
2502
+ registerProperty(property, authorization) {
2502
2503
  return __async(this, null, function* () {
2503
2504
  try {
2504
2505
  const response = yield livechatClientInstance.post(
@@ -2512,7 +2513,8 @@ var livechatPropertyApi = {
2512
2513
  domain: property.domain,
2513
2514
  range: property.range,
2514
2515
  default_value: property.default_value
2515
- }
2516
+ },
2517
+ getLiveChatClientConfig(authorization)
2516
2518
  );
2517
2519
  return response;
2518
2520
  } catch (error) {
@@ -2524,7 +2526,7 @@ var livechatPropertyApi = {
2524
2526
  }
2525
2527
  });
2526
2528
  },
2527
- unregisterProperty(propertyId, clientId, properties) {
2529
+ unregisterProperty(propertyId, clientId, properties, authorization) {
2528
2530
  return __async(this, null, function* () {
2529
2531
  try {
2530
2532
  const response = yield livechatClientInstance.post(
@@ -2532,7 +2534,8 @@ var livechatPropertyApi = {
2532
2534
  {
2533
2535
  name: propertyId,
2534
2536
  owner_client_id: clientId
2535
- }
2537
+ },
2538
+ getLiveChatClientConfig(authorization)
2536
2539
  );
2537
2540
  return response;
2538
2541
  } catch (error) {
@@ -2550,7 +2553,7 @@ var livechatPropertyApi = {
2550
2553
  }
2551
2554
  });
2552
2555
  },
2553
- publishProperty(propertyId, clientId, accessType) {
2556
+ publishProperty(propertyId, clientId, accessType, authorization) {
2554
2557
  return __async(this, null, function* () {
2555
2558
  try {
2556
2559
  const response = yield livechatClientInstance.post(
@@ -2559,7 +2562,8 @@ var livechatPropertyApi = {
2559
2562
  name: propertyId,
2560
2563
  owner_client_id: clientId,
2561
2564
  access_type: accessType
2562
- }
2565
+ },
2566
+ getLiveChatClientConfig(authorization)
2563
2567
  );
2564
2568
  return response;
2565
2569
  } catch (error) {
@@ -2571,7 +2575,7 @@ var livechatPropertyApi = {
2571
2575
  }
2572
2576
  });
2573
2577
  },
2574
- publishProperties(properties) {
2578
+ publishProperties(properties, authorization) {
2575
2579
  return __async(this, null, function* () {
2576
2580
  try {
2577
2581
  const response = yield Promise.all(
@@ -2582,7 +2586,8 @@ var livechatPropertyApi = {
2582
2586
  name: property.name,
2583
2587
  owner_client_id: property.owner_client_id,
2584
2588
  access_type: property.public_access
2585
- }
2589
+ },
2590
+ getLiveChatClientConfig(authorization)
2586
2591
  );
2587
2592
  }))
2588
2593
  );
@@ -2596,7 +2601,7 @@ var livechatPropertyApi = {
2596
2601
  }
2597
2602
  });
2598
2603
  },
2599
- registerProperties(properties) {
2604
+ registerProperties(properties, authorization) {
2600
2605
  return __async(this, null, function* () {
2601
2606
  try {
2602
2607
  const response = yield Promise.all(
@@ -2611,7 +2616,8 @@ var livechatPropertyApi = {
2611
2616
  range: property.range,
2612
2617
  access: property.access,
2613
2618
  default_value: property.default_value
2614
- }
2619
+ },
2620
+ getLiveChatClientConfig(authorization)
2615
2621
  );
2616
2622
  }))
2617
2623
  );
@@ -2625,7 +2631,7 @@ var livechatPropertyApi = {
2625
2631
  }
2626
2632
  });
2627
2633
  },
2628
- unregisterProperties(clientId) {
2634
+ unregisterProperties(clientId, authorization) {
2629
2635
  return __async(this, null, function* () {
2630
2636
  const { data: properties } = yield this.getProperties(clientId);
2631
2637
  try {
@@ -2637,7 +2643,8 @@ var livechatPropertyApi = {
2637
2643
  {
2638
2644
  name: property,
2639
2645
  owner_client_id: clientId
2640
- }
2646
+ },
2647
+ getLiveChatClientConfig(authorization)
2641
2648
  );
2642
2649
  }
2643
2650
  }))
@@ -2655,7 +2662,7 @@ var livechatPropertyApi = {
2655
2662
 
2656
2663
  // src/apis/products/livechat/configuration/webhooks/api.ts
2657
2664
  var livechatWebhookApi = {
2658
- getWebhooks(clientId, isAgent) {
2665
+ getWebhooks(clientId, isAgent, authorization) {
2659
2666
  return __async(this, null, function* () {
2660
2667
  if (isAgent) {
2661
2668
  return {
@@ -2667,7 +2674,8 @@ var livechatWebhookApi = {
2667
2674
  `/v3.5/configuration/action/list_webhooks`,
2668
2675
  {
2669
2676
  owner_client_id: clientId
2670
- }
2677
+ },
2678
+ getLiveChatClientConfig(authorization)
2671
2679
  );
2672
2680
  return response;
2673
2681
  } catch (error) {
@@ -2681,7 +2689,7 @@ var livechatWebhookApi = {
2681
2689
  }
2682
2690
  });
2683
2691
  },
2684
- unregisterWebhook(clientId, webhookId) {
2692
+ unregisterWebhook(clientId, webhookId, authorization) {
2685
2693
  return __async(this, null, function* () {
2686
2694
  try {
2687
2695
  const response = yield livechatClientInstance.post(
@@ -2689,7 +2697,8 @@ var livechatWebhookApi = {
2689
2697
  {
2690
2698
  id: webhookId,
2691
2699
  owner_client_id: clientId
2692
- }
2700
+ },
2701
+ getLiveChatClientConfig(authorization)
2693
2702
  );
2694
2703
  return response;
2695
2704
  } catch (error) {
@@ -2703,7 +2712,7 @@ var livechatWebhookApi = {
2703
2712
  }
2704
2713
  });
2705
2714
  },
2706
- unregisterWebhooks(clientId) {
2715
+ unregisterWebhooks(clientId, authorization) {
2707
2716
  return __async(this, null, function* () {
2708
2717
  try {
2709
2718
  const { data: webhooks } = yield this.getWebhooks(clientId);
@@ -2714,7 +2723,8 @@ var livechatWebhookApi = {
2714
2723
  {
2715
2724
  id: webhook.id,
2716
2725
  owner_client_id: clientId
2717
- }
2726
+ },
2727
+ getLiveChatClientConfig(authorization)
2718
2728
  );
2719
2729
  }))
2720
2730
  );
@@ -2729,7 +2739,7 @@ var livechatWebhookApi = {
2729
2739
  }
2730
2740
  });
2731
2741
  },
2732
- registerWebhooks(webhooks) {
2742
+ registerWebhooks(webhooks, authorization) {
2733
2743
  return __async(this, null, function* () {
2734
2744
  try {
2735
2745
  yield this.unregisterWebhooks(webhooks[0].owner_client_id);
@@ -2745,7 +2755,8 @@ var livechatWebhookApi = {
2745
2755
  type: webhook.type,
2746
2756
  description: webhook.description,
2747
2757
  filters: webhook.filters
2748
- }
2758
+ },
2759
+ getLiveChatClientConfig(authorization)
2749
2760
  );
2750
2761
  }))
2751
2762
  );
@@ -2760,7 +2771,7 @@ var livechatWebhookApi = {
2760
2771
  }
2761
2772
  });
2762
2773
  },
2763
- migrateWebhooks(webhooks, clientId) {
2774
+ migrateWebhooks(webhooks, clientId, authorization) {
2764
2775
  return __async(this, null, function* () {
2765
2776
  try {
2766
2777
  const webhooksToCheck = webhooks.map((webhook) => {
@@ -2770,9 +2781,11 @@ var livechatWebhookApi = {
2770
2781
  filters: webhook.filters
2771
2782
  };
2772
2783
  });
2773
- const { data: verifiedWebhooks } = yield livechatClientInstance.post(`/v3.3/configuration/action/check_webhooks_migration`, [
2774
- ...webhooksToCheck
2775
- ]);
2784
+ const { data: verifiedWebhooks } = yield livechatClientInstance.post(
2785
+ `/v3.3/configuration/action/check_webhooks_migration`,
2786
+ [...webhooksToCheck],
2787
+ getLiveChatClientConfig(authorization)
2788
+ );
2776
2789
  const updatedWebhooks = webhooks.map((webhook, index) => {
2777
2790
  return __spreadProps(__spreadValues({}, webhook), {
2778
2791
  action: verifiedWebhooks[index].action
@@ -2783,7 +2796,8 @@ var livechatWebhookApi = {
2783
2796
  {
2784
2797
  owner_client_id: clientId,
2785
2798
  webhooks: updatedWebhooks
2786
- }
2799
+ },
2800
+ getLiveChatClientConfig(authorization)
2787
2801
  );
2788
2802
  } catch (error) {
2789
2803
  if (error instanceof Error) {
@@ -2796,7 +2810,7 @@ var livechatWebhookApi = {
2796
2810
  }
2797
2811
  });
2798
2812
  },
2799
- getLicenseWebhooksList(isAgent) {
2813
+ getLicenseWebhooksList(isAgent, authorization) {
2800
2814
  return __async(this, null, function* () {
2801
2815
  if (isAgent) {
2802
2816
  return {
@@ -2806,7 +2820,8 @@ var livechatWebhookApi = {
2806
2820
  try {
2807
2821
  const response = yield livechatClientInstance.post(
2808
2822
  `/v3.2/configuration/action/list_registered_webhooks`,
2809
- {}
2823
+ {},
2824
+ getLiveChatClientConfig(authorization)
2810
2825
  );
2811
2826
  return response;
2812
2827
  } catch (error) {
@@ -2820,12 +2835,13 @@ var livechatWebhookApi = {
2820
2835
  }
2821
2836
  });
2822
2837
  },
2823
- deleteLicenseWebhook(id) {
2838
+ deleteLicenseWebhook(id, authorization) {
2824
2839
  return __async(this, null, function* () {
2825
2840
  try {
2826
2841
  const response = yield livechatClientInstance.post(
2827
2842
  `/v3.2/configuration/action/unregister_webhook`,
2828
- { webhook_id: id }
2843
+ { webhook_id: id },
2844
+ getLiveChatClientConfig(authorization)
2829
2845
  );
2830
2846
  return response;
2831
2847
  } catch (error) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@livechat/developer-studio-api",
3
- "version": "2.3.13",
3
+ "version": "2.3.14",
4
4
  "description": "This project is API for LiveChat Developer Studio.",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -18,8 +18,8 @@
18
18
  "tsup": "^7.1.0",
19
19
  "typescript": "^5.1.6",
20
20
  "config": "0.0.1",
21
- "eslint-config-custom": "0.0.2",
22
- "tsconfig": "0.0.1"
21
+ "tsconfig": "0.0.1",
22
+ "eslint-config-custom": "0.0.2"
23
23
  },
24
24
  "scripts": {
25
25
  "build": "tsup src/index.ts --format esm,cjs --dts",