@deepdesk/deepdesk-sdk 17.0.0-rc.9 → 17.0.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/dialogs.css +1 -1
- package/dist/index.cjs.js +8 -8
- package/dist/index.d.mts +61 -119
- package/dist/index.d.ts +61 -119
- package/dist/index.esm.js +8 -8
- package/dist/index.iife.js +35 -35
- package/input.css +1 -1
- package/package.json +126 -126
- package/styles/index.js +1 -1
- package/styles.css +1 -1
- package/widget.css +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -107,6 +107,7 @@ declare const styles$o: {
|
|
|
107
107
|
readonly "dropdownItemButton": string;
|
|
108
108
|
readonly "dropdownList": string;
|
|
109
109
|
readonly "fadein": string;
|
|
110
|
+
readonly "icon": string;
|
|
110
111
|
readonly "isClickable": string;
|
|
111
112
|
readonly "isSelected": string;
|
|
112
113
|
readonly "label": string;
|
|
@@ -592,64 +593,10 @@ declare namespace Server {
|
|
|
592
593
|
suggestion: string;
|
|
593
594
|
}[];
|
|
594
595
|
};
|
|
595
|
-
enum EventType {
|
|
596
|
-
SEND_MESSAGE = "Send Message",
|
|
597
|
-
HANDLING_TIME = "Handling Time",
|
|
598
|
-
ADD_TO_PERSONAL_COLLECTION = "Add to personal collection",
|
|
599
|
-
DELETE_FROM_PERSONAL_COLLECTION = "Delete from personal collection"
|
|
600
|
-
}
|
|
601
|
-
type UsedSuggestion = {
|
|
602
|
-
ab_test_name?: string | null;
|
|
603
|
-
ab_variant?: string | null;
|
|
604
|
-
input_type: string;
|
|
605
|
-
source?: string;
|
|
606
|
-
source_text?: string;
|
|
607
|
-
text: string;
|
|
608
|
-
training_jobs?: string[];
|
|
609
|
-
};
|
|
610
|
-
/**
|
|
611
|
-
* Abstract API object for event data
|
|
612
|
-
* @deprecated in favor of EventDataV2
|
|
613
|
-
* @see EventV2Data
|
|
614
|
-
*/
|
|
615
|
-
type EventData = {
|
|
616
|
-
conversation_id: string;
|
|
617
|
-
client_version: string;
|
|
618
|
-
source: 'agent' | 'visitor';
|
|
619
|
-
pastes: string[];
|
|
620
|
-
cuts: string[];
|
|
621
|
-
deletions: string[];
|
|
622
|
-
len_text_typed: number;
|
|
623
|
-
len_text_total: number;
|
|
624
|
-
len_text_assisted: number;
|
|
625
|
-
len_text_pasted: number;
|
|
626
|
-
len_text_cut: number;
|
|
627
|
-
len_text_deleted: number;
|
|
628
|
-
time_total_seconds: number;
|
|
629
|
-
chars_per_second: number;
|
|
630
|
-
text: string;
|
|
631
|
-
num_pastes: number;
|
|
632
|
-
text_suggestions_v2: UsedSuggestion[];
|
|
633
|
-
url_suggestions_v2: UsedSuggestion[];
|
|
634
|
-
url_link_suggestions_v2: UsedSuggestion[];
|
|
635
|
-
suggestions_counters: {
|
|
636
|
-
source: Sources;
|
|
637
|
-
count_offered: number;
|
|
638
|
-
}[];
|
|
639
|
-
time_start: string;
|
|
640
|
-
time_stop: string;
|
|
641
|
-
agent_id?: string;
|
|
642
|
-
agent_name?: string;
|
|
643
|
-
agent_email?: string;
|
|
644
|
-
platform: string;
|
|
645
|
-
backend_version: string;
|
|
646
|
-
engine_version: string;
|
|
647
|
-
gpt_version: string;
|
|
648
|
-
};
|
|
649
596
|
/**
|
|
650
597
|
* Backend API object for event data v2
|
|
651
598
|
*/
|
|
652
|
-
type
|
|
599
|
+
type EventData = {
|
|
653
600
|
name: string;
|
|
654
601
|
platform?: string;
|
|
655
602
|
conversation_id?: string;
|
|
@@ -700,15 +647,28 @@ declare namespace Server {
|
|
|
700
647
|
/**
|
|
701
648
|
* Handling time event data
|
|
702
649
|
*/
|
|
703
|
-
type HandlingTimeEventData =
|
|
650
|
+
type HandlingTimeEventData = {
|
|
651
|
+
client_version: string;
|
|
652
|
+
time_start: string;
|
|
653
|
+
time_stop: string;
|
|
654
|
+
};
|
|
704
655
|
/**
|
|
705
656
|
* Send message event data
|
|
706
657
|
*/
|
|
707
|
-
type SendMessageEventData =
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
658
|
+
type SendMessageEventData = {
|
|
659
|
+
client_version: string;
|
|
660
|
+
source: string;
|
|
661
|
+
len_text_total: number;
|
|
662
|
+
pastes: string[];
|
|
663
|
+
num_pastes: number;
|
|
664
|
+
suggestions: Array<{
|
|
665
|
+
input_type: string;
|
|
666
|
+
source?: Sources;
|
|
667
|
+
source_text?: string;
|
|
668
|
+
text: string;
|
|
669
|
+
training_jobs?: Array<string>;
|
|
670
|
+
}>;
|
|
671
|
+
};
|
|
712
672
|
/**
|
|
713
673
|
* Search results data
|
|
714
674
|
*/
|
|
@@ -771,27 +731,17 @@ declare namespace Server {
|
|
|
771
731
|
sticky_messages: boolean;
|
|
772
732
|
recommend_text_suggestions: boolean;
|
|
773
733
|
assisted_intake: boolean;
|
|
774
|
-
autocomplete_with_text_suggestions: boolean;
|
|
775
734
|
entities_command: boolean;
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
* Old rule group
|
|
781
|
-
* @deprecated in favor of `summarizer_assistant_new`
|
|
782
|
-
*/
|
|
783
|
-
summarizer_assistant?: string;
|
|
784
|
-
summarizer_assistant_new?: string;
|
|
785
|
-
conversation_accepted_assistant?: string;
|
|
786
|
-
conversation_new_message_assistant?: string;
|
|
787
|
-
conversation_ended_assistant?: string;
|
|
735
|
+
summarizer_assistant_new: string | null;
|
|
736
|
+
conversation_accepted_assistant: string | null;
|
|
737
|
+
conversation_new_message_assistant: string | null;
|
|
738
|
+
conversation_ended_assistant: string | null;
|
|
788
739
|
/**
|
|
789
740
|
* @deprecated in favor of `knowledge_assistant_new`
|
|
790
741
|
*/
|
|
791
|
-
knowledge_assistant: string;
|
|
792
|
-
knowledge_assistant_new: string;
|
|
742
|
+
knowledge_assistant: string | null;
|
|
743
|
+
knowledge_assistant_new: string | null;
|
|
793
744
|
on_demand_assistants: Array<OnDemandAssistant>;
|
|
794
|
-
authorized_groups: number[];
|
|
795
745
|
active_config: {
|
|
796
746
|
default_locale: string;
|
|
797
747
|
};
|
|
@@ -804,6 +754,7 @@ declare namespace Server {
|
|
|
804
754
|
amount: number;
|
|
805
755
|
lines: 'multiple' | 'single';
|
|
806
756
|
schema?: CustomDataSchema;
|
|
757
|
+
property?: string;
|
|
807
758
|
}>;
|
|
808
759
|
};
|
|
809
760
|
search: {
|
|
@@ -907,15 +858,15 @@ type CreateConversationOptions = {
|
|
|
907
858
|
*/
|
|
908
859
|
type SendMessageEventData = CamelCaseKeys<Server.SendMessageEventData>;
|
|
909
860
|
/**
|
|
910
|
-
* Event
|
|
861
|
+
* Event payload
|
|
911
862
|
*/
|
|
912
|
-
type
|
|
863
|
+
type Event$1<T = unknown> = CamelCaseKeys<Omit<Server.EventData, 'name' | 'backend_version' | 'engine_version' | 'gpt_version' | 'data'>> & {
|
|
913
864
|
data: T;
|
|
914
865
|
};
|
|
915
866
|
/**
|
|
916
867
|
* Handling time event data
|
|
917
868
|
*/
|
|
918
|
-
type HandlingTimeEventData = CamelCaseKeys<
|
|
869
|
+
type HandlingTimeEventData = CamelCaseKeys<Server.HandlingTimeEventData>;
|
|
919
870
|
/**
|
|
920
871
|
* Rule event meta data
|
|
921
872
|
*/
|
|
@@ -925,67 +876,61 @@ type RuleEventMeta = {
|
|
|
925
876
|
group: string;
|
|
926
877
|
};
|
|
927
878
|
/**
|
|
928
|
-
* Map the send event name to the data value in the payload
|
|
929
|
-
* @deprecated
|
|
930
|
-
*/
|
|
931
|
-
type SendEventV1ArgumentMap = {
|
|
932
|
-
'Send Message': SendMessageEventData;
|
|
933
|
-
'Handling Time': HandlingTimeEventData;
|
|
934
|
-
};
|
|
935
|
-
/**
|
|
936
|
-
* Map the send event name to the data value in the payload. (V2)
|
|
879
|
+
* Map the send event name to the data value in the payload
|
|
937
880
|
*/
|
|
938
|
-
type
|
|
939
|
-
'
|
|
881
|
+
type SendEventArgumentMap = {
|
|
882
|
+
'Send Message': Event$1<SendMessageEventData>;
|
|
883
|
+
'Handling Time': Event$1<HandlingTimeEventData>;
|
|
884
|
+
'Add to personal collection': Event$1<{
|
|
940
885
|
text: string;
|
|
941
886
|
}>;
|
|
942
|
-
'Delete from personal collection':
|
|
887
|
+
'Delete from personal collection': Event$1<{
|
|
943
888
|
text: string;
|
|
944
889
|
}>;
|
|
945
|
-
'entities found':
|
|
890
|
+
'entities found': Event$1<{
|
|
946
891
|
entities: Entity[];
|
|
947
892
|
}>;
|
|
948
|
-
'conversation summarized':
|
|
893
|
+
'conversation summarized': Event$1<{
|
|
949
894
|
summary: string;
|
|
950
895
|
assistant?: string;
|
|
951
896
|
}>;
|
|
952
|
-
'style suggested':
|
|
897
|
+
'style suggested': Event$1<{
|
|
953
898
|
keywordMatches: {
|
|
954
899
|
keyword: string;
|
|
955
900
|
suggestion: string;
|
|
956
901
|
}[];
|
|
957
902
|
}>;
|
|
958
|
-
'Image attached':
|
|
903
|
+
'Image attached': Event$1<{
|
|
959
904
|
path: string;
|
|
960
905
|
title: string;
|
|
961
906
|
}>;
|
|
962
|
-
'Assistant response displayed':
|
|
907
|
+
'Assistant response displayed': Event$1<RuleEventMeta & {
|
|
963
908
|
cueText: string;
|
|
964
909
|
}>;
|
|
965
|
-
'Assistant response closed':
|
|
910
|
+
'Assistant response closed': Event$1<RuleEventMeta & {
|
|
966
911
|
cueText: string;
|
|
967
912
|
}>;
|
|
968
|
-
'Assistant response feedback':
|
|
913
|
+
'Assistant response feedback': Event$1<RuleEventMeta & {
|
|
969
914
|
rating: 'up' | 'down';
|
|
970
915
|
cueText: string;
|
|
971
916
|
}>;
|
|
972
|
-
'Assistant response used':
|
|
917
|
+
'Assistant response used': Event$1<RuleEventMeta & {
|
|
973
918
|
usedText: string;
|
|
974
919
|
}>;
|
|
975
|
-
'Assistant response copied':
|
|
920
|
+
'Assistant response copied': Event$1<RuleEventMeta & {
|
|
976
921
|
copiedText: string;
|
|
977
922
|
}>;
|
|
978
|
-
'Assistant call to action':
|
|
923
|
+
'Assistant call to action': Event$1<RuleEventMeta & {
|
|
979
924
|
eventName: string;
|
|
980
925
|
value: string;
|
|
981
926
|
}>;
|
|
982
|
-
'knowledge assist feedback':
|
|
927
|
+
'knowledge assist feedback': Event$1<{
|
|
983
928
|
question: string;
|
|
984
929
|
isFollowUpQuestion: boolean;
|
|
985
930
|
isAgent: boolean;
|
|
986
931
|
answer: Server.KnowledgeResponse['answer'];
|
|
987
932
|
}>;
|
|
988
|
-
'knowledge assist question answered':
|
|
933
|
+
'knowledge assist question answered': Event$1<{
|
|
989
934
|
question: string;
|
|
990
935
|
answer: string;
|
|
991
936
|
sources: {
|
|
@@ -995,32 +940,32 @@ type SendEventV2ArgumentMap = {
|
|
|
995
940
|
isFollowUpQuestion: boolean;
|
|
996
941
|
isAutoInitiated: boolean;
|
|
997
942
|
}>;
|
|
998
|
-
'knowledge assist source viewed':
|
|
943
|
+
'knowledge assist source viewed': Event$1<{
|
|
999
944
|
question: string;
|
|
1000
945
|
sourceViewed: string;
|
|
1001
946
|
}>;
|
|
1002
|
-
'knowledge assist reset':
|
|
947
|
+
'knowledge assist reset': Event$1<{
|
|
1003
948
|
threadId?: number;
|
|
1004
949
|
}>;
|
|
1005
|
-
'summary feedback':
|
|
950
|
+
'summary feedback': Event$1<{
|
|
1006
951
|
summary: string;
|
|
1007
952
|
rating: 'up' | 'down';
|
|
1008
953
|
}>;
|
|
1009
|
-
'summary copied to clipboard':
|
|
954
|
+
'summary copied to clipboard': Event$1<{
|
|
1010
955
|
originalText: string;
|
|
1011
956
|
finalText: string;
|
|
1012
957
|
assistant: string;
|
|
1013
958
|
}>;
|
|
1014
|
-
'open search':
|
|
959
|
+
'open search': Event$1<{
|
|
1015
960
|
via: 'ctrl+k' | 'autocomplete-overlay' | 'widget-shortcut';
|
|
1016
961
|
}>;
|
|
1017
|
-
'open knowledge assistant':
|
|
962
|
+
'open knowledge assistant': Event$1<{
|
|
1018
963
|
via: 'ctrl+k' | 'widget-shortcut' | 'search-command';
|
|
1019
964
|
}>;
|
|
1020
|
-
'open my deepdesk':
|
|
965
|
+
'open my deepdesk': Event$1<{
|
|
1021
966
|
via: 'widget-shortcut';
|
|
1022
967
|
}>;
|
|
1023
|
-
'trigger on demand assistant':
|
|
968
|
+
'trigger on demand assistant': Event$1<{
|
|
1024
969
|
assistantCode: string;
|
|
1025
970
|
}>;
|
|
1026
971
|
};
|
|
@@ -1085,12 +1030,7 @@ declare class DeepdeskAPI {
|
|
|
1085
1030
|
/**
|
|
1086
1031
|
* Send event with meta data for analytics
|
|
1087
1032
|
*/
|
|
1088
|
-
sendEvent<T extends keyof
|
|
1089
|
-
/**
|
|
1090
|
-
* Send event with meta data for analytics
|
|
1091
|
-
* @deprecated
|
|
1092
|
-
*/
|
|
1093
|
-
sendEventV1<T extends keyof SendEventV1ArgumentMap>(event: T, payload: SendEventV1ArgumentMap[T]): Promise<void>;
|
|
1033
|
+
sendEvent<T extends keyof SendEventArgumentMap>(event: T, payload: SendEventArgumentMap[T]): Promise<void>;
|
|
1094
1034
|
getEntities(messages: Array<{
|
|
1095
1035
|
text: string;
|
|
1096
1036
|
}>): Promise<Entity[]>;
|
|
@@ -1371,7 +1311,7 @@ type AssistantInteraction = {
|
|
|
1371
1311
|
type State$2 = {
|
|
1372
1312
|
cues: Cue[];
|
|
1373
1313
|
threads: Record<number, AssistantInteraction[]>;
|
|
1374
|
-
|
|
1314
|
+
pending: string[];
|
|
1375
1315
|
};
|
|
1376
1316
|
type Transcript = Array<{
|
|
1377
1317
|
source: string;
|
|
@@ -2059,6 +1999,7 @@ interface WidgetOptions {
|
|
|
2059
1999
|
interface KnowledgeAssistantWidgetOptions extends KnowledgeAssistOptions {
|
|
2060
2000
|
customStyles?: WidgetCustomStyles;
|
|
2061
2001
|
isLegacyKnowledgeAssist?: boolean;
|
|
2002
|
+
title?: string;
|
|
2062
2003
|
}
|
|
2063
2004
|
declare class DeepdeskSDK {
|
|
2064
2005
|
static version: string;
|
|
@@ -2075,6 +2016,7 @@ declare class DeepdeskSDK {
|
|
|
2075
2016
|
private widgetElement;
|
|
2076
2017
|
private widgetRoot;
|
|
2077
2018
|
private dynamicThunkObject;
|
|
2019
|
+
private queues;
|
|
2078
2020
|
isMounted: boolean;
|
|
2079
2021
|
instanceId: number;
|
|
2080
2022
|
private shouldRender;
|
package/dist/index.d.ts
CHANGED
|
@@ -107,6 +107,7 @@ declare const styles$o: {
|
|
|
107
107
|
readonly "dropdownItemButton": string;
|
|
108
108
|
readonly "dropdownList": string;
|
|
109
109
|
readonly "fadein": string;
|
|
110
|
+
readonly "icon": string;
|
|
110
111
|
readonly "isClickable": string;
|
|
111
112
|
readonly "isSelected": string;
|
|
112
113
|
readonly "label": string;
|
|
@@ -592,64 +593,10 @@ declare namespace Server {
|
|
|
592
593
|
suggestion: string;
|
|
593
594
|
}[];
|
|
594
595
|
};
|
|
595
|
-
enum EventType {
|
|
596
|
-
SEND_MESSAGE = "Send Message",
|
|
597
|
-
HANDLING_TIME = "Handling Time",
|
|
598
|
-
ADD_TO_PERSONAL_COLLECTION = "Add to personal collection",
|
|
599
|
-
DELETE_FROM_PERSONAL_COLLECTION = "Delete from personal collection"
|
|
600
|
-
}
|
|
601
|
-
type UsedSuggestion = {
|
|
602
|
-
ab_test_name?: string | null;
|
|
603
|
-
ab_variant?: string | null;
|
|
604
|
-
input_type: string;
|
|
605
|
-
source?: string;
|
|
606
|
-
source_text?: string;
|
|
607
|
-
text: string;
|
|
608
|
-
training_jobs?: string[];
|
|
609
|
-
};
|
|
610
|
-
/**
|
|
611
|
-
* Abstract API object for event data
|
|
612
|
-
* @deprecated in favor of EventDataV2
|
|
613
|
-
* @see EventV2Data
|
|
614
|
-
*/
|
|
615
|
-
type EventData = {
|
|
616
|
-
conversation_id: string;
|
|
617
|
-
client_version: string;
|
|
618
|
-
source: 'agent' | 'visitor';
|
|
619
|
-
pastes: string[];
|
|
620
|
-
cuts: string[];
|
|
621
|
-
deletions: string[];
|
|
622
|
-
len_text_typed: number;
|
|
623
|
-
len_text_total: number;
|
|
624
|
-
len_text_assisted: number;
|
|
625
|
-
len_text_pasted: number;
|
|
626
|
-
len_text_cut: number;
|
|
627
|
-
len_text_deleted: number;
|
|
628
|
-
time_total_seconds: number;
|
|
629
|
-
chars_per_second: number;
|
|
630
|
-
text: string;
|
|
631
|
-
num_pastes: number;
|
|
632
|
-
text_suggestions_v2: UsedSuggestion[];
|
|
633
|
-
url_suggestions_v2: UsedSuggestion[];
|
|
634
|
-
url_link_suggestions_v2: UsedSuggestion[];
|
|
635
|
-
suggestions_counters: {
|
|
636
|
-
source: Sources;
|
|
637
|
-
count_offered: number;
|
|
638
|
-
}[];
|
|
639
|
-
time_start: string;
|
|
640
|
-
time_stop: string;
|
|
641
|
-
agent_id?: string;
|
|
642
|
-
agent_name?: string;
|
|
643
|
-
agent_email?: string;
|
|
644
|
-
platform: string;
|
|
645
|
-
backend_version: string;
|
|
646
|
-
engine_version: string;
|
|
647
|
-
gpt_version: string;
|
|
648
|
-
};
|
|
649
596
|
/**
|
|
650
597
|
* Backend API object for event data v2
|
|
651
598
|
*/
|
|
652
|
-
type
|
|
599
|
+
type EventData = {
|
|
653
600
|
name: string;
|
|
654
601
|
platform?: string;
|
|
655
602
|
conversation_id?: string;
|
|
@@ -700,15 +647,28 @@ declare namespace Server {
|
|
|
700
647
|
/**
|
|
701
648
|
* Handling time event data
|
|
702
649
|
*/
|
|
703
|
-
type HandlingTimeEventData =
|
|
650
|
+
type HandlingTimeEventData = {
|
|
651
|
+
client_version: string;
|
|
652
|
+
time_start: string;
|
|
653
|
+
time_stop: string;
|
|
654
|
+
};
|
|
704
655
|
/**
|
|
705
656
|
* Send message event data
|
|
706
657
|
*/
|
|
707
|
-
type SendMessageEventData =
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
658
|
+
type SendMessageEventData = {
|
|
659
|
+
client_version: string;
|
|
660
|
+
source: string;
|
|
661
|
+
len_text_total: number;
|
|
662
|
+
pastes: string[];
|
|
663
|
+
num_pastes: number;
|
|
664
|
+
suggestions: Array<{
|
|
665
|
+
input_type: string;
|
|
666
|
+
source?: Sources;
|
|
667
|
+
source_text?: string;
|
|
668
|
+
text: string;
|
|
669
|
+
training_jobs?: Array<string>;
|
|
670
|
+
}>;
|
|
671
|
+
};
|
|
712
672
|
/**
|
|
713
673
|
* Search results data
|
|
714
674
|
*/
|
|
@@ -771,27 +731,17 @@ declare namespace Server {
|
|
|
771
731
|
sticky_messages: boolean;
|
|
772
732
|
recommend_text_suggestions: boolean;
|
|
773
733
|
assisted_intake: boolean;
|
|
774
|
-
autocomplete_with_text_suggestions: boolean;
|
|
775
734
|
entities_command: boolean;
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
* Old rule group
|
|
781
|
-
* @deprecated in favor of `summarizer_assistant_new`
|
|
782
|
-
*/
|
|
783
|
-
summarizer_assistant?: string;
|
|
784
|
-
summarizer_assistant_new?: string;
|
|
785
|
-
conversation_accepted_assistant?: string;
|
|
786
|
-
conversation_new_message_assistant?: string;
|
|
787
|
-
conversation_ended_assistant?: string;
|
|
735
|
+
summarizer_assistant_new: string | null;
|
|
736
|
+
conversation_accepted_assistant: string | null;
|
|
737
|
+
conversation_new_message_assistant: string | null;
|
|
738
|
+
conversation_ended_assistant: string | null;
|
|
788
739
|
/**
|
|
789
740
|
* @deprecated in favor of `knowledge_assistant_new`
|
|
790
741
|
*/
|
|
791
|
-
knowledge_assistant: string;
|
|
792
|
-
knowledge_assistant_new: string;
|
|
742
|
+
knowledge_assistant: string | null;
|
|
743
|
+
knowledge_assistant_new: string | null;
|
|
793
744
|
on_demand_assistants: Array<OnDemandAssistant>;
|
|
794
|
-
authorized_groups: number[];
|
|
795
745
|
active_config: {
|
|
796
746
|
default_locale: string;
|
|
797
747
|
};
|
|
@@ -804,6 +754,7 @@ declare namespace Server {
|
|
|
804
754
|
amount: number;
|
|
805
755
|
lines: 'multiple' | 'single';
|
|
806
756
|
schema?: CustomDataSchema;
|
|
757
|
+
property?: string;
|
|
807
758
|
}>;
|
|
808
759
|
};
|
|
809
760
|
search: {
|
|
@@ -907,15 +858,15 @@ type CreateConversationOptions = {
|
|
|
907
858
|
*/
|
|
908
859
|
type SendMessageEventData = CamelCaseKeys<Server.SendMessageEventData>;
|
|
909
860
|
/**
|
|
910
|
-
* Event
|
|
861
|
+
* Event payload
|
|
911
862
|
*/
|
|
912
|
-
type
|
|
863
|
+
type Event$1<T = unknown> = CamelCaseKeys<Omit<Server.EventData, 'name' | 'backend_version' | 'engine_version' | 'gpt_version' | 'data'>> & {
|
|
913
864
|
data: T;
|
|
914
865
|
};
|
|
915
866
|
/**
|
|
916
867
|
* Handling time event data
|
|
917
868
|
*/
|
|
918
|
-
type HandlingTimeEventData = CamelCaseKeys<
|
|
869
|
+
type HandlingTimeEventData = CamelCaseKeys<Server.HandlingTimeEventData>;
|
|
919
870
|
/**
|
|
920
871
|
* Rule event meta data
|
|
921
872
|
*/
|
|
@@ -925,67 +876,61 @@ type RuleEventMeta = {
|
|
|
925
876
|
group: string;
|
|
926
877
|
};
|
|
927
878
|
/**
|
|
928
|
-
* Map the send event name to the data value in the payload
|
|
929
|
-
* @deprecated
|
|
930
|
-
*/
|
|
931
|
-
type SendEventV1ArgumentMap = {
|
|
932
|
-
'Send Message': SendMessageEventData;
|
|
933
|
-
'Handling Time': HandlingTimeEventData;
|
|
934
|
-
};
|
|
935
|
-
/**
|
|
936
|
-
* Map the send event name to the data value in the payload. (V2)
|
|
879
|
+
* Map the send event name to the data value in the payload
|
|
937
880
|
*/
|
|
938
|
-
type
|
|
939
|
-
'
|
|
881
|
+
type SendEventArgumentMap = {
|
|
882
|
+
'Send Message': Event$1<SendMessageEventData>;
|
|
883
|
+
'Handling Time': Event$1<HandlingTimeEventData>;
|
|
884
|
+
'Add to personal collection': Event$1<{
|
|
940
885
|
text: string;
|
|
941
886
|
}>;
|
|
942
|
-
'Delete from personal collection':
|
|
887
|
+
'Delete from personal collection': Event$1<{
|
|
943
888
|
text: string;
|
|
944
889
|
}>;
|
|
945
|
-
'entities found':
|
|
890
|
+
'entities found': Event$1<{
|
|
946
891
|
entities: Entity[];
|
|
947
892
|
}>;
|
|
948
|
-
'conversation summarized':
|
|
893
|
+
'conversation summarized': Event$1<{
|
|
949
894
|
summary: string;
|
|
950
895
|
assistant?: string;
|
|
951
896
|
}>;
|
|
952
|
-
'style suggested':
|
|
897
|
+
'style suggested': Event$1<{
|
|
953
898
|
keywordMatches: {
|
|
954
899
|
keyword: string;
|
|
955
900
|
suggestion: string;
|
|
956
901
|
}[];
|
|
957
902
|
}>;
|
|
958
|
-
'Image attached':
|
|
903
|
+
'Image attached': Event$1<{
|
|
959
904
|
path: string;
|
|
960
905
|
title: string;
|
|
961
906
|
}>;
|
|
962
|
-
'Assistant response displayed':
|
|
907
|
+
'Assistant response displayed': Event$1<RuleEventMeta & {
|
|
963
908
|
cueText: string;
|
|
964
909
|
}>;
|
|
965
|
-
'Assistant response closed':
|
|
910
|
+
'Assistant response closed': Event$1<RuleEventMeta & {
|
|
966
911
|
cueText: string;
|
|
967
912
|
}>;
|
|
968
|
-
'Assistant response feedback':
|
|
913
|
+
'Assistant response feedback': Event$1<RuleEventMeta & {
|
|
969
914
|
rating: 'up' | 'down';
|
|
970
915
|
cueText: string;
|
|
971
916
|
}>;
|
|
972
|
-
'Assistant response used':
|
|
917
|
+
'Assistant response used': Event$1<RuleEventMeta & {
|
|
973
918
|
usedText: string;
|
|
974
919
|
}>;
|
|
975
|
-
'Assistant response copied':
|
|
920
|
+
'Assistant response copied': Event$1<RuleEventMeta & {
|
|
976
921
|
copiedText: string;
|
|
977
922
|
}>;
|
|
978
|
-
'Assistant call to action':
|
|
923
|
+
'Assistant call to action': Event$1<RuleEventMeta & {
|
|
979
924
|
eventName: string;
|
|
980
925
|
value: string;
|
|
981
926
|
}>;
|
|
982
|
-
'knowledge assist feedback':
|
|
927
|
+
'knowledge assist feedback': Event$1<{
|
|
983
928
|
question: string;
|
|
984
929
|
isFollowUpQuestion: boolean;
|
|
985
930
|
isAgent: boolean;
|
|
986
931
|
answer: Server.KnowledgeResponse['answer'];
|
|
987
932
|
}>;
|
|
988
|
-
'knowledge assist question answered':
|
|
933
|
+
'knowledge assist question answered': Event$1<{
|
|
989
934
|
question: string;
|
|
990
935
|
answer: string;
|
|
991
936
|
sources: {
|
|
@@ -995,32 +940,32 @@ type SendEventV2ArgumentMap = {
|
|
|
995
940
|
isFollowUpQuestion: boolean;
|
|
996
941
|
isAutoInitiated: boolean;
|
|
997
942
|
}>;
|
|
998
|
-
'knowledge assist source viewed':
|
|
943
|
+
'knowledge assist source viewed': Event$1<{
|
|
999
944
|
question: string;
|
|
1000
945
|
sourceViewed: string;
|
|
1001
946
|
}>;
|
|
1002
|
-
'knowledge assist reset':
|
|
947
|
+
'knowledge assist reset': Event$1<{
|
|
1003
948
|
threadId?: number;
|
|
1004
949
|
}>;
|
|
1005
|
-
'summary feedback':
|
|
950
|
+
'summary feedback': Event$1<{
|
|
1006
951
|
summary: string;
|
|
1007
952
|
rating: 'up' | 'down';
|
|
1008
953
|
}>;
|
|
1009
|
-
'summary copied to clipboard':
|
|
954
|
+
'summary copied to clipboard': Event$1<{
|
|
1010
955
|
originalText: string;
|
|
1011
956
|
finalText: string;
|
|
1012
957
|
assistant: string;
|
|
1013
958
|
}>;
|
|
1014
|
-
'open search':
|
|
959
|
+
'open search': Event$1<{
|
|
1015
960
|
via: 'ctrl+k' | 'autocomplete-overlay' | 'widget-shortcut';
|
|
1016
961
|
}>;
|
|
1017
|
-
'open knowledge assistant':
|
|
962
|
+
'open knowledge assistant': Event$1<{
|
|
1018
963
|
via: 'ctrl+k' | 'widget-shortcut' | 'search-command';
|
|
1019
964
|
}>;
|
|
1020
|
-
'open my deepdesk':
|
|
965
|
+
'open my deepdesk': Event$1<{
|
|
1021
966
|
via: 'widget-shortcut';
|
|
1022
967
|
}>;
|
|
1023
|
-
'trigger on demand assistant':
|
|
968
|
+
'trigger on demand assistant': Event$1<{
|
|
1024
969
|
assistantCode: string;
|
|
1025
970
|
}>;
|
|
1026
971
|
};
|
|
@@ -1085,12 +1030,7 @@ declare class DeepdeskAPI {
|
|
|
1085
1030
|
/**
|
|
1086
1031
|
* Send event with meta data for analytics
|
|
1087
1032
|
*/
|
|
1088
|
-
sendEvent<T extends keyof
|
|
1089
|
-
/**
|
|
1090
|
-
* Send event with meta data for analytics
|
|
1091
|
-
* @deprecated
|
|
1092
|
-
*/
|
|
1093
|
-
sendEventV1<T extends keyof SendEventV1ArgumentMap>(event: T, payload: SendEventV1ArgumentMap[T]): Promise<void>;
|
|
1033
|
+
sendEvent<T extends keyof SendEventArgumentMap>(event: T, payload: SendEventArgumentMap[T]): Promise<void>;
|
|
1094
1034
|
getEntities(messages: Array<{
|
|
1095
1035
|
text: string;
|
|
1096
1036
|
}>): Promise<Entity[]>;
|
|
@@ -1371,7 +1311,7 @@ type AssistantInteraction = {
|
|
|
1371
1311
|
type State$2 = {
|
|
1372
1312
|
cues: Cue[];
|
|
1373
1313
|
threads: Record<number, AssistantInteraction[]>;
|
|
1374
|
-
|
|
1314
|
+
pending: string[];
|
|
1375
1315
|
};
|
|
1376
1316
|
type Transcript = Array<{
|
|
1377
1317
|
source: string;
|
|
@@ -2059,6 +1999,7 @@ interface WidgetOptions {
|
|
|
2059
1999
|
interface KnowledgeAssistantWidgetOptions extends KnowledgeAssistOptions {
|
|
2060
2000
|
customStyles?: WidgetCustomStyles;
|
|
2061
2001
|
isLegacyKnowledgeAssist?: boolean;
|
|
2002
|
+
title?: string;
|
|
2062
2003
|
}
|
|
2063
2004
|
declare class DeepdeskSDK {
|
|
2064
2005
|
static version: string;
|
|
@@ -2075,6 +2016,7 @@ declare class DeepdeskSDK {
|
|
|
2075
2016
|
private widgetElement;
|
|
2076
2017
|
private widgetRoot;
|
|
2077
2018
|
private dynamicThunkObject;
|
|
2019
|
+
private queues;
|
|
2078
2020
|
isMounted: boolean;
|
|
2079
2021
|
instanceId: number;
|
|
2080
2022
|
private shouldRender;
|