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

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,8 +149,10 @@ __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,
155
+ enrichWorkflowTrigger: () => enrichWorkflowTrigger,
150
156
  extractTokenFromAuthorizationHeader: () => extractTokenFromAuthorizationHeader,
151
157
  getAdapterClientConfig: () => getAdapterClientConfig,
152
158
  getAdapterClientDefaultConfig: () => getAdapterClientDefaultConfig,
@@ -220,6 +226,7 @@ __export(src_exports, {
220
226
  integrationSubscriptionZods: () => integrationSubscriptionZods,
221
227
  isFilter: () => isFilter,
222
228
  isFilterGroup: () => isFilterGroup,
229
+ isWorkflowBaseHttpTaskCore: () => isWorkflowBaseHttpTaskCore,
223
230
  livechatClientInstance: () => livechatClientInstance,
224
231
  mailchimpClientInstance: () => mailchimpClientInstance,
225
232
  mailchimpEventsZods: () => mailchimpEventsZods,
@@ -234,6 +241,8 @@ __export(src_exports, {
234
241
  slackClientInstance: () => slackClientInstance,
235
242
  slackEventsZods: () => slackEventsZods,
236
243
  textClientInstance: () => textClientInstance,
244
+ textCustomerEventsZods: () => textCustomerEventsZods,
245
+ textEventsZods: () => textEventsZods,
237
246
  textHelpDeskEventsZods: () => textHelpDeskEventsZods,
238
247
  textLivechatEventsZods: () => textLivechatEventsZods,
239
248
  updateAdapterClient: () => updateAdapterClient,
@@ -386,6 +395,11 @@ var extractTokenFromAuthorizationHeader = (headerValue) => {
386
395
  // src/utils/integrations/getIntegrationFlowUrl.ts
387
396
  var import_uuid = require("uuid");
388
397
 
398
+ // ../../../private/utils/src/arrays/notEmpty.ts
399
+ function notEmpty(item) {
400
+ return Boolean(item);
401
+ }
402
+
389
403
  // ../../../private/utils/src/misc/merge-deep.ts
390
404
  function isObject(item) {
391
405
  return item !== null && typeof item === "object" && !Array.isArray(item);
@@ -468,6 +482,7 @@ var IntegrationNames = /* @__PURE__ */ ((IntegrationNames2) => {
468
482
  IntegrationNames2["HelpDesk"] = "text-helpdesk";
469
483
  IntegrationNames2["Slack"] = "slack";
470
484
  IntegrationNames2["Salesforce"] = "salesforce";
485
+ IntegrationNames2["Klaviyo"] = "klaviyo";
471
486
  return IntegrationNames2;
472
487
  })(IntegrationNames || {});
473
488
  var IntegrationDisplayNames = /* @__PURE__ */ ((IntegrationDisplayNames2) => {
@@ -487,6 +502,7 @@ var IntegrationDisplayNames = /* @__PURE__ */ ((IntegrationDisplayNames2) => {
487
502
  IntegrationDisplayNames2["HelpDesk"] = "HelpDesk";
488
503
  IntegrationDisplayNames2["Slack"] = "Slack";
489
504
  IntegrationDisplayNames2["Salesforce"] = "Salesforce";
505
+ IntegrationDisplayNames2["Klaviyo"] = "Klaviyo";
490
506
  return IntegrationDisplayNames2;
491
507
  })(IntegrationDisplayNames || {});
492
508
  var IntegrationDisplayNameToNameMap = Object.keys(IntegrationNames).reduce(
@@ -505,7 +521,7 @@ var IntegrationNameToDisplayMap = Object.keys(IntegrationNames).reduce(
505
521
  );
506
522
 
507
523
  // src/apis/text-intelligence/workflows/adapter/integrations/_contracts/requests/events.ts
508
- var import_zod9 = require("zod");
524
+ var import_zod11 = require("zod");
509
525
 
510
526
  // src/apis/text-intelligence/workflows/adapter/integrations/bigcommerce/_contracts/requests/events.ts
511
527
  var import_zod2 = require("zod");
@@ -842,8 +858,57 @@ var slackEventsZods = {
842
858
  }
843
859
  };
844
860
 
845
- // src/apis/text-intelligence/workflows/adapter/integrations/text/_contracts/requests/events/helpdesk.ts
861
+ // src/apis/text-intelligence/workflows/adapter/integrations/text/_contracts/requests/events/domains/customer.ts
846
862
  var import_zod7 = require("zod");
863
+ var TextCustomerEventNames = /* @__PURE__ */ ((TextCustomerEventNames2) => {
864
+ TextCustomerEventNames2["EmailSet"] = "customer_email_set";
865
+ TextCustomerEventNames2["PropertiesValuesUpdated"] = "customer_properties_values_updated";
866
+ return TextCustomerEventNames2;
867
+ })(TextCustomerEventNames || {});
868
+ var textCustomerEventsZods = {
869
+ eventName: import_zod7.z.nativeEnum(TextCustomerEventNames),
870
+ events: {
871
+ emailSet: integrationEventBase.extend({
872
+ name: import_zod7.z.literal("customer_email_set" /* EmailSet */),
873
+ filters: import_zod7.z.array(import_zod7.z.string().min(1)).min(1).optional()
874
+ }),
875
+ propertiesValuesUpdated: integrationEventBase.extend({
876
+ name: import_zod7.z.literal("customer_properties_values_updated" /* PropertiesValuesUpdated */),
877
+ properties: import_zod7.z.array(
878
+ import_zod7.z.object({
879
+ id: import_zod7.z.string().min(1),
880
+ to: import_zod7.z.union([import_zod7.z.string(), import_zod7.z.number(), import_zod7.z.boolean()]).optional()
881
+ })
882
+ ).optional()
883
+ })
884
+ },
885
+ get event() {
886
+ return import_zod7.z.discriminatedUnion("name", [
887
+ this.events.emailSet,
888
+ this.events.propertiesValuesUpdated
889
+ ]);
890
+ },
891
+ get subscribe() {
892
+ return integrationEventsCoreZods.withCore(
893
+ import_zod7.z.object({
894
+ event: this.event,
895
+ callback: import_zod7.z.string()
896
+ })
897
+ );
898
+ },
899
+ get unsubscribe() {
900
+ return integrationEventsCoreZods.withCore(
901
+ import_zod7.z.object({
902
+ event: import_zod7.z.object({
903
+ name: this.eventName
904
+ })
905
+ })
906
+ );
907
+ }
908
+ };
909
+
910
+ // src/apis/text-intelligence/workflows/adapter/integrations/text/_contracts/requests/events/helpdesk.ts
911
+ var import_zod8 = require("zod");
847
912
 
848
913
  // src/apis/products/helpdesk/_contracts/dtos/ticket.ts
849
914
  var TicketStatus = /* @__PURE__ */ ((TicketStatus2) => {
@@ -871,64 +936,87 @@ var TextHelpDeskEventNames = /* @__PURE__ */ ((TextHelpDeskEventNames2) => {
871
936
  TextHelpDeskEventNames2["TicketTagsChanged"] = "ticket_tags_added";
872
937
  TextHelpDeskEventNames2["TicketFollowersChanged"] = "ticket_followers_added";
873
938
  TextHelpDeskEventNames2["TicketAssignmentChanged"] = "ticket_assignment_added";
939
+ TextHelpDeskEventNames2["TicketCustomFieldsChanged"] = "ticket_custom_fields_changed";
874
940
  TextHelpDeskEventNames2["TicketMessageAdded"] = "ticket_message_added";
875
941
  return TextHelpDeskEventNames2;
876
942
  })(TextHelpDeskEventNames || {});
877
- var assignmentZod = import_zod7.z.object({
878
- agent: import_zod7.z.string().optional(),
879
- team: import_zod7.z.string().optional()
943
+ var assignmentZod = import_zod8.z.object({
944
+ agent: import_zod8.z.string().optional(),
945
+ team: import_zod8.z.string().optional()
880
946
  });
881
- var baseFiltersZod = import_zod7.z.object({
947
+ var baseFiltersZod = import_zod8.z.object({
882
948
  assignment: assignmentZod.optional(),
883
- mailbox: import_zod7.z.string().optional()
949
+ mailbox: import_zod8.z.string().optional()
884
950
  });
885
951
  var textHelpDeskEventsZods = {
886
- provider: import_zod7.z.literal("text-helpdesk" /* HelpDesk */),
887
- eventName: import_zod7.z.nativeEnum(TextHelpDeskEventNames),
952
+ provider: import_zod8.z.literal("text-helpdesk" /* HelpDesk */),
953
+ eventName: import_zod8.z.nativeEnum(TextHelpDeskEventNames),
888
954
  events: {
889
955
  ticketCreated: integrationEventBase.extend({
890
- name: import_zod7.z.literal("ticket_created" /* TicketCreated */)
956
+ name: import_zod8.z.literal("ticket_created" /* TicketCreated */)
891
957
  }).extend(baseFiltersZod.shape),
892
958
  ticketUpdated: integrationEventBase.extend({
893
- name: import_zod7.z.literal("ticket_updated" /* TicketUpdated */)
959
+ name: import_zod8.z.literal("ticket_updated" /* TicketUpdated */)
894
960
  }).extend(baseFiltersZod.shape),
895
961
  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()
962
+ name: import_zod8.z.literal("ticket_status_changed" /* TicketStatusChanged */),
963
+ status: import_zod8.z.object({
964
+ from: import_zod8.z.array(import_zod8.z.nativeEnum(TicketStatus)).optional(),
965
+ to: import_zod8.z.array(import_zod8.z.nativeEnum(TicketStatus)).optional()
900
966
  }).optional()
901
967
  }).extend(baseFiltersZod.shape),
902
968
  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()
969
+ name: import_zod8.z.literal("ticket_priority_changed" /* TicketPriorityChanged */),
970
+ priority: import_zod8.z.object({
971
+ from: import_zod8.z.array(import_zod8.z.nativeEnum(TicketPriority)).optional(),
972
+ to: import_zod8.z.array(import_zod8.z.nativeEnum(TicketPriority)).optional()
907
973
  }).optional()
908
974
  }).extend(baseFiltersZod.shape),
909
975
  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()
976
+ name: import_zod8.z.literal("ticket_tags_added" /* TicketTagsChanged */),
977
+ tags: import_zod8.z.object({
978
+ from: import_zod8.z.array(import_zod8.z.string()).optional(),
979
+ to: import_zod8.z.array(import_zod8.z.string()).optional()
914
980
  }).optional()
915
981
  }).extend(baseFiltersZod.shape),
916
982
  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()
983
+ name: import_zod8.z.literal("ticket_followers_added" /* TicketFollowersChanged */),
984
+ from: import_zod8.z.array(import_zod8.z.string()).optional(),
985
+ to: import_zod8.z.array(import_zod8.z.string()).optional()
920
986
  }).extend(baseFiltersZod.shape),
921
987
  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()
988
+ name: import_zod8.z.literal("ticket_assignment_added" /* TicketAssignmentChanged */),
989
+ from: import_zod8.z.array(assignmentZod).optional(),
990
+ to: import_zod8.z.array(assignmentZod).optional()
991
+ }).extend(baseFiltersZod.shape),
992
+ ticketCustomFieldsChanged: integrationEventBase.extend({
993
+ name: import_zod8.z.literal("ticket_custom_fields_changed" /* TicketCustomFieldsChanged */),
994
+ customFields: import_zod8.z.array(
995
+ import_zod8.z.object({
996
+ id: import_zod8.z.string().min(1),
997
+ from: import_zod8.z.string().min(1).optional(),
998
+ to: import_zod8.z.string().min(1).optional()
999
+ })
1000
+ ).optional()
925
1001
  }).extend(baseFiltersZod.shape),
926
- ticketMessageAdded: integrationEventBase.extend({
927
- name: import_zod7.z.literal("ticket_message_added" /* TicketMessageAdded */)
928
- }).extend(baseFiltersZod.shape)
1002
+ ticketMessageAdded: import_zod8.z.discriminatedUnion("version", [
1003
+ import_zod8.z.object({
1004
+ name: import_zod8.z.literal("ticket_message_added" /* TicketMessageAdded */),
1005
+ version: import_zod8.z.undefined()
1006
+ }).extend(baseFiltersZod.shape),
1007
+ import_zod8.z.object({
1008
+ name: import_zod8.z.literal("ticket_message_added" /* TicketMessageAdded */),
1009
+ version: import_zod8.z.literal("v1"),
1010
+ from: import_zod8.z.enum(["anyone", "agent", "requester"]).optional(),
1011
+ privacy: import_zod8.z.enum(["any", "public", "private"]).optional(),
1012
+ filters: import_zod8.z.array(import_zod8.z.string()).optional(),
1013
+ caseInsensitive: import_zod8.z.boolean().optional(),
1014
+ matchWholeWords: import_zod8.z.boolean().optional()
1015
+ }).extend(baseFiltersZod.shape)
1016
+ ])
929
1017
  },
930
1018
  get event() {
931
- return import_zod7.z.discriminatedUnion("name", [
1019
+ return import_zod8.z.union([
932
1020
  this.events.ticketCreated,
933
1021
  this.events.ticketUpdated,
934
1022
  this.events.ticketStatusChanged,
@@ -936,33 +1024,34 @@ var textHelpDeskEventsZods = {
936
1024
  this.events.ticketTagsChanged,
937
1025
  this.events.ticketFollowersChanged,
938
1026
  this.events.ticketAssignmentChanged,
939
- this.events.ticketMessageAdded
1027
+ this.events.ticketMessageAdded,
1028
+ this.events.ticketCustomFieldsChanged
940
1029
  ]);
941
1030
  },
942
1031
  get subscribe() {
943
1032
  return integrationEventsCoreZods.withCore(
944
- import_zod7.z.object({
1033
+ import_zod8.z.object({
945
1034
  event: this.event,
946
- callback: import_zod7.z.string()
1035
+ callback: import_zod8.z.string()
947
1036
  })
948
1037
  );
949
1038
  },
950
1039
  get subscribeContent() {
951
- return import_zod7.z.object({
1040
+ return import_zod8.z.object({
952
1041
  provider: this.provider,
953
1042
  event: this.event,
954
- callback: import_zod7.z.string()
1043
+ callback: import_zod8.z.string()
955
1044
  });
956
1045
  },
957
1046
  get unsubscribe() {
958
1047
  return integrationEventsCoreZods.withCore(
959
- import_zod7.z.object({
1048
+ import_zod8.z.object({
960
1049
  event: this.event
961
1050
  })
962
1051
  );
963
1052
  },
964
1053
  get unsubscribeContent() {
965
- return import_zod7.z.object({
1054
+ return import_zod8.z.object({
966
1055
  provider: this.provider,
967
1056
  event: this.event
968
1057
  });
@@ -970,7 +1059,7 @@ var textHelpDeskEventsZods = {
970
1059
  };
971
1060
 
972
1061
  // src/apis/text-intelligence/workflows/adapter/integrations/text/_contracts/requests/events/livechat.ts
973
- var import_zod8 = require("zod");
1062
+ var import_zod9 = require("zod");
974
1063
  var TextLivechatEventNames = /* @__PURE__ */ ((TextLivechatEventNames2) => {
975
1064
  TextLivechatEventNames2["ChatStarted"] = "chat_started";
976
1065
  TextLivechatEventNames2["ChatEnded"] = "chat_ended";
@@ -982,6 +1071,8 @@ var TextLivechatEventNames = /* @__PURE__ */ ((TextLivechatEventNames2) => {
982
1071
  TextLivechatEventNames2["UserAddedToChat"] = "user_added_to_chat";
983
1072
  TextLivechatEventNames2["UserRemovedFromChat"] = "user_removed_from_chat";
984
1073
  TextLivechatEventNames2["CustomerLeftChat"] = "customer_left_chat";
1074
+ TextLivechatEventNames2["ChatIdle"] = "chat_idle";
1075
+ TextLivechatEventNames2["ProductCardEvent"] = "product_card_event";
985
1076
  return TextLivechatEventNames2;
986
1077
  })(TextLivechatEventNames || {});
987
1078
  var CustomerLeftChatReason = /* @__PURE__ */ ((CustomerLeftChatReason2) => {
@@ -990,63 +1081,78 @@ var CustomerLeftChatReason = /* @__PURE__ */ ((CustomerLeftChatReason2) => {
990
1081
  CustomerLeftChatReason2["Inactive"] = "inactive";
991
1082
  return CustomerLeftChatReason2;
992
1083
  })(CustomerLeftChatReason || {});
1084
+ var TextLivechatProductCardEventType = /* @__PURE__ */ ((TextLivechatProductCardEventType2) => {
1085
+ TextLivechatProductCardEventType2["ViewProduct"] = "view_product";
1086
+ TextLivechatProductCardEventType2["AddToCart"] = "add_to_cart";
1087
+ return TextLivechatProductCardEventType2;
1088
+ })(TextLivechatProductCardEventType || {});
993
1089
  var textLivechatEventsZods = {
994
- provider: import_zod8.z.literal("text-livechat" /* LiveChat */),
995
- eventName: import_zod8.z.nativeEnum(TextLivechatEventNames),
1090
+ provider: import_zod9.z.literal("text-livechat" /* LiveChat */),
1091
+ eventName: import_zod9.z.nativeEnum(TextLivechatEventNames),
996
1092
  events: {
997
1093
  chatStarted: integrationEventBase.extend({
998
- name: import_zod8.z.literal("chat_started" /* ChatStarted */),
999
- targetAgentId: import_zod8.z.string().optional()
1094
+ name: import_zod9.z.literal("chat_started" /* ChatStarted */),
1095
+ targetAgentId: import_zod9.z.string().optional()
1000
1096
  }),
1001
1097
  chatEnded: integrationEventBase.extend({
1002
- name: import_zod8.z.literal("chat_ended" /* ChatEnded */)
1098
+ name: import_zod9.z.literal("chat_ended" /* ChatEnded */)
1003
1099
  }),
1004
1100
  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()
1101
+ name: import_zod9.z.literal("chat_transferred" /* ChatTransferred */),
1102
+ targetGroups: import_zod9.z.array(import_zod9.z.number()).optional(),
1103
+ targetAgents: import_zod9.z.array(import_zod9.z.string()).optional()
1008
1104
  }),
1009
1105
  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()
1106
+ name: import_zod9.z.literal("chat_tagged" /* ChatTagged */),
1107
+ tag: import_zod9.z.string().optional(),
1108
+ exact: import_zod9.z.boolean().optional()
1013
1109
  }),
1014
1110
  chatRated: integrationEventBase.extend({
1015
- name: import_zod8.z.literal("chat_rated" /* ChatRated */),
1016
- rating: import_zod8.z.enum(["good", "bad", "all"]).optional()
1111
+ name: import_zod9.z.literal("chat_rated" /* ChatRated */),
1112
+ rating: import_zod9.z.enum(["good", "bad", "all"]).optional()
1017
1113
  }),
1018
1114
  chatCommented: integrationEventBase.extend({
1019
- name: import_zod8.z.literal("chat_commented" /* ChatCommented */)
1115
+ name: import_zod9.z.literal("chat_commented" /* ChatCommented */)
1020
1116
  }),
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()
1117
+ chatMessage: import_zod9.z.discriminatedUnion("version", [
1118
+ import_zod9.z.object({
1119
+ name: import_zod9.z.literal("chat_message" /* ChatMessage */),
1120
+ version: import_zod9.z.undefined(),
1121
+ filter: import_zod9.z.string().optional(),
1122
+ caseInsensitive: import_zod9.z.boolean().optional(),
1123
+ matchWholeWords: import_zod9.z.boolean().optional()
1027
1124
  }),
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()
1125
+ import_zod9.z.object({
1126
+ name: import_zod9.z.literal("chat_message" /* ChatMessage */),
1127
+ version: import_zod9.z.literal("v1"),
1128
+ filters: import_zod9.z.array(import_zod9.z.string()),
1129
+ caseInsensitive: import_zod9.z.boolean().optional(),
1130
+ matchWholeWords: import_zod9.z.boolean().optional()
1033
1131
  })
1034
1132
  ]),
1035
1133
  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()
1134
+ name: import_zod9.z.literal("user_added_to_chat" /* UserAddedToChat */),
1135
+ userType: import_zod9.z.enum(["agent", "customer"]).optional(),
1136
+ targetAgentId: import_zod9.z.string().optional()
1039
1137
  }),
1040
1138
  userRemovedFromChat: integrationEventBase.extend({
1041
- name: import_zod8.z.literal("user_removed_from_chat" /* UserRemovedFromChat */)
1139
+ name: import_zod9.z.literal("user_removed_from_chat" /* UserRemovedFromChat */)
1042
1140
  }),
1043
1141
  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()
1142
+ name: import_zod9.z.literal("customer_left_chat" /* CustomerLeftChat */),
1143
+ reasons: import_zod9.z.array(import_zod9.z.nativeEnum(CustomerLeftChatReason)).optional()
1144
+ }),
1145
+ chatIdle: integrationEventBase.extend({
1146
+ name: import_zod9.z.literal("chat_idle" /* ChatIdle */)
1147
+ }),
1148
+ productCardEvent: integrationEventBase.extend({
1149
+ name: import_zod9.z.literal("product_card_event" /* ProductCardEvent */),
1150
+ type: import_zod9.z.nativeEnum(TextLivechatProductCardEventType),
1151
+ product_id: import_zod9.z.string().optional()
1046
1152
  })
1047
1153
  },
1048
1154
  get event() {
1049
- return import_zod8.z.union([
1155
+ return import_zod9.z.union([
1050
1156
  this.events.chatStarted,
1051
1157
  this.events.chatEnded,
1052
1158
  this.events.chatTransferred,
@@ -1056,33 +1162,72 @@ var textLivechatEventsZods = {
1056
1162
  this.events.chatMessage,
1057
1163
  this.events.userAddedToChat,
1058
1164
  this.events.userRemovedFromChat,
1059
- this.events.customerLeftChat
1165
+ this.events.customerLeftChat,
1166
+ this.events.chatIdle,
1167
+ this.events.productCardEvent
1060
1168
  ]);
1061
1169
  },
1062
1170
  get subscribe() {
1063
1171
  return integrationEventsCoreZods.withCore(
1064
- import_zod8.z.object({
1172
+ import_zod9.z.object({
1065
1173
  event: this.event,
1066
- callback: import_zod8.z.string()
1174
+ callback: import_zod9.z.string()
1067
1175
  })
1068
1176
  );
1069
1177
  },
1070
1178
  get subscribeContent() {
1071
- return import_zod8.z.object({
1179
+ return import_zod9.z.object({
1072
1180
  provider: this.provider,
1073
1181
  event: this.event,
1074
- callback: import_zod8.z.string()
1182
+ callback: import_zod9.z.string()
1075
1183
  });
1076
1184
  },
1077
1185
  get unsubscribe() {
1078
1186
  return integrationEventsCoreZods.withCore(
1079
- import_zod8.z.object({
1187
+ import_zod9.z.object({
1080
1188
  event: this.event
1081
1189
  })
1082
1190
  );
1083
1191
  },
1084
1192
  get unsubscribeContent() {
1085
- return import_zod8.z.object({
1193
+ return import_zod9.z.object({
1194
+ provider: this.provider,
1195
+ event: this.event
1196
+ });
1197
+ }
1198
+ };
1199
+
1200
+ // src/apis/text-intelligence/workflows/adapter/integrations/text/_contracts/requests/events/text.ts
1201
+ var import_zod10 = require("zod");
1202
+ var textEventsZods = {
1203
+ provider: import_zod10.z.literal("text" /* Text */),
1204
+ get event() {
1205
+ return textCustomerEventsZods.event;
1206
+ },
1207
+ get subscribe() {
1208
+ return integrationEventsCoreZods.withCore(
1209
+ import_zod10.z.object({
1210
+ event: this.event,
1211
+ callback: import_zod10.z.string()
1212
+ })
1213
+ );
1214
+ },
1215
+ get subscribeContent() {
1216
+ return import_zod10.z.object({
1217
+ provider: this.provider,
1218
+ event: this.event,
1219
+ callback: import_zod10.z.string()
1220
+ });
1221
+ },
1222
+ get unsubscribe() {
1223
+ return integrationEventsCoreZods.withCore(
1224
+ import_zod10.z.object({
1225
+ event: this.event
1226
+ })
1227
+ );
1228
+ },
1229
+ get unsubscribeContent() {
1230
+ return import_zod10.z.object({
1086
1231
  provider: this.provider,
1087
1232
  event: this.event
1088
1233
  });
@@ -1091,7 +1236,8 @@ var textLivechatEventsZods = {
1091
1236
 
1092
1237
  // src/apis/text-intelligence/workflows/adapter/integrations/_contracts/requests/events.ts
1093
1238
  var integrationEventsZods = {
1094
- providerName: import_zod9.z.enum([
1239
+ providerName: import_zod11.z.enum([
1240
+ "text" /* Text */,
1095
1241
  "text-livechat" /* LiveChat */,
1096
1242
  "text-helpdesk" /* HelpDesk */,
1097
1243
  "mailchimp" /* Mailchimp */,
@@ -1101,11 +1247,12 @@ var integrationEventsZods = {
1101
1247
  "bigcommerce" /* BigCommerce */
1102
1248
  ]),
1103
1249
  get event() {
1104
- return textLivechatEventsZods.event.or(textHelpDeskEventsZods.event).or(shopifyEventsZods.event).or(mailchimpEventsZods.event).or(hubspotEventsZods.event).or(bigcommerceEventsZods.event).or(slackEventsZods.event);
1250
+ 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
1251
  },
1106
1252
  get subscribe() {
1107
1253
  return integrationEventsCoreZods.withCore(
1108
- import_zod9.z.discriminatedUnion("provider", [
1254
+ import_zod11.z.discriminatedUnion("provider", [
1255
+ textEventsZods.subscribeContent,
1109
1256
  textLivechatEventsZods.subscribeContent,
1110
1257
  textHelpDeskEventsZods.subscribeContent,
1111
1258
  shopifyEventsZods.subscribeContent,
@@ -1118,7 +1265,8 @@ var integrationEventsZods = {
1118
1265
  },
1119
1266
  get unsubscribe() {
1120
1267
  return integrationEventsCoreZods.withCore(
1121
- import_zod9.z.discriminatedUnion("provider", [
1268
+ import_zod11.z.discriminatedUnion("provider", [
1269
+ textEventsZods.unsubscribeContent,
1122
1270
  textLivechatEventsZods.unsubscribeContent,
1123
1271
  textHelpDeskEventsZods.unsubscribeContent,
1124
1272
  shopifyEventsZods.unsubscribeContent,
@@ -2283,19 +2431,17 @@ var mailchimpApi = {
2283
2431
  },
2284
2432
  getMetadata(_0) {
2285
2433
  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
- }
2434
+ var _a, _b, _c, _d;
2435
+ const { data } = yield import_axios8.default.get("https://login.mailchimp.com/oauth2/metadata", {
2436
+ headers: {
2437
+ "Content-Type": "application/json",
2438
+ Authorization: `OAuth ${token}`
2295
2439
  }
2296
- );
2440
+ });
2441
+ 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
2442
  return {
2298
- server
2443
+ server: data.dc,
2444
+ email
2299
2445
  };
2300
2446
  });
2301
2447
  }
@@ -3430,7 +3576,8 @@ var salesforceApi = {
3430
3576
  const url = new URL(data.profile);
3431
3577
  const instance_url = url.origin;
3432
3578
  return {
3433
- instance_url
3579
+ instance_url,
3580
+ email: data.email
3434
3581
  };
3435
3582
  });
3436
3583
  }
@@ -4050,12 +4197,13 @@ var textPlatformWorkflowsCredentialsApi = {
4050
4197
  });
4051
4198
  });
4052
4199
  },
4053
- connect(id, code, authorization) {
4200
+ connect(id, code, codeVerifier, authorization) {
4054
4201
  return __async(this, null, function* () {
4055
4202
  return textClientInstance.put(
4056
4203
  urls2.connect(id),
4057
4204
  {
4058
- code
4205
+ code,
4206
+ code_verifier: codeVerifier
4059
4207
  },
4060
4208
  getTextClientConfig(__spreadProps(__spreadValues({}, authorization), {
4061
4209
  ensureAuthorizationToken: true
@@ -4293,7 +4441,7 @@ var OauthCredentialGrantType = /* @__PURE__ */ ((OauthCredentialGrantType2) => {
4293
4441
  })(OauthCredentialGrantType || {});
4294
4442
 
4295
4443
  // src/apis/integrations/text/platform/workflow/workflows/_contracts/dtos/tasks/base.ts
4296
- var WorkflowDefinitionTaskType = {
4444
+ var WorkflowTaskType = {
4297
4445
  http: "HTTP",
4298
4446
  switch: "SWITCH",
4299
4447
  forkJoin: "FORK_JOIN",
@@ -4305,23 +4453,23 @@ var WorkflowDefinitionTaskType = {
4305
4453
  inline: "INLINE",
4306
4454
  transform: "JSON_JQ_TRANSFORM"
4307
4455
  };
4308
- var WorkflowDefinitionCustomTaskName = {
4456
+ var WorkflowCustomTaskName = {
4309
4457
  // SWITCH
4310
- condition: `${WorkflowDefinitionTaskType.switch}_IF`,
4311
- switchCase: `${WorkflowDefinitionTaskType.switch}_CASE`,
4458
+ condition: `${WorkflowTaskType.switch}_IF`,
4459
+ switchCase: `${WorkflowTaskType.switch}_CASE`,
4312
4460
  // SIMPLE
4313
4461
  action: "action",
4314
4462
  awaitAgent: "await",
4315
4463
  notifyAgent: "notify_ai_agent",
4316
4464
  reasoning: "reasoning",
4317
4465
  // DO WHILE
4318
- loop: `${WorkflowDefinitionTaskType.doWhile}_LOOP`,
4319
- forEach: `${WorkflowDefinitionTaskType.doWhile}_FOR_EACH`,
4466
+ loop: `${WorkflowTaskType.doWhile}_LOOP`,
4467
+ forEach: `${WorkflowTaskType.doWhile}_FOR_EACH`,
4320
4468
  // INLINE
4321
- script: `${WorkflowDefinitionTaskType.inline}_SCRIPT`,
4469
+ script: `${WorkflowTaskType.inline}_SCRIPT`,
4322
4470
  // JQ TRANSFORM
4323
- convert: `${WorkflowDefinitionTaskType.transform}_CONVERT`,
4324
- construct: `${WorkflowDefinitionTaskType.transform}_CONSTRUCT`
4471
+ convert: `${WorkflowTaskType.transform}_CONVERT`,
4472
+ construct: `${WorkflowTaskType.transform}_CONSTRUCT`
4325
4473
  };
4326
4474
  var WorkflowExecutionTaskStatus = /* @__PURE__ */ ((WorkflowExecutionTaskStatus2) => {
4327
4475
  WorkflowExecutionTaskStatus2["Completed"] = "COMPLETED";
@@ -4337,6 +4485,11 @@ var WorkflowExecutionTaskStatus = /* @__PURE__ */ ((WorkflowExecutionTaskStatus2
4337
4485
  return WorkflowExecutionTaskStatus2;
4338
4486
  })(WorkflowExecutionTaskStatus || {});
4339
4487
 
4488
+ // src/apis/integrations/text/platform/workflow/workflows/_contracts/dtos/tasks/http.ts
4489
+ function isWorkflowBaseHttpTaskCore(task) {
4490
+ return task.name === WorkflowTaskType.http;
4491
+ }
4492
+
4340
4493
  // src/apis/integrations/text/platform/workflow/workflows/_contracts/dtos/tasks/switch/variants/condition.ts
4341
4494
  var WorkflowConditionTaskLogic = /* @__PURE__ */ ((WorkflowConditionTaskLogic2) => {
4342
4495
  WorkflowConditionTaskLogic2["AND"] = "AND";
@@ -4420,6 +4573,9 @@ var WorkflowTriggerType = {
4420
4573
  webhookManual: "webhook_manual"
4421
4574
  };
4422
4575
 
4576
+ // src/apis/integrations/text/platform/workflow/workflows/_contracts/dtos/workflowElement.ts
4577
+ var TRIGGER_REFERENCE_NAME = "trigger";
4578
+
4423
4579
  // src/apis/integrations/text/platform/workflow/workflows/_contracts/dtos/workflowExecution.ts
4424
4580
  var WorkflowExecutionStatus = /* @__PURE__ */ ((WorkflowExecutionStatus2) => {
4425
4581
  WorkflowExecutionStatus2["Succeeded"] = "succeeded";
@@ -4645,82 +4801,395 @@ function getWorkflowApiCrmConfig(authorization) {
4645
4801
  });
4646
4802
  }
4647
4803
 
4648
- // src/apis/integrations/vercel/instance.ts
4649
- var import_axios22 = __toESM(require("axios"));
4650
- function getVercelClientAuthorization(req, headerPrefix = "x-adapter-vercel") {
4651
- if (req.headers instanceof Headers) {
4652
- return {
4653
- token: req.headers.get(`${headerPrefix}-token`)
4654
- };
4655
- }
4656
- return {
4657
- token: req.headers[`${headerPrefix}-token`]
4658
- };
4659
- }
4660
- var vercelClientInstance = import_axios22.default.create({
4661
- baseURL: "https://api.vercel.com"
4662
- });
4663
- vercelClientInstance.interceptors.response.use(
4664
- (r) => r,
4665
- (error) => {
4666
- var _a, _b;
4667
- if (import_axios22.default.isAxiosError(error)) {
4668
- if (((_a = error.response) == null ? void 0 : _a.status) === 401 || ((_b = error.response) == null ? void 0 : _b.status) === 403) {
4669
- throw new UnauthorizeApiError("vercel");
4804
+ // src/apis/integrations/text/platform/workflow/workflows/internal/crm/api.ts
4805
+ var getUrl3 = (segments = []) => buildUrlFromSegments(segments, "/internal/crm");
4806
+ var urls4 = {
4807
+ getOrganizations: (queryParams) => enrichUrlWithQueryParams(getUrl3(["stats"]), queryParams),
4808
+ getOrganization: (organizationId) => getUrl3(["stats", organizationId]),
4809
+ getWorkflows: (queryParams) => enrichUrlWithQueryParams(getUrl3(["workflows"]), queryParams),
4810
+ getWorkflow: (id) => getUrl3(["workflows", id]),
4811
+ getWorkflowExecutions: (id, queryParams) => enrichUrlWithQueryParams(
4812
+ getUrl3(["workflows", id, "executions"]),
4813
+ queryParams
4814
+ ),
4815
+ getWorkflowExecution: (id, executionId) => getUrl3(["workflows", id, "executions", executionId]),
4816
+ getWorkflowIntrospection: (id) => getUrl3(["workflows", id, "metadata"])
4817
+ };
4818
+ var textPlatformWorkflowsInternalCrmApi = {
4819
+ meta: {
4820
+ urls: urls4
4821
+ },
4822
+ getOrganizations(queryParams, authorization) {
4823
+ return __async(this, null, function* () {
4824
+ const { data: organizations } = yield textClientInstance.get(
4825
+ urls4.getOrganizations(queryParams),
4826
+ getWorkflowApiCrmConfig(authorization)
4827
+ );
4828
+ return organizations;
4829
+ });
4830
+ },
4831
+ getOrganization(organizationId, authorization) {
4832
+ return __async(this, null, function* () {
4833
+ const { data: organization } = yield textClientInstance.get(
4834
+ urls4.getOrganization(organizationId),
4835
+ getWorkflowApiCrmConfig(authorization)
4836
+ );
4837
+ return organization;
4838
+ });
4839
+ },
4840
+ getWorkflows(queryParams, authorization) {
4841
+ return __async(this, null, function* () {
4842
+ const { data: workflows } = yield textClientInstance.get(urls4.getWorkflows(queryParams), getWorkflowApiCrmConfig(authorization));
4843
+ workflows.data = workflows.data.map(enrichWorkflowTrigger);
4844
+ return workflows;
4845
+ });
4846
+ },
4847
+ getWorkflow(workflowId, authorization) {
4848
+ return __async(this, null, function* () {
4849
+ const searchParams = new URLSearchParams();
4850
+ const query = searchParams.toString();
4851
+ const { data: workflow } = yield textClientInstance.get(
4852
+ `${urls4.getWorkflow(workflowId)}${query ? `?${query}` : ""}`,
4853
+ getWorkflowApiCrmConfig(authorization)
4854
+ );
4855
+ return enrichWorkflowTrigger(workflow);
4856
+ });
4857
+ },
4858
+ getWorkflowExecutions(workflowId, queryParams, authorization) {
4859
+ return __async(this, null, function* () {
4860
+ const { data: executions } = yield textClientInstance.get(
4861
+ urls4.getWorkflowExecutions(workflowId, queryParams),
4862
+ getWorkflowApiCrmConfig(authorization)
4863
+ );
4864
+ return executions;
4865
+ });
4866
+ },
4867
+ getWorkflowExecution(workflowId, executionId, authorization) {
4868
+ return __async(this, null, function* () {
4869
+ const { data: execution } = yield textClientInstance.get(
4870
+ urls4.getWorkflowExecution(workflowId, executionId),
4871
+ getWorkflowApiCrmConfig(authorization)
4872
+ );
4873
+ return execution;
4874
+ });
4875
+ },
4876
+ getWorkflowIntrospection(workflowId, version, authorization) {
4877
+ return __async(this, null, function* () {
4878
+ const searchParams = new URLSearchParams();
4879
+ if (version) {
4880
+ searchParams.append("version", `${version}`);
4670
4881
  }
4671
- }
4672
- throw error;
4882
+ const query = searchParams.toString();
4883
+ const { data: introspection } = yield textClientInstance.get(
4884
+ `${urls4.getWorkflowIntrospection(workflowId)}${query ? `?${query}` : ""}`,
4885
+ getWorkflowApiCrmConfig(authorization)
4886
+ );
4887
+ return {
4888
+ tasks: introspection
4889
+ };
4890
+ });
4673
4891
  }
4674
- );
4675
- function getVercelClientConfig(options = {}) {
4676
- var _a;
4677
- const currentHeaders = vercelClientInstance.defaults.headers;
4678
- const config = {
4679
- authorization: (_a = options.token ? `Bearer ${options.token}` : void 0) != null ? _a : currentHeaders.Authorization
4680
- };
4681
- if (options.ensureAuthorizationToken && !config.authorization) {
4682
- throw new UnauthorizeApiError("vercel");
4892
+ };
4893
+
4894
+ // src/apis/integrations/text/platform/workflow/workflows/internal/api.ts
4895
+ var textPlatformWorkflowsInternalApi = {
4896
+ crm: textPlatformWorkflowsInternalCrmApi
4897
+ };
4898
+
4899
+ // src/apis/integrations/text/platform/workflow/workflows/api.ts
4900
+ var enrichWorkflowTrigger = (workflow) => {
4901
+ var _a, _b, _c, _d, _e, _f, _g, _h;
4902
+ if (((_a = workflow.trigger) == null ? void 0 : _a.type) === WorkflowTriggerType.webhook) {
4903
+ workflow.trigger.name = (_c = workflow.trigger.sub_type) != null ? _c : `${workflow.trigger.webhook.source}-${(_b = workflow.trigger.webhook.event) == null ? void 0 : _b.name}`;
4683
4904
  }
4684
- return {
4685
- headers: __spreadValues({}, config.authorization ? { Authorization: config.authorization } : {})
4686
- };
4687
- }
4688
- function initVercelClient(token) {
4689
- if (token) {
4690
- updateVercelClient(token);
4905
+ if (((_d = workflow.trigger) == null ? void 0 : _d.type) === WorkflowTriggerType.webhookManual) {
4906
+ workflow.trigger.name = "webhook_manual";
4691
4907
  }
4692
- }
4693
- function updateVercelClient(token) {
4694
- const headers = vercelClientInstance.defaults.headers;
4695
- if (token) {
4696
- headers.Authorization = `Bearer ${token}`;
4697
- } else {
4698
- delete headers.Authorization;
4908
+ if (((_e = workflow.trigger) == null ? void 0 : _e.type) === WorkflowTriggerType.manual) {
4909
+ workflow.trigger.name = "manual";
4699
4910
  }
4700
- }
4701
-
4702
- // src/apis/platform/accounts/instance.ts
4703
- var AccountsApiError = class extends ApiErrorBase {
4704
- constructor() {
4705
- super(...arguments);
4706
- this.name = "accounts";
4911
+ if (((_f = workflow.trigger) == null ? void 0 : _f.type) === WorkflowTriggerType.agent) {
4912
+ workflow.trigger.name = "ai_agent";
4707
4913
  }
4708
- };
4709
- var UnauthorizeAccountsApiError = class extends UnauthorizeApiError {
4710
- constructor(message) {
4711
- super("accounts", message);
4914
+ if (((_g = workflow.trigger) == null ? void 0 : _g.type) === WorkflowTriggerType.recurring) {
4915
+ workflow.trigger.name = "scheduled";
4712
4916
  }
4713
- };
4714
- var AccountApiClient = class extends ApiClient {
4715
- constructor() {
4716
- super(...arguments);
4717
- this.UnauthorizedError = UnauthorizeAccountsApiError;
4718
- this.Error = AccountsApiError;
4719
- this.options = {
4720
- headers: {
4721
- "Content-Type": "application/json"
4722
- }
4723
- };
4917
+ if (((_h = workflow.trigger) == null ? void 0 : _h.type) === WorkflowTriggerType.oneTime) {
4918
+ workflow.trigger.name = "one_time";
4919
+ }
4920
+ return workflow;
4921
+ };
4922
+ var getUrl4 = (segments = [], version) => buildUrlFromSegments(
4923
+ segments,
4924
+ `/workflow_platform/${version ? `${version}/` : ""}workflows`
4925
+ );
4926
+ var urls5 = {
4927
+ getWorkflows: (queryParams) => enrichUrlWithQueryParams(getUrl4([], "v1.0" /* V1 */), queryParams),
4928
+ createWorkflow: () => getUrl4(),
4929
+ getWorkflow: (id) => getUrl4([id], "v1.0" /* V1 */),
4930
+ updateWorkflow: (id) => getUrl4([id]),
4931
+ deleteWorkflow: (id) => getUrl4([id]),
4932
+ createWorkflowDraft: (id) => getUrl4([id, "draft"]),
4933
+ publishWorkflowDraft: (id) => getUrl4([id, "publish"]),
4934
+ toggleWorkflowActivation: (id) => getUrl4([id, "activation"]),
4935
+ executeWorkflow: (id) => getUrl4([id, "executions"]),
4936
+ getWorkflowExecutions: (id, queryParams) => enrichUrlWithQueryParams(
4937
+ getUrl4([id, "executions"], "v1.0" /* V1 */),
4938
+ queryParams
4939
+ ),
4940
+ getWorkflowExecution: (id, executionId) => getUrl4([id, "executions", executionId], "v1.0" /* V1 */),
4941
+ getWorkflowIntrospection: (id) => getUrl4([id, "metadata"], "v1.0" /* V1 */),
4942
+ introspectWorkflowTask: (id) => getUrl4([id, "run_task"], "v1.0" /* V1 */)
4943
+ };
4944
+ var textPlatformWorkflowsApi = {
4945
+ internal: textPlatformWorkflowsInternalApi,
4946
+ meta: {
4947
+ urls: urls5
4948
+ },
4949
+ getWorkflows(queryParams, authorization) {
4950
+ return __async(this, null, function* () {
4951
+ const { data: workflows } = yield textClientInstance.get(
4952
+ urls5.getWorkflows(queryParams),
4953
+ getTextClientConfig(__spreadProps(__spreadValues({}, authorization), {
4954
+ ensureAuthorizationToken: true
4955
+ }))
4956
+ );
4957
+ workflows.data = workflows.data.map(enrichWorkflowTrigger);
4958
+ return workflows;
4959
+ });
4960
+ },
4961
+ getWorkflow(workflowId, version, authorization) {
4962
+ return __async(this, null, function* () {
4963
+ const searchParams = new URLSearchParams();
4964
+ if (version) {
4965
+ searchParams.append("version", `${version}`);
4966
+ }
4967
+ const query = searchParams.toString();
4968
+ const { data: workflow } = yield textClientInstance.get(
4969
+ `${urls5.getWorkflow(workflowId)}${query ? `?${query}` : ""}`,
4970
+ getTextClientConfig(__spreadProps(__spreadValues({}, authorization), {
4971
+ ensureAuthorizationToken: true
4972
+ }))
4973
+ );
4974
+ return enrichWorkflowTrigger(workflow);
4975
+ });
4976
+ },
4977
+ createWorkflow(payload, authorization) {
4978
+ return __async(this, null, function* () {
4979
+ return textClientInstance.post(
4980
+ urls5.createWorkflow(),
4981
+ __spreadProps(__spreadValues({}, payload), {
4982
+ trigger: payload.trigger || {}
4983
+ }),
4984
+ getTextClientConfig(__spreadProps(__spreadValues({}, authorization), {
4985
+ ensureAuthorizationToken: true
4986
+ }))
4987
+ );
4988
+ });
4989
+ },
4990
+ updateWorkflow(workflowId, payload, authorization) {
4991
+ return __async(this, null, function* () {
4992
+ return textClientInstance.put(
4993
+ urls5.updateWorkflow(workflowId),
4994
+ __spreadProps(__spreadValues({}, payload), {
4995
+ trigger: payload.trigger || {}
4996
+ }),
4997
+ getTextClientConfig(__spreadProps(__spreadValues({}, authorization), {
4998
+ ensureAuthorizationToken: true
4999
+ }))
5000
+ );
5001
+ });
5002
+ },
5003
+ deleteWorkflow(workflowId, authorization) {
5004
+ return __async(this, null, function* () {
5005
+ return textClientInstance.delete(urls5.deleteWorkflow(workflowId), __spreadValues({}, getTextClientConfig(__spreadProps(__spreadValues({}, authorization), {
5006
+ ensureAuthorizationToken: true
5007
+ }))));
5008
+ });
5009
+ },
5010
+ createWorkflowDraft(workflowId, payload, authorization) {
5011
+ return __async(this, null, function* () {
5012
+ return textClientInstance.post(
5013
+ urls5.createWorkflowDraft(workflowId),
5014
+ __spreadProps(__spreadValues({}, payload), {
5015
+ trigger: payload.trigger || {}
5016
+ }),
5017
+ getTextClientConfig(__spreadProps(__spreadValues({}, authorization), {
5018
+ ensureAuthorizationToken: true
5019
+ }))
5020
+ );
5021
+ });
5022
+ },
5023
+ publishWorkflowDraft(workflowId, authorization) {
5024
+ return __async(this, null, function* () {
5025
+ return textClientInstance.post(
5026
+ urls5.publishWorkflowDraft(workflowId),
5027
+ getTextClientConfig(__spreadProps(__spreadValues({}, authorization), {
5028
+ ensureAuthorizationToken: true
5029
+ }))
5030
+ );
5031
+ });
5032
+ },
5033
+ toggleWorkflowActivation(workflowId, isActive, authorization) {
5034
+ return __async(this, null, function* () {
5035
+ return textClientInstance.put(
5036
+ urls5.toggleWorkflowActivation(workflowId),
5037
+ {
5038
+ active: isActive
5039
+ },
5040
+ getTextClientConfig(__spreadProps(__spreadValues({}, authorization), {
5041
+ ensureAuthorizationToken: true
5042
+ }))
5043
+ );
5044
+ });
5045
+ },
5046
+ executeWorkflow(workflowId, input, authorization) {
5047
+ return __async(this, null, function* () {
5048
+ const { data: execution } = yield textClientInstance.post(
5049
+ urls5.executeWorkflow(workflowId),
5050
+ {
5051
+ input
5052
+ },
5053
+ getTextClientConfig(__spreadProps(__spreadValues({}, authorization), {
5054
+ ensureAuthorizationToken: true
5055
+ }))
5056
+ );
5057
+ return execution;
5058
+ });
5059
+ },
5060
+ getWorkflowExecutions(workflowId, queryParams, authorization) {
5061
+ return __async(this, null, function* () {
5062
+ const { data: executions } = yield textClientInstance.get(
5063
+ urls5.getWorkflowExecutions(workflowId, queryParams),
5064
+ getTextClientConfig(__spreadProps(__spreadValues({}, authorization), {
5065
+ ensureAuthorizationToken: true
5066
+ }))
5067
+ );
5068
+ return executions;
5069
+ });
5070
+ },
5071
+ getWorkflowExecution(workflowId, executionId, authorization) {
5072
+ return __async(this, null, function* () {
5073
+ const { data: execution } = yield textClientInstance.get(
5074
+ urls5.getWorkflowExecution(workflowId, executionId),
5075
+ getTextClientConfig(__spreadProps(__spreadValues({}, authorization), {
5076
+ ensureAuthorizationToken: true
5077
+ }))
5078
+ );
5079
+ return execution;
5080
+ });
5081
+ },
5082
+ getWorkflowIntrospection(workflowId, version, authorization) {
5083
+ return __async(this, null, function* () {
5084
+ const searchParams = new URLSearchParams();
5085
+ if (version) {
5086
+ searchParams.append("version", `${version}`);
5087
+ }
5088
+ const query = searchParams.toString();
5089
+ const { data: introspection } = yield textClientInstance.get(
5090
+ `${urls5.getWorkflowIntrospection(workflowId)}${query ? `?${query}` : ""}`,
5091
+ getTextClientConfig(__spreadProps(__spreadValues({}, authorization), {
5092
+ ensureAuthorizationToken: true
5093
+ }))
5094
+ );
5095
+ return {
5096
+ tasks: introspection
5097
+ };
5098
+ });
5099
+ },
5100
+ introspectWorkflowTask(workflowId, payload, authorization) {
5101
+ return __async(this, null, function* () {
5102
+ const response = yield textClientInstance.post(
5103
+ urls5.introspectWorkflowTask(workflowId),
5104
+ {
5105
+ task_reference_name: payload.taskReferenceName,
5106
+ input_parameters: payload.inputParameters
5107
+ },
5108
+ getTextClientConfig(__spreadProps(__spreadValues({}, authorization), {
5109
+ ensureAuthorizationToken: true
5110
+ }))
5111
+ );
5112
+ return response.data;
5113
+ });
5114
+ }
5115
+ };
5116
+
5117
+ // src/apis/integrations/vercel/instance.ts
5118
+ var import_axios22 = __toESM(require("axios"));
5119
+ function getVercelClientAuthorization(req, headerPrefix = "x-adapter-vercel") {
5120
+ if (req.headers instanceof Headers) {
5121
+ return {
5122
+ token: req.headers.get(`${headerPrefix}-token`)
5123
+ };
5124
+ }
5125
+ return {
5126
+ token: req.headers[`${headerPrefix}-token`]
5127
+ };
5128
+ }
5129
+ var vercelClientInstance = import_axios22.default.create({
5130
+ baseURL: "https://api.vercel.com"
5131
+ });
5132
+ vercelClientInstance.interceptors.response.use(
5133
+ (r) => r,
5134
+ (error) => {
5135
+ var _a, _b;
5136
+ if (import_axios22.default.isAxiosError(error)) {
5137
+ if (((_a = error.response) == null ? void 0 : _a.status) === 401 || ((_b = error.response) == null ? void 0 : _b.status) === 403) {
5138
+ throw new UnauthorizeApiError("vercel");
5139
+ }
5140
+ }
5141
+ throw error;
5142
+ }
5143
+ );
5144
+ function getVercelClientConfig(options = {}) {
5145
+ var _a;
5146
+ const currentHeaders = vercelClientInstance.defaults.headers;
5147
+ const config = {
5148
+ authorization: (_a = options.token ? `Bearer ${options.token}` : void 0) != null ? _a : currentHeaders.Authorization
5149
+ };
5150
+ if (options.ensureAuthorizationToken && !config.authorization) {
5151
+ throw new UnauthorizeApiError("vercel");
5152
+ }
5153
+ return {
5154
+ headers: __spreadValues({}, config.authorization ? { Authorization: config.authorization } : {})
5155
+ };
5156
+ }
5157
+ function initVercelClient(token) {
5158
+ if (token) {
5159
+ updateVercelClient(token);
5160
+ }
5161
+ }
5162
+ function updateVercelClient(token) {
5163
+ const headers = vercelClientInstance.defaults.headers;
5164
+ if (token) {
5165
+ headers.Authorization = `Bearer ${token}`;
5166
+ } else {
5167
+ delete headers.Authorization;
5168
+ }
5169
+ }
5170
+
5171
+ // src/apis/platform/accounts/instance.ts
5172
+ var AccountsApiError = class extends ApiErrorBase {
5173
+ constructor() {
5174
+ super(...arguments);
5175
+ this.name = "accounts";
5176
+ }
5177
+ };
5178
+ var UnauthorizeAccountsApiError = class extends UnauthorizeApiError {
5179
+ constructor(message) {
5180
+ super("accounts", message);
5181
+ }
5182
+ };
5183
+ var AccountApiClient = class extends ApiClient {
5184
+ constructor() {
5185
+ super(...arguments);
5186
+ this.UnauthorizedError = UnauthorizeAccountsApiError;
5187
+ this.Error = AccountsApiError;
5188
+ this.options = {
5189
+ headers: {
5190
+ "Content-Type": "application/json"
5191
+ }
5192
+ };
4724
5193
  }
4725
5194
  };
4726
5195
  var platformAccountsClientInstance = new AccountApiClient({
@@ -4769,6 +5238,42 @@ function initBillingClient(baseUrl, token) {
4769
5238
  }
4770
5239
  }
4771
5240
 
5241
+ // src/apis/platform/cdp/events/_contracts/payloads/events.ts
5242
+ var import_zod12 = require("zod");
5243
+ var CdpCustomerEventType = /* @__PURE__ */ ((CdpCustomerEventType2) => {
5244
+ CdpCustomerEventType2["EmailSet"] = "customer_email_set";
5245
+ CdpCustomerEventType2["PropertiesValuesUpdated"] = "customer_properties_values_updated";
5246
+ return CdpCustomerEventType2;
5247
+ })(CdpCustomerEventType || {});
5248
+ var customerMetadataZod = import_zod12.z.object({
5249
+ organization_id: import_zod12.z.string(),
5250
+ customer_id: import_zod12.z.string(),
5251
+ master_id: import_zod12.z.string()
5252
+ });
5253
+ var cdpCustomerEventMessageZod = import_zod12.z.discriminatedUnion("type", [
5254
+ import_zod12.z.object({
5255
+ id: import_zod12.z.string(),
5256
+ type: import_zod12.z.literal("customer_email_set" /* EmailSet */),
5257
+ data: customerMetadataZod.extend({
5258
+ email: import_zod12.z.string()
5259
+ }).passthrough()
5260
+ }),
5261
+ import_zod12.z.object({
5262
+ id: import_zod12.z.string(),
5263
+ type: import_zod12.z.literal("customer_properties_values_updated" /* PropertiesValuesUpdated */),
5264
+ data: customerMetadataZod.extend({
5265
+ customer_properties: import_zod12.z.record(
5266
+ import_zod12.z.object({
5267
+ value: import_zod12.z.unknown(),
5268
+ last_updated_at: import_zod12.z.string(),
5269
+ last_updated_agent_account_id: import_zod12.z.string().optional(),
5270
+ last_updated_agent_client_id: import_zod12.z.string().optional()
5271
+ }).passthrough()
5272
+ )
5273
+ }).passthrough()
5274
+ })
5275
+ ]);
5276
+
4772
5277
  // src/apis/platform/console/instance.ts
4773
5278
  var import_axios24 = __toESM(require("axios"));
4774
5279
  var REGION = {
@@ -5099,6 +5604,7 @@ var HelpDeskWebhookEventType = /* @__PURE__ */ ((HelpDeskWebhookEventType2) => {
5099
5604
  HelpDeskWebhookEventType2["TicketTagsChanged"] = "tickets.events.tags";
5100
5605
  HelpDeskWebhookEventType2["TicketFollowersChanged"] = "tickets.events.followers";
5101
5606
  HelpDeskWebhookEventType2["TicketAssignmentChanged"] = "tickets.events.assignment";
5607
+ HelpDeskWebhookEventType2["TicketCustomFieldsChanged"] = "tickets.events.customFields";
5102
5608
  HelpDeskWebhookEventType2["TicketMessageAdded"] = "tickets.events.message";
5103
5609
  return HelpDeskWebhookEventType2;
5104
5610
  })(HelpDeskWebhookEventType || {});
@@ -5112,6 +5618,7 @@ var LivechatWebhookActions = /* @__PURE__ */ ((LivechatWebhookActions2) => {
5112
5618
  LivechatWebhookActions2["UserAddedToChat"] = "user_added_to_chat";
5113
5619
  LivechatWebhookActions2["UserRemovedFromChat"] = "user_removed_from_chat";
5114
5620
  LivechatWebhookActions2["IncomingEvent"] = "incoming_event";
5621
+ LivechatWebhookActions2["IncomingRichMessagePostback"] = "incoming_rich_message_postback";
5115
5622
  LivechatWebhookActions2["ThreadTagged"] = "thread_tagged";
5116
5623
  LivechatWebhookActions2["ThreadUntagged"] = "thread_untagged";
5117
5624
  LivechatWebhookActions2["IncomingCustomer"] = "incoming_customer";
@@ -5134,6 +5641,7 @@ var LivechatWebhookSystemMessages = /* @__PURE__ */ ((LivechatWebhookSystemMessa
5134
5641
  LivechatWebhookSystemMessages2["ChatArchivedCustomerManual"] = "manual_archived_customer";
5135
5642
  LivechatWebhookSystemMessages2["ChatArchivedCustomerDisconnected"] = "archived_customer_disconnected";
5136
5643
  LivechatWebhookSystemMessages2["ChatArchivedInactive"] = "routing.archived_inactive";
5644
+ LivechatWebhookSystemMessages2["ChatIdle"] = "routing.idle";
5137
5645
  return LivechatWebhookSystemMessages2;
5138
5646
  })(LivechatWebhookSystemMessages || {});
5139
5647
 
@@ -5215,40 +5723,40 @@ function initLiveChatClient(baseUrl, token) {
5215
5723
  }
5216
5724
 
5217
5725
  // src/apis/text-intelligence/workflows/adapter/admin/events/notifications/_contracts/dtos/notification.ts
5218
- var import_zod10 = require("zod");
5726
+ var import_zod13 = require("zod");
5219
5727
  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()
5728
+ notification: import_zod13.z.object({
5729
+ id: import_zod13.z.string(),
5730
+ jobId: import_zod13.z.string().nullable(),
5731
+ subscription_id: import_zod13.z.string(),
5732
+ organization_id: import_zod13.z.string(),
5733
+ user_id: import_zod13.z.string().nullable(),
5734
+ source: import_zod13.z.string().nullable(),
5735
+ sourceKey: import_zod13.z.string().nullable(),
5736
+ target: import_zod13.z.string(),
5737
+ targetKey: import_zod13.z.string(),
5738
+ eventName: import_zod13.z.string(),
5739
+ callback: import_zod13.z.string(),
5740
+ status: import_zod13.z.string(),
5741
+ statusCode: import_zod13.z.number().nullable(),
5742
+ attempts: import_zod13.z.number(),
5743
+ error: import_zod13.z.string().nullable(),
5744
+ enqueuedAt: import_zod13.z.string(),
5745
+ completedAt: import_zod13.z.string()
5238
5746
  })
5239
5747
  };
5240
5748
 
5241
5749
  // src/apis/text-intelligence/workflows/adapter/admin/events/notifications/_contracts/requests/notifications.ts
5242
- var import_zod11 = require("zod");
5750
+ var import_zod14 = require("zod");
5243
5751
  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([
5752
+ getNotifications: import_zod14.z.object({
5753
+ target: import_zod14.z.string().optional(),
5754
+ status: import_zod14.z.string().optional(),
5755
+ eventName: import_zod14.z.string().optional(),
5756
+ search: import_zod14.z.string().optional(),
5757
+ page: import_zod14.z.number().optional(),
5758
+ size: import_zod14.z.number().optional(),
5759
+ order_by: import_zod14.z.enum([
5252
5760
  "id",
5253
5761
  "status",
5254
5762
  "target",
@@ -5257,60 +5765,60 @@ var integrationNotificationRequestZods = {
5257
5765
  "organization_id",
5258
5766
  "user_id"
5259
5767
  ]).optional(),
5260
- order: import_zod11.z.enum(["asc", "desc"]).optional()
5768
+ order: import_zod14.z.enum(["asc", "desc"]).optional()
5261
5769
  })
5262
5770
  };
5263
5771
 
5264
5772
  // src/apis/text-intelligence/workflows/adapter/admin/events/subscriptions/_contracts/dtos/subscription.ts
5265
- var import_zod12 = require("zod");
5773
+ var import_zod15 = require("zod");
5266
5774
  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()
5775
+ subscription: import_zod15.z.object({
5776
+ id: import_zod15.z.string(),
5777
+ organization_id: import_zod15.z.string(),
5778
+ user_id: import_zod15.z.string(),
5779
+ callback: import_zod15.z.string(),
5780
+ source: import_zod15.z.string(),
5781
+ sourceKey: import_zod15.z.string(),
5782
+ target: import_zod15.z.string(),
5783
+ targets: import_zod15.z.array(
5784
+ import_zod15.z.object({
5785
+ id: import_zod15.z.string(),
5786
+ target: import_zod15.z.string(),
5787
+ targetKey: import_zod15.z.string()
5280
5788
  })
5281
5789
  ).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()
5790
+ event: import_zod15.z.unknown(),
5791
+ orphaned_at: import_zod15.z.string().datetime().nullable(),
5792
+ orphaned_reason: import_zod15.z.string().nullable(),
5793
+ orphaned_last_hit: import_zod15.z.string().datetime().nullable(),
5794
+ orphaned_hit_count: import_zod15.z.number()
5287
5795
  }),
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() })
5796
+ stats: import_zod15.z.object({
5797
+ totalSubscriptions: import_zod15.z.number(),
5798
+ uniqueOrganizations: import_zod15.z.number(),
5799
+ uniqueUsers: import_zod15.z.number(),
5800
+ byTarget: import_zod15.z.array(import_zod15.z.object({ target: import_zod15.z.string(), count: import_zod15.z.number() })),
5801
+ bySource: import_zod15.z.array(import_zod15.z.object({ source: import_zod15.z.string(), count: import_zod15.z.number() })),
5802
+ topOrganizations: import_zod15.z.array(
5803
+ import_zod15.z.object({ organizationId: import_zod15.z.string(), count: import_zod15.z.number() })
5296
5804
  ),
5297
- topCallbackDomains: import_zod12.z.array(
5298
- import_zod12.z.object({ domain: import_zod12.z.string(), count: import_zod12.z.number() })
5805
+ topCallbackDomains: import_zod15.z.array(
5806
+ import_zod15.z.object({ domain: import_zod15.z.string(), count: import_zod15.z.number() })
5299
5807
  )
5300
5808
  })
5301
5809
  };
5302
5810
 
5303
5811
  // src/apis/text-intelligence/workflows/adapter/admin/events/subscriptions/_contracts/requests/subscriptions.ts
5304
- var import_zod13 = require("zod");
5812
+ var import_zod16 = require("zod");
5305
5813
  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([
5814
+ getSubscriptions: import_zod16.z.object({
5815
+ target: import_zod16.z.string().optional(),
5816
+ source: import_zod16.z.string().optional(),
5817
+ search: import_zod16.z.string().optional(),
5818
+ orphaned: import_zod16.z.boolean().optional(),
5819
+ page: import_zod16.z.number().optional(),
5820
+ size: import_zod16.z.number().optional(),
5821
+ order_by: import_zod16.z.enum([
5314
5822
  "id",
5315
5823
  "source",
5316
5824
  "target",
@@ -5318,7 +5826,7 @@ var integrationSubscriptionRequestZods = {
5318
5826
  "user_id",
5319
5827
  "orphaned_at"
5320
5828
  ]).optional(),
5321
- order: import_zod13.z.enum(["asc", "desc"]).optional()
5829
+ order: import_zod16.z.enum(["asc", "desc"]).optional()
5322
5830
  })
5323
5831
  };
5324
5832
 
@@ -5622,384 +6130,74 @@ var textPlatformWorkflowsResourcesApi = {
5622
6130
  var _a;
5623
6131
  const baseProvider = (_a = integrationNameToProduct[resource.provider]) != null ? _a : resource.provider;
5624
6132
  const provider = resource.product ? `${baseProvider}-${resource.product}` : baseProvider;
5625
- const config = getTextClientConfig(__spreadProps(__spreadValues({}, authorization), {
5626
- ensureAuthorizationToken: true
5627
- }));
5628
- return textClientInstance.get(
5629
- `/workflow_platform/external_resources/${encodeURIComponent(provider)}/${encodeURIComponent(resource.name)}`,
5630
- __spreadProps(__spreadValues({}, config), {
5631
- params,
5632
- headers: __spreadProps(__spreadValues({}, config.headers), {
5633
- "X-Cred-ID": authorization == null ? void 0 : authorization.credentialId
5634
- })
5635
- })
5636
- ).catch((error) => {
5637
- if (error instanceof TextApiError) {
5638
- throw error.withCustomMessage(
5639
- `Couldn't get external resources. [${error.message}]`
5640
- );
5641
- }
5642
- throw error;
5643
- });
5644
- });
5645
- }
5646
- };
5647
-
5648
- // src/apis/integrations/text/platform/workflow/templates/api.ts
5649
- var getUrl3 = (segments = [], version) => buildUrlFromSegments(
5650
- segments,
5651
- `/workflow_platform/${version ? `${version}/` : ""}workflows/templates`
5652
- );
5653
- var urls4 = {
5654
- getList: (queryParams) => enrichUrlWithQueryParams(getUrl3([], "v1.0" /* V1 */), queryParams),
5655
- get: (templateId) => getUrl3([templateId], "v1.0" /* V1 */)
5656
- };
5657
- var textPlatformWorkflowsTemplatesApi = {
5658
- meta: {
5659
- urls: urls4
5660
- },
5661
- getList(queryParams, authorization) {
5662
- return __async(this, null, function* () {
5663
- return textClientInstance.get(
5664
- urls4.getList(queryParams),
5665
- getTextClientConfig(__spreadProps(__spreadValues({}, authorization), {
5666
- ensureAuthorizationToken: true
5667
- }))
5668
- ).catch((error) => {
5669
- if (error instanceof TextApiError) {
5670
- throw error.withCustomMessage(
5671
- `Couldn't get workflow templates. [${error.message}]`
5672
- );
5673
- }
5674
- throw error;
5675
- });
5676
- });
5677
- },
5678
- get(templateId, authorization) {
5679
- return __async(this, null, function* () {
5680
- return textClientInstance.get(
5681
- urls4.get(templateId),
5682
- getTextClientConfig(__spreadProps(__spreadValues({}, authorization), {
5683
- ensureAuthorizationToken: true
5684
- }))
5685
- ).catch((error) => {
5686
- if (error instanceof TextApiError) {
5687
- throw error.withCustomMessage(
5688
- `Couldn't get workflow template. [${error.message}]`
5689
- );
5690
- }
5691
- throw error;
5692
- });
5693
- });
5694
- }
5695
- };
5696
-
5697
- // src/apis/integrations/text/platform/workflow/workflows/internal/crm/api.ts
5698
- var getUrl4 = (segments = []) => buildUrlFromSegments(segments, "/internal/crm");
5699
- var urls5 = {
5700
- getOrganizations: (queryParams) => enrichUrlWithQueryParams(getUrl4(["stats"]), queryParams),
5701
- getOrganization: (organizationId) => getUrl4(["stats", organizationId]),
5702
- getWorkflows: (queryParams) => enrichUrlWithQueryParams(getUrl4(["workflows"]), queryParams),
5703
- getWorkflow: (id) => getUrl4(["workflows", id]),
5704
- getWorkflowExecutions: (id, queryParams) => enrichUrlWithQueryParams(
5705
- getUrl4(["workflows", id, "executions"]),
5706
- queryParams
5707
- ),
5708
- getWorkflowExecution: (id, executionId) => getUrl4(["workflows", id, "executions", executionId]),
5709
- getWorkflowIntrospection: (id) => getUrl4(["workflows", id, "metadata"])
5710
- };
5711
- var textPlatformWorkflowsInternalCrmApi = {
5712
- meta: {
5713
- urls: urls5
5714
- },
5715
- getOrganizations(queryParams, authorization) {
5716
- return __async(this, null, function* () {
5717
- const { data: organizations } = yield textClientInstance.get(
5718
- urls5.getOrganizations(queryParams),
5719
- getWorkflowApiCrmConfig(authorization)
5720
- );
5721
- return organizations;
5722
- });
5723
- },
5724
- getOrganization(organizationId, authorization) {
5725
- return __async(this, null, function* () {
5726
- const { data: organization } = yield textClientInstance.get(
5727
- urls5.getOrganization(organizationId),
5728
- getWorkflowApiCrmConfig(authorization)
5729
- );
5730
- return organization;
5731
- });
5732
- },
5733
- getWorkflows(queryParams, authorization) {
5734
- return __async(this, null, function* () {
5735
- const { data: workflows } = yield textClientInstance.get(urls5.getWorkflows(queryParams), getWorkflowApiCrmConfig(authorization));
5736
- workflows.data = workflows.data.map(enrichWorkflowTrigger);
5737
- return workflows;
5738
- });
5739
- },
5740
- getWorkflow(workflowId, authorization) {
5741
- return __async(this, null, function* () {
5742
- const searchParams = new URLSearchParams();
5743
- const query = searchParams.toString();
5744
- const { data: workflow } = yield textClientInstance.get(
5745
- `${urls5.getWorkflow(workflowId)}${query ? `?${query}` : ""}`,
5746
- getWorkflowApiCrmConfig(authorization)
5747
- );
5748
- return enrichWorkflowTrigger(workflow);
5749
- });
5750
- },
5751
- getWorkflowExecutions(workflowId, queryParams, authorization) {
5752
- return __async(this, null, function* () {
5753
- const { data: executions } = yield textClientInstance.get(
5754
- urls5.getWorkflowExecutions(workflowId, queryParams),
5755
- getWorkflowApiCrmConfig(authorization)
5756
- );
5757
- return executions;
5758
- });
5759
- },
5760
- getWorkflowExecution(workflowId, executionId, authorization) {
5761
- return __async(this, null, function* () {
5762
- const { data: execution } = yield textClientInstance.get(
5763
- urls5.getWorkflowExecution(workflowId, executionId),
5764
- getWorkflowApiCrmConfig(authorization)
5765
- );
5766
- return execution;
5767
- });
5768
- },
5769
- getWorkflowIntrospection(workflowId, version, authorization) {
5770
- return __async(this, null, function* () {
5771
- const searchParams = new URLSearchParams();
5772
- if (version) {
5773
- searchParams.append("version", `${version}`);
5774
- }
5775
- const query = searchParams.toString();
5776
- const { data: introspection } = yield textClientInstance.get(
5777
- `${urls5.getWorkflowIntrospection(workflowId)}${query ? `?${query}` : ""}`,
5778
- getWorkflowApiCrmConfig(authorization)
5779
- );
5780
- return {
5781
- tasks: introspection
5782
- };
6133
+ const config = getTextClientConfig(__spreadProps(__spreadValues({}, authorization), {
6134
+ ensureAuthorizationToken: true
6135
+ }));
6136
+ return textClientInstance.get(
6137
+ `/workflow_platform/external_resources/${encodeURIComponent(provider)}/${encodeURIComponent(resource.name)}`,
6138
+ __spreadProps(__spreadValues({}, config), {
6139
+ params,
6140
+ headers: __spreadProps(__spreadValues({}, config.headers), {
6141
+ "X-Cred-ID": authorization == null ? void 0 : authorization.credentialId
6142
+ })
6143
+ })
6144
+ ).catch((error) => {
6145
+ if (error instanceof TextApiError) {
6146
+ throw error.withCustomMessage(
6147
+ `Couldn't get external resources. [${error.message}]`
6148
+ );
6149
+ }
6150
+ throw error;
6151
+ });
5783
6152
  });
5784
6153
  }
5785
6154
  };
5786
6155
 
5787
- // src/apis/integrations/text/platform/workflow/workflows/internal/api.ts
5788
- var textPlatformWorkflowsInternalApi = {
5789
- crm: textPlatformWorkflowsInternalCrmApi
5790
- };
5791
-
5792
- // src/apis/integrations/text/platform/workflow/workflows/api.ts
5793
- var enrichWorkflowTrigger = (workflow) => {
5794
- var _a, _b, _c, _d, _e, _f;
5795
- 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}`;
5797
- }
5798
- if (((_c = workflow.trigger) == null ? void 0 : _c.type) === WorkflowTriggerType.webhookManual) {
5799
- workflow.trigger.name = "webhook_manual";
5800
- }
5801
- if (((_d = workflow.trigger) == null ? void 0 : _d.type) === WorkflowTriggerType.manual) {
5802
- workflow.trigger.name = "manual";
5803
- }
5804
- if (((_e = workflow.trigger) == null ? void 0 : _e.type) === WorkflowTriggerType.agent) {
5805
- workflow.trigger.name = "ai_agent";
5806
- }
5807
- if (((_f = workflow.trigger) == null ? void 0 : _f.type) === WorkflowTriggerType.recurring) {
5808
- workflow.trigger.name = "scheduled";
5809
- }
5810
- return workflow;
5811
- };
6156
+ // src/apis/integrations/text/platform/workflow/templates/api.ts
5812
6157
  var getUrl5 = (segments = [], version) => buildUrlFromSegments(
5813
6158
  segments,
5814
- `/workflow_platform/${version ? `${version}/` : ""}workflows`
6159
+ `/workflow_platform/${version ? `${version}/` : ""}workflows/templates`
5815
6160
  );
5816
6161
  var urls6 = {
5817
- getWorkflows: (queryParams) => enrichUrlWithQueryParams(getUrl5([], "v1.0" /* V1 */), queryParams),
5818
- createWorkflow: () => getUrl5(),
5819
- getWorkflow: (id) => getUrl5([id], "v1.0" /* V1 */),
5820
- updateWorkflow: (id) => getUrl5([id]),
5821
- deleteWorkflow: (id) => getUrl5([id]),
5822
- createWorkflowDraft: (id) => getUrl5([id, "draft"]),
5823
- publishWorkflowDraft: (id) => getUrl5([id, "publish"]),
5824
- toggleWorkflowActivation: (id) => getUrl5([id, "activation"]),
5825
- executeWorkflow: (id) => getUrl5([id, "executions"]),
5826
- getWorkflowExecutions: (id, queryParams) => enrichUrlWithQueryParams(
5827
- getUrl5([id, "executions"], "v1.0" /* V1 */),
5828
- queryParams
5829
- ),
5830
- getWorkflowExecution: (id, executionId) => getUrl5([id, "executions", executionId], "v1.0" /* V1 */),
5831
- getWorkflowIntrospection: (id) => getUrl5([id, "metadata"], "v1.0" /* V1 */),
5832
- introspectWorkflowTask: (id) => getUrl5([id, "run_task"], "v1.0" /* V1 */)
6162
+ getList: (queryParams) => enrichUrlWithQueryParams(getUrl5([], "v1.0" /* V1 */), queryParams),
6163
+ get: (templateId) => getUrl5([templateId], "v1.0" /* V1 */)
5833
6164
  };
5834
- var textPlatformWorkflowsApi = {
5835
- internal: textPlatformWorkflowsInternalApi,
6165
+ var textPlatformWorkflowsTemplatesApi = {
5836
6166
  meta: {
5837
6167
  urls: urls6
5838
6168
  },
5839
- getWorkflows(queryParams, authorization) {
5840
- return __async(this, null, function* () {
5841
- const { data: workflows } = yield textClientInstance.get(
5842
- urls6.getWorkflows(queryParams),
5843
- getTextClientConfig(__spreadProps(__spreadValues({}, authorization), {
5844
- ensureAuthorizationToken: true
5845
- }))
5846
- );
5847
- workflows.data = workflows.data.map(enrichWorkflowTrigger);
5848
- return workflows;
5849
- });
5850
- },
5851
- getWorkflow(workflowId, version, authorization) {
5852
- return __async(this, null, function* () {
5853
- const searchParams = new URLSearchParams();
5854
- if (version) {
5855
- searchParams.append("version", `${version}`);
5856
- }
5857
- const query = searchParams.toString();
5858
- const { data: workflow } = yield textClientInstance.get(
5859
- `${urls6.getWorkflow(workflowId)}${query ? `?${query}` : ""}`,
5860
- getTextClientConfig(__spreadProps(__spreadValues({}, authorization), {
5861
- ensureAuthorizationToken: true
5862
- }))
5863
- );
5864
- return enrichWorkflowTrigger(workflow);
5865
- });
5866
- },
5867
- createWorkflow(payload, authorization) {
5868
- return __async(this, null, function* () {
5869
- return textClientInstance.post(
5870
- urls6.createWorkflow(),
5871
- __spreadProps(__spreadValues({}, payload), {
5872
- trigger: payload.trigger || {}
5873
- }),
5874
- getTextClientConfig(__spreadProps(__spreadValues({}, authorization), {
5875
- ensureAuthorizationToken: true
5876
- }))
5877
- );
5878
- });
5879
- },
5880
- updateWorkflow(workflowId, payload, authorization) {
5881
- return __async(this, null, function* () {
5882
- return textClientInstance.put(
5883
- urls6.updateWorkflow(workflowId),
5884
- __spreadProps(__spreadValues({}, payload), {
5885
- trigger: payload.trigger || {}
5886
- }),
5887
- getTextClientConfig(__spreadProps(__spreadValues({}, authorization), {
5888
- ensureAuthorizationToken: true
5889
- }))
5890
- );
5891
- });
5892
- },
5893
- deleteWorkflow(workflowId, authorization) {
5894
- return __async(this, null, function* () {
5895
- return textClientInstance.delete(urls6.deleteWorkflow(workflowId), __spreadValues({}, getTextClientConfig(__spreadProps(__spreadValues({}, authorization), {
5896
- ensureAuthorizationToken: true
5897
- }))));
5898
- });
5899
- },
5900
- createWorkflowDraft(workflowId, payload, authorization) {
5901
- return __async(this, null, function* () {
5902
- return textClientInstance.post(
5903
- urls6.createWorkflowDraft(workflowId),
5904
- __spreadProps(__spreadValues({}, payload), {
5905
- trigger: payload.trigger || {}
5906
- }),
5907
- getTextClientConfig(__spreadProps(__spreadValues({}, authorization), {
5908
- ensureAuthorizationToken: true
5909
- }))
5910
- );
5911
- });
5912
- },
5913
- publishWorkflowDraft(workflowId, authorization) {
5914
- return __async(this, null, function* () {
5915
- return textClientInstance.post(
5916
- urls6.publishWorkflowDraft(workflowId),
5917
- getTextClientConfig(__spreadProps(__spreadValues({}, authorization), {
5918
- ensureAuthorizationToken: true
5919
- }))
5920
- );
5921
- });
5922
- },
5923
- toggleWorkflowActivation(workflowId, isActive, authorization) {
5924
- return __async(this, null, function* () {
5925
- return textClientInstance.put(
5926
- urls6.toggleWorkflowActivation(workflowId),
5927
- {
5928
- active: isActive
5929
- },
5930
- getTextClientConfig(__spreadProps(__spreadValues({}, authorization), {
5931
- ensureAuthorizationToken: true
5932
- }))
5933
- );
5934
- });
5935
- },
5936
- executeWorkflow(workflowId, input, authorization) {
5937
- return __async(this, null, function* () {
5938
- const { data: execution } = yield textClientInstance.post(
5939
- urls6.executeWorkflow(workflowId),
5940
- {
5941
- input
5942
- },
5943
- getTextClientConfig(__spreadProps(__spreadValues({}, authorization), {
5944
- ensureAuthorizationToken: true
5945
- }))
5946
- );
5947
- return execution;
5948
- });
5949
- },
5950
- getWorkflowExecutions(workflowId, queryParams, authorization) {
5951
- return __async(this, null, function* () {
5952
- const { data: executions } = yield textClientInstance.get(
5953
- urls6.getWorkflowExecutions(workflowId, queryParams),
5954
- getTextClientConfig(__spreadProps(__spreadValues({}, authorization), {
5955
- ensureAuthorizationToken: true
5956
- }))
5957
- );
5958
- return executions;
5959
- });
5960
- },
5961
- getWorkflowExecution(workflowId, executionId, authorization) {
5962
- return __async(this, null, function* () {
5963
- const { data: execution } = yield textClientInstance.get(
5964
- urls6.getWorkflowExecution(workflowId, executionId),
5965
- getTextClientConfig(__spreadProps(__spreadValues({}, authorization), {
5966
- ensureAuthorizationToken: true
5967
- }))
5968
- );
5969
- return execution;
5970
- });
5971
- },
5972
- getWorkflowIntrospection(workflowId, version, authorization) {
6169
+ getList(queryParams, authorization) {
5973
6170
  return __async(this, null, function* () {
5974
- const searchParams = new URLSearchParams();
5975
- if (version) {
5976
- searchParams.append("version", `${version}`);
5977
- }
5978
- const query = searchParams.toString();
5979
- const { data: introspection } = yield textClientInstance.get(
5980
- `${urls6.getWorkflowIntrospection(workflowId)}${query ? `?${query}` : ""}`,
6171
+ return textClientInstance.get(
6172
+ urls6.getList(queryParams),
5981
6173
  getTextClientConfig(__spreadProps(__spreadValues({}, authorization), {
5982
6174
  ensureAuthorizationToken: true
5983
6175
  }))
5984
- );
5985
- return {
5986
- tasks: introspection
5987
- };
6176
+ ).catch((error) => {
6177
+ if (error instanceof TextApiError) {
6178
+ throw error.withCustomMessage(
6179
+ `Couldn't get workflow templates. [${error.message}]`
6180
+ );
6181
+ }
6182
+ throw error;
6183
+ });
5988
6184
  });
5989
6185
  },
5990
- introspectWorkflowTask(workflowId, payload, authorization) {
6186
+ get(templateId, authorization) {
5991
6187
  return __async(this, null, function* () {
5992
- const response = yield textClientInstance.post(
5993
- urls6.introspectWorkflowTask(workflowId),
5994
- {
5995
- task_reference_name: payload.taskReferenceName,
5996
- input_parameters: payload.inputParameters
5997
- },
6188
+ return textClientInstance.get(
6189
+ urls6.get(templateId),
5998
6190
  getTextClientConfig(__spreadProps(__spreadValues({}, authorization), {
5999
6191
  ensureAuthorizationToken: true
6000
6192
  }))
6001
- );
6002
- return response.data;
6193
+ ).catch((error) => {
6194
+ if (error instanceof TextApiError) {
6195
+ throw error.withCustomMessage(
6196
+ `Couldn't get workflow template. [${error.message}]`
6197
+ );
6198
+ }
6199
+ throw error;
6200
+ });
6003
6201
  });
6004
6202
  }
6005
6203
  };
@@ -6019,11 +6217,87 @@ var textPlatformApi = {
6019
6217
  workflow: textPlatformWorkflowApi
6020
6218
  };
6021
6219
 
6220
+ // src/apis/integrations/text/resourcer/api.ts
6221
+ var buildResourcePath = ({ provider, domain, name }) => {
6222
+ let targetProvider = provider;
6223
+ if (["text-livechat" /* LiveChat */, "text-helpdesk" /* HelpDesk */].includes(
6224
+ provider
6225
+ )) {
6226
+ targetProvider = "text" /* Text */;
6227
+ }
6228
+ return [targetProvider, domain, name].filter(notEmpty).join("/");
6229
+ };
6230
+ var urls7 = {
6231
+ listSchema: () => "/workflow_resources/schema",
6232
+ getSchema: (provider) => `/workflow_resources/schema/${provider}`,
6233
+ getResource: (resource) => `/workflow_resources/resources/${buildResourcePath(resource)}`
6234
+ };
6235
+ var textResourcerApi = {
6236
+ getResource(resource, credentialId, authorization) {
6237
+ return __async(this, null, function* () {
6238
+ const config = getTextClientConfig(__spreadProps(__spreadValues({}, authorization), {
6239
+ ensureAuthorizationToken: true
6240
+ }));
6241
+ return textClientInstance.get(urls7.getResource(resource), __spreadProps(__spreadValues({}, config), {
6242
+ headers: __spreadProps(__spreadValues({}, config.headers), {
6243
+ "X-Credential-ID": credentialId
6244
+ })
6245
+ })).catch((error) => {
6246
+ if (error instanceof TextApiError) {
6247
+ throw error.withCustomMessage(
6248
+ `Couldn't get resourcer resource. [${error.message}]`
6249
+ );
6250
+ }
6251
+ throw error;
6252
+ });
6253
+ });
6254
+ },
6255
+ listSchema(credentialId, authorization) {
6256
+ return __async(this, null, function* () {
6257
+ const config = getTextClientConfig(__spreadProps(__spreadValues({}, authorization), {
6258
+ ensureAuthorizationToken: true
6259
+ }));
6260
+ return textClientInstance.get(urls7.listSchema(), __spreadProps(__spreadValues({}, config), {
6261
+ headers: __spreadProps(__spreadValues({}, config.headers), {
6262
+ "X-Credential-ID": credentialId
6263
+ })
6264
+ })).catch((error) => {
6265
+ if (error instanceof TextApiError) {
6266
+ throw error.withCustomMessage(
6267
+ `Couldn't list resourcer schema. [${error.message}]`
6268
+ );
6269
+ }
6270
+ throw error;
6271
+ });
6272
+ });
6273
+ },
6274
+ getSchema(provider, credentialId, authorization) {
6275
+ return __async(this, null, function* () {
6276
+ const config = getTextClientConfig(__spreadProps(__spreadValues({}, authorization), {
6277
+ ensureAuthorizationToken: true
6278
+ }));
6279
+ return textClientInstance.get(urls7.getSchema(provider), __spreadProps(__spreadValues({}, config), {
6280
+ headers: __spreadProps(__spreadValues({}, config.headers), {
6281
+ "X-Credential-ID": credentialId
6282
+ })
6283
+ })).catch((error) => {
6284
+ if (error instanceof TextApiError) {
6285
+ throw error.withCustomMessage(
6286
+ `Couldn't get resourcer schema. [${error.message}]`
6287
+ );
6288
+ }
6289
+ throw error;
6290
+ });
6291
+ });
6292
+ }
6293
+ };
6294
+
6022
6295
  // src/apis/integrations/text/api.ts
6023
6296
  var textApi = {
6024
6297
  platform: textPlatformApi,
6025
6298
  ai: textAiAgentApi,
6026
- externalAccountManager: textExternalAccountManagerApi
6299
+ externalAccountManager: textExternalAccountManagerApi,
6300
+ resourcer: textResourcerApi
6027
6301
  };
6028
6302
 
6029
6303
  // src/apis/integrations/vercel/api.ts
@@ -6324,7 +6598,7 @@ var integrationsApi = {
6324
6598
  };
6325
6599
 
6326
6600
  // src/apis/platform/accounts/accounts/api.ts
6327
- var urls7 = (withBaseUrl = false) => {
6601
+ var urls8 = (withBaseUrl = false) => {
6328
6602
  const getUrl7 = (segments = []) => buildUrlFromSegments(
6329
6603
  segments,
6330
6604
  "/v2/accounts",
@@ -6340,7 +6614,7 @@ var api2 = {
6340
6614
  getAccounts(authorization) {
6341
6615
  return __async(this, null, function* () {
6342
6616
  return platformAccountsClientInstance.get(
6343
- urls7().getAccounts(),
6617
+ urls8().getAccounts(),
6344
6618
  {
6345
6619
  authorization,
6346
6620
  customErrorMessage: "Accounts couldn't be fetched."
@@ -6351,7 +6625,7 @@ var api2 = {
6351
6625
  getAccount(accountId, authorization) {
6352
6626
  return __async(this, null, function* () {
6353
6627
  return platformAccountsClientInstance.get(
6354
- urls7().getAccount(accountId),
6628
+ urls8().getAccount(accountId),
6355
6629
  {
6356
6630
  authorization,
6357
6631
  customErrorMessage: "Account couldn't be fetched."
@@ -6373,7 +6647,7 @@ var api2 = {
6373
6647
  };
6374
6648
  var platformAccountsAccountApi = __spreadProps(__spreadValues({}, api2), {
6375
6649
  meta: {
6376
- urls: urls7
6650
+ urls: urls8
6377
6651
  }
6378
6652
  });
6379
6653
 
@@ -6539,18 +6813,18 @@ var platformAccountsPersonalAccessTokenApi = {
6539
6813
 
6540
6814
  // src/apis/platform/accounts/products/api.ts
6541
6815
  var getUrl6 = (segments = []) => buildUrlFromSegments(segments, "/v2/organizations");
6542
- var urls8 = {
6816
+ var urls9 = {
6543
6817
  getOrganizationProducts: () => getUrl6(["my", "products"]),
6544
6818
  updateOrganizationProducts: () => getUrl6(["my", "products"])
6545
6819
  };
6546
6820
  var platformAccountsProductsApi = {
6547
6821
  meta: {
6548
- urls: urls8
6822
+ urls: urls9
6549
6823
  },
6550
6824
  getOrganizationProducts(authorization) {
6551
6825
  return __async(this, null, function* () {
6552
6826
  return platformAccountsClientInstance.get(
6553
- urls8.getOrganizationProducts(),
6827
+ urls9.getOrganizationProducts(),
6554
6828
  { authorization, customErrorMessage: "Products couldn't be fetched." }
6555
6829
  );
6556
6830
  });
@@ -6558,7 +6832,7 @@ var platformAccountsProductsApi = {
6558
6832
  updateOrganizationProducts(payload, authorization) {
6559
6833
  return __async(this, null, function* () {
6560
6834
  return platformAccountsClientInstance.post(
6561
- urls8.updateOrganizationProducts(),
6835
+ urls9.updateOrganizationProducts(),
6562
6836
  payload,
6563
6837
  { authorization, customErrorMessage: "Products couldn't be updated." }
6564
6838
  );
@@ -7988,7 +8262,7 @@ var platformDpsApplicationStatsApi = {
7988
8262
  var platformDpsApplicationWebhooksApi = {
7989
8263
  updateAppWebhooks(appId, payload, authorization) {
7990
8264
  return __async(this, null, function* () {
7991
- yield dpsClientInstance.put(
8265
+ return dpsClientInstance.put(
7992
8266
  `/v2/applications/${encodeURIComponent(appId)}/webhook`,
7993
8267
  payload,
7994
8268
  getDpsClientConfig(authorization)
@@ -9188,7 +9462,7 @@ var livechatWebhookApi = {
9188
9462
  registerWebhook(webhook, authorization) {
9189
9463
  return __async(this, null, function* () {
9190
9464
  yield livechatClientInstance.post(
9191
- `/v${webhook.api_version || "3.5"}/configuration/action/register_webhook`,
9465
+ `/v${webhook.api_version || "3.6"}/configuration/action/register_webhook`,
9192
9466
  {
9193
9467
  url: webhook.url,
9194
9468
  action: webhook.action,
@@ -9214,7 +9488,7 @@ var livechatWebhookApi = {
9214
9488
  yield Promise.all(
9215
9489
  webhooks.map((webhook) => __async(this, null, function* () {
9216
9490
  return livechatClientInstance.post(
9217
- `/v${webhook.api_version || "3.5"}/configuration/action/register_webhook`,
9491
+ `/v${webhook.api_version || "3.6"}/configuration/action/register_webhook`,
9218
9492
  {
9219
9493
  url: webhook.url,
9220
9494
  action: webhook.action,
@@ -9584,6 +9858,7 @@ function initApi(config, tokens) {
9584
9858
  BigCommerceApiError,
9585
9859
  BigCommerceEventNames,
9586
9860
  BigCommerceWebhookScopes,
9861
+ CdpCustomerEventType,
9587
9862
  ConsoleApiError,
9588
9863
  CredentialStatus,
9589
9864
  CredentialType,
@@ -9620,9 +9895,12 @@ function initApi(config, tokens) {
9620
9895
  SlackMessageEventSubTypes,
9621
9896
  SortBy,
9622
9897
  SortOrder,
9898
+ TRIGGER_REFERENCE_NAME,
9623
9899
  TextApiError,
9900
+ TextCustomerEventNames,
9624
9901
  TextHelpDeskEventNames,
9625
9902
  TextLivechatEventNames,
9903
+ TextLivechatProductCardEventType,
9626
9904
  TicketPriority,
9627
9905
  TicketStatus,
9628
9906
  UnauthorizeAccountsApiError,
@@ -9632,12 +9910,12 @@ function initApi(config, tokens) {
9632
9910
  WorkflowConditionTaskOperator,
9633
9911
  WorkflowConditionTaskOperatorGroup,
9634
9912
  WorkflowConditionTaskOperatorValueType,
9635
- WorkflowDefinitionCustomTaskName,
9636
- WorkflowDefinitionTaskType,
9913
+ WorkflowCustomTaskName,
9637
9914
  WorkflowExecutionDefinitionStatus,
9638
9915
  WorkflowExecutionStatus,
9639
9916
  WorkflowExecutionTaskStatus,
9640
9917
  WorkflowItemKind,
9918
+ WorkflowTaskType,
9641
9919
  WorkflowTemplateCategory,
9642
9920
  WorkflowTriggerType,
9643
9921
  WorkflowsApiError,
@@ -9653,8 +9931,10 @@ function initApi(config, tokens) {
9653
9931
  bigcommerceEventsZods,
9654
9932
  billingClientInstance,
9655
9933
  buildUrlFromSegments,
9934
+ cdpCustomerEventMessageZod,
9656
9935
  consoleClientInstance,
9657
9936
  dpsClientInstance,
9937
+ enrichWorkflowTrigger,
9658
9938
  extractTokenFromAuthorizationHeader,
9659
9939
  getAdapterClientConfig,
9660
9940
  getAdapterClientDefaultConfig,
@@ -9728,6 +10008,7 @@ function initApi(config, tokens) {
9728
10008
  integrationSubscriptionZods,
9729
10009
  isFilter,
9730
10010
  isFilterGroup,
10011
+ isWorkflowBaseHttpTaskCore,
9731
10012
  livechatClientInstance,
9732
10013
  mailchimpClientInstance,
9733
10014
  mailchimpEventsZods,
@@ -9742,6 +10023,8 @@ function initApi(config, tokens) {
9742
10023
  slackClientInstance,
9743
10024
  slackEventsZods,
9744
10025
  textClientInstance,
10026
+ textCustomerEventsZods,
10027
+ textEventsZods,
9745
10028
  textHelpDeskEventsZods,
9746
10029
  textLivechatEventsZods,
9747
10030
  updateAdapterClient,