@livechat/developer-studio-api 4.1.0 → 5.2.0-beta.v1

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
@@ -76,6 +76,7 @@ __export(src_exports, {
76
76
  BigCommerceApiError: () => BigCommerceApiError,
77
77
  BigCommerceEventNames: () => BigCommerceEventNames,
78
78
  BigCommerceWebhookScopes: () => BigCommerceWebhookScopes,
79
+ CdpCustomerEventType: () => CdpCustomerEventType,
79
80
  ConsoleApiError: () => ConsoleApiError,
80
81
  CredentialStatus: () => CredentialStatus,
81
82
  CredentialType: () => CredentialType,
@@ -112,9 +113,12 @@ __export(src_exports, {
112
113
  SlackMessageEventSubTypes: () => SlackMessageEventSubTypes,
113
114
  SortBy: () => SortBy,
114
115
  SortOrder: () => SortOrder,
116
+ TRIGGER_REFERENCE_NAME: () => TRIGGER_REFERENCE_NAME,
115
117
  TextApiError: () => TextApiError,
118
+ TextCustomerEventNames: () => TextCustomerEventNames,
116
119
  TextHelpDeskEventNames: () => TextHelpDeskEventNames,
117
120
  TextLivechatEventNames: () => TextLivechatEventNames,
121
+ TextLivechatProductCardEventType: () => TextLivechatProductCardEventType,
118
122
  TicketPriority: () => TicketPriority,
119
123
  TicketStatus: () => TicketStatus,
120
124
  UnauthorizeAccountsApiError: () => UnauthorizeAccountsApiError,
@@ -124,12 +128,12 @@ __export(src_exports, {
124
128
  WorkflowConditionTaskOperator: () => WorkflowConditionTaskOperator,
125
129
  WorkflowConditionTaskOperatorGroup: () => WorkflowConditionTaskOperatorGroup,
126
130
  WorkflowConditionTaskOperatorValueType: () => WorkflowConditionTaskOperatorValueType,
127
- WorkflowDefinitionCustomTaskName: () => WorkflowDefinitionCustomTaskName,
128
- WorkflowDefinitionTaskType: () => WorkflowDefinitionTaskType,
131
+ WorkflowCustomTaskName: () => WorkflowCustomTaskName,
129
132
  WorkflowExecutionDefinitionStatus: () => WorkflowExecutionDefinitionStatus,
130
133
  WorkflowExecutionStatus: () => WorkflowExecutionStatus,
131
134
  WorkflowExecutionTaskStatus: () => WorkflowExecutionTaskStatus,
132
135
  WorkflowItemKind: () => WorkflowItemKind,
136
+ WorkflowTaskType: () => WorkflowTaskType,
133
137
  WorkflowTemplateCategory: () => WorkflowTemplateCategory,
134
138
  WorkflowTriggerType: () => WorkflowTriggerType,
135
139
  WorkflowsApiError: () => WorkflowsApiError,
@@ -145,6 +149,7 @@ __export(src_exports, {
145
149
  bigcommerceEventsZods: () => bigcommerceEventsZods,
146
150
  billingClientInstance: () => billingClientInstance,
147
151
  buildUrlFromSegments: () => buildUrlFromSegments,
152
+ cdpCustomerEventMessageZod: () => cdpCustomerEventMessageZod,
148
153
  consoleClientInstance: () => consoleClientInstance,
149
154
  dpsClientInstance: () => dpsClientInstance,
150
155
  extractTokenFromAuthorizationHeader: () => extractTokenFromAuthorizationHeader,
@@ -234,6 +239,8 @@ __export(src_exports, {
234
239
  slackClientInstance: () => slackClientInstance,
235
240
  slackEventsZods: () => slackEventsZods,
236
241
  textClientInstance: () => textClientInstance,
242
+ textCustomerEventsZods: () => textCustomerEventsZods,
243
+ textEventsZods: () => textEventsZods,
237
244
  textHelpDeskEventsZods: () => textHelpDeskEventsZods,
238
245
  textLivechatEventsZods: () => textLivechatEventsZods,
239
246
  updateAdapterClient: () => updateAdapterClient,
@@ -386,6 +393,11 @@ var extractTokenFromAuthorizationHeader = (headerValue) => {
386
393
  // src/utils/integrations/getIntegrationFlowUrl.ts
387
394
  var import_uuid = require("uuid");
388
395
 
396
+ // ../../../private/utils/src/arrays/notEmpty.ts
397
+ function notEmpty(item) {
398
+ return Boolean(item);
399
+ }
400
+
389
401
  // ../../../private/utils/src/misc/merge-deep.ts
390
402
  function isObject(item) {
391
403
  return item !== null && typeof item === "object" && !Array.isArray(item);
@@ -468,6 +480,7 @@ var IntegrationNames = /* @__PURE__ */ ((IntegrationNames2) => {
468
480
  IntegrationNames2["HelpDesk"] = "text-helpdesk";
469
481
  IntegrationNames2["Slack"] = "slack";
470
482
  IntegrationNames2["Salesforce"] = "salesforce";
483
+ IntegrationNames2["Klaviyo"] = "klaviyo";
471
484
  return IntegrationNames2;
472
485
  })(IntegrationNames || {});
473
486
  var IntegrationDisplayNames = /* @__PURE__ */ ((IntegrationDisplayNames2) => {
@@ -487,6 +500,7 @@ var IntegrationDisplayNames = /* @__PURE__ */ ((IntegrationDisplayNames2) => {
487
500
  IntegrationDisplayNames2["HelpDesk"] = "HelpDesk";
488
501
  IntegrationDisplayNames2["Slack"] = "Slack";
489
502
  IntegrationDisplayNames2["Salesforce"] = "Salesforce";
503
+ IntegrationDisplayNames2["Klaviyo"] = "Klaviyo";
490
504
  return IntegrationDisplayNames2;
491
505
  })(IntegrationDisplayNames || {});
492
506
  var IntegrationDisplayNameToNameMap = Object.keys(IntegrationNames).reduce(
@@ -505,7 +519,7 @@ var IntegrationNameToDisplayMap = Object.keys(IntegrationNames).reduce(
505
519
  );
506
520
 
507
521
  // src/apis/text-intelligence/workflows/adapter/integrations/_contracts/requests/events.ts
508
- var import_zod9 = require("zod");
522
+ var import_zod11 = require("zod");
509
523
 
510
524
  // src/apis/text-intelligence/workflows/adapter/integrations/bigcommerce/_contracts/requests/events.ts
511
525
  var import_zod2 = require("zod");
@@ -842,8 +856,57 @@ var slackEventsZods = {
842
856
  }
843
857
  };
844
858
 
845
- // src/apis/text-intelligence/workflows/adapter/integrations/text/_contracts/requests/events/helpdesk.ts
859
+ // src/apis/text-intelligence/workflows/adapter/integrations/text/_contracts/requests/events/domains/customer.ts
846
860
  var import_zod7 = require("zod");
861
+ var TextCustomerEventNames = /* @__PURE__ */ ((TextCustomerEventNames2) => {
862
+ TextCustomerEventNames2["EmailSet"] = "customer_email_set";
863
+ TextCustomerEventNames2["PropertiesValuesUpdated"] = "customer_properties_values_updated";
864
+ return TextCustomerEventNames2;
865
+ })(TextCustomerEventNames || {});
866
+ var textCustomerEventsZods = {
867
+ eventName: import_zod7.z.nativeEnum(TextCustomerEventNames),
868
+ events: {
869
+ emailSet: integrationEventBase.extend({
870
+ name: import_zod7.z.literal("customer_email_set" /* EmailSet */),
871
+ filters: import_zod7.z.array(import_zod7.z.string().min(1)).min(1).optional()
872
+ }),
873
+ propertiesValuesUpdated: integrationEventBase.extend({
874
+ name: import_zod7.z.literal("customer_properties_values_updated" /* PropertiesValuesUpdated */),
875
+ properties: import_zod7.z.array(
876
+ import_zod7.z.object({
877
+ id: import_zod7.z.string().min(1),
878
+ to: import_zod7.z.union([import_zod7.z.string(), import_zod7.z.number(), import_zod7.z.boolean()]).optional()
879
+ })
880
+ ).optional()
881
+ })
882
+ },
883
+ get event() {
884
+ return import_zod7.z.discriminatedUnion("name", [
885
+ this.events.emailSet,
886
+ this.events.propertiesValuesUpdated
887
+ ]);
888
+ },
889
+ get subscribe() {
890
+ return integrationEventsCoreZods.withCore(
891
+ import_zod7.z.object({
892
+ event: this.event,
893
+ callback: import_zod7.z.string()
894
+ })
895
+ );
896
+ },
897
+ get unsubscribe() {
898
+ return integrationEventsCoreZods.withCore(
899
+ import_zod7.z.object({
900
+ event: import_zod7.z.object({
901
+ name: this.eventName
902
+ })
903
+ })
904
+ );
905
+ }
906
+ };
907
+
908
+ // src/apis/text-intelligence/workflows/adapter/integrations/text/_contracts/requests/events/helpdesk.ts
909
+ var import_zod8 = require("zod");
847
910
 
848
911
  // src/apis/products/helpdesk/_contracts/dtos/ticket.ts
849
912
  var TicketStatus = /* @__PURE__ */ ((TicketStatus2) => {
@@ -871,64 +934,87 @@ var TextHelpDeskEventNames = /* @__PURE__ */ ((TextHelpDeskEventNames2) => {
871
934
  TextHelpDeskEventNames2["TicketTagsChanged"] = "ticket_tags_added";
872
935
  TextHelpDeskEventNames2["TicketFollowersChanged"] = "ticket_followers_added";
873
936
  TextHelpDeskEventNames2["TicketAssignmentChanged"] = "ticket_assignment_added";
937
+ TextHelpDeskEventNames2["TicketCustomFieldsChanged"] = "ticket_custom_fields_changed";
874
938
  TextHelpDeskEventNames2["TicketMessageAdded"] = "ticket_message_added";
875
939
  return TextHelpDeskEventNames2;
876
940
  })(TextHelpDeskEventNames || {});
877
- var assignmentZod = import_zod7.z.object({
878
- agent: import_zod7.z.string().optional(),
879
- team: import_zod7.z.string().optional()
941
+ var assignmentZod = import_zod8.z.object({
942
+ agent: import_zod8.z.string().optional(),
943
+ team: import_zod8.z.string().optional()
880
944
  });
881
- var baseFiltersZod = import_zod7.z.object({
945
+ var baseFiltersZod = import_zod8.z.object({
882
946
  assignment: assignmentZod.optional(),
883
- mailbox: import_zod7.z.string().optional()
947
+ mailbox: import_zod8.z.string().optional()
884
948
  });
885
949
  var textHelpDeskEventsZods = {
886
- provider: import_zod7.z.literal("text-helpdesk" /* HelpDesk */),
887
- eventName: import_zod7.z.nativeEnum(TextHelpDeskEventNames),
950
+ provider: import_zod8.z.literal("text-helpdesk" /* HelpDesk */),
951
+ eventName: import_zod8.z.nativeEnum(TextHelpDeskEventNames),
888
952
  events: {
889
953
  ticketCreated: integrationEventBase.extend({
890
- name: import_zod7.z.literal("ticket_created" /* TicketCreated */)
954
+ name: import_zod8.z.literal("ticket_created" /* TicketCreated */)
891
955
  }).extend(baseFiltersZod.shape),
892
956
  ticketUpdated: integrationEventBase.extend({
893
- name: import_zod7.z.literal("ticket_updated" /* TicketUpdated */)
957
+ name: import_zod8.z.literal("ticket_updated" /* TicketUpdated */)
894
958
  }).extend(baseFiltersZod.shape),
895
959
  ticketStatusChanged: integrationEventBase.extend({
896
- name: import_zod7.z.literal("ticket_status_changed" /* TicketStatusChanged */),
897
- status: import_zod7.z.object({
898
- from: import_zod7.z.array(import_zod7.z.nativeEnum(TicketStatus)).optional(),
899
- to: import_zod7.z.array(import_zod7.z.nativeEnum(TicketStatus)).optional()
960
+ name: import_zod8.z.literal("ticket_status_changed" /* TicketStatusChanged */),
961
+ status: import_zod8.z.object({
962
+ from: import_zod8.z.array(import_zod8.z.nativeEnum(TicketStatus)).optional(),
963
+ to: import_zod8.z.array(import_zod8.z.nativeEnum(TicketStatus)).optional()
900
964
  }).optional()
901
965
  }).extend(baseFiltersZod.shape),
902
966
  ticketPriorityChanged: integrationEventBase.extend({
903
- name: import_zod7.z.literal("ticket_priority_changed" /* TicketPriorityChanged */),
904
- priority: import_zod7.z.object({
905
- from: import_zod7.z.array(import_zod7.z.nativeEnum(TicketPriority)).optional(),
906
- to: import_zod7.z.array(import_zod7.z.nativeEnum(TicketPriority)).optional()
967
+ name: import_zod8.z.literal("ticket_priority_changed" /* TicketPriorityChanged */),
968
+ priority: import_zod8.z.object({
969
+ from: import_zod8.z.array(import_zod8.z.nativeEnum(TicketPriority)).optional(),
970
+ to: import_zod8.z.array(import_zod8.z.nativeEnum(TicketPriority)).optional()
907
971
  }).optional()
908
972
  }).extend(baseFiltersZod.shape),
909
973
  ticketTagsChanged: integrationEventBase.extend({
910
- name: import_zod7.z.literal("ticket_tags_added" /* TicketTagsChanged */),
911
- tags: import_zod7.z.object({
912
- from: import_zod7.z.array(import_zod7.z.string()).optional(),
913
- to: import_zod7.z.array(import_zod7.z.string()).optional()
974
+ name: import_zod8.z.literal("ticket_tags_added" /* TicketTagsChanged */),
975
+ tags: import_zod8.z.object({
976
+ from: import_zod8.z.array(import_zod8.z.string()).optional(),
977
+ to: import_zod8.z.array(import_zod8.z.string()).optional()
914
978
  }).optional()
915
979
  }).extend(baseFiltersZod.shape),
916
980
  ticketFollowersChanged: integrationEventBase.extend({
917
- name: import_zod7.z.literal("ticket_followers_added" /* TicketFollowersChanged */),
918
- from: import_zod7.z.array(import_zod7.z.string()).optional(),
919
- to: import_zod7.z.array(import_zod7.z.string()).optional()
981
+ name: import_zod8.z.literal("ticket_followers_added" /* TicketFollowersChanged */),
982
+ from: import_zod8.z.array(import_zod8.z.string()).optional(),
983
+ to: import_zod8.z.array(import_zod8.z.string()).optional()
920
984
  }).extend(baseFiltersZod.shape),
921
985
  ticketAssignmentChanged: integrationEventBase.extend({
922
- name: import_zod7.z.literal("ticket_assignment_added" /* TicketAssignmentChanged */),
923
- from: import_zod7.z.array(assignmentZod).optional(),
924
- to: import_zod7.z.array(assignmentZod).optional()
986
+ name: import_zod8.z.literal("ticket_assignment_added" /* TicketAssignmentChanged */),
987
+ from: import_zod8.z.array(assignmentZod).optional(),
988
+ to: import_zod8.z.array(assignmentZod).optional()
989
+ }).extend(baseFiltersZod.shape),
990
+ ticketCustomFieldsChanged: integrationEventBase.extend({
991
+ name: import_zod8.z.literal("ticket_custom_fields_changed" /* TicketCustomFieldsChanged */),
992
+ customFields: import_zod8.z.array(
993
+ import_zod8.z.object({
994
+ id: import_zod8.z.string().min(1),
995
+ from: import_zod8.z.string().min(1).optional(),
996
+ to: import_zod8.z.string().min(1).optional()
997
+ })
998
+ ).optional()
925
999
  }).extend(baseFiltersZod.shape),
926
- ticketMessageAdded: integrationEventBase.extend({
927
- name: import_zod7.z.literal("ticket_message_added" /* TicketMessageAdded */)
928
- }).extend(baseFiltersZod.shape)
1000
+ ticketMessageAdded: import_zod8.z.discriminatedUnion("version", [
1001
+ import_zod8.z.object({
1002
+ name: import_zod8.z.literal("ticket_message_added" /* TicketMessageAdded */),
1003
+ version: import_zod8.z.undefined()
1004
+ }).extend(baseFiltersZod.shape),
1005
+ import_zod8.z.object({
1006
+ name: import_zod8.z.literal("ticket_message_added" /* TicketMessageAdded */),
1007
+ version: import_zod8.z.literal("v1"),
1008
+ from: import_zod8.z.enum(["anyone", "agent", "requester"]).optional(),
1009
+ privacy: import_zod8.z.enum(["any", "public", "private"]).optional(),
1010
+ filters: import_zod8.z.array(import_zod8.z.string()).optional(),
1011
+ caseInsensitive: import_zod8.z.boolean().optional(),
1012
+ matchWholeWords: import_zod8.z.boolean().optional()
1013
+ }).extend(baseFiltersZod.shape)
1014
+ ])
929
1015
  },
930
1016
  get event() {
931
- return import_zod7.z.discriminatedUnion("name", [
1017
+ return import_zod8.z.union([
932
1018
  this.events.ticketCreated,
933
1019
  this.events.ticketUpdated,
934
1020
  this.events.ticketStatusChanged,
@@ -936,33 +1022,34 @@ var textHelpDeskEventsZods = {
936
1022
  this.events.ticketTagsChanged,
937
1023
  this.events.ticketFollowersChanged,
938
1024
  this.events.ticketAssignmentChanged,
939
- this.events.ticketMessageAdded
1025
+ this.events.ticketMessageAdded,
1026
+ this.events.ticketCustomFieldsChanged
940
1027
  ]);
941
1028
  },
942
1029
  get subscribe() {
943
1030
  return integrationEventsCoreZods.withCore(
944
- import_zod7.z.object({
1031
+ import_zod8.z.object({
945
1032
  event: this.event,
946
- callback: import_zod7.z.string()
1033
+ callback: import_zod8.z.string()
947
1034
  })
948
1035
  );
949
1036
  },
950
1037
  get subscribeContent() {
951
- return import_zod7.z.object({
1038
+ return import_zod8.z.object({
952
1039
  provider: this.provider,
953
1040
  event: this.event,
954
- callback: import_zod7.z.string()
1041
+ callback: import_zod8.z.string()
955
1042
  });
956
1043
  },
957
1044
  get unsubscribe() {
958
1045
  return integrationEventsCoreZods.withCore(
959
- import_zod7.z.object({
1046
+ import_zod8.z.object({
960
1047
  event: this.event
961
1048
  })
962
1049
  );
963
1050
  },
964
1051
  get unsubscribeContent() {
965
- return import_zod7.z.object({
1052
+ return import_zod8.z.object({
966
1053
  provider: this.provider,
967
1054
  event: this.event
968
1055
  });
@@ -970,7 +1057,7 @@ var textHelpDeskEventsZods = {
970
1057
  };
971
1058
 
972
1059
  // src/apis/text-intelligence/workflows/adapter/integrations/text/_contracts/requests/events/livechat.ts
973
- var import_zod8 = require("zod");
1060
+ var import_zod9 = require("zod");
974
1061
  var TextLivechatEventNames = /* @__PURE__ */ ((TextLivechatEventNames2) => {
975
1062
  TextLivechatEventNames2["ChatStarted"] = "chat_started";
976
1063
  TextLivechatEventNames2["ChatEnded"] = "chat_ended";
@@ -982,6 +1069,8 @@ var TextLivechatEventNames = /* @__PURE__ */ ((TextLivechatEventNames2) => {
982
1069
  TextLivechatEventNames2["UserAddedToChat"] = "user_added_to_chat";
983
1070
  TextLivechatEventNames2["UserRemovedFromChat"] = "user_removed_from_chat";
984
1071
  TextLivechatEventNames2["CustomerLeftChat"] = "customer_left_chat";
1072
+ TextLivechatEventNames2["ChatIdle"] = "chat_idle";
1073
+ TextLivechatEventNames2["ProductCardEvent"] = "product_card_event";
985
1074
  return TextLivechatEventNames2;
986
1075
  })(TextLivechatEventNames || {});
987
1076
  var CustomerLeftChatReason = /* @__PURE__ */ ((CustomerLeftChatReason2) => {
@@ -990,63 +1079,78 @@ var CustomerLeftChatReason = /* @__PURE__ */ ((CustomerLeftChatReason2) => {
990
1079
  CustomerLeftChatReason2["Inactive"] = "inactive";
991
1080
  return CustomerLeftChatReason2;
992
1081
  })(CustomerLeftChatReason || {});
1082
+ var TextLivechatProductCardEventType = /* @__PURE__ */ ((TextLivechatProductCardEventType2) => {
1083
+ TextLivechatProductCardEventType2["ViewProduct"] = "view_product";
1084
+ TextLivechatProductCardEventType2["AddToCart"] = "add_to_cart";
1085
+ return TextLivechatProductCardEventType2;
1086
+ })(TextLivechatProductCardEventType || {});
993
1087
  var textLivechatEventsZods = {
994
- provider: import_zod8.z.literal("text-livechat" /* LiveChat */),
995
- eventName: import_zod8.z.nativeEnum(TextLivechatEventNames),
1088
+ provider: import_zod9.z.literal("text-livechat" /* LiveChat */),
1089
+ eventName: import_zod9.z.nativeEnum(TextLivechatEventNames),
996
1090
  events: {
997
1091
  chatStarted: integrationEventBase.extend({
998
- name: import_zod8.z.literal("chat_started" /* ChatStarted */),
999
- targetAgentId: import_zod8.z.string().optional()
1092
+ name: import_zod9.z.literal("chat_started" /* ChatStarted */),
1093
+ targetAgentId: import_zod9.z.string().optional()
1000
1094
  }),
1001
1095
  chatEnded: integrationEventBase.extend({
1002
- name: import_zod8.z.literal("chat_ended" /* ChatEnded */)
1096
+ name: import_zod9.z.literal("chat_ended" /* ChatEnded */)
1003
1097
  }),
1004
1098
  chatTransferred: integrationEventBase.extend({
1005
- name: import_zod8.z.literal("chat_transferred" /* ChatTransferred */),
1006
- targetGroups: import_zod8.z.array(import_zod8.z.number()).optional(),
1007
- targetAgents: import_zod8.z.array(import_zod8.z.string()).optional()
1099
+ name: import_zod9.z.literal("chat_transferred" /* ChatTransferred */),
1100
+ targetGroups: import_zod9.z.array(import_zod9.z.number()).optional(),
1101
+ targetAgents: import_zod9.z.array(import_zod9.z.string()).optional()
1008
1102
  }),
1009
1103
  chatTagged: integrationEventBase.extend({
1010
- name: import_zod8.z.literal("chat_tagged" /* ChatTagged */),
1011
- tag: import_zod8.z.string().optional(),
1012
- exact: import_zod8.z.boolean().optional()
1104
+ name: import_zod9.z.literal("chat_tagged" /* ChatTagged */),
1105
+ tag: import_zod9.z.string().optional(),
1106
+ exact: import_zod9.z.boolean().optional()
1013
1107
  }),
1014
1108
  chatRated: integrationEventBase.extend({
1015
- name: import_zod8.z.literal("chat_rated" /* ChatRated */),
1016
- rating: import_zod8.z.enum(["good", "bad", "all"]).optional()
1109
+ name: import_zod9.z.literal("chat_rated" /* ChatRated */),
1110
+ rating: import_zod9.z.enum(["good", "bad", "all"]).optional()
1017
1111
  }),
1018
1112
  chatCommented: integrationEventBase.extend({
1019
- name: import_zod8.z.literal("chat_commented" /* ChatCommented */)
1113
+ name: import_zod9.z.literal("chat_commented" /* ChatCommented */)
1020
1114
  }),
1021
- chatMessage: import_zod8.z.discriminatedUnion("version", [
1022
- import_zod8.z.object({
1023
- name: import_zod8.z.literal("chat_message" /* ChatMessage */),
1024
- version: import_zod8.z.undefined(),
1025
- filter: import_zod8.z.string().optional(),
1026
- caseInsensitive: import_zod8.z.boolean().optional()
1115
+ chatMessage: import_zod9.z.discriminatedUnion("version", [
1116
+ import_zod9.z.object({
1117
+ name: import_zod9.z.literal("chat_message" /* ChatMessage */),
1118
+ version: import_zod9.z.undefined(),
1119
+ filter: import_zod9.z.string().optional(),
1120
+ caseInsensitive: import_zod9.z.boolean().optional(),
1121
+ matchWholeWords: import_zod9.z.boolean().optional()
1027
1122
  }),
1028
- import_zod8.z.object({
1029
- name: import_zod8.z.literal("chat_message" /* ChatMessage */),
1030
- version: import_zod8.z.literal("v1"),
1031
- filters: import_zod8.z.array(import_zod8.z.string()),
1032
- caseInsensitive: import_zod8.z.boolean().optional()
1123
+ import_zod9.z.object({
1124
+ name: import_zod9.z.literal("chat_message" /* ChatMessage */),
1125
+ version: import_zod9.z.literal("v1"),
1126
+ filters: import_zod9.z.array(import_zod9.z.string()),
1127
+ caseInsensitive: import_zod9.z.boolean().optional(),
1128
+ matchWholeWords: import_zod9.z.boolean().optional()
1033
1129
  })
1034
1130
  ]),
1035
1131
  userAddedToChat: integrationEventBase.extend({
1036
- name: import_zod8.z.literal("user_added_to_chat" /* UserAddedToChat */),
1037
- userType: import_zod8.z.enum(["agent", "customer"]).optional(),
1038
- targetAgentId: import_zod8.z.string().optional()
1132
+ name: import_zod9.z.literal("user_added_to_chat" /* UserAddedToChat */),
1133
+ userType: import_zod9.z.enum(["agent", "customer"]).optional(),
1134
+ targetAgentId: import_zod9.z.string().optional()
1039
1135
  }),
1040
1136
  userRemovedFromChat: integrationEventBase.extend({
1041
- name: import_zod8.z.literal("user_removed_from_chat" /* UserRemovedFromChat */)
1137
+ name: import_zod9.z.literal("user_removed_from_chat" /* UserRemovedFromChat */)
1042
1138
  }),
1043
1139
  customerLeftChat: integrationEventBase.extend({
1044
- name: import_zod8.z.literal("customer_left_chat" /* CustomerLeftChat */),
1045
- reasons: import_zod8.z.array(import_zod8.z.nativeEnum(CustomerLeftChatReason)).optional()
1140
+ name: import_zod9.z.literal("customer_left_chat" /* CustomerLeftChat */),
1141
+ reasons: import_zod9.z.array(import_zod9.z.nativeEnum(CustomerLeftChatReason)).optional()
1142
+ }),
1143
+ chatIdle: integrationEventBase.extend({
1144
+ name: import_zod9.z.literal("chat_idle" /* ChatIdle */)
1145
+ }),
1146
+ productCardEvent: integrationEventBase.extend({
1147
+ name: import_zod9.z.literal("product_card_event" /* ProductCardEvent */),
1148
+ type: import_zod9.z.nativeEnum(TextLivechatProductCardEventType),
1149
+ product_id: import_zod9.z.string().optional()
1046
1150
  })
1047
1151
  },
1048
1152
  get event() {
1049
- return import_zod8.z.union([
1153
+ return import_zod9.z.union([
1050
1154
  this.events.chatStarted,
1051
1155
  this.events.chatEnded,
1052
1156
  this.events.chatTransferred,
@@ -1056,33 +1160,72 @@ var textLivechatEventsZods = {
1056
1160
  this.events.chatMessage,
1057
1161
  this.events.userAddedToChat,
1058
1162
  this.events.userRemovedFromChat,
1059
- this.events.customerLeftChat
1163
+ this.events.customerLeftChat,
1164
+ this.events.chatIdle,
1165
+ this.events.productCardEvent
1060
1166
  ]);
1061
1167
  },
1062
1168
  get subscribe() {
1063
1169
  return integrationEventsCoreZods.withCore(
1064
- import_zod8.z.object({
1170
+ import_zod9.z.object({
1065
1171
  event: this.event,
1066
- callback: import_zod8.z.string()
1172
+ callback: import_zod9.z.string()
1067
1173
  })
1068
1174
  );
1069
1175
  },
1070
1176
  get subscribeContent() {
1071
- return import_zod8.z.object({
1177
+ return import_zod9.z.object({
1072
1178
  provider: this.provider,
1073
1179
  event: this.event,
1074
- callback: import_zod8.z.string()
1180
+ callback: import_zod9.z.string()
1075
1181
  });
1076
1182
  },
1077
1183
  get unsubscribe() {
1078
1184
  return integrationEventsCoreZods.withCore(
1079
- import_zod8.z.object({
1185
+ import_zod9.z.object({
1080
1186
  event: this.event
1081
1187
  })
1082
1188
  );
1083
1189
  },
1084
1190
  get unsubscribeContent() {
1085
- return import_zod8.z.object({
1191
+ return import_zod9.z.object({
1192
+ provider: this.provider,
1193
+ event: this.event
1194
+ });
1195
+ }
1196
+ };
1197
+
1198
+ // src/apis/text-intelligence/workflows/adapter/integrations/text/_contracts/requests/events/text.ts
1199
+ var import_zod10 = require("zod");
1200
+ var textEventsZods = {
1201
+ provider: import_zod10.z.literal("text" /* Text */),
1202
+ get event() {
1203
+ return textCustomerEventsZods.event;
1204
+ },
1205
+ get subscribe() {
1206
+ return integrationEventsCoreZods.withCore(
1207
+ import_zod10.z.object({
1208
+ event: this.event,
1209
+ callback: import_zod10.z.string()
1210
+ })
1211
+ );
1212
+ },
1213
+ get subscribeContent() {
1214
+ return import_zod10.z.object({
1215
+ provider: this.provider,
1216
+ event: this.event,
1217
+ callback: import_zod10.z.string()
1218
+ });
1219
+ },
1220
+ get unsubscribe() {
1221
+ return integrationEventsCoreZods.withCore(
1222
+ import_zod10.z.object({
1223
+ event: this.event
1224
+ })
1225
+ );
1226
+ },
1227
+ get unsubscribeContent() {
1228
+ return import_zod10.z.object({
1086
1229
  provider: this.provider,
1087
1230
  event: this.event
1088
1231
  });
@@ -1091,7 +1234,8 @@ var textLivechatEventsZods = {
1091
1234
 
1092
1235
  // src/apis/text-intelligence/workflows/adapter/integrations/_contracts/requests/events.ts
1093
1236
  var integrationEventsZods = {
1094
- providerName: import_zod9.z.enum([
1237
+ providerName: import_zod11.z.enum([
1238
+ "text" /* Text */,
1095
1239
  "text-livechat" /* LiveChat */,
1096
1240
  "text-helpdesk" /* HelpDesk */,
1097
1241
  "mailchimp" /* Mailchimp */,
@@ -1101,11 +1245,12 @@ var integrationEventsZods = {
1101
1245
  "bigcommerce" /* BigCommerce */
1102
1246
  ]),
1103
1247
  get event() {
1104
- return textLivechatEventsZods.event.or(textHelpDeskEventsZods.event).or(shopifyEventsZods.event).or(mailchimpEventsZods.event).or(hubspotEventsZods.event).or(bigcommerceEventsZods.event).or(slackEventsZods.event);
1248
+ return textEventsZods.event.or(textLivechatEventsZods.event).or(textHelpDeskEventsZods.event).or(shopifyEventsZods.event).or(mailchimpEventsZods.event).or(hubspotEventsZods.event).or(bigcommerceEventsZods.event).or(slackEventsZods.event);
1105
1249
  },
1106
1250
  get subscribe() {
1107
1251
  return integrationEventsCoreZods.withCore(
1108
- import_zod9.z.discriminatedUnion("provider", [
1252
+ import_zod11.z.discriminatedUnion("provider", [
1253
+ textEventsZods.subscribeContent,
1109
1254
  textLivechatEventsZods.subscribeContent,
1110
1255
  textHelpDeskEventsZods.subscribeContent,
1111
1256
  shopifyEventsZods.subscribeContent,
@@ -1118,7 +1263,8 @@ var integrationEventsZods = {
1118
1263
  },
1119
1264
  get unsubscribe() {
1120
1265
  return integrationEventsCoreZods.withCore(
1121
- import_zod9.z.discriminatedUnion("provider", [
1266
+ import_zod11.z.discriminatedUnion("provider", [
1267
+ textEventsZods.unsubscribeContent,
1122
1268
  textLivechatEventsZods.unsubscribeContent,
1123
1269
  textHelpDeskEventsZods.unsubscribeContent,
1124
1270
  shopifyEventsZods.unsubscribeContent,
@@ -2283,19 +2429,17 @@ var mailchimpApi = {
2283
2429
  },
2284
2430
  getMetadata(_0) {
2285
2431
  return __async(this, arguments, function* ({ token }) {
2286
- const {
2287
- data: { dc: server }
2288
- } = yield import_axios8.default.get(
2289
- "https://login.mailchimp.com/oauth2/metadata",
2290
- {
2291
- headers: {
2292
- "Content-Type": "application/json",
2293
- Authorization: `OAuth ${token}`
2294
- }
2432
+ var _a, _b, _c, _d;
2433
+ const { data } = yield import_axios8.default.get("https://login.mailchimp.com/oauth2/metadata", {
2434
+ headers: {
2435
+ "Content-Type": "application/json",
2436
+ Authorization: `OAuth ${token}`
2295
2437
  }
2296
- );
2438
+ });
2439
+ const email = (_d = (_c = (_a = data.login) == null ? void 0 : _a.email) != null ? _c : (_b = data.login) == null ? void 0 : _b.login_email) != null ? _d : data.accountname;
2297
2440
  return {
2298
- server
2441
+ server: data.dc,
2442
+ email
2299
2443
  };
2300
2444
  });
2301
2445
  }
@@ -3430,7 +3574,8 @@ var salesforceApi = {
3430
3574
  const url = new URL(data.profile);
3431
3575
  const instance_url = url.origin;
3432
3576
  return {
3433
- instance_url
3577
+ instance_url,
3578
+ email: data.email
3434
3579
  };
3435
3580
  });
3436
3581
  }
@@ -4050,12 +4195,13 @@ var textPlatformWorkflowsCredentialsApi = {
4050
4195
  });
4051
4196
  });
4052
4197
  },
4053
- connect(id, code, authorization) {
4198
+ connect(id, code, codeVerifier, authorization) {
4054
4199
  return __async(this, null, function* () {
4055
4200
  return textClientInstance.put(
4056
4201
  urls2.connect(id),
4057
4202
  {
4058
- code
4203
+ code,
4204
+ code_verifier: codeVerifier
4059
4205
  },
4060
4206
  getTextClientConfig(__spreadProps(__spreadValues({}, authorization), {
4061
4207
  ensureAuthorizationToken: true
@@ -4293,7 +4439,7 @@ var OauthCredentialGrantType = /* @__PURE__ */ ((OauthCredentialGrantType2) => {
4293
4439
  })(OauthCredentialGrantType || {});
4294
4440
 
4295
4441
  // src/apis/integrations/text/platform/workflow/workflows/_contracts/dtos/tasks/base.ts
4296
- var WorkflowDefinitionTaskType = {
4442
+ var WorkflowTaskType = {
4297
4443
  http: "HTTP",
4298
4444
  switch: "SWITCH",
4299
4445
  forkJoin: "FORK_JOIN",
@@ -4305,23 +4451,23 @@ var WorkflowDefinitionTaskType = {
4305
4451
  inline: "INLINE",
4306
4452
  transform: "JSON_JQ_TRANSFORM"
4307
4453
  };
4308
- var WorkflowDefinitionCustomTaskName = {
4454
+ var WorkflowCustomTaskName = {
4309
4455
  // SWITCH
4310
- condition: `${WorkflowDefinitionTaskType.switch}_IF`,
4311
- switchCase: `${WorkflowDefinitionTaskType.switch}_CASE`,
4456
+ condition: `${WorkflowTaskType.switch}_IF`,
4457
+ switchCase: `${WorkflowTaskType.switch}_CASE`,
4312
4458
  // SIMPLE
4313
4459
  action: "action",
4314
4460
  awaitAgent: "await",
4315
4461
  notifyAgent: "notify_ai_agent",
4316
4462
  reasoning: "reasoning",
4317
4463
  // DO WHILE
4318
- loop: `${WorkflowDefinitionTaskType.doWhile}_LOOP`,
4319
- forEach: `${WorkflowDefinitionTaskType.doWhile}_FOR_EACH`,
4464
+ loop: `${WorkflowTaskType.doWhile}_LOOP`,
4465
+ forEach: `${WorkflowTaskType.doWhile}_FOR_EACH`,
4320
4466
  // INLINE
4321
- script: `${WorkflowDefinitionTaskType.inline}_SCRIPT`,
4467
+ script: `${WorkflowTaskType.inline}_SCRIPT`,
4322
4468
  // JQ TRANSFORM
4323
- convert: `${WorkflowDefinitionTaskType.transform}_CONVERT`,
4324
- construct: `${WorkflowDefinitionTaskType.transform}_CONSTRUCT`
4469
+ convert: `${WorkflowTaskType.transform}_CONVERT`,
4470
+ construct: `${WorkflowTaskType.transform}_CONSTRUCT`
4325
4471
  };
4326
4472
  var WorkflowExecutionTaskStatus = /* @__PURE__ */ ((WorkflowExecutionTaskStatus2) => {
4327
4473
  WorkflowExecutionTaskStatus2["Completed"] = "COMPLETED";
@@ -4420,6 +4566,9 @@ var WorkflowTriggerType = {
4420
4566
  webhookManual: "webhook_manual"
4421
4567
  };
4422
4568
 
4569
+ // src/apis/integrations/text/platform/workflow/workflows/_contracts/dtos/workflowElement.ts
4570
+ var TRIGGER_REFERENCE_NAME = "trigger";
4571
+
4423
4572
  // src/apis/integrations/text/platform/workflow/workflows/_contracts/dtos/workflowExecution.ts
4424
4573
  var WorkflowExecutionStatus = /* @__PURE__ */ ((WorkflowExecutionStatus2) => {
4425
4574
  WorkflowExecutionStatus2["Succeeded"] = "succeeded";
@@ -4769,6 +4918,42 @@ function initBillingClient(baseUrl, token) {
4769
4918
  }
4770
4919
  }
4771
4920
 
4921
+ // src/apis/platform/cdp/events/_contracts/payloads/events.ts
4922
+ var import_zod12 = require("zod");
4923
+ var CdpCustomerEventType = /* @__PURE__ */ ((CdpCustomerEventType2) => {
4924
+ CdpCustomerEventType2["EmailSet"] = "customer_email_set";
4925
+ CdpCustomerEventType2["PropertiesValuesUpdated"] = "customer_properties_values_updated";
4926
+ return CdpCustomerEventType2;
4927
+ })(CdpCustomerEventType || {});
4928
+ var customerMetadataZod = import_zod12.z.object({
4929
+ organization_id: import_zod12.z.string(),
4930
+ customer_id: import_zod12.z.string(),
4931
+ master_id: import_zod12.z.string()
4932
+ });
4933
+ var cdpCustomerEventMessageZod = import_zod12.z.discriminatedUnion("type", [
4934
+ import_zod12.z.object({
4935
+ id: import_zod12.z.string(),
4936
+ type: import_zod12.z.literal("customer_email_set" /* EmailSet */),
4937
+ data: customerMetadataZod.extend({
4938
+ email: import_zod12.z.string()
4939
+ }).passthrough()
4940
+ }),
4941
+ import_zod12.z.object({
4942
+ id: import_zod12.z.string(),
4943
+ type: import_zod12.z.literal("customer_properties_values_updated" /* PropertiesValuesUpdated */),
4944
+ data: customerMetadataZod.extend({
4945
+ customer_properties: import_zod12.z.record(
4946
+ import_zod12.z.object({
4947
+ value: import_zod12.z.unknown(),
4948
+ last_updated_at: import_zod12.z.string(),
4949
+ last_updated_agent_account_id: import_zod12.z.string().optional(),
4950
+ last_updated_agent_client_id: import_zod12.z.string().optional()
4951
+ }).passthrough()
4952
+ )
4953
+ }).passthrough()
4954
+ })
4955
+ ]);
4956
+
4772
4957
  // src/apis/platform/console/instance.ts
4773
4958
  var import_axios24 = __toESM(require("axios"));
4774
4959
  var REGION = {
@@ -5099,6 +5284,7 @@ var HelpDeskWebhookEventType = /* @__PURE__ */ ((HelpDeskWebhookEventType2) => {
5099
5284
  HelpDeskWebhookEventType2["TicketTagsChanged"] = "tickets.events.tags";
5100
5285
  HelpDeskWebhookEventType2["TicketFollowersChanged"] = "tickets.events.followers";
5101
5286
  HelpDeskWebhookEventType2["TicketAssignmentChanged"] = "tickets.events.assignment";
5287
+ HelpDeskWebhookEventType2["TicketCustomFieldsChanged"] = "tickets.events.customFields";
5102
5288
  HelpDeskWebhookEventType2["TicketMessageAdded"] = "tickets.events.message";
5103
5289
  return HelpDeskWebhookEventType2;
5104
5290
  })(HelpDeskWebhookEventType || {});
@@ -5112,6 +5298,7 @@ var LivechatWebhookActions = /* @__PURE__ */ ((LivechatWebhookActions2) => {
5112
5298
  LivechatWebhookActions2["UserAddedToChat"] = "user_added_to_chat";
5113
5299
  LivechatWebhookActions2["UserRemovedFromChat"] = "user_removed_from_chat";
5114
5300
  LivechatWebhookActions2["IncomingEvent"] = "incoming_event";
5301
+ LivechatWebhookActions2["IncomingRichMessagePostback"] = "incoming_rich_message_postback";
5115
5302
  LivechatWebhookActions2["ThreadTagged"] = "thread_tagged";
5116
5303
  LivechatWebhookActions2["ThreadUntagged"] = "thread_untagged";
5117
5304
  LivechatWebhookActions2["IncomingCustomer"] = "incoming_customer";
@@ -5134,6 +5321,7 @@ var LivechatWebhookSystemMessages = /* @__PURE__ */ ((LivechatWebhookSystemMessa
5134
5321
  LivechatWebhookSystemMessages2["ChatArchivedCustomerManual"] = "manual_archived_customer";
5135
5322
  LivechatWebhookSystemMessages2["ChatArchivedCustomerDisconnected"] = "archived_customer_disconnected";
5136
5323
  LivechatWebhookSystemMessages2["ChatArchivedInactive"] = "routing.archived_inactive";
5324
+ LivechatWebhookSystemMessages2["ChatIdle"] = "routing.idle";
5137
5325
  return LivechatWebhookSystemMessages2;
5138
5326
  })(LivechatWebhookSystemMessages || {});
5139
5327
 
@@ -5215,40 +5403,40 @@ function initLiveChatClient(baseUrl, token) {
5215
5403
  }
5216
5404
 
5217
5405
  // src/apis/text-intelligence/workflows/adapter/admin/events/notifications/_contracts/dtos/notification.ts
5218
- var import_zod10 = require("zod");
5406
+ var import_zod13 = require("zod");
5219
5407
  var integrationNotificationZods = {
5220
- notification: import_zod10.z.object({
5221
- id: import_zod10.z.string(),
5222
- jobId: import_zod10.z.string().nullable(),
5223
- subscription_id: import_zod10.z.string(),
5224
- organization_id: import_zod10.z.string(),
5225
- user_id: import_zod10.z.string().nullable(),
5226
- source: import_zod10.z.string().nullable(),
5227
- sourceKey: import_zod10.z.string().nullable(),
5228
- target: import_zod10.z.string(),
5229
- targetKey: import_zod10.z.string(),
5230
- eventName: import_zod10.z.string(),
5231
- callback: import_zod10.z.string(),
5232
- status: import_zod10.z.string(),
5233
- statusCode: import_zod10.z.number().nullable(),
5234
- attempts: import_zod10.z.number(),
5235
- error: import_zod10.z.string().nullable(),
5236
- enqueuedAt: import_zod10.z.string(),
5237
- completedAt: import_zod10.z.string()
5408
+ notification: import_zod13.z.object({
5409
+ id: import_zod13.z.string(),
5410
+ jobId: import_zod13.z.string().nullable(),
5411
+ subscription_id: import_zod13.z.string(),
5412
+ organization_id: import_zod13.z.string(),
5413
+ user_id: import_zod13.z.string().nullable(),
5414
+ source: import_zod13.z.string().nullable(),
5415
+ sourceKey: import_zod13.z.string().nullable(),
5416
+ target: import_zod13.z.string(),
5417
+ targetKey: import_zod13.z.string(),
5418
+ eventName: import_zod13.z.string(),
5419
+ callback: import_zod13.z.string(),
5420
+ status: import_zod13.z.string(),
5421
+ statusCode: import_zod13.z.number().nullable(),
5422
+ attempts: import_zod13.z.number(),
5423
+ error: import_zod13.z.string().nullable(),
5424
+ enqueuedAt: import_zod13.z.string(),
5425
+ completedAt: import_zod13.z.string()
5238
5426
  })
5239
5427
  };
5240
5428
 
5241
5429
  // src/apis/text-intelligence/workflows/adapter/admin/events/notifications/_contracts/requests/notifications.ts
5242
- var import_zod11 = require("zod");
5430
+ var import_zod14 = require("zod");
5243
5431
  var integrationNotificationRequestZods = {
5244
- getNotifications: import_zod11.z.object({
5245
- target: import_zod11.z.string().optional(),
5246
- status: import_zod11.z.string().optional(),
5247
- eventName: import_zod11.z.string().optional(),
5248
- search: import_zod11.z.string().optional(),
5249
- page: import_zod11.z.number().optional(),
5250
- size: import_zod11.z.number().optional(),
5251
- order_by: import_zod11.z.enum([
5432
+ getNotifications: import_zod14.z.object({
5433
+ target: import_zod14.z.string().optional(),
5434
+ status: import_zod14.z.string().optional(),
5435
+ eventName: import_zod14.z.string().optional(),
5436
+ search: import_zod14.z.string().optional(),
5437
+ page: import_zod14.z.number().optional(),
5438
+ size: import_zod14.z.number().optional(),
5439
+ order_by: import_zod14.z.enum([
5252
5440
  "id",
5253
5441
  "status",
5254
5442
  "target",
@@ -5257,60 +5445,60 @@ var integrationNotificationRequestZods = {
5257
5445
  "organization_id",
5258
5446
  "user_id"
5259
5447
  ]).optional(),
5260
- order: import_zod11.z.enum(["asc", "desc"]).optional()
5448
+ order: import_zod14.z.enum(["asc", "desc"]).optional()
5261
5449
  })
5262
5450
  };
5263
5451
 
5264
5452
  // src/apis/text-intelligence/workflows/adapter/admin/events/subscriptions/_contracts/dtos/subscription.ts
5265
- var import_zod12 = require("zod");
5453
+ var import_zod15 = require("zod");
5266
5454
  var integrationSubscriptionZods = {
5267
- subscription: import_zod12.z.object({
5268
- id: import_zod12.z.string(),
5269
- organization_id: import_zod12.z.string(),
5270
- user_id: import_zod12.z.string(),
5271
- callback: import_zod12.z.string(),
5272
- source: import_zod12.z.string(),
5273
- sourceKey: import_zod12.z.string(),
5274
- target: import_zod12.z.string(),
5275
- targets: import_zod12.z.array(
5276
- import_zod12.z.object({
5277
- id: import_zod12.z.string(),
5278
- target: import_zod12.z.string(),
5279
- targetKey: import_zod12.z.string()
5455
+ subscription: import_zod15.z.object({
5456
+ id: import_zod15.z.string(),
5457
+ organization_id: import_zod15.z.string(),
5458
+ user_id: import_zod15.z.string(),
5459
+ callback: import_zod15.z.string(),
5460
+ source: import_zod15.z.string(),
5461
+ sourceKey: import_zod15.z.string(),
5462
+ target: import_zod15.z.string(),
5463
+ targets: import_zod15.z.array(
5464
+ import_zod15.z.object({
5465
+ id: import_zod15.z.string(),
5466
+ target: import_zod15.z.string(),
5467
+ targetKey: import_zod15.z.string()
5280
5468
  })
5281
5469
  ).optional(),
5282
- event: import_zod12.z.unknown(),
5283
- orphaned_at: import_zod12.z.string().datetime().nullable(),
5284
- orphaned_reason: import_zod12.z.string().nullable(),
5285
- orphaned_last_hit: import_zod12.z.string().datetime().nullable(),
5286
- orphaned_hit_count: import_zod12.z.number()
5470
+ event: import_zod15.z.unknown(),
5471
+ orphaned_at: import_zod15.z.string().datetime().nullable(),
5472
+ orphaned_reason: import_zod15.z.string().nullable(),
5473
+ orphaned_last_hit: import_zod15.z.string().datetime().nullable(),
5474
+ orphaned_hit_count: import_zod15.z.number()
5287
5475
  }),
5288
- stats: import_zod12.z.object({
5289
- totalSubscriptions: import_zod12.z.number(),
5290
- uniqueOrganizations: import_zod12.z.number(),
5291
- uniqueUsers: import_zod12.z.number(),
5292
- byTarget: import_zod12.z.array(import_zod12.z.object({ target: import_zod12.z.string(), count: import_zod12.z.number() })),
5293
- bySource: import_zod12.z.array(import_zod12.z.object({ source: import_zod12.z.string(), count: import_zod12.z.number() })),
5294
- topOrganizations: import_zod12.z.array(
5295
- import_zod12.z.object({ organizationId: import_zod12.z.string(), count: import_zod12.z.number() })
5476
+ stats: import_zod15.z.object({
5477
+ totalSubscriptions: import_zod15.z.number(),
5478
+ uniqueOrganizations: import_zod15.z.number(),
5479
+ uniqueUsers: import_zod15.z.number(),
5480
+ byTarget: import_zod15.z.array(import_zod15.z.object({ target: import_zod15.z.string(), count: import_zod15.z.number() })),
5481
+ bySource: import_zod15.z.array(import_zod15.z.object({ source: import_zod15.z.string(), count: import_zod15.z.number() })),
5482
+ topOrganizations: import_zod15.z.array(
5483
+ import_zod15.z.object({ organizationId: import_zod15.z.string(), count: import_zod15.z.number() })
5296
5484
  ),
5297
- topCallbackDomains: import_zod12.z.array(
5298
- import_zod12.z.object({ domain: import_zod12.z.string(), count: import_zod12.z.number() })
5485
+ topCallbackDomains: import_zod15.z.array(
5486
+ import_zod15.z.object({ domain: import_zod15.z.string(), count: import_zod15.z.number() })
5299
5487
  )
5300
5488
  })
5301
5489
  };
5302
5490
 
5303
5491
  // src/apis/text-intelligence/workflows/adapter/admin/events/subscriptions/_contracts/requests/subscriptions.ts
5304
- var import_zod13 = require("zod");
5492
+ var import_zod16 = require("zod");
5305
5493
  var integrationSubscriptionRequestZods = {
5306
- getSubscriptions: import_zod13.z.object({
5307
- target: import_zod13.z.string().optional(),
5308
- source: import_zod13.z.string().optional(),
5309
- search: import_zod13.z.string().optional(),
5310
- orphaned: import_zod13.z.boolean().optional(),
5311
- page: import_zod13.z.number().optional(),
5312
- size: import_zod13.z.number().optional(),
5313
- order_by: import_zod13.z.enum([
5494
+ getSubscriptions: import_zod16.z.object({
5495
+ target: import_zod16.z.string().optional(),
5496
+ source: import_zod16.z.string().optional(),
5497
+ search: import_zod16.z.string().optional(),
5498
+ orphaned: import_zod16.z.boolean().optional(),
5499
+ page: import_zod16.z.number().optional(),
5500
+ size: import_zod16.z.number().optional(),
5501
+ order_by: import_zod16.z.enum([
5314
5502
  "id",
5315
5503
  "source",
5316
5504
  "target",
@@ -5318,7 +5506,7 @@ var integrationSubscriptionRequestZods = {
5318
5506
  "user_id",
5319
5507
  "orphaned_at"
5320
5508
  ]).optional(),
5321
- order: import_zod13.z.enum(["asc", "desc"]).optional()
5509
+ order: import_zod16.z.enum(["asc", "desc"]).optional()
5322
5510
  })
5323
5511
  };
5324
5512
 
@@ -5791,20 +5979,20 @@ var textPlatformWorkflowsInternalApi = {
5791
5979
 
5792
5980
  // src/apis/integrations/text/platform/workflow/workflows/api.ts
5793
5981
  var enrichWorkflowTrigger = (workflow) => {
5794
- var _a, _b, _c, _d, _e, _f;
5982
+ var _a, _b, _c, _d, _e, _f, _g;
5795
5983
  if (((_a = workflow.trigger) == null ? void 0 : _a.type) === WorkflowTriggerType.webhook) {
5796
- workflow.trigger.name = `${workflow.trigger.webhook.source}-${(_b = workflow.trigger.webhook.event) == null ? void 0 : _b.name}`;
5984
+ workflow.trigger.name = (_c = workflow.trigger.sub_type) != null ? _c : `${workflow.trigger.webhook.source}-${(_b = workflow.trigger.webhook.event) == null ? void 0 : _b.name}`;
5797
5985
  }
5798
- if (((_c = workflow.trigger) == null ? void 0 : _c.type) === WorkflowTriggerType.webhookManual) {
5986
+ if (((_d = workflow.trigger) == null ? void 0 : _d.type) === WorkflowTriggerType.webhookManual) {
5799
5987
  workflow.trigger.name = "webhook_manual";
5800
5988
  }
5801
- if (((_d = workflow.trigger) == null ? void 0 : _d.type) === WorkflowTriggerType.manual) {
5989
+ if (((_e = workflow.trigger) == null ? void 0 : _e.type) === WorkflowTriggerType.manual) {
5802
5990
  workflow.trigger.name = "manual";
5803
5991
  }
5804
- if (((_e = workflow.trigger) == null ? void 0 : _e.type) === WorkflowTriggerType.agent) {
5992
+ if (((_f = workflow.trigger) == null ? void 0 : _f.type) === WorkflowTriggerType.agent) {
5805
5993
  workflow.trigger.name = "ai_agent";
5806
5994
  }
5807
- if (((_f = workflow.trigger) == null ? void 0 : _f.type) === WorkflowTriggerType.recurring) {
5995
+ if (((_g = workflow.trigger) == null ? void 0 : _g.type) === WorkflowTriggerType.recurring) {
5808
5996
  workflow.trigger.name = "scheduled";
5809
5997
  }
5810
5998
  return workflow;
@@ -6019,11 +6207,87 @@ var textPlatformApi = {
6019
6207
  workflow: textPlatformWorkflowApi
6020
6208
  };
6021
6209
 
6210
+ // src/apis/integrations/text/resourcer/api.ts
6211
+ var buildResourcePath = ({ provider, domain, name }) => {
6212
+ let targetProvider = provider;
6213
+ if (["text-livechat" /* LiveChat */, "text-helpdesk" /* HelpDesk */].includes(
6214
+ provider
6215
+ )) {
6216
+ targetProvider = "text" /* Text */;
6217
+ }
6218
+ return [targetProvider, domain, name].filter(notEmpty).join("/");
6219
+ };
6220
+ var urls7 = {
6221
+ listSchema: () => "/workflow_resources/schema",
6222
+ getSchema: (provider) => `/workflow_resources/schema/${provider}`,
6223
+ getResource: (resource) => `/workflow_resources/resources/${buildResourcePath(resource)}`
6224
+ };
6225
+ var textResourcerApi = {
6226
+ getResource(resource, credentialId, authorization) {
6227
+ return __async(this, null, function* () {
6228
+ const config = getTextClientConfig(__spreadProps(__spreadValues({}, authorization), {
6229
+ ensureAuthorizationToken: true
6230
+ }));
6231
+ return textClientInstance.get(urls7.getResource(resource), __spreadProps(__spreadValues({}, config), {
6232
+ headers: __spreadProps(__spreadValues({}, config.headers), {
6233
+ "X-Credential-ID": credentialId
6234
+ })
6235
+ })).catch((error) => {
6236
+ if (error instanceof TextApiError) {
6237
+ throw error.withCustomMessage(
6238
+ `Couldn't get resourcer resource. [${error.message}]`
6239
+ );
6240
+ }
6241
+ throw error;
6242
+ });
6243
+ });
6244
+ },
6245
+ listSchema(credentialId, authorization) {
6246
+ return __async(this, null, function* () {
6247
+ const config = getTextClientConfig(__spreadProps(__spreadValues({}, authorization), {
6248
+ ensureAuthorizationToken: true
6249
+ }));
6250
+ return textClientInstance.get(urls7.listSchema(), __spreadProps(__spreadValues({}, config), {
6251
+ headers: __spreadProps(__spreadValues({}, config.headers), {
6252
+ "X-Credential-ID": credentialId
6253
+ })
6254
+ })).catch((error) => {
6255
+ if (error instanceof TextApiError) {
6256
+ throw error.withCustomMessage(
6257
+ `Couldn't list resourcer schema. [${error.message}]`
6258
+ );
6259
+ }
6260
+ throw error;
6261
+ });
6262
+ });
6263
+ },
6264
+ getSchema(provider, credentialId, authorization) {
6265
+ return __async(this, null, function* () {
6266
+ const config = getTextClientConfig(__spreadProps(__spreadValues({}, authorization), {
6267
+ ensureAuthorizationToken: true
6268
+ }));
6269
+ return textClientInstance.get(urls7.getSchema(provider), __spreadProps(__spreadValues({}, config), {
6270
+ headers: __spreadProps(__spreadValues({}, config.headers), {
6271
+ "X-Credential-ID": credentialId
6272
+ })
6273
+ })).catch((error) => {
6274
+ if (error instanceof TextApiError) {
6275
+ throw error.withCustomMessage(
6276
+ `Couldn't get resourcer schema. [${error.message}]`
6277
+ );
6278
+ }
6279
+ throw error;
6280
+ });
6281
+ });
6282
+ }
6283
+ };
6284
+
6022
6285
  // src/apis/integrations/text/api.ts
6023
6286
  var textApi = {
6024
6287
  platform: textPlatformApi,
6025
6288
  ai: textAiAgentApi,
6026
- externalAccountManager: textExternalAccountManagerApi
6289
+ externalAccountManager: textExternalAccountManagerApi,
6290
+ resourcer: textResourcerApi
6027
6291
  };
6028
6292
 
6029
6293
  // src/apis/integrations/vercel/api.ts
@@ -6324,7 +6588,7 @@ var integrationsApi = {
6324
6588
  };
6325
6589
 
6326
6590
  // src/apis/platform/accounts/accounts/api.ts
6327
- var urls7 = (withBaseUrl = false) => {
6591
+ var urls8 = (withBaseUrl = false) => {
6328
6592
  const getUrl7 = (segments = []) => buildUrlFromSegments(
6329
6593
  segments,
6330
6594
  "/v2/accounts",
@@ -6340,7 +6604,7 @@ var api2 = {
6340
6604
  getAccounts(authorization) {
6341
6605
  return __async(this, null, function* () {
6342
6606
  return platformAccountsClientInstance.get(
6343
- urls7().getAccounts(),
6607
+ urls8().getAccounts(),
6344
6608
  {
6345
6609
  authorization,
6346
6610
  customErrorMessage: "Accounts couldn't be fetched."
@@ -6351,7 +6615,7 @@ var api2 = {
6351
6615
  getAccount(accountId, authorization) {
6352
6616
  return __async(this, null, function* () {
6353
6617
  return platformAccountsClientInstance.get(
6354
- urls7().getAccount(accountId),
6618
+ urls8().getAccount(accountId),
6355
6619
  {
6356
6620
  authorization,
6357
6621
  customErrorMessage: "Account couldn't be fetched."
@@ -6373,7 +6637,7 @@ var api2 = {
6373
6637
  };
6374
6638
  var platformAccountsAccountApi = __spreadProps(__spreadValues({}, api2), {
6375
6639
  meta: {
6376
- urls: urls7
6640
+ urls: urls8
6377
6641
  }
6378
6642
  });
6379
6643
 
@@ -6539,18 +6803,18 @@ var platformAccountsPersonalAccessTokenApi = {
6539
6803
 
6540
6804
  // src/apis/platform/accounts/products/api.ts
6541
6805
  var getUrl6 = (segments = []) => buildUrlFromSegments(segments, "/v2/organizations");
6542
- var urls8 = {
6806
+ var urls9 = {
6543
6807
  getOrganizationProducts: () => getUrl6(["my", "products"]),
6544
6808
  updateOrganizationProducts: () => getUrl6(["my", "products"])
6545
6809
  };
6546
6810
  var platformAccountsProductsApi = {
6547
6811
  meta: {
6548
- urls: urls8
6812
+ urls: urls9
6549
6813
  },
6550
6814
  getOrganizationProducts(authorization) {
6551
6815
  return __async(this, null, function* () {
6552
6816
  return platformAccountsClientInstance.get(
6553
- urls8.getOrganizationProducts(),
6817
+ urls9.getOrganizationProducts(),
6554
6818
  { authorization, customErrorMessage: "Products couldn't be fetched." }
6555
6819
  );
6556
6820
  });
@@ -6558,7 +6822,7 @@ var platformAccountsProductsApi = {
6558
6822
  updateOrganizationProducts(payload, authorization) {
6559
6823
  return __async(this, null, function* () {
6560
6824
  return platformAccountsClientInstance.post(
6561
- urls8.updateOrganizationProducts(),
6825
+ urls9.updateOrganizationProducts(),
6562
6826
  payload,
6563
6827
  { authorization, customErrorMessage: "Products couldn't be updated." }
6564
6828
  );
@@ -7988,7 +8252,7 @@ var platformDpsApplicationStatsApi = {
7988
8252
  var platformDpsApplicationWebhooksApi = {
7989
8253
  updateAppWebhooks(appId, payload, authorization) {
7990
8254
  return __async(this, null, function* () {
7991
- yield dpsClientInstance.put(
8255
+ return dpsClientInstance.put(
7992
8256
  `/v2/applications/${encodeURIComponent(appId)}/webhook`,
7993
8257
  payload,
7994
8258
  getDpsClientConfig(authorization)
@@ -9188,7 +9452,7 @@ var livechatWebhookApi = {
9188
9452
  registerWebhook(webhook, authorization) {
9189
9453
  return __async(this, null, function* () {
9190
9454
  yield livechatClientInstance.post(
9191
- `/v${webhook.api_version || "3.5"}/configuration/action/register_webhook`,
9455
+ `/v${webhook.api_version || "3.6"}/configuration/action/register_webhook`,
9192
9456
  {
9193
9457
  url: webhook.url,
9194
9458
  action: webhook.action,
@@ -9214,7 +9478,7 @@ var livechatWebhookApi = {
9214
9478
  yield Promise.all(
9215
9479
  webhooks.map((webhook) => __async(this, null, function* () {
9216
9480
  return livechatClientInstance.post(
9217
- `/v${webhook.api_version || "3.5"}/configuration/action/register_webhook`,
9481
+ `/v${webhook.api_version || "3.6"}/configuration/action/register_webhook`,
9218
9482
  {
9219
9483
  url: webhook.url,
9220
9484
  action: webhook.action,
@@ -9584,6 +9848,7 @@ function initApi(config, tokens) {
9584
9848
  BigCommerceApiError,
9585
9849
  BigCommerceEventNames,
9586
9850
  BigCommerceWebhookScopes,
9851
+ CdpCustomerEventType,
9587
9852
  ConsoleApiError,
9588
9853
  CredentialStatus,
9589
9854
  CredentialType,
@@ -9620,9 +9885,12 @@ function initApi(config, tokens) {
9620
9885
  SlackMessageEventSubTypes,
9621
9886
  SortBy,
9622
9887
  SortOrder,
9888
+ TRIGGER_REFERENCE_NAME,
9623
9889
  TextApiError,
9890
+ TextCustomerEventNames,
9624
9891
  TextHelpDeskEventNames,
9625
9892
  TextLivechatEventNames,
9893
+ TextLivechatProductCardEventType,
9626
9894
  TicketPriority,
9627
9895
  TicketStatus,
9628
9896
  UnauthorizeAccountsApiError,
@@ -9632,12 +9900,12 @@ function initApi(config, tokens) {
9632
9900
  WorkflowConditionTaskOperator,
9633
9901
  WorkflowConditionTaskOperatorGroup,
9634
9902
  WorkflowConditionTaskOperatorValueType,
9635
- WorkflowDefinitionCustomTaskName,
9636
- WorkflowDefinitionTaskType,
9903
+ WorkflowCustomTaskName,
9637
9904
  WorkflowExecutionDefinitionStatus,
9638
9905
  WorkflowExecutionStatus,
9639
9906
  WorkflowExecutionTaskStatus,
9640
9907
  WorkflowItemKind,
9908
+ WorkflowTaskType,
9641
9909
  WorkflowTemplateCategory,
9642
9910
  WorkflowTriggerType,
9643
9911
  WorkflowsApiError,
@@ -9653,6 +9921,7 @@ function initApi(config, tokens) {
9653
9921
  bigcommerceEventsZods,
9654
9922
  billingClientInstance,
9655
9923
  buildUrlFromSegments,
9924
+ cdpCustomerEventMessageZod,
9656
9925
  consoleClientInstance,
9657
9926
  dpsClientInstance,
9658
9927
  extractTokenFromAuthorizationHeader,
@@ -9742,6 +10011,8 @@ function initApi(config, tokens) {
9742
10011
  slackClientInstance,
9743
10012
  slackEventsZods,
9744
10013
  textClientInstance,
10014
+ textCustomerEventsZods,
10015
+ textEventsZods,
9745
10016
  textHelpDeskEventsZods,
9746
10017
  textLivechatEventsZods,
9747
10018
  updateAdapterClient,