@deepdesk/deepdesk-sdk 17.1.7-beta.0 → 17.1.7-beta.2

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
@@ -624,7 +624,7 @@ declare namespace Server {
624
624
  interface CallToAction {
625
625
  label: string;
626
626
  event: string;
627
- value: string;
627
+ value: unknown;
628
628
  }
629
629
  type ResponseFormat = 'text' | 'json-object' | 'json-schema:cues' | 'json-schema:knowledge-assist';
630
630
  interface LegacyCue {
@@ -637,6 +637,7 @@ declare namespace Server {
637
637
  code: string;
638
638
  name: string;
639
639
  response: string;
640
+ editable?: boolean;
640
641
  call_to_action?: CallToAction;
641
642
  }> : T extends 'json-schema:knowledge-assist' ? {
642
643
  response: string;
@@ -1308,6 +1309,7 @@ interface State$3 {
1308
1309
 
1309
1310
  type LegacyCue = CamelCaseKeys<Server.LegacyCue> & {
1310
1311
  isLoading?: boolean;
1312
+ editable?: boolean;
1311
1313
  specialType?: 'summary';
1312
1314
  };
1313
1315
 
@@ -1933,6 +1935,30 @@ type State = {
1933
1935
  type Settings = State;
1934
1936
  declare const set: _reduxjs_toolkit.ActionCreatorWithPayload<Partial<State>, "settings/set">;
1935
1937
 
1938
+ type WebsocketOptions = {
1939
+ url: string;
1940
+ maxReconnectAttempts?: number;
1941
+ reconnectInterval?: number;
1942
+ shouldReconnect(): Promise<boolean>;
1943
+ };
1944
+ type EventCallback<T = any> = (data: T) => void;
1945
+ declare class WebsocketClient {
1946
+ options: WebsocketOptions;
1947
+ private socket;
1948
+ private eventListeners;
1949
+ private url;
1950
+ private maxReconnectAttempts;
1951
+ private reconnectInterval;
1952
+ private shouldReconnect;
1953
+ constructor(options: WebsocketOptions);
1954
+ private setupListeners;
1955
+ private reconnect;
1956
+ send(event: string, data: any): void;
1957
+ on<T = unknown>(eventType: string, callback: EventCallback<T>): void;
1958
+ close(): void;
1959
+ cleanup(): void;
1960
+ }
1961
+
1936
1962
  declare global {
1937
1963
  interface Window {
1938
1964
  clipboardData: any;
@@ -1947,6 +1973,7 @@ interface SDKOptions {
1947
1973
  fetch?: typeof window.fetch;
1948
1974
  productName?: string;
1949
1975
  createCustomChannel?: (name: string) => Channel;
1976
+ websocketClient?: typeof WebsocketClient;
1950
1977
  }
1951
1978
  interface SDKEventMap {
1952
1979
  'select-suggestion': {
@@ -2042,8 +2069,9 @@ declare class DeepdeskSDK {
2042
2069
  isMounted: boolean;
2043
2070
  instanceId: number;
2044
2071
  private shouldRender;
2072
+ private ws;
2045
2073
  store: Store;
2046
- constructor({ deepdeskUrl, version, locale, token, fetch, productName, createCustomChannel, }: SDKOptions);
2074
+ constructor({ deepdeskUrl, version, locale, token, fetch, productName, createCustomChannel, websocketClient, }: SDKOptions);
2047
2075
  get state(): {
2048
2076
  assistants: State$2;
2049
2077
  auth: State$3;
package/dist/index.d.ts CHANGED
@@ -624,7 +624,7 @@ declare namespace Server {
624
624
  interface CallToAction {
625
625
  label: string;
626
626
  event: string;
627
- value: string;
627
+ value: unknown;
628
628
  }
629
629
  type ResponseFormat = 'text' | 'json-object' | 'json-schema:cues' | 'json-schema:knowledge-assist';
630
630
  interface LegacyCue {
@@ -637,6 +637,7 @@ declare namespace Server {
637
637
  code: string;
638
638
  name: string;
639
639
  response: string;
640
+ editable?: boolean;
640
641
  call_to_action?: CallToAction;
641
642
  }> : T extends 'json-schema:knowledge-assist' ? {
642
643
  response: string;
@@ -1308,6 +1309,7 @@ interface State$3 {
1308
1309
 
1309
1310
  type LegacyCue = CamelCaseKeys<Server.LegacyCue> & {
1310
1311
  isLoading?: boolean;
1312
+ editable?: boolean;
1311
1313
  specialType?: 'summary';
1312
1314
  };
1313
1315
 
@@ -1933,6 +1935,30 @@ type State = {
1933
1935
  type Settings = State;
1934
1936
  declare const set: _reduxjs_toolkit.ActionCreatorWithPayload<Partial<State>, "settings/set">;
1935
1937
 
1938
+ type WebsocketOptions = {
1939
+ url: string;
1940
+ maxReconnectAttempts?: number;
1941
+ reconnectInterval?: number;
1942
+ shouldReconnect(): Promise<boolean>;
1943
+ };
1944
+ type EventCallback<T = any> = (data: T) => void;
1945
+ declare class WebsocketClient {
1946
+ options: WebsocketOptions;
1947
+ private socket;
1948
+ private eventListeners;
1949
+ private url;
1950
+ private maxReconnectAttempts;
1951
+ private reconnectInterval;
1952
+ private shouldReconnect;
1953
+ constructor(options: WebsocketOptions);
1954
+ private setupListeners;
1955
+ private reconnect;
1956
+ send(event: string, data: any): void;
1957
+ on<T = unknown>(eventType: string, callback: EventCallback<T>): void;
1958
+ close(): void;
1959
+ cleanup(): void;
1960
+ }
1961
+
1936
1962
  declare global {
1937
1963
  interface Window {
1938
1964
  clipboardData: any;
@@ -1947,6 +1973,7 @@ interface SDKOptions {
1947
1973
  fetch?: typeof window.fetch;
1948
1974
  productName?: string;
1949
1975
  createCustomChannel?: (name: string) => Channel;
1976
+ websocketClient?: typeof WebsocketClient;
1950
1977
  }
1951
1978
  interface SDKEventMap {
1952
1979
  'select-suggestion': {
@@ -2042,8 +2069,9 @@ declare class DeepdeskSDK {
2042
2069
  isMounted: boolean;
2043
2070
  instanceId: number;
2044
2071
  private shouldRender;
2072
+ private ws;
2045
2073
  store: Store;
2046
- constructor({ deepdeskUrl, version, locale, token, fetch, productName, createCustomChannel, }: SDKOptions);
2074
+ constructor({ deepdeskUrl, version, locale, token, fetch, productName, createCustomChannel, websocketClient, }: SDKOptions);
2047
2075
  get state(): {
2048
2076
  assistants: State$2;
2049
2077
  auth: State$3;