@livechat/developer-studio-api 3.2.3 → 3.2.5

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
@@ -426,7 +426,7 @@ interface WorkflowDto {
426
426
  }
427
427
  type WorkflowTriggerType = "manual_only" | "recurring" | "one_time" | "webhook";
428
428
  type WorkflowTriggerDto = Record<string, never> | {
429
- type: "manual_only";
429
+ type?: "manual_only";
430
430
  } | {
431
431
  type: "recurring";
432
432
  schedule: string;
@@ -6463,6 +6463,7 @@ declare const api: {
6463
6463
  secret: string;
6464
6464
  id: string;
6465
6465
  }, any>>;
6466
+ deleteBotTemplates(clientId: string, authorization?: PlatformClientAuthorization | undefined): Promise<void>;
6466
6467
  };
6467
6468
  property: {
6468
6469
  getProperties(clientId: string, isAgent?: boolean | undefined, authorization?: PlatformClientAuthorization | undefined): Promise<axios.AxiosResponse<PropertiesDto, any>>;
package/dist/index.d.ts CHANGED
@@ -426,7 +426,7 @@ interface WorkflowDto {
426
426
  }
427
427
  type WorkflowTriggerType = "manual_only" | "recurring" | "one_time" | "webhook";
428
428
  type WorkflowTriggerDto = Record<string, never> | {
429
- type: "manual_only";
429
+ type?: "manual_only";
430
430
  } | {
431
431
  type: "recurring";
432
432
  schedule: string;
@@ -6463,6 +6463,7 @@ declare const api: {
6463
6463
  secret: string;
6464
6464
  id: string;
6465
6465
  }, any>>;
6466
+ deleteBotTemplates(clientId: string, authorization?: PlatformClientAuthorization | undefined): Promise<void>;
6466
6467
  };
6467
6468
  property: {
6468
6469
  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.3",
3
+ "version": "3.2.5",
4
4
  "description": "This project is API for LiveChat Developer Studio.",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",