@deepdesk/deepdesk-sdk 19.6.2-beta.13 → 19.6.2-beta.14

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
@@ -2161,28 +2161,6 @@ interface KnowledgeAssistOptions {
2161
2161
  };
2162
2162
  }
2163
2163
  type OpenAdminFeedbackHandler = (feedbackPath: string) => void | Promise<void>;
2164
- /**
2165
- * Options for {@link DeepdeskSDK.reloadConversationContext} and
2166
- * {@link DeepdeskSDK.syncHostConversation}.
2167
- */
2168
- type ReloadConversationContextOptions = {
2169
- /** Conversation payload from the host (same shape as {@link DeepdeskSDK.upsertConversation}). */
2170
- conversation: CreateConversation;
2171
- /** Optional visitor fields to apply when refreshing metadata on the same session. */
2172
- visitorInfo?: Partial<VisitorInfo>;
2173
- /**
2174
- * When `true`, clears on-screen assistant output after upsert (typical same-conversation refresh).
2175
- * Visitor info is applied after the clear so it is not wiped with suggestion UI state.
2176
- */
2177
- clearDisplayedUi?: boolean;
2178
- };
2179
- /**
2180
- * Options for {@link DeepdeskSDK.syncHostConversation}: metadata reload plus transcript publish.
2181
- */
2182
- type SyncHostConversationOptions = ReloadConversationContextOptions & {
2183
- /** Host-built transcript; forwarded to {@link DeepdeskSDK.publishConversationTranscript}. */
2184
- messages: ConversationMessage[];
2185
- };
2186
2164
  interface WidgetOptions {
2187
2165
  customStyles?: WidgetCustomStyles;
2188
2166
  showImages?: boolean;
@@ -2718,127 +2696,6 @@ declare class DeepdeskSDK {
2718
2696
  * ```
2719
2697
  */
2720
2698
  resetConversation(): void;
2721
- /**
2722
- * Clears on-screen assistant answers and related suggestion UI for the loaded
2723
- * conversation without unloading it from the store.
2724
- *
2725
- * **Preserved:** `conversation.current` (including `id`, `externalId`, and `metadata`),
2726
- * visitor info, profile configuration, and active handling-time tracking.
2727
- *
2728
- * **Reset:** assistant panels, text/style/search/pinned suggestions, entities, and input
2729
- * fields tied to displayed answers (same slices as after {@link resetConversation}, except
2730
- * `conversation.current` and handling-time state stay set).
2731
- *
2732
- * Does not re-fetch CRM data or post transcript messages. For a host-driven refresh,
2733
- * use {@link reloadConversationContext} with `clearDisplayedUi: true` and then
2734
- * {@link publishConversationTranscript}, or {@link syncHostConversation} when no host
2735
- * logic is needed between those steps.
2736
- *
2737
- * **Integrators:** do not dispatch private store actions (for example
2738
- * `conversation/upsert/fulfilled`) to simulate a refresh; use the public methods above.
2739
- *
2740
- * No-op when no conversation is loaded.
2741
- *
2742
- * @example
2743
- * ```typescript
2744
- * // Same session, only wipe stale suggestions before reposting messages
2745
- * sdk.clearDisplayedAnswers();
2746
- * await sdk.publishConversationTranscript(messagesFromCrm);
2747
- * ```
2748
- */
2749
- clearDisplayedAnswers(): void;
2750
- /**
2751
- * Applies host-fetched conversation metadata to the current SDK session.
2752
- *
2753
- * Upserts via {@link upsertConversation} and optionally clears on-screen assistant UI.
2754
- * The host must fetch CRM (or other) data itself; this method does not load emails or
2755
- * transcript text. Call {@link publishConversationTranscript} afterward to push messages
2756
- * and refresh the conversation query.
2757
- *
2758
- * When `clearDisplayedUi` is `true`, {@link clearDisplayedAnswers} runs after the upsert.
2759
- * If `visitorInfo` is provided, it is applied after upsert (and after the UI clear when
2760
- * requested) so visitor fields survive reset paths—use this for same-conversation refresh flows.
2761
- *
2762
- * When switching to a different conversation, prefer {@link resetConversation} first,
2763
- * then load or upsert the new conversation.
2764
- *
2765
- * @param options - Host conversation payload and optional visitor / UI flags.
2766
- * @param options.conversation - Metadata to upsert (external id, platform, metadata, etc.).
2767
- * @param options.visitorInfo - Visitor fields to merge when refreshing the same session.
2768
- * @param options.clearDisplayedUi - Clear assistant/suggestion UI after upsert (default `false`).
2769
- *
2770
- * @example
2771
- * ```typescript
2772
- * const conversation = await fetchConversationFromCrm(caseId);
2773
- * const messages = await fetchEmailsFromCrm(caseId);
2774
- *
2775
- * await sdk.reloadConversationContext({
2776
- * conversation,
2777
- * visitorInfo: { visitorId: contactId, visitorName: contactName },
2778
- * clearDisplayedUi: true,
2779
- * });
2780
- *
2781
- * // Optional: host-only widget state (assistant input, etc.)
2782
- * updateWidgetAssistantInput(...);
2783
- *
2784
- * await sdk.publishConversationTranscript(messages);
2785
- * ```
2786
- */
2787
- reloadConversationContext({ conversation, visitorInfo, clearDisplayedUi, }: ReloadConversationContextOptions): Promise<void>;
2788
- /**
2789
- * Publishes a host-built transcript for the current conversation.
2790
- *
2791
- * Sets the dynamic conversation query to the given messages and, when the array is
2792
- * non-empty, posts them through {@link postMessages}. Use after
2793
- * {@link reloadConversationContext} when the host already fetched the latest thread
2794
- * from an external system.
2795
- *
2796
- * @param messages - Transcript lines (`source`, `text`, and other {@link ConversationMessage} fields).
2797
- *
2798
- * @example
2799
- * ```typescript
2800
- * await sdk.publishConversationTranscript([
2801
- * {
2802
- * externalId: 'msg-1',
2803
- * time: '2024-01-01T12:00:00Z',
2804
- * source: 'visitor',
2805
- * authorId: 'visitor-1',
2806
- * text: 'Hello',
2807
- * metadata: null,
2808
- * },
2809
- * {
2810
- * externalId: 'msg-2',
2811
- * time: '2024-01-01T12:01:00Z',
2812
- * source: 'agent',
2813
- * authorId: 'agent-1',
2814
- * text: 'Hi, how can I help?',
2815
- * metadata: null,
2816
- * },
2817
- * ]);
2818
- * ```
2819
- */
2820
- publishConversationTranscript(messages: ConversationMessage[]): Promise<void>;
2821
- /**
2822
- * Convenience wrapper: {@link reloadConversationContext} then {@link publishConversationTranscript}
2823
- * in one call.
2824
- *
2825
- * Use {@link reloadConversationContext} and {@link publishConversationTranscript} separately
2826
- * when the host must update widget-only state (for example assistant input) or run other
2827
- * logic between metadata upsert and transcript publish.
2828
- *
2829
- * @param options - Same as {@link reloadConversationContext} plus `messages` for the transcript.
2830
- *
2831
- * @example
2832
- * ```typescript
2833
- * await sdk.syncHostConversation({
2834
- * conversation: crmConversation,
2835
- * visitorInfo: { visitorId: 'visitor-1', visitorName: 'Jane Doe' },
2836
- * clearDisplayedUi: true,
2837
- * messages: crmMessages,
2838
- * });
2839
- * ```
2840
- */
2841
- syncHostConversation({ conversation, messages, visitorInfo, clearDisplayedUi, }: SyncHostConversationOptions): Promise<void>;
2842
2699
  /**
2843
2700
  * Updates SDK configuration settings.
2844
2701
  *
@@ -3871,4 +3728,4 @@ declare function logEvent<T extends keyof SendEventArgumentMap>(event: LogEvent<
3871
3728
  type CSSModule = Record<string, string>;
3872
3729
  declare function useStyles<TStyles extends CSSModule>(componentName: string, defaultStyles: TStyles): TStyles;
3873
3730
 
3874
- export { type AgentInfo, Card, ContentEditableInput, type Conversation, type ConversationAssistantResult, type ConversationMessage, DeepdeskAPI, DeepdeskSDK, type EvaluationAttachment, HTTPClient, InputMediator, type InputOverlayCustomStyles, InputType, KeyboardHint, Label, Locale, type Logger, type MountOptions, type OpenAdminFeedbackHandler, type PinnedMessage, type PlatformConfig, type ReloadConversationContextOptions, type RootState, Section, SectionList, type SelectionRange, Sources, Suggestion, type SuggestionEventMetrics, SuggestionList, type SuggestionMetrics, type SyncHostConversationOptions, TextAreaInput, type TextSuggestion, ToggleButton, type UrlSuggestion, type VisitorInfo, type WidgetCustomStyles, type WidgetOptions, attachFile, authenticateWithKey, createFullRange, createOverlayContainer, createRangeFromOffsets, escapeHTML, formatTextMarkup, getRangeOffsets, getRangeText, insertCKEditor, isHTML, isSupportedInputElement, logEvent, updateContentEditable, updateTextArea, useClickOutsideRoot, useStyles, waitForElementVisibilityChange };
3731
+ export { type AgentInfo, Card, ContentEditableInput, type Conversation, type ConversationAssistantResult, type ConversationMessage, DeepdeskAPI, DeepdeskSDK, type EvaluationAttachment, HTTPClient, InputMediator, type InputOverlayCustomStyles, InputType, KeyboardHint, Label, Locale, type Logger, type MountOptions, type OpenAdminFeedbackHandler, type PinnedMessage, type PlatformConfig, type RootState, Section, SectionList, type SelectionRange, Sources, Suggestion, type SuggestionEventMetrics, SuggestionList, type SuggestionMetrics, TextAreaInput, type TextSuggestion, ToggleButton, type UrlSuggestion, type VisitorInfo, type WidgetCustomStyles, type WidgetOptions, attachFile, authenticateWithKey, createFullRange, createOverlayContainer, createRangeFromOffsets, escapeHTML, formatTextMarkup, getRangeOffsets, getRangeText, insertCKEditor, isHTML, isSupportedInputElement, logEvent, updateContentEditable, updateTextArea, useClickOutsideRoot, useStyles, waitForElementVisibilityChange };
package/dist/index.d.ts CHANGED
@@ -2161,28 +2161,6 @@ interface KnowledgeAssistOptions {
2161
2161
  };
2162
2162
  }
2163
2163
  type OpenAdminFeedbackHandler = (feedbackPath: string) => void | Promise<void>;
2164
- /**
2165
- * Options for {@link DeepdeskSDK.reloadConversationContext} and
2166
- * {@link DeepdeskSDK.syncHostConversation}.
2167
- */
2168
- type ReloadConversationContextOptions = {
2169
- /** Conversation payload from the host (same shape as {@link DeepdeskSDK.upsertConversation}). */
2170
- conversation: CreateConversation;
2171
- /** Optional visitor fields to apply when refreshing metadata on the same session. */
2172
- visitorInfo?: Partial<VisitorInfo>;
2173
- /**
2174
- * When `true`, clears on-screen assistant output after upsert (typical same-conversation refresh).
2175
- * Visitor info is applied after the clear so it is not wiped with suggestion UI state.
2176
- */
2177
- clearDisplayedUi?: boolean;
2178
- };
2179
- /**
2180
- * Options for {@link DeepdeskSDK.syncHostConversation}: metadata reload plus transcript publish.
2181
- */
2182
- type SyncHostConversationOptions = ReloadConversationContextOptions & {
2183
- /** Host-built transcript; forwarded to {@link DeepdeskSDK.publishConversationTranscript}. */
2184
- messages: ConversationMessage[];
2185
- };
2186
2164
  interface WidgetOptions {
2187
2165
  customStyles?: WidgetCustomStyles;
2188
2166
  showImages?: boolean;
@@ -2718,127 +2696,6 @@ declare class DeepdeskSDK {
2718
2696
  * ```
2719
2697
  */
2720
2698
  resetConversation(): void;
2721
- /**
2722
- * Clears on-screen assistant answers and related suggestion UI for the loaded
2723
- * conversation without unloading it from the store.
2724
- *
2725
- * **Preserved:** `conversation.current` (including `id`, `externalId`, and `metadata`),
2726
- * visitor info, profile configuration, and active handling-time tracking.
2727
- *
2728
- * **Reset:** assistant panels, text/style/search/pinned suggestions, entities, and input
2729
- * fields tied to displayed answers (same slices as after {@link resetConversation}, except
2730
- * `conversation.current` and handling-time state stay set).
2731
- *
2732
- * Does not re-fetch CRM data or post transcript messages. For a host-driven refresh,
2733
- * use {@link reloadConversationContext} with `clearDisplayedUi: true` and then
2734
- * {@link publishConversationTranscript}, or {@link syncHostConversation} when no host
2735
- * logic is needed between those steps.
2736
- *
2737
- * **Integrators:** do not dispatch private store actions (for example
2738
- * `conversation/upsert/fulfilled`) to simulate a refresh; use the public methods above.
2739
- *
2740
- * No-op when no conversation is loaded.
2741
- *
2742
- * @example
2743
- * ```typescript
2744
- * // Same session, only wipe stale suggestions before reposting messages
2745
- * sdk.clearDisplayedAnswers();
2746
- * await sdk.publishConversationTranscript(messagesFromCrm);
2747
- * ```
2748
- */
2749
- clearDisplayedAnswers(): void;
2750
- /**
2751
- * Applies host-fetched conversation metadata to the current SDK session.
2752
- *
2753
- * Upserts via {@link upsertConversation} and optionally clears on-screen assistant UI.
2754
- * The host must fetch CRM (or other) data itself; this method does not load emails or
2755
- * transcript text. Call {@link publishConversationTranscript} afterward to push messages
2756
- * and refresh the conversation query.
2757
- *
2758
- * When `clearDisplayedUi` is `true`, {@link clearDisplayedAnswers} runs after the upsert.
2759
- * If `visitorInfo` is provided, it is applied after upsert (and after the UI clear when
2760
- * requested) so visitor fields survive reset paths—use this for same-conversation refresh flows.
2761
- *
2762
- * When switching to a different conversation, prefer {@link resetConversation} first,
2763
- * then load or upsert the new conversation.
2764
- *
2765
- * @param options - Host conversation payload and optional visitor / UI flags.
2766
- * @param options.conversation - Metadata to upsert (external id, platform, metadata, etc.).
2767
- * @param options.visitorInfo - Visitor fields to merge when refreshing the same session.
2768
- * @param options.clearDisplayedUi - Clear assistant/suggestion UI after upsert (default `false`).
2769
- *
2770
- * @example
2771
- * ```typescript
2772
- * const conversation = await fetchConversationFromCrm(caseId);
2773
- * const messages = await fetchEmailsFromCrm(caseId);
2774
- *
2775
- * await sdk.reloadConversationContext({
2776
- * conversation,
2777
- * visitorInfo: { visitorId: contactId, visitorName: contactName },
2778
- * clearDisplayedUi: true,
2779
- * });
2780
- *
2781
- * // Optional: host-only widget state (assistant input, etc.)
2782
- * updateWidgetAssistantInput(...);
2783
- *
2784
- * await sdk.publishConversationTranscript(messages);
2785
- * ```
2786
- */
2787
- reloadConversationContext({ conversation, visitorInfo, clearDisplayedUi, }: ReloadConversationContextOptions): Promise<void>;
2788
- /**
2789
- * Publishes a host-built transcript for the current conversation.
2790
- *
2791
- * Sets the dynamic conversation query to the given messages and, when the array is
2792
- * non-empty, posts them through {@link postMessages}. Use after
2793
- * {@link reloadConversationContext} when the host already fetched the latest thread
2794
- * from an external system.
2795
- *
2796
- * @param messages - Transcript lines (`source`, `text`, and other {@link ConversationMessage} fields).
2797
- *
2798
- * @example
2799
- * ```typescript
2800
- * await sdk.publishConversationTranscript([
2801
- * {
2802
- * externalId: 'msg-1',
2803
- * time: '2024-01-01T12:00:00Z',
2804
- * source: 'visitor',
2805
- * authorId: 'visitor-1',
2806
- * text: 'Hello',
2807
- * metadata: null,
2808
- * },
2809
- * {
2810
- * externalId: 'msg-2',
2811
- * time: '2024-01-01T12:01:00Z',
2812
- * source: 'agent',
2813
- * authorId: 'agent-1',
2814
- * text: 'Hi, how can I help?',
2815
- * metadata: null,
2816
- * },
2817
- * ]);
2818
- * ```
2819
- */
2820
- publishConversationTranscript(messages: ConversationMessage[]): Promise<void>;
2821
- /**
2822
- * Convenience wrapper: {@link reloadConversationContext} then {@link publishConversationTranscript}
2823
- * in one call.
2824
- *
2825
- * Use {@link reloadConversationContext} and {@link publishConversationTranscript} separately
2826
- * when the host must update widget-only state (for example assistant input) or run other
2827
- * logic between metadata upsert and transcript publish.
2828
- *
2829
- * @param options - Same as {@link reloadConversationContext} plus `messages` for the transcript.
2830
- *
2831
- * @example
2832
- * ```typescript
2833
- * await sdk.syncHostConversation({
2834
- * conversation: crmConversation,
2835
- * visitorInfo: { visitorId: 'visitor-1', visitorName: 'Jane Doe' },
2836
- * clearDisplayedUi: true,
2837
- * messages: crmMessages,
2838
- * });
2839
- * ```
2840
- */
2841
- syncHostConversation({ conversation, messages, visitorInfo, clearDisplayedUi, }: SyncHostConversationOptions): Promise<void>;
2842
2699
  /**
2843
2700
  * Updates SDK configuration settings.
2844
2701
  *
@@ -3871,4 +3728,4 @@ declare function logEvent<T extends keyof SendEventArgumentMap>(event: LogEvent<
3871
3728
  type CSSModule = Record<string, string>;
3872
3729
  declare function useStyles<TStyles extends CSSModule>(componentName: string, defaultStyles: TStyles): TStyles;
3873
3730
 
3874
- export { type AgentInfo, Card, ContentEditableInput, type Conversation, type ConversationAssistantResult, type ConversationMessage, DeepdeskAPI, DeepdeskSDK, type EvaluationAttachment, HTTPClient, InputMediator, type InputOverlayCustomStyles, InputType, KeyboardHint, Label, Locale, type Logger, type MountOptions, type OpenAdminFeedbackHandler, type PinnedMessage, type PlatformConfig, type ReloadConversationContextOptions, type RootState, Section, SectionList, type SelectionRange, Sources, Suggestion, type SuggestionEventMetrics, SuggestionList, type SuggestionMetrics, type SyncHostConversationOptions, TextAreaInput, type TextSuggestion, ToggleButton, type UrlSuggestion, type VisitorInfo, type WidgetCustomStyles, type WidgetOptions, attachFile, authenticateWithKey, createFullRange, createOverlayContainer, createRangeFromOffsets, escapeHTML, formatTextMarkup, getRangeOffsets, getRangeText, insertCKEditor, isHTML, isSupportedInputElement, logEvent, updateContentEditable, updateTextArea, useClickOutsideRoot, useStyles, waitForElementVisibilityChange };
3731
+ export { type AgentInfo, Card, ContentEditableInput, type Conversation, type ConversationAssistantResult, type ConversationMessage, DeepdeskAPI, DeepdeskSDK, type EvaluationAttachment, HTTPClient, InputMediator, type InputOverlayCustomStyles, InputType, KeyboardHint, Label, Locale, type Logger, type MountOptions, type OpenAdminFeedbackHandler, type PinnedMessage, type PlatformConfig, type RootState, Section, SectionList, type SelectionRange, Sources, Suggestion, type SuggestionEventMetrics, SuggestionList, type SuggestionMetrics, TextAreaInput, type TextSuggestion, ToggleButton, type UrlSuggestion, type VisitorInfo, type WidgetCustomStyles, type WidgetOptions, attachFile, authenticateWithKey, createFullRange, createOverlayContainer, createRangeFromOffsets, escapeHTML, formatTextMarkup, getRangeOffsets, getRangeText, insertCKEditor, isHTML, isSupportedInputElement, logEvent, updateContentEditable, updateTextArea, useClickOutsideRoot, useStyles, waitForElementVisibilityChange };