@deepdesk/deepdesk-sdk 17.0.0-rc.9 → 17.0.1-beta.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.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 EventV2Data = {
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 = Pick<EventData, 'conversation_id' | 'client_version' | 'time_start' | 'time_stop'> & Partial<Pick<EventData, 'agent_id' | 'agent_name' | 'agent_email'>>;
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 = Pick<EventData, 'client_version' | 'conversation_id' | 'source' | 'pastes' | 'cuts' | 'deletions' | 'len_text_typed' | 'len_text_total' | 'len_text_assisted' | 'len_text_pasted' | 'len_text_cut' | 'len_text_deleted' | 'time_total_seconds' | 'chars_per_second' | 'num_pastes' | 'text' | 'text_suggestions_v2' | 'suggestions_counters'> & Partial<Pick<EventData, 'agent_id' | 'agent_name' | 'agent_email'>>;
708
- /**
709
- * PersonalCollection event data
710
- */
711
- type PersonalCollectionEventData = Pick<EventData, 'text' | 'platform'>;
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
  */
@@ -760,6 +720,11 @@ declare namespace Server {
760
720
  last_name?: string;
761
721
  default_locale?: string;
762
722
  };
723
+ type ConversationAssistant = {
724
+ id: number;
725
+ code: string;
726
+ name: string;
727
+ };
763
728
  /**
764
729
  * Profile
765
730
  */
@@ -771,27 +736,20 @@ declare namespace Server {
771
736
  sticky_messages: boolean;
772
737
  recommend_text_suggestions: boolean;
773
738
  assisted_intake: boolean;
774
- autocomplete_with_text_suggestions: boolean;
775
739
  entities_command: boolean;
776
- summarizer: boolean;
777
- summarizer_prompt_instruction: string;
778
- summarizer_model: string;
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;
740
+ summarizer_assistant_new: string | null;
741
+ conversation_accepted_assistant: string | null;
742
+ conversation_new_message_assistant: string | null;
743
+ conversation_ended_assistant: string | null;
744
+ on_conversation_accepted_assistants: Array<ConversationAssistant>;
745
+ on_conversation_new_message_assistants: Array<ConversationAssistant>;
746
+ on_conversation_ended_assistants: Array<ConversationAssistant>;
788
747
  /**
789
748
  * @deprecated in favor of `knowledge_assistant_new`
790
749
  */
791
- knowledge_assistant: string;
792
- knowledge_assistant_new: string;
750
+ knowledge_assistant: string | null;
751
+ knowledge_assistant_new: string | null;
793
752
  on_demand_assistants: Array<OnDemandAssistant>;
794
- authorized_groups: number[];
795
753
  active_config: {
796
754
  default_locale: string;
797
755
  };
@@ -804,6 +762,7 @@ declare namespace Server {
804
762
  amount: number;
805
763
  lines: 'multiple' | 'single';
806
764
  schema?: CustomDataSchema;
765
+ property?: string;
807
766
  }>;
808
767
  };
809
768
  search: {
@@ -907,15 +866,15 @@ type CreateConversationOptions = {
907
866
  */
908
867
  type SendMessageEventData = CamelCaseKeys<Server.SendMessageEventData>;
909
868
  /**
910
- * Event v2 payload
869
+ * Event payload
911
870
  */
912
- type EventV2<T = unknown> = CamelCaseKeys<Omit<Server.EventV2Data, 'name' | 'backend_version' | 'engine_version' | 'gpt_version' | 'data'>> & {
871
+ type Event$1<T = unknown> = CamelCaseKeys<Omit<Server.EventData, 'name' | 'backend_version' | 'engine_version' | 'gpt_version' | 'data'>> & {
913
872
  data: T;
914
873
  };
915
874
  /**
916
875
  * Handling time event data
917
876
  */
918
- type HandlingTimeEventData = CamelCaseKeys<Pick<Server.HandlingTimeEventData, 'conversation_id' | 'client_version' | 'time_start' | 'time_stop'>>;
877
+ type HandlingTimeEventData = CamelCaseKeys<Server.HandlingTimeEventData>;
919
878
  /**
920
879
  * Rule event meta data
921
880
  */
@@ -925,67 +884,61 @@ type RuleEventMeta = {
925
884
  group: string;
926
885
  };
927
886
  /**
928
- * Map the send event name to the data value in the payload. (V1)
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)
887
+ * Map the send event name to the data value in the payload
937
888
  */
938
- type SendEventV2ArgumentMap = {
939
- 'Add to personal collection': EventV2<{
889
+ type SendEventArgumentMap = {
890
+ 'Send Message': Event$1<SendMessageEventData>;
891
+ 'Handling Time': Event$1<HandlingTimeEventData>;
892
+ 'Add to personal collection': Event$1<{
940
893
  text: string;
941
894
  }>;
942
- 'Delete from personal collection': EventV2<{
895
+ 'Delete from personal collection': Event$1<{
943
896
  text: string;
944
897
  }>;
945
- 'entities found': EventV2<{
898
+ 'entities found': Event$1<{
946
899
  entities: Entity[];
947
900
  }>;
948
- 'conversation summarized': EventV2<{
901
+ 'conversation summarized': Event$1<{
949
902
  summary: string;
950
903
  assistant?: string;
951
904
  }>;
952
- 'style suggested': EventV2<{
905
+ 'style suggested': Event$1<{
953
906
  keywordMatches: {
954
907
  keyword: string;
955
908
  suggestion: string;
956
909
  }[];
957
910
  }>;
958
- 'Image attached': EventV2<{
911
+ 'Image attached': Event$1<{
959
912
  path: string;
960
913
  title: string;
961
914
  }>;
962
- 'Assistant response displayed': EventV2<RuleEventMeta & {
915
+ 'Assistant response displayed': Event$1<RuleEventMeta & {
963
916
  cueText: string;
964
917
  }>;
965
- 'Assistant response closed': EventV2<RuleEventMeta & {
918
+ 'Assistant response closed': Event$1<RuleEventMeta & {
966
919
  cueText: string;
967
920
  }>;
968
- 'Assistant response feedback': EventV2<RuleEventMeta & {
921
+ 'Assistant response feedback': Event$1<RuleEventMeta & {
969
922
  rating: 'up' | 'down';
970
923
  cueText: string;
971
924
  }>;
972
- 'Assistant response used': EventV2<RuleEventMeta & {
925
+ 'Assistant response used': Event$1<RuleEventMeta & {
973
926
  usedText: string;
974
927
  }>;
975
- 'Assistant response copied': EventV2<RuleEventMeta & {
928
+ 'Assistant response copied': Event$1<RuleEventMeta & {
976
929
  copiedText: string;
977
930
  }>;
978
- 'Assistant call to action': EventV2<RuleEventMeta & {
931
+ 'Assistant call to action': Event$1<RuleEventMeta & {
979
932
  eventName: string;
980
933
  value: string;
981
934
  }>;
982
- 'knowledge assist feedback': EventV2<{
935
+ 'knowledge assist feedback': Event$1<{
983
936
  question: string;
984
937
  isFollowUpQuestion: boolean;
985
938
  isAgent: boolean;
986
939
  answer: Server.KnowledgeResponse['answer'];
987
940
  }>;
988
- 'knowledge assist question answered': EventV2<{
941
+ 'knowledge assist question answered': Event$1<{
989
942
  question: string;
990
943
  answer: string;
991
944
  sources: {
@@ -995,32 +948,32 @@ type SendEventV2ArgumentMap = {
995
948
  isFollowUpQuestion: boolean;
996
949
  isAutoInitiated: boolean;
997
950
  }>;
998
- 'knowledge assist source viewed': EventV2<{
951
+ 'knowledge assist source viewed': Event$1<{
999
952
  question: string;
1000
953
  sourceViewed: string;
1001
954
  }>;
1002
- 'knowledge assist reset': EventV2<{
955
+ 'knowledge assist reset': Event$1<{
1003
956
  threadId?: number;
1004
957
  }>;
1005
- 'summary feedback': EventV2<{
958
+ 'summary feedback': Event$1<{
1006
959
  summary: string;
1007
960
  rating: 'up' | 'down';
1008
961
  }>;
1009
- 'summary copied to clipboard': EventV2<{
962
+ 'summary copied to clipboard': Event$1<{
1010
963
  originalText: string;
1011
964
  finalText: string;
1012
965
  assistant: string;
1013
966
  }>;
1014
- 'open search': EventV2<{
967
+ 'open search': Event$1<{
1015
968
  via: 'ctrl+k' | 'autocomplete-overlay' | 'widget-shortcut';
1016
969
  }>;
1017
- 'open knowledge assistant': EventV2<{
970
+ 'open knowledge assistant': Event$1<{
1018
971
  via: 'ctrl+k' | 'widget-shortcut' | 'search-command';
1019
972
  }>;
1020
- 'open my deepdesk': EventV2<{
973
+ 'open my deepdesk': Event$1<{
1021
974
  via: 'widget-shortcut';
1022
975
  }>;
1023
- 'trigger on demand assistant': EventV2<{
976
+ 'trigger on demand assistant': Event$1<{
1024
977
  assistantCode: string;
1025
978
  }>;
1026
979
  };
@@ -1085,12 +1038,7 @@ declare class DeepdeskAPI {
1085
1038
  /**
1086
1039
  * Send event with meta data for analytics
1087
1040
  */
1088
- sendEvent<T extends keyof SendEventV2ArgumentMap>(event: T, payload: SendEventV2ArgumentMap[T]): Promise<void>;
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>;
1041
+ sendEvent<T extends keyof SendEventArgumentMap>(event: T, payload: SendEventArgumentMap[T]): Promise<void>;
1094
1042
  getEntities(messages: Array<{
1095
1043
  text: string;
1096
1044
  }>): Promise<Entity[]>;
@@ -1371,7 +1319,7 @@ type AssistantInteraction = {
1371
1319
  type State$2 = {
1372
1320
  cues: Cue[];
1373
1321
  threads: Record<number, AssistantInteraction[]>;
1374
- fetchState: FetchState;
1322
+ pending: string[];
1375
1323
  };
1376
1324
  type Transcript = Array<{
1377
1325
  source: string;
@@ -2059,6 +2007,7 @@ interface WidgetOptions {
2059
2007
  interface KnowledgeAssistantWidgetOptions extends KnowledgeAssistOptions {
2060
2008
  customStyles?: WidgetCustomStyles;
2061
2009
  isLegacyKnowledgeAssist?: boolean;
2010
+ title?: string;
2062
2011
  }
2063
2012
  declare class DeepdeskSDK {
2064
2013
  static version: string;
@@ -2075,6 +2024,7 @@ declare class DeepdeskSDK {
2075
2024
  private widgetElement;
2076
2025
  private widgetRoot;
2077
2026
  private dynamicThunkObject;
2027
+ private queues;
2078
2028
  isMounted: boolean;
2079
2029
  instanceId: number;
2080
2030
  private shouldRender;