@deepdesk/deepdesk-sdk 10.1.4 → 10.1.6

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
@@ -176,7 +176,7 @@ declare const ToggleButton: React.FC<Props>;
176
176
  declare enum Sources {
177
177
  SEARCH = "search",
178
178
  TEMPLATE = "template",
179
- ELASTIC_SEARCH = "studio-search",
179
+ ELASTIC_SEARCH = "search-autocomplete",
180
180
  GPT = "gpt",
181
181
  TRIE = "trie",
182
182
  TRIE_WITH_TYPOS = "trie-with-typos",
@@ -185,7 +185,10 @@ declare enum Sources {
185
185
  URL_RECOMMENDATION = "url_recommendation",
186
186
  LINK_RECOMMENDATION = "link_recommendation",
187
187
  PERSONAL_COLLECTION = "personal-collection",
188
- PERSONAL_COLLECTION_SEARCH = "personal-collection-search"
188
+ PERSONAL_COLLECTION_SEARCH = "personal-collection-search",
189
+ SEARCH_OVERLAY = "search-overlay",
190
+ SEARCH_PREVIEW = "search-preview",
191
+ SEARCH_URL = "search-url"
189
192
  }
190
193
  declare enum InputType {
191
194
  TAB = "tab",
@@ -450,6 +453,67 @@ interface StoreConfig {
450
453
  middleware?: Middleware[];
451
454
  preloadedState?: any;
452
455
  }
456
+ declare const reducers: redux.Reducer<redux.CombinedState<{
457
+ activeSuggestion: State$e;
458
+ answer: State$c;
459
+ auth: State$d;
460
+ autoflows: State$6;
461
+ conversation: State$b;
462
+ contentTypes: State$a;
463
+ customMessages: State$9;
464
+ exchangeToken: State$8;
465
+ entities: State$7;
466
+ handlingTime: State$f;
467
+ info: {
468
+ agentInfo?: AgentInfo | undefined;
469
+ agentSettings: unknown;
470
+ visitorInfo?: VisitorInfo | undefined;
471
+ fetchState: FetchState;
472
+ };
473
+ input: State$5;
474
+ overlayInput: State$5;
475
+ settings: {
476
+ locale: Locale;
477
+ deanonymize: boolean;
478
+ fallbackImage: string | false;
479
+ isEmbedded: boolean;
480
+ showAutoflows: number | boolean;
481
+ showCustomMessages: number | boolean;
482
+ showImages: boolean;
483
+ showPersonalCollectionLink: boolean;
484
+ showSearch: boolean;
485
+ showImageSearch: boolean;
486
+ showStyleSuggestions: number | boolean;
487
+ showMidSentenceSuggestions: boolean;
488
+ showSuggestionsBeforePattern: string | false;
489
+ showSuggestionsAfterPattern: string | false;
490
+ showTabCompletion: boolean;
491
+ showTextSuggestions: boolean;
492
+ showEntitiesCommand: boolean;
493
+ showSummaryCommand: boolean;
494
+ showKnowledgeSearch: boolean;
495
+ textSuggestionsCount: number;
496
+ recommendTextSuggestions: boolean;
497
+ searchTriggerKey: string;
498
+ visible: boolean;
499
+ insertLink: boolean;
500
+ inlineSuggestions: boolean;
501
+ adminUrl?: string | undefined;
502
+ productName: string;
503
+ };
504
+ profile: State$4;
505
+ search: State$3;
506
+ summary: State$2;
507
+ styleSuggestions: State$1;
508
+ ui: {
509
+ showTabHint: boolean;
510
+ inputHasFocus: boolean;
511
+ overlayCollapsed: boolean;
512
+ openOverlayWhenTyping: boolean;
513
+ overlayCollapsedUserOverwrite: boolean;
514
+ };
515
+ textSuggestions: TextSuggestionState;
516
+ }>, redux.AnyAction>;
453
517
  declare function createStore(config: StoreConfig): _reduxjs_toolkit_dist_configureStore.ToolkitStore<redux.EmptyObject & {
454
518
  activeSuggestion: State$e;
455
519
  answer: State$c;
@@ -575,6 +639,7 @@ declare function createStore(config: StoreConfig): _reduxjs_toolkit_dist_configu
575
639
  deepdeskAPI: DeepdeskAPI;
576
640
  deepdeskBrokerAPI: DeepdeskBrokerAPI | undefined;
577
641
  }>[]>;
642
+ type RootState = ReturnType<typeof reducers>;
578
643
  type Store = ReturnType<typeof createStore>;
579
644
 
580
645
  interface State$d {
@@ -1416,6 +1481,7 @@ interface TextSuggestion extends SuggestionApiMetrics {
1416
1481
  url?: string;
1417
1482
  title?: string;
1418
1483
  sourceLabel?: string;
1484
+ searchTerm?: string;
1419
1485
  type?: string;
1420
1486
  searchKeywords?: string[];
1421
1487
  image?: string;
@@ -1453,6 +1519,7 @@ interface SearchSuggestion extends SuggestionApiMetrics {
1453
1519
  id?: string;
1454
1520
  text: string;
1455
1521
  title?: string;
1522
+ source?: string;
1456
1523
  context?: string;
1457
1524
  image?: string;
1458
1525
  type?: SearchResultType;
@@ -1529,6 +1596,7 @@ type MetricState = {
1529
1596
  numCharsDeleted: number;
1530
1597
  numPaste: number;
1531
1598
  agentStartedTypingTimestamp: number | null;
1599
+ externalTimeTotalSeconds: number | null;
1532
1600
  pastes: any[];
1533
1601
  deletions: any[];
1534
1602
  offeredTextSuggestions: TextSuggestion[];
@@ -1592,6 +1660,18 @@ interface TextSuggestionState {
1592
1660
  [type: string]: SuggestionState;
1593
1661
  }
1594
1662
 
1663
+ interface MessagePayload {
1664
+ name: string;
1665
+ type: string;
1666
+ channel: string;
1667
+ payload: unknown;
1668
+ }
1669
+ interface Channel {
1670
+ onMessage(cb: (event: MessageEvent<MessagePayload>) => void): void;
1671
+ postMessage(message: MessagePayload): void;
1672
+ close(): void;
1673
+ }
1674
+
1595
1675
  type State = {
1596
1676
  locale: Locale;
1597
1677
  deanonymize: boolean;
@@ -1637,6 +1717,7 @@ interface SDKOptions {
1637
1717
  token?: string;
1638
1718
  fetch?: typeof window.fetch;
1639
1719
  productName?: string;
1720
+ createCustomChannel?: (name: string) => Channel;
1640
1721
  }
1641
1722
  interface SDKEventMap {
1642
1723
  'select-suggestion': {
@@ -1710,7 +1791,7 @@ declare class DeepdeskSDK {
1710
1791
  instanceId: number;
1711
1792
  private shouldRender;
1712
1793
  store: Store;
1713
- constructor({ deepdeskUrl, brokerUrl, version, locale, token, fetch, productName, }: SDKOptions);
1794
+ constructor({ deepdeskUrl, brokerUrl, version, locale, token, fetch, productName, createCustomChannel, }: SDKOptions);
1714
1795
  get state(): redux.EmptyObject & {
1715
1796
  activeSuggestion: State$e;
1716
1797
  answer: State$c;
@@ -2078,4 +2159,4 @@ declare function waitForElementVisibilityChange(element: HTMLElement, callback:
2078
2159
  type CSSModule = Record<string, string>;
2079
2160
  declare function useStyles<TStyles extends CSSModule>(componentName: string, defaultStyles: TStyles): TStyles;
2080
2161
 
2081
- export { AgentInfo, Card, Chip, ContentEditableInput, Conversation, ConversationMessage, DeepdeskAPI, DeepdeskSDK, InputMediator, InputOverlayCustomStyles, InputType, KeyboardHint, Label, Locale, Logger, MountOptions, PinnedMessage, PlatformConfig, Section, SectionList, SelectionRange, Sources, Suggestion, SuggestionEventMetrics, SuggestionList, SuggestionMetrics, TextAreaInput, TextSuggestion, ToggleButton, UrlSuggestion, VisitorInfo, WidgetCustomStyles, WidgetOptions, attachFile, authenticateWithKey, createOverlayContainer, createRangeFromOffsets, escapeHTML, fetchPlatformConfig, formatTextMarkup, getRangeOffsets, getRangeText, isSupportedInputElement, updateContentEditable, updateTextArea, useStyles, waitForElementVisibilityChange };
2162
+ export { AgentInfo, Card, Chip, ContentEditableInput, Conversation, ConversationMessage, DeepdeskAPI, DeepdeskSDK, HTTPClient, InputMediator, InputOverlayCustomStyles, InputType, KeyboardHint, Label, Locale, Logger, MountOptions, PinnedMessage, PlatformConfig, RootState, Section, SectionList, SelectionRange, Sources, Suggestion, SuggestionEventMetrics, SuggestionList, SuggestionMetrics, TextAreaInput, TextSuggestion, ToggleButton, UrlSuggestion, VisitorInfo, WidgetCustomStyles, WidgetOptions, attachFile, authenticateWithKey, createOverlayContainer, createRangeFromOffsets, escapeHTML, fetchPlatformConfig, formatTextMarkup, getRangeOffsets, getRangeText, isSupportedInputElement, updateContentEditable, updateTextArea, useStyles, waitForElementVisibilityChange };
package/dist/index.d.ts CHANGED
@@ -176,7 +176,7 @@ declare const ToggleButton: React.FC<Props>;
176
176
  declare enum Sources {
177
177
  SEARCH = "search",
178
178
  TEMPLATE = "template",
179
- ELASTIC_SEARCH = "studio-search",
179
+ ELASTIC_SEARCH = "search-autocomplete",
180
180
  GPT = "gpt",
181
181
  TRIE = "trie",
182
182
  TRIE_WITH_TYPOS = "trie-with-typos",
@@ -185,7 +185,10 @@ declare enum Sources {
185
185
  URL_RECOMMENDATION = "url_recommendation",
186
186
  LINK_RECOMMENDATION = "link_recommendation",
187
187
  PERSONAL_COLLECTION = "personal-collection",
188
- PERSONAL_COLLECTION_SEARCH = "personal-collection-search"
188
+ PERSONAL_COLLECTION_SEARCH = "personal-collection-search",
189
+ SEARCH_OVERLAY = "search-overlay",
190
+ SEARCH_PREVIEW = "search-preview",
191
+ SEARCH_URL = "search-url"
189
192
  }
190
193
  declare enum InputType {
191
194
  TAB = "tab",
@@ -450,6 +453,67 @@ interface StoreConfig {
450
453
  middleware?: Middleware[];
451
454
  preloadedState?: any;
452
455
  }
456
+ declare const reducers: redux.Reducer<redux.CombinedState<{
457
+ activeSuggestion: State$e;
458
+ answer: State$c;
459
+ auth: State$d;
460
+ autoflows: State$6;
461
+ conversation: State$b;
462
+ contentTypes: State$a;
463
+ customMessages: State$9;
464
+ exchangeToken: State$8;
465
+ entities: State$7;
466
+ handlingTime: State$f;
467
+ info: {
468
+ agentInfo?: AgentInfo | undefined;
469
+ agentSettings: unknown;
470
+ visitorInfo?: VisitorInfo | undefined;
471
+ fetchState: FetchState;
472
+ };
473
+ input: State$5;
474
+ overlayInput: State$5;
475
+ settings: {
476
+ locale: Locale;
477
+ deanonymize: boolean;
478
+ fallbackImage: string | false;
479
+ isEmbedded: boolean;
480
+ showAutoflows: number | boolean;
481
+ showCustomMessages: number | boolean;
482
+ showImages: boolean;
483
+ showPersonalCollectionLink: boolean;
484
+ showSearch: boolean;
485
+ showImageSearch: boolean;
486
+ showStyleSuggestions: number | boolean;
487
+ showMidSentenceSuggestions: boolean;
488
+ showSuggestionsBeforePattern: string | false;
489
+ showSuggestionsAfterPattern: string | false;
490
+ showTabCompletion: boolean;
491
+ showTextSuggestions: boolean;
492
+ showEntitiesCommand: boolean;
493
+ showSummaryCommand: boolean;
494
+ showKnowledgeSearch: boolean;
495
+ textSuggestionsCount: number;
496
+ recommendTextSuggestions: boolean;
497
+ searchTriggerKey: string;
498
+ visible: boolean;
499
+ insertLink: boolean;
500
+ inlineSuggestions: boolean;
501
+ adminUrl?: string | undefined;
502
+ productName: string;
503
+ };
504
+ profile: State$4;
505
+ search: State$3;
506
+ summary: State$2;
507
+ styleSuggestions: State$1;
508
+ ui: {
509
+ showTabHint: boolean;
510
+ inputHasFocus: boolean;
511
+ overlayCollapsed: boolean;
512
+ openOverlayWhenTyping: boolean;
513
+ overlayCollapsedUserOverwrite: boolean;
514
+ };
515
+ textSuggestions: TextSuggestionState;
516
+ }>, redux.AnyAction>;
453
517
  declare function createStore(config: StoreConfig): _reduxjs_toolkit_dist_configureStore.ToolkitStore<redux.EmptyObject & {
454
518
  activeSuggestion: State$e;
455
519
  answer: State$c;
@@ -575,6 +639,7 @@ declare function createStore(config: StoreConfig): _reduxjs_toolkit_dist_configu
575
639
  deepdeskAPI: DeepdeskAPI;
576
640
  deepdeskBrokerAPI: DeepdeskBrokerAPI | undefined;
577
641
  }>[]>;
642
+ type RootState = ReturnType<typeof reducers>;
578
643
  type Store = ReturnType<typeof createStore>;
579
644
 
580
645
  interface State$d {
@@ -1416,6 +1481,7 @@ interface TextSuggestion extends SuggestionApiMetrics {
1416
1481
  url?: string;
1417
1482
  title?: string;
1418
1483
  sourceLabel?: string;
1484
+ searchTerm?: string;
1419
1485
  type?: string;
1420
1486
  searchKeywords?: string[];
1421
1487
  image?: string;
@@ -1453,6 +1519,7 @@ interface SearchSuggestion extends SuggestionApiMetrics {
1453
1519
  id?: string;
1454
1520
  text: string;
1455
1521
  title?: string;
1522
+ source?: string;
1456
1523
  context?: string;
1457
1524
  image?: string;
1458
1525
  type?: SearchResultType;
@@ -1529,6 +1596,7 @@ type MetricState = {
1529
1596
  numCharsDeleted: number;
1530
1597
  numPaste: number;
1531
1598
  agentStartedTypingTimestamp: number | null;
1599
+ externalTimeTotalSeconds: number | null;
1532
1600
  pastes: any[];
1533
1601
  deletions: any[];
1534
1602
  offeredTextSuggestions: TextSuggestion[];
@@ -1592,6 +1660,18 @@ interface TextSuggestionState {
1592
1660
  [type: string]: SuggestionState;
1593
1661
  }
1594
1662
 
1663
+ interface MessagePayload {
1664
+ name: string;
1665
+ type: string;
1666
+ channel: string;
1667
+ payload: unknown;
1668
+ }
1669
+ interface Channel {
1670
+ onMessage(cb: (event: MessageEvent<MessagePayload>) => void): void;
1671
+ postMessage(message: MessagePayload): void;
1672
+ close(): void;
1673
+ }
1674
+
1595
1675
  type State = {
1596
1676
  locale: Locale;
1597
1677
  deanonymize: boolean;
@@ -1637,6 +1717,7 @@ interface SDKOptions {
1637
1717
  token?: string;
1638
1718
  fetch?: typeof window.fetch;
1639
1719
  productName?: string;
1720
+ createCustomChannel?: (name: string) => Channel;
1640
1721
  }
1641
1722
  interface SDKEventMap {
1642
1723
  'select-suggestion': {
@@ -1710,7 +1791,7 @@ declare class DeepdeskSDK {
1710
1791
  instanceId: number;
1711
1792
  private shouldRender;
1712
1793
  store: Store;
1713
- constructor({ deepdeskUrl, brokerUrl, version, locale, token, fetch, productName, }: SDKOptions);
1794
+ constructor({ deepdeskUrl, brokerUrl, version, locale, token, fetch, productName, createCustomChannel, }: SDKOptions);
1714
1795
  get state(): redux.EmptyObject & {
1715
1796
  activeSuggestion: State$e;
1716
1797
  answer: State$c;
@@ -2078,4 +2159,4 @@ declare function waitForElementVisibilityChange(element: HTMLElement, callback:
2078
2159
  type CSSModule = Record<string, string>;
2079
2160
  declare function useStyles<TStyles extends CSSModule>(componentName: string, defaultStyles: TStyles): TStyles;
2080
2161
 
2081
- export { AgentInfo, Card, Chip, ContentEditableInput, Conversation, ConversationMessage, DeepdeskAPI, DeepdeskSDK, InputMediator, InputOverlayCustomStyles, InputType, KeyboardHint, Label, Locale, Logger, MountOptions, PinnedMessage, PlatformConfig, Section, SectionList, SelectionRange, Sources, Suggestion, SuggestionEventMetrics, SuggestionList, SuggestionMetrics, TextAreaInput, TextSuggestion, ToggleButton, UrlSuggestion, VisitorInfo, WidgetCustomStyles, WidgetOptions, attachFile, authenticateWithKey, createOverlayContainer, createRangeFromOffsets, escapeHTML, fetchPlatformConfig, formatTextMarkup, getRangeOffsets, getRangeText, isSupportedInputElement, updateContentEditable, updateTextArea, useStyles, waitForElementVisibilityChange };
2162
+ export { AgentInfo, Card, Chip, ContentEditableInput, Conversation, ConversationMessage, DeepdeskAPI, DeepdeskSDK, HTTPClient, InputMediator, InputOverlayCustomStyles, InputType, KeyboardHint, Label, Locale, Logger, MountOptions, PinnedMessage, PlatformConfig, RootState, Section, SectionList, SelectionRange, Sources, Suggestion, SuggestionEventMetrics, SuggestionList, SuggestionMetrics, TextAreaInput, TextSuggestion, ToggleButton, UrlSuggestion, VisitorInfo, WidgetCustomStyles, WidgetOptions, attachFile, authenticateWithKey, createOverlayContainer, createRangeFromOffsets, escapeHTML, fetchPlatformConfig, formatTextMarkup, getRangeOffsets, getRangeText, isSupportedInputElement, updateContentEditable, updateTextArea, useStyles, waitForElementVisibilityChange };