@livechat/developer-studio-api 3.2.4 → 3.2.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -569,6 +569,9 @@ type Credential = {
569
569
  provider_fields?: Record<string, string>;
570
570
  connected?: boolean;
571
571
  };
572
+ } | {
573
+ type: "text_auth";
574
+ data: Record<string, never>;
572
575
  });
573
576
  type CredentialDto = Credential & {
574
577
  created_at: string;
@@ -6463,6 +6466,7 @@ declare const api: {
6463
6466
  secret: string;
6464
6467
  id: string;
6465
6468
  }, any>>;
6469
+ deleteBotTemplates(clientId: string, authorization?: PlatformClientAuthorization | undefined): Promise<void>;
6466
6470
  };
6467
6471
  property: {
6468
6472
  getProperties(clientId: string, isAgent?: boolean | undefined, authorization?: PlatformClientAuthorization | undefined): Promise<axios.AxiosResponse<PropertiesDto, any>>;
package/dist/index.d.ts CHANGED
@@ -569,6 +569,9 @@ type Credential = {
569
569
  provider_fields?: Record<string, string>;
570
570
  connected?: boolean;
571
571
  };
572
+ } | {
573
+ type: "text_auth";
574
+ data: Record<string, never>;
572
575
  });
573
576
  type CredentialDto = Credential & {
574
577
  created_at: string;
@@ -6463,6 +6466,7 @@ declare const api: {
6463
6466
  secret: string;
6464
6467
  id: string;
6465
6468
  }, any>>;
6469
+ deleteBotTemplates(clientId: string, authorization?: PlatformClientAuthorization | undefined): Promise<void>;
6466
6470
  };
6467
6471
  property: {
6468
6472
  getProperties(clientId: string, isAgent?: boolean | undefined, authorization?: PlatformClientAuthorization | undefined): Promise<axios.AxiosResponse<PropertiesDto, any>>;
package/dist/index.js CHANGED
@@ -5090,6 +5090,36 @@ var livechatBotsTemplatesApi = {
5090
5090
  }
5091
5091
  }
5092
5092
  });
5093
+ },
5094
+ deleteBotTemplates(clientId, authorization) {
5095
+ return __async(this, null, function* () {
5096
+ try {
5097
+ const { data: botTemplates } = yield this.getBotTemplates(
5098
+ clientId,
5099
+ authorization
5100
+ );
5101
+ yield Promise.all(
5102
+ botTemplates.map((bot) => __async(this, null, function* () {
5103
+ return livechatClientInstance.post(
5104
+ `v3.5/configuration/action/delete_bot_template`,
5105
+ {
5106
+ id: bot.id,
5107
+ owner_client_id: clientId
5108
+ },
5109
+ getLiveChatClientConfig(authorization)
5110
+ );
5111
+ }))
5112
+ );
5113
+ } catch (error) {
5114
+ if (error instanceof LivechatApiError) {
5115
+ throw error.withCustomMessage(
5116
+ `${API_NOTIFICATIONS.BUILDING_BLOCKS.FAILURE.DELETED} [${error.message}]`
5117
+ );
5118
+ } else {
5119
+ throw error;
5120
+ }
5121
+ }
5122
+ });
5093
5123
  }
5094
5124
  };
5095
5125
 
package/dist/index.mjs CHANGED
@@ -4937,6 +4937,36 @@ var livechatBotsTemplatesApi = {
4937
4937
  }
4938
4938
  }
4939
4939
  });
4940
+ },
4941
+ deleteBotTemplates(clientId, authorization) {
4942
+ return __async(this, null, function* () {
4943
+ try {
4944
+ const { data: botTemplates } = yield this.getBotTemplates(
4945
+ clientId,
4946
+ authorization
4947
+ );
4948
+ yield Promise.all(
4949
+ botTemplates.map((bot) => __async(this, null, function* () {
4950
+ return livechatClientInstance.post(
4951
+ `v3.5/configuration/action/delete_bot_template`,
4952
+ {
4953
+ id: bot.id,
4954
+ owner_client_id: clientId
4955
+ },
4956
+ getLiveChatClientConfig(authorization)
4957
+ );
4958
+ }))
4959
+ );
4960
+ } catch (error) {
4961
+ if (error instanceof LivechatApiError) {
4962
+ throw error.withCustomMessage(
4963
+ `${API_NOTIFICATIONS.BUILDING_BLOCKS.FAILURE.DELETED} [${error.message}]`
4964
+ );
4965
+ } else {
4966
+ throw error;
4967
+ }
4968
+ }
4969
+ });
4940
4970
  }
4941
4971
  };
4942
4972
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@livechat/developer-studio-api",
3
- "version": "3.2.4",
3
+ "version": "3.2.6",
4
4
  "description": "This project is API for LiveChat Developer Studio.",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",