@livechat/developer-studio-api 4.1.0 → 5.2.0-beta.v2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +3859 -1042
- package/dist/index.d.ts +3859 -1042
- package/dist/index.js +468 -197
- package/dist/index.mjs +459 -195
- package/package.json +3 -3
package/dist/index.mjs
CHANGED
|
@@ -170,6 +170,11 @@ var extractTokenFromAuthorizationHeader = (headerValue) => {
|
|
|
170
170
|
// src/utils/integrations/getIntegrationFlowUrl.ts
|
|
171
171
|
import { v4 as uuidv4 } from "uuid";
|
|
172
172
|
|
|
173
|
+
// ../../../private/utils/src/arrays/notEmpty.ts
|
|
174
|
+
function notEmpty(item) {
|
|
175
|
+
return Boolean(item);
|
|
176
|
+
}
|
|
177
|
+
|
|
173
178
|
// ../../../private/utils/src/misc/merge-deep.ts
|
|
174
179
|
function isObject(item) {
|
|
175
180
|
return item !== null && typeof item === "object" && !Array.isArray(item);
|
|
@@ -252,6 +257,7 @@ var IntegrationNames = /* @__PURE__ */ ((IntegrationNames2) => {
|
|
|
252
257
|
IntegrationNames2["HelpDesk"] = "text-helpdesk";
|
|
253
258
|
IntegrationNames2["Slack"] = "slack";
|
|
254
259
|
IntegrationNames2["Salesforce"] = "salesforce";
|
|
260
|
+
IntegrationNames2["Klaviyo"] = "klaviyo";
|
|
255
261
|
return IntegrationNames2;
|
|
256
262
|
})(IntegrationNames || {});
|
|
257
263
|
var IntegrationDisplayNames = /* @__PURE__ */ ((IntegrationDisplayNames2) => {
|
|
@@ -271,6 +277,7 @@ var IntegrationDisplayNames = /* @__PURE__ */ ((IntegrationDisplayNames2) => {
|
|
|
271
277
|
IntegrationDisplayNames2["HelpDesk"] = "HelpDesk";
|
|
272
278
|
IntegrationDisplayNames2["Slack"] = "Slack";
|
|
273
279
|
IntegrationDisplayNames2["Salesforce"] = "Salesforce";
|
|
280
|
+
IntegrationDisplayNames2["Klaviyo"] = "Klaviyo";
|
|
274
281
|
return IntegrationDisplayNames2;
|
|
275
282
|
})(IntegrationDisplayNames || {});
|
|
276
283
|
var IntegrationDisplayNameToNameMap = Object.keys(IntegrationNames).reduce(
|
|
@@ -289,7 +296,7 @@ var IntegrationNameToDisplayMap = Object.keys(IntegrationNames).reduce(
|
|
|
289
296
|
);
|
|
290
297
|
|
|
291
298
|
// src/apis/text-intelligence/workflows/adapter/integrations/_contracts/requests/events.ts
|
|
292
|
-
import { z as
|
|
299
|
+
import { z as z11 } from "zod";
|
|
293
300
|
|
|
294
301
|
// src/apis/text-intelligence/workflows/adapter/integrations/bigcommerce/_contracts/requests/events.ts
|
|
295
302
|
import { z as z2 } from "zod";
|
|
@@ -626,8 +633,57 @@ var slackEventsZods = {
|
|
|
626
633
|
}
|
|
627
634
|
};
|
|
628
635
|
|
|
629
|
-
// src/apis/text-intelligence/workflows/adapter/integrations/text/_contracts/requests/events/
|
|
636
|
+
// src/apis/text-intelligence/workflows/adapter/integrations/text/_contracts/requests/events/domains/customer.ts
|
|
630
637
|
import { z as z7 } from "zod";
|
|
638
|
+
var TextCustomerEventNames = /* @__PURE__ */ ((TextCustomerEventNames2) => {
|
|
639
|
+
TextCustomerEventNames2["EmailSet"] = "customer_email_set";
|
|
640
|
+
TextCustomerEventNames2["PropertiesValuesUpdated"] = "customer_properties_values_updated";
|
|
641
|
+
return TextCustomerEventNames2;
|
|
642
|
+
})(TextCustomerEventNames || {});
|
|
643
|
+
var textCustomerEventsZods = {
|
|
644
|
+
eventName: z7.nativeEnum(TextCustomerEventNames),
|
|
645
|
+
events: {
|
|
646
|
+
emailSet: integrationEventBase.extend({
|
|
647
|
+
name: z7.literal("customer_email_set" /* EmailSet */),
|
|
648
|
+
filters: z7.array(z7.string().min(1)).min(1).optional()
|
|
649
|
+
}),
|
|
650
|
+
propertiesValuesUpdated: integrationEventBase.extend({
|
|
651
|
+
name: z7.literal("customer_properties_values_updated" /* PropertiesValuesUpdated */),
|
|
652
|
+
properties: z7.array(
|
|
653
|
+
z7.object({
|
|
654
|
+
id: z7.string().min(1),
|
|
655
|
+
to: z7.union([z7.string(), z7.number(), z7.boolean()]).optional()
|
|
656
|
+
})
|
|
657
|
+
).optional()
|
|
658
|
+
})
|
|
659
|
+
},
|
|
660
|
+
get event() {
|
|
661
|
+
return z7.discriminatedUnion("name", [
|
|
662
|
+
this.events.emailSet,
|
|
663
|
+
this.events.propertiesValuesUpdated
|
|
664
|
+
]);
|
|
665
|
+
},
|
|
666
|
+
get subscribe() {
|
|
667
|
+
return integrationEventsCoreZods.withCore(
|
|
668
|
+
z7.object({
|
|
669
|
+
event: this.event,
|
|
670
|
+
callback: z7.string()
|
|
671
|
+
})
|
|
672
|
+
);
|
|
673
|
+
},
|
|
674
|
+
get unsubscribe() {
|
|
675
|
+
return integrationEventsCoreZods.withCore(
|
|
676
|
+
z7.object({
|
|
677
|
+
event: z7.object({
|
|
678
|
+
name: this.eventName
|
|
679
|
+
})
|
|
680
|
+
})
|
|
681
|
+
);
|
|
682
|
+
}
|
|
683
|
+
};
|
|
684
|
+
|
|
685
|
+
// src/apis/text-intelligence/workflows/adapter/integrations/text/_contracts/requests/events/helpdesk.ts
|
|
686
|
+
import { z as z8 } from "zod";
|
|
631
687
|
|
|
632
688
|
// src/apis/products/helpdesk/_contracts/dtos/ticket.ts
|
|
633
689
|
var TicketStatus = /* @__PURE__ */ ((TicketStatus2) => {
|
|
@@ -655,64 +711,87 @@ var TextHelpDeskEventNames = /* @__PURE__ */ ((TextHelpDeskEventNames2) => {
|
|
|
655
711
|
TextHelpDeskEventNames2["TicketTagsChanged"] = "ticket_tags_added";
|
|
656
712
|
TextHelpDeskEventNames2["TicketFollowersChanged"] = "ticket_followers_added";
|
|
657
713
|
TextHelpDeskEventNames2["TicketAssignmentChanged"] = "ticket_assignment_added";
|
|
714
|
+
TextHelpDeskEventNames2["TicketCustomFieldsChanged"] = "ticket_custom_fields_changed";
|
|
658
715
|
TextHelpDeskEventNames2["TicketMessageAdded"] = "ticket_message_added";
|
|
659
716
|
return TextHelpDeskEventNames2;
|
|
660
717
|
})(TextHelpDeskEventNames || {});
|
|
661
|
-
var assignmentZod =
|
|
662
|
-
agent:
|
|
663
|
-
team:
|
|
718
|
+
var assignmentZod = z8.object({
|
|
719
|
+
agent: z8.string().optional(),
|
|
720
|
+
team: z8.string().optional()
|
|
664
721
|
});
|
|
665
|
-
var baseFiltersZod =
|
|
722
|
+
var baseFiltersZod = z8.object({
|
|
666
723
|
assignment: assignmentZod.optional(),
|
|
667
|
-
mailbox:
|
|
724
|
+
mailbox: z8.string().optional()
|
|
668
725
|
});
|
|
669
726
|
var textHelpDeskEventsZods = {
|
|
670
|
-
provider:
|
|
671
|
-
eventName:
|
|
727
|
+
provider: z8.literal("text-helpdesk" /* HelpDesk */),
|
|
728
|
+
eventName: z8.nativeEnum(TextHelpDeskEventNames),
|
|
672
729
|
events: {
|
|
673
730
|
ticketCreated: integrationEventBase.extend({
|
|
674
|
-
name:
|
|
731
|
+
name: z8.literal("ticket_created" /* TicketCreated */)
|
|
675
732
|
}).extend(baseFiltersZod.shape),
|
|
676
733
|
ticketUpdated: integrationEventBase.extend({
|
|
677
|
-
name:
|
|
734
|
+
name: z8.literal("ticket_updated" /* TicketUpdated */)
|
|
678
735
|
}).extend(baseFiltersZod.shape),
|
|
679
736
|
ticketStatusChanged: integrationEventBase.extend({
|
|
680
|
-
name:
|
|
681
|
-
status:
|
|
682
|
-
from:
|
|
683
|
-
to:
|
|
737
|
+
name: z8.literal("ticket_status_changed" /* TicketStatusChanged */),
|
|
738
|
+
status: z8.object({
|
|
739
|
+
from: z8.array(z8.nativeEnum(TicketStatus)).optional(),
|
|
740
|
+
to: z8.array(z8.nativeEnum(TicketStatus)).optional()
|
|
684
741
|
}).optional()
|
|
685
742
|
}).extend(baseFiltersZod.shape),
|
|
686
743
|
ticketPriorityChanged: integrationEventBase.extend({
|
|
687
|
-
name:
|
|
688
|
-
priority:
|
|
689
|
-
from:
|
|
690
|
-
to:
|
|
744
|
+
name: z8.literal("ticket_priority_changed" /* TicketPriorityChanged */),
|
|
745
|
+
priority: z8.object({
|
|
746
|
+
from: z8.array(z8.nativeEnum(TicketPriority)).optional(),
|
|
747
|
+
to: z8.array(z8.nativeEnum(TicketPriority)).optional()
|
|
691
748
|
}).optional()
|
|
692
749
|
}).extend(baseFiltersZod.shape),
|
|
693
750
|
ticketTagsChanged: integrationEventBase.extend({
|
|
694
|
-
name:
|
|
695
|
-
tags:
|
|
696
|
-
from:
|
|
697
|
-
to:
|
|
751
|
+
name: z8.literal("ticket_tags_added" /* TicketTagsChanged */),
|
|
752
|
+
tags: z8.object({
|
|
753
|
+
from: z8.array(z8.string()).optional(),
|
|
754
|
+
to: z8.array(z8.string()).optional()
|
|
698
755
|
}).optional()
|
|
699
756
|
}).extend(baseFiltersZod.shape),
|
|
700
757
|
ticketFollowersChanged: integrationEventBase.extend({
|
|
701
|
-
name:
|
|
702
|
-
from:
|
|
703
|
-
to:
|
|
758
|
+
name: z8.literal("ticket_followers_added" /* TicketFollowersChanged */),
|
|
759
|
+
from: z8.array(z8.string()).optional(),
|
|
760
|
+
to: z8.array(z8.string()).optional()
|
|
704
761
|
}).extend(baseFiltersZod.shape),
|
|
705
762
|
ticketAssignmentChanged: integrationEventBase.extend({
|
|
706
|
-
name:
|
|
707
|
-
from:
|
|
708
|
-
to:
|
|
763
|
+
name: z8.literal("ticket_assignment_added" /* TicketAssignmentChanged */),
|
|
764
|
+
from: z8.array(assignmentZod).optional(),
|
|
765
|
+
to: z8.array(assignmentZod).optional()
|
|
766
|
+
}).extend(baseFiltersZod.shape),
|
|
767
|
+
ticketCustomFieldsChanged: integrationEventBase.extend({
|
|
768
|
+
name: z8.literal("ticket_custom_fields_changed" /* TicketCustomFieldsChanged */),
|
|
769
|
+
customFields: z8.array(
|
|
770
|
+
z8.object({
|
|
771
|
+
id: z8.string().min(1),
|
|
772
|
+
from: z8.string().min(1).optional(),
|
|
773
|
+
to: z8.string().min(1).optional()
|
|
774
|
+
})
|
|
775
|
+
).optional()
|
|
709
776
|
}).extend(baseFiltersZod.shape),
|
|
710
|
-
ticketMessageAdded:
|
|
711
|
-
|
|
712
|
-
|
|
777
|
+
ticketMessageAdded: z8.discriminatedUnion("version", [
|
|
778
|
+
z8.object({
|
|
779
|
+
name: z8.literal("ticket_message_added" /* TicketMessageAdded */),
|
|
780
|
+
version: z8.undefined()
|
|
781
|
+
}).extend(baseFiltersZod.shape),
|
|
782
|
+
z8.object({
|
|
783
|
+
name: z8.literal("ticket_message_added" /* TicketMessageAdded */),
|
|
784
|
+
version: z8.literal("v1"),
|
|
785
|
+
from: z8.enum(["anyone", "agent", "requester"]).optional(),
|
|
786
|
+
privacy: z8.enum(["any", "public", "private"]).optional(),
|
|
787
|
+
filters: z8.array(z8.string()).optional(),
|
|
788
|
+
caseInsensitive: z8.boolean().optional(),
|
|
789
|
+
matchWholeWords: z8.boolean().optional()
|
|
790
|
+
}).extend(baseFiltersZod.shape)
|
|
791
|
+
])
|
|
713
792
|
},
|
|
714
793
|
get event() {
|
|
715
|
-
return
|
|
794
|
+
return z8.union([
|
|
716
795
|
this.events.ticketCreated,
|
|
717
796
|
this.events.ticketUpdated,
|
|
718
797
|
this.events.ticketStatusChanged,
|
|
@@ -720,33 +799,34 @@ var textHelpDeskEventsZods = {
|
|
|
720
799
|
this.events.ticketTagsChanged,
|
|
721
800
|
this.events.ticketFollowersChanged,
|
|
722
801
|
this.events.ticketAssignmentChanged,
|
|
723
|
-
this.events.ticketMessageAdded
|
|
802
|
+
this.events.ticketMessageAdded,
|
|
803
|
+
this.events.ticketCustomFieldsChanged
|
|
724
804
|
]);
|
|
725
805
|
},
|
|
726
806
|
get subscribe() {
|
|
727
807
|
return integrationEventsCoreZods.withCore(
|
|
728
|
-
|
|
808
|
+
z8.object({
|
|
729
809
|
event: this.event,
|
|
730
|
-
callback:
|
|
810
|
+
callback: z8.string()
|
|
731
811
|
})
|
|
732
812
|
);
|
|
733
813
|
},
|
|
734
814
|
get subscribeContent() {
|
|
735
|
-
return
|
|
815
|
+
return z8.object({
|
|
736
816
|
provider: this.provider,
|
|
737
817
|
event: this.event,
|
|
738
|
-
callback:
|
|
818
|
+
callback: z8.string()
|
|
739
819
|
});
|
|
740
820
|
},
|
|
741
821
|
get unsubscribe() {
|
|
742
822
|
return integrationEventsCoreZods.withCore(
|
|
743
|
-
|
|
823
|
+
z8.object({
|
|
744
824
|
event: this.event
|
|
745
825
|
})
|
|
746
826
|
);
|
|
747
827
|
},
|
|
748
828
|
get unsubscribeContent() {
|
|
749
|
-
return
|
|
829
|
+
return z8.object({
|
|
750
830
|
provider: this.provider,
|
|
751
831
|
event: this.event
|
|
752
832
|
});
|
|
@@ -754,7 +834,7 @@ var textHelpDeskEventsZods = {
|
|
|
754
834
|
};
|
|
755
835
|
|
|
756
836
|
// src/apis/text-intelligence/workflows/adapter/integrations/text/_contracts/requests/events/livechat.ts
|
|
757
|
-
import { z as
|
|
837
|
+
import { z as z9 } from "zod";
|
|
758
838
|
var TextLivechatEventNames = /* @__PURE__ */ ((TextLivechatEventNames2) => {
|
|
759
839
|
TextLivechatEventNames2["ChatStarted"] = "chat_started";
|
|
760
840
|
TextLivechatEventNames2["ChatEnded"] = "chat_ended";
|
|
@@ -766,6 +846,8 @@ var TextLivechatEventNames = /* @__PURE__ */ ((TextLivechatEventNames2) => {
|
|
|
766
846
|
TextLivechatEventNames2["UserAddedToChat"] = "user_added_to_chat";
|
|
767
847
|
TextLivechatEventNames2["UserRemovedFromChat"] = "user_removed_from_chat";
|
|
768
848
|
TextLivechatEventNames2["CustomerLeftChat"] = "customer_left_chat";
|
|
849
|
+
TextLivechatEventNames2["ChatIdle"] = "chat_idle";
|
|
850
|
+
TextLivechatEventNames2["ProductCardEvent"] = "product_card_event";
|
|
769
851
|
return TextLivechatEventNames2;
|
|
770
852
|
})(TextLivechatEventNames || {});
|
|
771
853
|
var CustomerLeftChatReason = /* @__PURE__ */ ((CustomerLeftChatReason2) => {
|
|
@@ -774,63 +856,78 @@ var CustomerLeftChatReason = /* @__PURE__ */ ((CustomerLeftChatReason2) => {
|
|
|
774
856
|
CustomerLeftChatReason2["Inactive"] = "inactive";
|
|
775
857
|
return CustomerLeftChatReason2;
|
|
776
858
|
})(CustomerLeftChatReason || {});
|
|
859
|
+
var TextLivechatProductCardEventType = /* @__PURE__ */ ((TextLivechatProductCardEventType2) => {
|
|
860
|
+
TextLivechatProductCardEventType2["ViewProduct"] = "view_product";
|
|
861
|
+
TextLivechatProductCardEventType2["AddToCart"] = "add_to_cart";
|
|
862
|
+
return TextLivechatProductCardEventType2;
|
|
863
|
+
})(TextLivechatProductCardEventType || {});
|
|
777
864
|
var textLivechatEventsZods = {
|
|
778
|
-
provider:
|
|
779
|
-
eventName:
|
|
865
|
+
provider: z9.literal("text-livechat" /* LiveChat */),
|
|
866
|
+
eventName: z9.nativeEnum(TextLivechatEventNames),
|
|
780
867
|
events: {
|
|
781
868
|
chatStarted: integrationEventBase.extend({
|
|
782
|
-
name:
|
|
783
|
-
targetAgentId:
|
|
869
|
+
name: z9.literal("chat_started" /* ChatStarted */),
|
|
870
|
+
targetAgentId: z9.string().optional()
|
|
784
871
|
}),
|
|
785
872
|
chatEnded: integrationEventBase.extend({
|
|
786
|
-
name:
|
|
873
|
+
name: z9.literal("chat_ended" /* ChatEnded */)
|
|
787
874
|
}),
|
|
788
875
|
chatTransferred: integrationEventBase.extend({
|
|
789
|
-
name:
|
|
790
|
-
targetGroups:
|
|
791
|
-
targetAgents:
|
|
876
|
+
name: z9.literal("chat_transferred" /* ChatTransferred */),
|
|
877
|
+
targetGroups: z9.array(z9.number()).optional(),
|
|
878
|
+
targetAgents: z9.array(z9.string()).optional()
|
|
792
879
|
}),
|
|
793
880
|
chatTagged: integrationEventBase.extend({
|
|
794
|
-
name:
|
|
795
|
-
tag:
|
|
796
|
-
exact:
|
|
881
|
+
name: z9.literal("chat_tagged" /* ChatTagged */),
|
|
882
|
+
tag: z9.string().optional(),
|
|
883
|
+
exact: z9.boolean().optional()
|
|
797
884
|
}),
|
|
798
885
|
chatRated: integrationEventBase.extend({
|
|
799
|
-
name:
|
|
800
|
-
rating:
|
|
886
|
+
name: z9.literal("chat_rated" /* ChatRated */),
|
|
887
|
+
rating: z9.enum(["good", "bad", "all"]).optional()
|
|
801
888
|
}),
|
|
802
889
|
chatCommented: integrationEventBase.extend({
|
|
803
|
-
name:
|
|
890
|
+
name: z9.literal("chat_commented" /* ChatCommented */)
|
|
804
891
|
}),
|
|
805
|
-
chatMessage:
|
|
806
|
-
|
|
807
|
-
name:
|
|
808
|
-
version:
|
|
809
|
-
filter:
|
|
810
|
-
caseInsensitive:
|
|
892
|
+
chatMessage: z9.discriminatedUnion("version", [
|
|
893
|
+
z9.object({
|
|
894
|
+
name: z9.literal("chat_message" /* ChatMessage */),
|
|
895
|
+
version: z9.undefined(),
|
|
896
|
+
filter: z9.string().optional(),
|
|
897
|
+
caseInsensitive: z9.boolean().optional(),
|
|
898
|
+
matchWholeWords: z9.boolean().optional()
|
|
811
899
|
}),
|
|
812
|
-
|
|
813
|
-
name:
|
|
814
|
-
version:
|
|
815
|
-
filters:
|
|
816
|
-
caseInsensitive:
|
|
900
|
+
z9.object({
|
|
901
|
+
name: z9.literal("chat_message" /* ChatMessage */),
|
|
902
|
+
version: z9.literal("v1"),
|
|
903
|
+
filters: z9.array(z9.string()),
|
|
904
|
+
caseInsensitive: z9.boolean().optional(),
|
|
905
|
+
matchWholeWords: z9.boolean().optional()
|
|
817
906
|
})
|
|
818
907
|
]),
|
|
819
908
|
userAddedToChat: integrationEventBase.extend({
|
|
820
|
-
name:
|
|
821
|
-
userType:
|
|
822
|
-
targetAgentId:
|
|
909
|
+
name: z9.literal("user_added_to_chat" /* UserAddedToChat */),
|
|
910
|
+
userType: z9.enum(["agent", "customer"]).optional(),
|
|
911
|
+
targetAgentId: z9.string().optional()
|
|
823
912
|
}),
|
|
824
913
|
userRemovedFromChat: integrationEventBase.extend({
|
|
825
|
-
name:
|
|
914
|
+
name: z9.literal("user_removed_from_chat" /* UserRemovedFromChat */)
|
|
826
915
|
}),
|
|
827
916
|
customerLeftChat: integrationEventBase.extend({
|
|
828
|
-
name:
|
|
829
|
-
reasons:
|
|
917
|
+
name: z9.literal("customer_left_chat" /* CustomerLeftChat */),
|
|
918
|
+
reasons: z9.array(z9.nativeEnum(CustomerLeftChatReason)).optional()
|
|
919
|
+
}),
|
|
920
|
+
chatIdle: integrationEventBase.extend({
|
|
921
|
+
name: z9.literal("chat_idle" /* ChatIdle */)
|
|
922
|
+
}),
|
|
923
|
+
productCardEvent: integrationEventBase.extend({
|
|
924
|
+
name: z9.literal("product_card_event" /* ProductCardEvent */),
|
|
925
|
+
type: z9.nativeEnum(TextLivechatProductCardEventType),
|
|
926
|
+
product_id: z9.string().optional()
|
|
830
927
|
})
|
|
831
928
|
},
|
|
832
929
|
get event() {
|
|
833
|
-
return
|
|
930
|
+
return z9.union([
|
|
834
931
|
this.events.chatStarted,
|
|
835
932
|
this.events.chatEnded,
|
|
836
933
|
this.events.chatTransferred,
|
|
@@ -840,33 +937,72 @@ var textLivechatEventsZods = {
|
|
|
840
937
|
this.events.chatMessage,
|
|
841
938
|
this.events.userAddedToChat,
|
|
842
939
|
this.events.userRemovedFromChat,
|
|
843
|
-
this.events.customerLeftChat
|
|
940
|
+
this.events.customerLeftChat,
|
|
941
|
+
this.events.chatIdle,
|
|
942
|
+
this.events.productCardEvent
|
|
844
943
|
]);
|
|
845
944
|
},
|
|
846
945
|
get subscribe() {
|
|
847
946
|
return integrationEventsCoreZods.withCore(
|
|
848
|
-
|
|
947
|
+
z9.object({
|
|
849
948
|
event: this.event,
|
|
850
|
-
callback:
|
|
949
|
+
callback: z9.string()
|
|
851
950
|
})
|
|
852
951
|
);
|
|
853
952
|
},
|
|
854
953
|
get subscribeContent() {
|
|
855
|
-
return
|
|
954
|
+
return z9.object({
|
|
856
955
|
provider: this.provider,
|
|
857
956
|
event: this.event,
|
|
858
|
-
callback:
|
|
957
|
+
callback: z9.string()
|
|
859
958
|
});
|
|
860
959
|
},
|
|
861
960
|
get unsubscribe() {
|
|
862
961
|
return integrationEventsCoreZods.withCore(
|
|
863
|
-
|
|
962
|
+
z9.object({
|
|
864
963
|
event: this.event
|
|
865
964
|
})
|
|
866
965
|
);
|
|
867
966
|
},
|
|
868
967
|
get unsubscribeContent() {
|
|
869
|
-
return
|
|
968
|
+
return z9.object({
|
|
969
|
+
provider: this.provider,
|
|
970
|
+
event: this.event
|
|
971
|
+
});
|
|
972
|
+
}
|
|
973
|
+
};
|
|
974
|
+
|
|
975
|
+
// src/apis/text-intelligence/workflows/adapter/integrations/text/_contracts/requests/events/text.ts
|
|
976
|
+
import { z as z10 } from "zod";
|
|
977
|
+
var textEventsZods = {
|
|
978
|
+
provider: z10.literal("text" /* Text */),
|
|
979
|
+
get event() {
|
|
980
|
+
return textCustomerEventsZods.event;
|
|
981
|
+
},
|
|
982
|
+
get subscribe() {
|
|
983
|
+
return integrationEventsCoreZods.withCore(
|
|
984
|
+
z10.object({
|
|
985
|
+
event: this.event,
|
|
986
|
+
callback: z10.string()
|
|
987
|
+
})
|
|
988
|
+
);
|
|
989
|
+
},
|
|
990
|
+
get subscribeContent() {
|
|
991
|
+
return z10.object({
|
|
992
|
+
provider: this.provider,
|
|
993
|
+
event: this.event,
|
|
994
|
+
callback: z10.string()
|
|
995
|
+
});
|
|
996
|
+
},
|
|
997
|
+
get unsubscribe() {
|
|
998
|
+
return integrationEventsCoreZods.withCore(
|
|
999
|
+
z10.object({
|
|
1000
|
+
event: this.event
|
|
1001
|
+
})
|
|
1002
|
+
);
|
|
1003
|
+
},
|
|
1004
|
+
get unsubscribeContent() {
|
|
1005
|
+
return z10.object({
|
|
870
1006
|
provider: this.provider,
|
|
871
1007
|
event: this.event
|
|
872
1008
|
});
|
|
@@ -875,7 +1011,8 @@ var textLivechatEventsZods = {
|
|
|
875
1011
|
|
|
876
1012
|
// src/apis/text-intelligence/workflows/adapter/integrations/_contracts/requests/events.ts
|
|
877
1013
|
var integrationEventsZods = {
|
|
878
|
-
providerName:
|
|
1014
|
+
providerName: z11.enum([
|
|
1015
|
+
"text" /* Text */,
|
|
879
1016
|
"text-livechat" /* LiveChat */,
|
|
880
1017
|
"text-helpdesk" /* HelpDesk */,
|
|
881
1018
|
"mailchimp" /* Mailchimp */,
|
|
@@ -885,11 +1022,12 @@ var integrationEventsZods = {
|
|
|
885
1022
|
"bigcommerce" /* BigCommerce */
|
|
886
1023
|
]),
|
|
887
1024
|
get event() {
|
|
888
|
-
return textLivechatEventsZods.event.or(textHelpDeskEventsZods.event).or(shopifyEventsZods.event).or(mailchimpEventsZods.event).or(hubspotEventsZods.event).or(bigcommerceEventsZods.event).or(slackEventsZods.event);
|
|
1025
|
+
return textEventsZods.event.or(textLivechatEventsZods.event).or(textHelpDeskEventsZods.event).or(shopifyEventsZods.event).or(mailchimpEventsZods.event).or(hubspotEventsZods.event).or(bigcommerceEventsZods.event).or(slackEventsZods.event);
|
|
889
1026
|
},
|
|
890
1027
|
get subscribe() {
|
|
891
1028
|
return integrationEventsCoreZods.withCore(
|
|
892
|
-
|
|
1029
|
+
z11.discriminatedUnion("provider", [
|
|
1030
|
+
textEventsZods.subscribeContent,
|
|
893
1031
|
textLivechatEventsZods.subscribeContent,
|
|
894
1032
|
textHelpDeskEventsZods.subscribeContent,
|
|
895
1033
|
shopifyEventsZods.subscribeContent,
|
|
@@ -902,7 +1040,8 @@ var integrationEventsZods = {
|
|
|
902
1040
|
},
|
|
903
1041
|
get unsubscribe() {
|
|
904
1042
|
return integrationEventsCoreZods.withCore(
|
|
905
|
-
|
|
1043
|
+
z11.discriminatedUnion("provider", [
|
|
1044
|
+
textEventsZods.unsubscribeContent,
|
|
906
1045
|
textLivechatEventsZods.unsubscribeContent,
|
|
907
1046
|
textHelpDeskEventsZods.unsubscribeContent,
|
|
908
1047
|
shopifyEventsZods.unsubscribeContent,
|
|
@@ -2067,19 +2206,17 @@ var mailchimpApi = {
|
|
|
2067
2206
|
},
|
|
2068
2207
|
getMetadata(_0) {
|
|
2069
2208
|
return __async(this, arguments, function* ({ token }) {
|
|
2070
|
-
|
|
2071
|
-
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
headers: {
|
|
2076
|
-
"Content-Type": "application/json",
|
|
2077
|
-
Authorization: `OAuth ${token}`
|
|
2078
|
-
}
|
|
2209
|
+
var _a, _b, _c, _d;
|
|
2210
|
+
const { data } = yield axios7.get("https://login.mailchimp.com/oauth2/metadata", {
|
|
2211
|
+
headers: {
|
|
2212
|
+
"Content-Type": "application/json",
|
|
2213
|
+
Authorization: `OAuth ${token}`
|
|
2079
2214
|
}
|
|
2080
|
-
);
|
|
2215
|
+
});
|
|
2216
|
+
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;
|
|
2081
2217
|
return {
|
|
2082
|
-
server
|
|
2218
|
+
server: data.dc,
|
|
2219
|
+
email
|
|
2083
2220
|
};
|
|
2084
2221
|
});
|
|
2085
2222
|
}
|
|
@@ -3214,7 +3351,8 @@ var salesforceApi = {
|
|
|
3214
3351
|
const url = new URL(data.profile);
|
|
3215
3352
|
const instance_url = url.origin;
|
|
3216
3353
|
return {
|
|
3217
|
-
instance_url
|
|
3354
|
+
instance_url,
|
|
3355
|
+
email: data.email
|
|
3218
3356
|
};
|
|
3219
3357
|
});
|
|
3220
3358
|
}
|
|
@@ -3834,12 +3972,13 @@ var textPlatformWorkflowsCredentialsApi = {
|
|
|
3834
3972
|
});
|
|
3835
3973
|
});
|
|
3836
3974
|
},
|
|
3837
|
-
connect(id, code, authorization) {
|
|
3975
|
+
connect(id, code, codeVerifier, authorization) {
|
|
3838
3976
|
return __async(this, null, function* () {
|
|
3839
3977
|
return textClientInstance.put(
|
|
3840
3978
|
urls2.connect(id),
|
|
3841
3979
|
{
|
|
3842
|
-
code
|
|
3980
|
+
code,
|
|
3981
|
+
code_verifier: codeVerifier
|
|
3843
3982
|
},
|
|
3844
3983
|
getTextClientConfig(__spreadProps(__spreadValues({}, authorization), {
|
|
3845
3984
|
ensureAuthorizationToken: true
|
|
@@ -4077,7 +4216,7 @@ var OauthCredentialGrantType = /* @__PURE__ */ ((OauthCredentialGrantType2) => {
|
|
|
4077
4216
|
})(OauthCredentialGrantType || {});
|
|
4078
4217
|
|
|
4079
4218
|
// src/apis/integrations/text/platform/workflow/workflows/_contracts/dtos/tasks/base.ts
|
|
4080
|
-
var
|
|
4219
|
+
var WorkflowTaskType = {
|
|
4081
4220
|
http: "HTTP",
|
|
4082
4221
|
switch: "SWITCH",
|
|
4083
4222
|
forkJoin: "FORK_JOIN",
|
|
@@ -4089,23 +4228,23 @@ var WorkflowDefinitionTaskType = {
|
|
|
4089
4228
|
inline: "INLINE",
|
|
4090
4229
|
transform: "JSON_JQ_TRANSFORM"
|
|
4091
4230
|
};
|
|
4092
|
-
var
|
|
4231
|
+
var WorkflowCustomTaskName = {
|
|
4093
4232
|
// SWITCH
|
|
4094
|
-
condition: `${
|
|
4095
|
-
switchCase: `${
|
|
4233
|
+
condition: `${WorkflowTaskType.switch}_IF`,
|
|
4234
|
+
switchCase: `${WorkflowTaskType.switch}_CASE`,
|
|
4096
4235
|
// SIMPLE
|
|
4097
4236
|
action: "action",
|
|
4098
4237
|
awaitAgent: "await",
|
|
4099
4238
|
notifyAgent: "notify_ai_agent",
|
|
4100
4239
|
reasoning: "reasoning",
|
|
4101
4240
|
// DO WHILE
|
|
4102
|
-
loop: `${
|
|
4103
|
-
forEach: `${
|
|
4241
|
+
loop: `${WorkflowTaskType.doWhile}_LOOP`,
|
|
4242
|
+
forEach: `${WorkflowTaskType.doWhile}_FOR_EACH`,
|
|
4104
4243
|
// INLINE
|
|
4105
|
-
script: `${
|
|
4244
|
+
script: `${WorkflowTaskType.inline}_SCRIPT`,
|
|
4106
4245
|
// JQ TRANSFORM
|
|
4107
|
-
convert: `${
|
|
4108
|
-
construct: `${
|
|
4246
|
+
convert: `${WorkflowTaskType.transform}_CONVERT`,
|
|
4247
|
+
construct: `${WorkflowTaskType.transform}_CONSTRUCT`
|
|
4109
4248
|
};
|
|
4110
4249
|
var WorkflowExecutionTaskStatus = /* @__PURE__ */ ((WorkflowExecutionTaskStatus2) => {
|
|
4111
4250
|
WorkflowExecutionTaskStatus2["Completed"] = "COMPLETED";
|
|
@@ -4204,6 +4343,9 @@ var WorkflowTriggerType = {
|
|
|
4204
4343
|
webhookManual: "webhook_manual"
|
|
4205
4344
|
};
|
|
4206
4345
|
|
|
4346
|
+
// src/apis/integrations/text/platform/workflow/workflows/_contracts/dtos/workflowElement.ts
|
|
4347
|
+
var TRIGGER_REFERENCE_NAME = "trigger";
|
|
4348
|
+
|
|
4207
4349
|
// src/apis/integrations/text/platform/workflow/workflows/_contracts/dtos/workflowExecution.ts
|
|
4208
4350
|
var WorkflowExecutionStatus = /* @__PURE__ */ ((WorkflowExecutionStatus2) => {
|
|
4209
4351
|
WorkflowExecutionStatus2["Succeeded"] = "succeeded";
|
|
@@ -4553,6 +4695,42 @@ function initBillingClient(baseUrl, token) {
|
|
|
4553
4695
|
}
|
|
4554
4696
|
}
|
|
4555
4697
|
|
|
4698
|
+
// src/apis/platform/cdp/events/_contracts/payloads/events.ts
|
|
4699
|
+
import { z as z12 } from "zod";
|
|
4700
|
+
var CdpCustomerEventType = /* @__PURE__ */ ((CdpCustomerEventType2) => {
|
|
4701
|
+
CdpCustomerEventType2["EmailSet"] = "customer_email_set";
|
|
4702
|
+
CdpCustomerEventType2["PropertiesValuesUpdated"] = "customer_properties_values_updated";
|
|
4703
|
+
return CdpCustomerEventType2;
|
|
4704
|
+
})(CdpCustomerEventType || {});
|
|
4705
|
+
var customerMetadataZod = z12.object({
|
|
4706
|
+
organization_id: z12.string(),
|
|
4707
|
+
customer_id: z12.string(),
|
|
4708
|
+
master_id: z12.string()
|
|
4709
|
+
});
|
|
4710
|
+
var cdpCustomerEventMessageZod = z12.discriminatedUnion("type", [
|
|
4711
|
+
z12.object({
|
|
4712
|
+
id: z12.string(),
|
|
4713
|
+
type: z12.literal("customer_email_set" /* EmailSet */),
|
|
4714
|
+
data: customerMetadataZod.extend({
|
|
4715
|
+
email: z12.string()
|
|
4716
|
+
}).passthrough()
|
|
4717
|
+
}),
|
|
4718
|
+
z12.object({
|
|
4719
|
+
id: z12.string(),
|
|
4720
|
+
type: z12.literal("customer_properties_values_updated" /* PropertiesValuesUpdated */),
|
|
4721
|
+
data: customerMetadataZod.extend({
|
|
4722
|
+
customer_properties: z12.record(
|
|
4723
|
+
z12.object({
|
|
4724
|
+
value: z12.unknown(),
|
|
4725
|
+
last_updated_at: z12.string(),
|
|
4726
|
+
last_updated_agent_account_id: z12.string().optional(),
|
|
4727
|
+
last_updated_agent_client_id: z12.string().optional()
|
|
4728
|
+
}).passthrough()
|
|
4729
|
+
)
|
|
4730
|
+
}).passthrough()
|
|
4731
|
+
})
|
|
4732
|
+
]);
|
|
4733
|
+
|
|
4556
4734
|
// src/apis/platform/console/instance.ts
|
|
4557
4735
|
import axios22 from "axios";
|
|
4558
4736
|
var REGION = {
|
|
@@ -4883,6 +5061,7 @@ var HelpDeskWebhookEventType = /* @__PURE__ */ ((HelpDeskWebhookEventType2) => {
|
|
|
4883
5061
|
HelpDeskWebhookEventType2["TicketTagsChanged"] = "tickets.events.tags";
|
|
4884
5062
|
HelpDeskWebhookEventType2["TicketFollowersChanged"] = "tickets.events.followers";
|
|
4885
5063
|
HelpDeskWebhookEventType2["TicketAssignmentChanged"] = "tickets.events.assignment";
|
|
5064
|
+
HelpDeskWebhookEventType2["TicketCustomFieldsChanged"] = "tickets.events.customFields";
|
|
4886
5065
|
HelpDeskWebhookEventType2["TicketMessageAdded"] = "tickets.events.message";
|
|
4887
5066
|
return HelpDeskWebhookEventType2;
|
|
4888
5067
|
})(HelpDeskWebhookEventType || {});
|
|
@@ -4896,6 +5075,7 @@ var LivechatWebhookActions = /* @__PURE__ */ ((LivechatWebhookActions2) => {
|
|
|
4896
5075
|
LivechatWebhookActions2["UserAddedToChat"] = "user_added_to_chat";
|
|
4897
5076
|
LivechatWebhookActions2["UserRemovedFromChat"] = "user_removed_from_chat";
|
|
4898
5077
|
LivechatWebhookActions2["IncomingEvent"] = "incoming_event";
|
|
5078
|
+
LivechatWebhookActions2["IncomingRichMessagePostback"] = "incoming_rich_message_postback";
|
|
4899
5079
|
LivechatWebhookActions2["ThreadTagged"] = "thread_tagged";
|
|
4900
5080
|
LivechatWebhookActions2["ThreadUntagged"] = "thread_untagged";
|
|
4901
5081
|
LivechatWebhookActions2["IncomingCustomer"] = "incoming_customer";
|
|
@@ -4918,6 +5098,7 @@ var LivechatWebhookSystemMessages = /* @__PURE__ */ ((LivechatWebhookSystemMessa
|
|
|
4918
5098
|
LivechatWebhookSystemMessages2["ChatArchivedCustomerManual"] = "manual_archived_customer";
|
|
4919
5099
|
LivechatWebhookSystemMessages2["ChatArchivedCustomerDisconnected"] = "archived_customer_disconnected";
|
|
4920
5100
|
LivechatWebhookSystemMessages2["ChatArchivedInactive"] = "routing.archived_inactive";
|
|
5101
|
+
LivechatWebhookSystemMessages2["ChatIdle"] = "routing.idle";
|
|
4921
5102
|
return LivechatWebhookSystemMessages2;
|
|
4922
5103
|
})(LivechatWebhookSystemMessages || {});
|
|
4923
5104
|
|
|
@@ -4999,40 +5180,40 @@ function initLiveChatClient(baseUrl, token) {
|
|
|
4999
5180
|
}
|
|
5000
5181
|
|
|
5001
5182
|
// src/apis/text-intelligence/workflows/adapter/admin/events/notifications/_contracts/dtos/notification.ts
|
|
5002
|
-
import { z as
|
|
5183
|
+
import { z as z13 } from "zod";
|
|
5003
5184
|
var integrationNotificationZods = {
|
|
5004
|
-
notification:
|
|
5005
|
-
id:
|
|
5006
|
-
jobId:
|
|
5007
|
-
subscription_id:
|
|
5008
|
-
organization_id:
|
|
5009
|
-
user_id:
|
|
5010
|
-
source:
|
|
5011
|
-
sourceKey:
|
|
5012
|
-
target:
|
|
5013
|
-
targetKey:
|
|
5014
|
-
eventName:
|
|
5015
|
-
callback:
|
|
5016
|
-
status:
|
|
5017
|
-
statusCode:
|
|
5018
|
-
attempts:
|
|
5019
|
-
error:
|
|
5020
|
-
enqueuedAt:
|
|
5021
|
-
completedAt:
|
|
5185
|
+
notification: z13.object({
|
|
5186
|
+
id: z13.string(),
|
|
5187
|
+
jobId: z13.string().nullable(),
|
|
5188
|
+
subscription_id: z13.string(),
|
|
5189
|
+
organization_id: z13.string(),
|
|
5190
|
+
user_id: z13.string().nullable(),
|
|
5191
|
+
source: z13.string().nullable(),
|
|
5192
|
+
sourceKey: z13.string().nullable(),
|
|
5193
|
+
target: z13.string(),
|
|
5194
|
+
targetKey: z13.string(),
|
|
5195
|
+
eventName: z13.string(),
|
|
5196
|
+
callback: z13.string(),
|
|
5197
|
+
status: z13.string(),
|
|
5198
|
+
statusCode: z13.number().nullable(),
|
|
5199
|
+
attempts: z13.number(),
|
|
5200
|
+
error: z13.string().nullable(),
|
|
5201
|
+
enqueuedAt: z13.string(),
|
|
5202
|
+
completedAt: z13.string()
|
|
5022
5203
|
})
|
|
5023
5204
|
};
|
|
5024
5205
|
|
|
5025
5206
|
// src/apis/text-intelligence/workflows/adapter/admin/events/notifications/_contracts/requests/notifications.ts
|
|
5026
|
-
import { z as
|
|
5207
|
+
import { z as z14 } from "zod";
|
|
5027
5208
|
var integrationNotificationRequestZods = {
|
|
5028
|
-
getNotifications:
|
|
5029
|
-
target:
|
|
5030
|
-
status:
|
|
5031
|
-
eventName:
|
|
5032
|
-
search:
|
|
5033
|
-
page:
|
|
5034
|
-
size:
|
|
5035
|
-
order_by:
|
|
5209
|
+
getNotifications: z14.object({
|
|
5210
|
+
target: z14.string().optional(),
|
|
5211
|
+
status: z14.string().optional(),
|
|
5212
|
+
eventName: z14.string().optional(),
|
|
5213
|
+
search: z14.string().optional(),
|
|
5214
|
+
page: z14.number().optional(),
|
|
5215
|
+
size: z14.number().optional(),
|
|
5216
|
+
order_by: z14.enum([
|
|
5036
5217
|
"id",
|
|
5037
5218
|
"status",
|
|
5038
5219
|
"target",
|
|
@@ -5041,60 +5222,60 @@ var integrationNotificationRequestZods = {
|
|
|
5041
5222
|
"organization_id",
|
|
5042
5223
|
"user_id"
|
|
5043
5224
|
]).optional(),
|
|
5044
|
-
order:
|
|
5225
|
+
order: z14.enum(["asc", "desc"]).optional()
|
|
5045
5226
|
})
|
|
5046
5227
|
};
|
|
5047
5228
|
|
|
5048
5229
|
// src/apis/text-intelligence/workflows/adapter/admin/events/subscriptions/_contracts/dtos/subscription.ts
|
|
5049
|
-
import { z as
|
|
5230
|
+
import { z as z15 } from "zod";
|
|
5050
5231
|
var integrationSubscriptionZods = {
|
|
5051
|
-
subscription:
|
|
5052
|
-
id:
|
|
5053
|
-
organization_id:
|
|
5054
|
-
user_id:
|
|
5055
|
-
callback:
|
|
5056
|
-
source:
|
|
5057
|
-
sourceKey:
|
|
5058
|
-
target:
|
|
5059
|
-
targets:
|
|
5060
|
-
|
|
5061
|
-
id:
|
|
5062
|
-
target:
|
|
5063
|
-
targetKey:
|
|
5232
|
+
subscription: z15.object({
|
|
5233
|
+
id: z15.string(),
|
|
5234
|
+
organization_id: z15.string(),
|
|
5235
|
+
user_id: z15.string(),
|
|
5236
|
+
callback: z15.string(),
|
|
5237
|
+
source: z15.string(),
|
|
5238
|
+
sourceKey: z15.string(),
|
|
5239
|
+
target: z15.string(),
|
|
5240
|
+
targets: z15.array(
|
|
5241
|
+
z15.object({
|
|
5242
|
+
id: z15.string(),
|
|
5243
|
+
target: z15.string(),
|
|
5244
|
+
targetKey: z15.string()
|
|
5064
5245
|
})
|
|
5065
5246
|
).optional(),
|
|
5066
|
-
event:
|
|
5067
|
-
orphaned_at:
|
|
5068
|
-
orphaned_reason:
|
|
5069
|
-
orphaned_last_hit:
|
|
5070
|
-
orphaned_hit_count:
|
|
5247
|
+
event: z15.unknown(),
|
|
5248
|
+
orphaned_at: z15.string().datetime().nullable(),
|
|
5249
|
+
orphaned_reason: z15.string().nullable(),
|
|
5250
|
+
orphaned_last_hit: z15.string().datetime().nullable(),
|
|
5251
|
+
orphaned_hit_count: z15.number()
|
|
5071
5252
|
}),
|
|
5072
|
-
stats:
|
|
5073
|
-
totalSubscriptions:
|
|
5074
|
-
uniqueOrganizations:
|
|
5075
|
-
uniqueUsers:
|
|
5076
|
-
byTarget:
|
|
5077
|
-
bySource:
|
|
5078
|
-
topOrganizations:
|
|
5079
|
-
|
|
5253
|
+
stats: z15.object({
|
|
5254
|
+
totalSubscriptions: z15.number(),
|
|
5255
|
+
uniqueOrganizations: z15.number(),
|
|
5256
|
+
uniqueUsers: z15.number(),
|
|
5257
|
+
byTarget: z15.array(z15.object({ target: z15.string(), count: z15.number() })),
|
|
5258
|
+
bySource: z15.array(z15.object({ source: z15.string(), count: z15.number() })),
|
|
5259
|
+
topOrganizations: z15.array(
|
|
5260
|
+
z15.object({ organizationId: z15.string(), count: z15.number() })
|
|
5080
5261
|
),
|
|
5081
|
-
topCallbackDomains:
|
|
5082
|
-
|
|
5262
|
+
topCallbackDomains: z15.array(
|
|
5263
|
+
z15.object({ domain: z15.string(), count: z15.number() })
|
|
5083
5264
|
)
|
|
5084
5265
|
})
|
|
5085
5266
|
};
|
|
5086
5267
|
|
|
5087
5268
|
// src/apis/text-intelligence/workflows/adapter/admin/events/subscriptions/_contracts/requests/subscriptions.ts
|
|
5088
|
-
import { z as
|
|
5269
|
+
import { z as z16 } from "zod";
|
|
5089
5270
|
var integrationSubscriptionRequestZods = {
|
|
5090
|
-
getSubscriptions:
|
|
5091
|
-
target:
|
|
5092
|
-
source:
|
|
5093
|
-
search:
|
|
5094
|
-
orphaned:
|
|
5095
|
-
page:
|
|
5096
|
-
size:
|
|
5097
|
-
order_by:
|
|
5271
|
+
getSubscriptions: z16.object({
|
|
5272
|
+
target: z16.string().optional(),
|
|
5273
|
+
source: z16.string().optional(),
|
|
5274
|
+
search: z16.string().optional(),
|
|
5275
|
+
orphaned: z16.boolean().optional(),
|
|
5276
|
+
page: z16.number().optional(),
|
|
5277
|
+
size: z16.number().optional(),
|
|
5278
|
+
order_by: z16.enum([
|
|
5098
5279
|
"id",
|
|
5099
5280
|
"source",
|
|
5100
5281
|
"target",
|
|
@@ -5102,7 +5283,7 @@ var integrationSubscriptionRequestZods = {
|
|
|
5102
5283
|
"user_id",
|
|
5103
5284
|
"orphaned_at"
|
|
5104
5285
|
]).optional(),
|
|
5105
|
-
order:
|
|
5286
|
+
order: z16.enum(["asc", "desc"]).optional()
|
|
5106
5287
|
})
|
|
5107
5288
|
};
|
|
5108
5289
|
|
|
@@ -5575,20 +5756,20 @@ var textPlatformWorkflowsInternalApi = {
|
|
|
5575
5756
|
|
|
5576
5757
|
// src/apis/integrations/text/platform/workflow/workflows/api.ts
|
|
5577
5758
|
var enrichWorkflowTrigger = (workflow) => {
|
|
5578
|
-
var _a, _b, _c, _d, _e, _f;
|
|
5759
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
5579
5760
|
if (((_a = workflow.trigger) == null ? void 0 : _a.type) === WorkflowTriggerType.webhook) {
|
|
5580
|
-
workflow.trigger.name = `${workflow.trigger.webhook.source}-${(_b = workflow.trigger.webhook.event) == null ? void 0 : _b.name}`;
|
|
5761
|
+
workflow.trigger.name = (_c = workflow.trigger.sub_type) != null ? _c : `${workflow.trigger.webhook.source}-${(_b = workflow.trigger.webhook.event) == null ? void 0 : _b.name}`;
|
|
5581
5762
|
}
|
|
5582
|
-
if (((
|
|
5763
|
+
if (((_d = workflow.trigger) == null ? void 0 : _d.type) === WorkflowTriggerType.webhookManual) {
|
|
5583
5764
|
workflow.trigger.name = "webhook_manual";
|
|
5584
5765
|
}
|
|
5585
|
-
if (((
|
|
5766
|
+
if (((_e = workflow.trigger) == null ? void 0 : _e.type) === WorkflowTriggerType.manual) {
|
|
5586
5767
|
workflow.trigger.name = "manual";
|
|
5587
5768
|
}
|
|
5588
|
-
if (((
|
|
5769
|
+
if (((_f = workflow.trigger) == null ? void 0 : _f.type) === WorkflowTriggerType.agent) {
|
|
5589
5770
|
workflow.trigger.name = "ai_agent";
|
|
5590
5771
|
}
|
|
5591
|
-
if (((
|
|
5772
|
+
if (((_g = workflow.trigger) == null ? void 0 : _g.type) === WorkflowTriggerType.recurring) {
|
|
5592
5773
|
workflow.trigger.name = "scheduled";
|
|
5593
5774
|
}
|
|
5594
5775
|
return workflow;
|
|
@@ -5803,11 +5984,87 @@ var textPlatformApi = {
|
|
|
5803
5984
|
workflow: textPlatformWorkflowApi
|
|
5804
5985
|
};
|
|
5805
5986
|
|
|
5987
|
+
// src/apis/integrations/text/resourcer/api.ts
|
|
5988
|
+
var buildResourcePath = ({ provider, domain, name }) => {
|
|
5989
|
+
let targetProvider = provider;
|
|
5990
|
+
if (["text-livechat" /* LiveChat */, "text-helpdesk" /* HelpDesk */].includes(
|
|
5991
|
+
provider
|
|
5992
|
+
)) {
|
|
5993
|
+
targetProvider = "text" /* Text */;
|
|
5994
|
+
}
|
|
5995
|
+
return [targetProvider, domain, name].filter(notEmpty).join("/");
|
|
5996
|
+
};
|
|
5997
|
+
var urls7 = {
|
|
5998
|
+
listSchema: () => "/workflow_resources/schema",
|
|
5999
|
+
getSchema: (provider) => `/workflow_resources/schema/${provider}`,
|
|
6000
|
+
getResource: (resource) => `/workflow_resources/resources/${buildResourcePath(resource)}`
|
|
6001
|
+
};
|
|
6002
|
+
var textResourcerApi = {
|
|
6003
|
+
getResource(resource, credentialId, authorization) {
|
|
6004
|
+
return __async(this, null, function* () {
|
|
6005
|
+
const config = getTextClientConfig(__spreadProps(__spreadValues({}, authorization), {
|
|
6006
|
+
ensureAuthorizationToken: true
|
|
6007
|
+
}));
|
|
6008
|
+
return textClientInstance.get(urls7.getResource(resource), __spreadProps(__spreadValues({}, config), {
|
|
6009
|
+
headers: __spreadProps(__spreadValues({}, config.headers), {
|
|
6010
|
+
"X-Credential-ID": credentialId
|
|
6011
|
+
})
|
|
6012
|
+
})).catch((error) => {
|
|
6013
|
+
if (error instanceof TextApiError) {
|
|
6014
|
+
throw error.withCustomMessage(
|
|
6015
|
+
`Couldn't get resourcer resource. [${error.message}]`
|
|
6016
|
+
);
|
|
6017
|
+
}
|
|
6018
|
+
throw error;
|
|
6019
|
+
});
|
|
6020
|
+
});
|
|
6021
|
+
},
|
|
6022
|
+
listSchema(credentialId, authorization) {
|
|
6023
|
+
return __async(this, null, function* () {
|
|
6024
|
+
const config = getTextClientConfig(__spreadProps(__spreadValues({}, authorization), {
|
|
6025
|
+
ensureAuthorizationToken: true
|
|
6026
|
+
}));
|
|
6027
|
+
return textClientInstance.get(urls7.listSchema(), __spreadProps(__spreadValues({}, config), {
|
|
6028
|
+
headers: __spreadProps(__spreadValues({}, config.headers), {
|
|
6029
|
+
"X-Credential-ID": credentialId
|
|
6030
|
+
})
|
|
6031
|
+
})).catch((error) => {
|
|
6032
|
+
if (error instanceof TextApiError) {
|
|
6033
|
+
throw error.withCustomMessage(
|
|
6034
|
+
`Couldn't list resourcer schema. [${error.message}]`
|
|
6035
|
+
);
|
|
6036
|
+
}
|
|
6037
|
+
throw error;
|
|
6038
|
+
});
|
|
6039
|
+
});
|
|
6040
|
+
},
|
|
6041
|
+
getSchema(provider, credentialId, authorization) {
|
|
6042
|
+
return __async(this, null, function* () {
|
|
6043
|
+
const config = getTextClientConfig(__spreadProps(__spreadValues({}, authorization), {
|
|
6044
|
+
ensureAuthorizationToken: true
|
|
6045
|
+
}));
|
|
6046
|
+
return textClientInstance.get(urls7.getSchema(provider), __spreadProps(__spreadValues({}, config), {
|
|
6047
|
+
headers: __spreadProps(__spreadValues({}, config.headers), {
|
|
6048
|
+
"X-Credential-ID": credentialId
|
|
6049
|
+
})
|
|
6050
|
+
})).catch((error) => {
|
|
6051
|
+
if (error instanceof TextApiError) {
|
|
6052
|
+
throw error.withCustomMessage(
|
|
6053
|
+
`Couldn't get resourcer schema. [${error.message}]`
|
|
6054
|
+
);
|
|
6055
|
+
}
|
|
6056
|
+
throw error;
|
|
6057
|
+
});
|
|
6058
|
+
});
|
|
6059
|
+
}
|
|
6060
|
+
};
|
|
6061
|
+
|
|
5806
6062
|
// src/apis/integrations/text/api.ts
|
|
5807
6063
|
var textApi = {
|
|
5808
6064
|
platform: textPlatformApi,
|
|
5809
6065
|
ai: textAiAgentApi,
|
|
5810
|
-
externalAccountManager: textExternalAccountManagerApi
|
|
6066
|
+
externalAccountManager: textExternalAccountManagerApi,
|
|
6067
|
+
resourcer: textResourcerApi
|
|
5811
6068
|
};
|
|
5812
6069
|
|
|
5813
6070
|
// src/apis/integrations/vercel/api.ts
|
|
@@ -6108,7 +6365,7 @@ var integrationsApi = {
|
|
|
6108
6365
|
};
|
|
6109
6366
|
|
|
6110
6367
|
// src/apis/platform/accounts/accounts/api.ts
|
|
6111
|
-
var
|
|
6368
|
+
var urls8 = (withBaseUrl = false) => {
|
|
6112
6369
|
const getUrl7 = (segments = []) => buildUrlFromSegments(
|
|
6113
6370
|
segments,
|
|
6114
6371
|
"/v2/accounts",
|
|
@@ -6124,7 +6381,7 @@ var api2 = {
|
|
|
6124
6381
|
getAccounts(authorization) {
|
|
6125
6382
|
return __async(this, null, function* () {
|
|
6126
6383
|
return platformAccountsClientInstance.get(
|
|
6127
|
-
|
|
6384
|
+
urls8().getAccounts(),
|
|
6128
6385
|
{
|
|
6129
6386
|
authorization,
|
|
6130
6387
|
customErrorMessage: "Accounts couldn't be fetched."
|
|
@@ -6135,7 +6392,7 @@ var api2 = {
|
|
|
6135
6392
|
getAccount(accountId, authorization) {
|
|
6136
6393
|
return __async(this, null, function* () {
|
|
6137
6394
|
return platformAccountsClientInstance.get(
|
|
6138
|
-
|
|
6395
|
+
urls8().getAccount(accountId),
|
|
6139
6396
|
{
|
|
6140
6397
|
authorization,
|
|
6141
6398
|
customErrorMessage: "Account couldn't be fetched."
|
|
@@ -6157,7 +6414,7 @@ var api2 = {
|
|
|
6157
6414
|
};
|
|
6158
6415
|
var platformAccountsAccountApi = __spreadProps(__spreadValues({}, api2), {
|
|
6159
6416
|
meta: {
|
|
6160
|
-
urls:
|
|
6417
|
+
urls: urls8
|
|
6161
6418
|
}
|
|
6162
6419
|
});
|
|
6163
6420
|
|
|
@@ -6323,18 +6580,18 @@ var platformAccountsPersonalAccessTokenApi = {
|
|
|
6323
6580
|
|
|
6324
6581
|
// src/apis/platform/accounts/products/api.ts
|
|
6325
6582
|
var getUrl6 = (segments = []) => buildUrlFromSegments(segments, "/v2/organizations");
|
|
6326
|
-
var
|
|
6583
|
+
var urls9 = {
|
|
6327
6584
|
getOrganizationProducts: () => getUrl6(["my", "products"]),
|
|
6328
6585
|
updateOrganizationProducts: () => getUrl6(["my", "products"])
|
|
6329
6586
|
};
|
|
6330
6587
|
var platformAccountsProductsApi = {
|
|
6331
6588
|
meta: {
|
|
6332
|
-
urls:
|
|
6589
|
+
urls: urls9
|
|
6333
6590
|
},
|
|
6334
6591
|
getOrganizationProducts(authorization) {
|
|
6335
6592
|
return __async(this, null, function* () {
|
|
6336
6593
|
return platformAccountsClientInstance.get(
|
|
6337
|
-
|
|
6594
|
+
urls9.getOrganizationProducts(),
|
|
6338
6595
|
{ authorization, customErrorMessage: "Products couldn't be fetched." }
|
|
6339
6596
|
);
|
|
6340
6597
|
});
|
|
@@ -6342,7 +6599,7 @@ var platformAccountsProductsApi = {
|
|
|
6342
6599
|
updateOrganizationProducts(payload, authorization) {
|
|
6343
6600
|
return __async(this, null, function* () {
|
|
6344
6601
|
return platformAccountsClientInstance.post(
|
|
6345
|
-
|
|
6602
|
+
urls9.updateOrganizationProducts(),
|
|
6346
6603
|
payload,
|
|
6347
6604
|
{ authorization, customErrorMessage: "Products couldn't be updated." }
|
|
6348
6605
|
);
|
|
@@ -7772,7 +8029,7 @@ var platformDpsApplicationStatsApi = {
|
|
|
7772
8029
|
var platformDpsApplicationWebhooksApi = {
|
|
7773
8030
|
updateAppWebhooks(appId, payload, authorization) {
|
|
7774
8031
|
return __async(this, null, function* () {
|
|
7775
|
-
|
|
8032
|
+
return dpsClientInstance.put(
|
|
7776
8033
|
`/v2/applications/${encodeURIComponent(appId)}/webhook`,
|
|
7777
8034
|
payload,
|
|
7778
8035
|
getDpsClientConfig(authorization)
|
|
@@ -8972,7 +9229,7 @@ var livechatWebhookApi = {
|
|
|
8972
9229
|
registerWebhook(webhook, authorization) {
|
|
8973
9230
|
return __async(this, null, function* () {
|
|
8974
9231
|
yield livechatClientInstance.post(
|
|
8975
|
-
`/v${webhook.api_version || "3.
|
|
9232
|
+
`/v${webhook.api_version || "3.6"}/configuration/action/register_webhook`,
|
|
8976
9233
|
{
|
|
8977
9234
|
url: webhook.url,
|
|
8978
9235
|
action: webhook.action,
|
|
@@ -8998,7 +9255,7 @@ var livechatWebhookApi = {
|
|
|
8998
9255
|
yield Promise.all(
|
|
8999
9256
|
webhooks.map((webhook) => __async(this, null, function* () {
|
|
9000
9257
|
return livechatClientInstance.post(
|
|
9001
|
-
`/v${webhook.api_version || "3.
|
|
9258
|
+
`/v${webhook.api_version || "3.6"}/configuration/action/register_webhook`,
|
|
9002
9259
|
{
|
|
9003
9260
|
url: webhook.url,
|
|
9004
9261
|
action: webhook.action,
|
|
@@ -9367,6 +9624,7 @@ export {
|
|
|
9367
9624
|
BigCommerceApiError,
|
|
9368
9625
|
BigCommerceEventNames,
|
|
9369
9626
|
BigCommerceWebhookScopes,
|
|
9627
|
+
CdpCustomerEventType,
|
|
9370
9628
|
ConsoleApiError,
|
|
9371
9629
|
CredentialStatus,
|
|
9372
9630
|
CredentialType,
|
|
@@ -9403,9 +9661,12 @@ export {
|
|
|
9403
9661
|
SlackMessageEventSubTypes,
|
|
9404
9662
|
SortBy,
|
|
9405
9663
|
SortOrder,
|
|
9664
|
+
TRIGGER_REFERENCE_NAME,
|
|
9406
9665
|
TextApiError,
|
|
9666
|
+
TextCustomerEventNames,
|
|
9407
9667
|
TextHelpDeskEventNames,
|
|
9408
9668
|
TextLivechatEventNames,
|
|
9669
|
+
TextLivechatProductCardEventType,
|
|
9409
9670
|
TicketPriority,
|
|
9410
9671
|
TicketStatus,
|
|
9411
9672
|
UnauthorizeAccountsApiError,
|
|
@@ -9415,12 +9676,12 @@ export {
|
|
|
9415
9676
|
WorkflowConditionTaskOperator,
|
|
9416
9677
|
WorkflowConditionTaskOperatorGroup,
|
|
9417
9678
|
WorkflowConditionTaskOperatorValueType,
|
|
9418
|
-
|
|
9419
|
-
WorkflowDefinitionTaskType,
|
|
9679
|
+
WorkflowCustomTaskName,
|
|
9420
9680
|
WorkflowExecutionDefinitionStatus,
|
|
9421
9681
|
WorkflowExecutionStatus,
|
|
9422
9682
|
WorkflowExecutionTaskStatus,
|
|
9423
9683
|
WorkflowItemKind,
|
|
9684
|
+
WorkflowTaskType,
|
|
9424
9685
|
WorkflowTemplateCategory,
|
|
9425
9686
|
WorkflowTriggerType,
|
|
9426
9687
|
WorkflowsApiError,
|
|
@@ -9436,6 +9697,7 @@ export {
|
|
|
9436
9697
|
bigcommerceEventsZods,
|
|
9437
9698
|
billingClientInstance,
|
|
9438
9699
|
buildUrlFromSegments,
|
|
9700
|
+
cdpCustomerEventMessageZod,
|
|
9439
9701
|
consoleClientInstance,
|
|
9440
9702
|
dpsClientInstance,
|
|
9441
9703
|
extractTokenFromAuthorizationHeader,
|
|
@@ -9525,6 +9787,8 @@ export {
|
|
|
9525
9787
|
slackClientInstance,
|
|
9526
9788
|
slackEventsZods,
|
|
9527
9789
|
textClientInstance,
|
|
9790
|
+
textCustomerEventsZods,
|
|
9791
|
+
textEventsZods,
|
|
9528
9792
|
textHelpDeskEventsZods,
|
|
9529
9793
|
textLivechatEventsZods,
|
|
9530
9794
|
updateAdapterClient,
|