@deepdesk/deepdesk-sdk 17.0.0-rc.7 → 17.0.0-rc.9

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
@@ -1,10 +1,9 @@
1
1
  import React, { FC, HTMLAttributes, ForwardRefExoticComponent, RefAttributes, ReactNode, SyntheticEvent } from 'react';
2
2
  import * as react_jsx_runtime from 'react/jsx-runtime';
3
+ import * as _reduxjs_toolkit from '@reduxjs/toolkit';
4
+ import { Middleware, Tuple } from '@reduxjs/toolkit';
3
5
  import * as redux from 'redux';
4
6
  import { Unsubscribe } from 'redux';
5
- import * as _reduxjs_toolkit_dist_configureStore from '@reduxjs/toolkit/dist/configureStore';
6
- import * as _reduxjs_toolkit from '@reduxjs/toolkit';
7
- import { Middleware } from '@reduxjs/toolkit';
8
7
 
9
8
  declare const styles$t: {
10
9
  readonly "content": string;
@@ -24,11 +23,13 @@ type ContentProps = {
24
23
  cropText?: boolean;
25
24
  className?: string;
26
25
  lineClamp?: boolean;
26
+ children: React.ReactNode;
27
27
  };
28
28
  interface TitleProps extends React.HTMLProps<HTMLHeadingElement> {
29
29
  cropText?: boolean;
30
30
  className?: string;
31
31
  as?: string;
32
+ children: React.ReactNode;
32
33
  }
33
34
  interface CardComposition {
34
35
  Image: FC<ImageProps>;
@@ -36,7 +37,9 @@ interface CardComposition {
36
37
  Title: FC<TitleProps>;
37
38
  }
38
39
  type CardStyles = typeof styles$t;
39
- declare const Card: FC & CardComposition;
40
+ declare const Card: FC<{
41
+ children: React.ReactNode;
42
+ }> & CardComposition;
40
43
 
41
44
  declare const styles$s: {
42
45
  readonly "root": string;
@@ -167,6 +170,7 @@ declare const styles$n: {
167
170
  type SuggestionListStyles = typeof styles$n;
168
171
  interface Props$1 {
169
172
  withDivider?: boolean;
173
+ children: React.ReactNode;
170
174
  }
171
175
  declare const SuggestionList: React.FC<Props$1>;
172
176
 
@@ -488,7 +492,6 @@ declare namespace Server {
488
492
  visitor_name: string | null;
489
493
  chat_start_time: string | null;
490
494
  external_id: string;
491
- messages: ConversationMessage[];
492
495
  metadata: Metadata;
493
496
  };
494
497
  /**
@@ -867,10 +870,8 @@ declare namespace Server {
867
870
  type ConversationMessage = CamelCaseKeys<Omit<Server.ConversationMessage, 'metadata'>> & {
868
871
  metadata: Server.Metadata | null;
869
872
  };
870
- type Conversation = CamelCaseKeys<Omit<Server.Conversation, 'metadata' | 'messages'>> & {
873
+ type Conversation = CamelCaseKeys<Omit<Server.Conversation, 'metadata'>> & {
871
874
  metadata: Server.Metadata;
872
- } & {
873
- messages: ConversationMessage[];
874
875
  };
875
876
  /**
876
877
  * Create Conversation Options
@@ -1076,21 +1077,11 @@ declare class DeepdeskAPI {
1076
1077
  /**
1077
1078
  * Update converstation meta data
1078
1079
  */
1079
- updateConversation(conversationId: string, data: Partial<Omit<Conversation, 'messages'>>): Promise<Conversation>;
1080
+ updateConversation(conversationId: string, data: Partial<Conversation>): Promise<Conversation>;
1080
1081
  /**
1081
1082
  * Post converstation messages
1082
1083
  */
1083
- postMessages(conversationId: string, messages: CamelCaseKeys<Server.ConversationMessage>[]): Promise<({
1084
- text: string;
1085
- source: "agent" | "visitor" | "bot" | "system";
1086
- time: string;
1087
- externalId: string;
1088
- authorId: string;
1089
- authorName?: string | undefined;
1090
- authorEmail?: string | undefined;
1091
- } & {
1092
- metadata: Server.Metadata | null;
1093
- })[]>;
1084
+ postMessages(conversationId: string, messages: CamelCaseKeys<Server.ConversationMessage>[]): Promise<void>;
1094
1085
  /**
1095
1086
  * Send event with meta data for analytics
1096
1087
  */
@@ -1409,7 +1400,7 @@ interface StoreConfig {
1409
1400
  middleware?: Middleware[];
1410
1401
  preloadedState?: any;
1411
1402
  }
1412
- declare const reducers: redux.Reducer<redux.CombinedState<{
1403
+ declare const reducers: redux.Reducer<{
1413
1404
  assistants: State$2;
1414
1405
  auth: State$3;
1415
1406
  conversation: State$4;
@@ -1469,15 +1460,14 @@ declare const reducers: redux.Reducer<redux.CombinedState<{
1469
1460
  overlayCollapsedUserOverwrite: boolean;
1470
1461
  };
1471
1462
  textSuggestions: TextSuggestionState;
1472
- }>, redux.AnyAction>;
1473
- declare function createStore(config: StoreConfig): _reduxjs_toolkit_dist_configureStore.ToolkitStore<redux.EmptyObject & {
1474
- assistants: State$2;
1475
- auth: State$3;
1476
- conversation: State$4;
1477
- contentTypes: State$5;
1478
- passwordlessToken: State$6;
1479
- entities: State$1;
1480
- handlingTime: State$7;
1463
+ }, redux.UnknownAction, Partial<{
1464
+ assistants: State$2 | undefined;
1465
+ auth: State$3 | undefined;
1466
+ conversation: State$4 | undefined;
1467
+ contentTypes: State$5 | undefined;
1468
+ passwordlessToken: State$6 | undefined;
1469
+ entities: State$1 | undefined;
1470
+ handlingTime: State$7 | undefined;
1481
1471
  info: {
1482
1472
  agentInfo?: AgentInfo;
1483
1473
  agentSettings: unknown;
@@ -1485,8 +1475,8 @@ declare function createStore(config: StoreConfig): _reduxjs_toolkit_dist_configu
1485
1475
  customData?: CustomData;
1486
1476
  platformVariables?: VariableMapping;
1487
1477
  fetchState: FetchState;
1488
- };
1489
- input: State$8;
1478
+ } | undefined;
1479
+ input: State$8 | undefined;
1490
1480
  settings: {
1491
1481
  locale: Locale;
1492
1482
  deanonymize: boolean;
@@ -1518,19 +1508,20 @@ declare function createStore(config: StoreConfig): _reduxjs_toolkit_dist_configu
1518
1508
  enableSuggestionFeedback: boolean;
1519
1509
  enableFeedbackForm: boolean;
1520
1510
  hasKeyboardInput: boolean;
1521
- };
1522
- profile: State$9;
1523
- search: State$b;
1524
- styleSuggestions: State$a;
1511
+ } | undefined;
1512
+ profile: State$9 | undefined;
1513
+ search: State$b | undefined;
1514
+ styleSuggestions: State$a | undefined;
1525
1515
  ui: {
1526
1516
  showTabHint: boolean;
1527
1517
  inputHasFocus: boolean;
1528
1518
  overlayCollapsed: boolean;
1529
1519
  openOverlayWhenTyping: boolean;
1530
1520
  overlayCollapsedUserOverwrite: boolean;
1531
- };
1532
- textSuggestions: TextSuggestionState;
1533
- }, redux.AnyAction, _reduxjs_toolkit.ThunkMiddleware<redux.CombinedState<{
1521
+ } | undefined;
1522
+ textSuggestions: TextSuggestionState | undefined;
1523
+ }>>;
1524
+ declare function createStore(config: StoreConfig): _reduxjs_toolkit.EnhancedStore<{
1534
1525
  assistants: State$2;
1535
1526
  auth: State$3;
1536
1527
  conversation: State$4;
@@ -1590,10 +1581,9 @@ declare function createStore(config: StoreConfig): _reduxjs_toolkit_dist_configu
1590
1581
  overlayCollapsedUserOverwrite: boolean;
1591
1582
  };
1592
1583
  textSuggestions: TextSuggestionState;
1593
- }>, redux.AnyAction, {
1594
- dynamicThunkObject: Record<string, unknown> | undefined;
1595
- deepdeskAPI: DeepdeskAPI;
1596
- }>[]>;
1584
+ }, redux.UnknownAction, Tuple<[redux.StoreEnhancer<{
1585
+ dispatch: {};
1586
+ }>, redux.StoreEnhancer]>>;
1597
1587
  type RootState = ReturnType<typeof reducers>;
1598
1588
  type Store = ReturnType<typeof createStore>;
1599
1589
 
@@ -2082,6 +2072,7 @@ declare class DeepdeskSDK {
2082
2072
  private inlineSuggestions;
2083
2073
  private aboveSuggestions;
2084
2074
  private floatingMenu;
2075
+ private widgetElement;
2085
2076
  private widgetRoot;
2086
2077
  private dynamicThunkObject;
2087
2078
  isMounted: boolean;
@@ -2089,7 +2080,7 @@ declare class DeepdeskSDK {
2089
2080
  private shouldRender;
2090
2081
  store: Store;
2091
2082
  constructor({ deepdeskUrl, version, locale, token, fetch, productName, createCustomChannel, }: SDKOptions);
2092
- get state(): redux.EmptyObject & {
2083
+ get state(): {
2093
2084
  assistants: State$2;
2094
2085
  auth: State$3;
2095
2086
  conversation: State$4;
@@ -2217,7 +2208,7 @@ declare class DeepdeskSDK {
2217
2208
  * Method to call when the conversation is updated, either by an incoming message
2218
2209
  * from the visitor, or a message sent by the agent.
2219
2210
  */
2220
- postMessages(messages: ConversationMessage[]): Promise<any>;
2211
+ postMessages(messages: ConversationMessage[]): Promise<void>;
2221
2212
  /**
2222
2213
  * Update converstation meta data
2223
2214
  */
package/dist/index.d.ts CHANGED
@@ -1,10 +1,9 @@
1
1
  import React, { FC, HTMLAttributes, ForwardRefExoticComponent, RefAttributes, ReactNode, SyntheticEvent } from 'react';
2
2
  import * as react_jsx_runtime from 'react/jsx-runtime';
3
+ import * as _reduxjs_toolkit from '@reduxjs/toolkit';
4
+ import { Middleware, Tuple } from '@reduxjs/toolkit';
3
5
  import * as redux from 'redux';
4
6
  import { Unsubscribe } from 'redux';
5
- import * as _reduxjs_toolkit_dist_configureStore from '@reduxjs/toolkit/dist/configureStore';
6
- import * as _reduxjs_toolkit from '@reduxjs/toolkit';
7
- import { Middleware } from '@reduxjs/toolkit';
8
7
 
9
8
  declare const styles$t: {
10
9
  readonly "content": string;
@@ -24,11 +23,13 @@ type ContentProps = {
24
23
  cropText?: boolean;
25
24
  className?: string;
26
25
  lineClamp?: boolean;
26
+ children: React.ReactNode;
27
27
  };
28
28
  interface TitleProps extends React.HTMLProps<HTMLHeadingElement> {
29
29
  cropText?: boolean;
30
30
  className?: string;
31
31
  as?: string;
32
+ children: React.ReactNode;
32
33
  }
33
34
  interface CardComposition {
34
35
  Image: FC<ImageProps>;
@@ -36,7 +37,9 @@ interface CardComposition {
36
37
  Title: FC<TitleProps>;
37
38
  }
38
39
  type CardStyles = typeof styles$t;
39
- declare const Card: FC & CardComposition;
40
+ declare const Card: FC<{
41
+ children: React.ReactNode;
42
+ }> & CardComposition;
40
43
 
41
44
  declare const styles$s: {
42
45
  readonly "root": string;
@@ -167,6 +170,7 @@ declare const styles$n: {
167
170
  type SuggestionListStyles = typeof styles$n;
168
171
  interface Props$1 {
169
172
  withDivider?: boolean;
173
+ children: React.ReactNode;
170
174
  }
171
175
  declare const SuggestionList: React.FC<Props$1>;
172
176
 
@@ -488,7 +492,6 @@ declare namespace Server {
488
492
  visitor_name: string | null;
489
493
  chat_start_time: string | null;
490
494
  external_id: string;
491
- messages: ConversationMessage[];
492
495
  metadata: Metadata;
493
496
  };
494
497
  /**
@@ -867,10 +870,8 @@ declare namespace Server {
867
870
  type ConversationMessage = CamelCaseKeys<Omit<Server.ConversationMessage, 'metadata'>> & {
868
871
  metadata: Server.Metadata | null;
869
872
  };
870
- type Conversation = CamelCaseKeys<Omit<Server.Conversation, 'metadata' | 'messages'>> & {
873
+ type Conversation = CamelCaseKeys<Omit<Server.Conversation, 'metadata'>> & {
871
874
  metadata: Server.Metadata;
872
- } & {
873
- messages: ConversationMessage[];
874
875
  };
875
876
  /**
876
877
  * Create Conversation Options
@@ -1076,21 +1077,11 @@ declare class DeepdeskAPI {
1076
1077
  /**
1077
1078
  * Update converstation meta data
1078
1079
  */
1079
- updateConversation(conversationId: string, data: Partial<Omit<Conversation, 'messages'>>): Promise<Conversation>;
1080
+ updateConversation(conversationId: string, data: Partial<Conversation>): Promise<Conversation>;
1080
1081
  /**
1081
1082
  * Post converstation messages
1082
1083
  */
1083
- postMessages(conversationId: string, messages: CamelCaseKeys<Server.ConversationMessage>[]): Promise<({
1084
- text: string;
1085
- source: "agent" | "visitor" | "bot" | "system";
1086
- time: string;
1087
- externalId: string;
1088
- authorId: string;
1089
- authorName?: string | undefined;
1090
- authorEmail?: string | undefined;
1091
- } & {
1092
- metadata: Server.Metadata | null;
1093
- })[]>;
1084
+ postMessages(conversationId: string, messages: CamelCaseKeys<Server.ConversationMessage>[]): Promise<void>;
1094
1085
  /**
1095
1086
  * Send event with meta data for analytics
1096
1087
  */
@@ -1409,7 +1400,7 @@ interface StoreConfig {
1409
1400
  middleware?: Middleware[];
1410
1401
  preloadedState?: any;
1411
1402
  }
1412
- declare const reducers: redux.Reducer<redux.CombinedState<{
1403
+ declare const reducers: redux.Reducer<{
1413
1404
  assistants: State$2;
1414
1405
  auth: State$3;
1415
1406
  conversation: State$4;
@@ -1469,15 +1460,14 @@ declare const reducers: redux.Reducer<redux.CombinedState<{
1469
1460
  overlayCollapsedUserOverwrite: boolean;
1470
1461
  };
1471
1462
  textSuggestions: TextSuggestionState;
1472
- }>, redux.AnyAction>;
1473
- declare function createStore(config: StoreConfig): _reduxjs_toolkit_dist_configureStore.ToolkitStore<redux.EmptyObject & {
1474
- assistants: State$2;
1475
- auth: State$3;
1476
- conversation: State$4;
1477
- contentTypes: State$5;
1478
- passwordlessToken: State$6;
1479
- entities: State$1;
1480
- handlingTime: State$7;
1463
+ }, redux.UnknownAction, Partial<{
1464
+ assistants: State$2 | undefined;
1465
+ auth: State$3 | undefined;
1466
+ conversation: State$4 | undefined;
1467
+ contentTypes: State$5 | undefined;
1468
+ passwordlessToken: State$6 | undefined;
1469
+ entities: State$1 | undefined;
1470
+ handlingTime: State$7 | undefined;
1481
1471
  info: {
1482
1472
  agentInfo?: AgentInfo;
1483
1473
  agentSettings: unknown;
@@ -1485,8 +1475,8 @@ declare function createStore(config: StoreConfig): _reduxjs_toolkit_dist_configu
1485
1475
  customData?: CustomData;
1486
1476
  platformVariables?: VariableMapping;
1487
1477
  fetchState: FetchState;
1488
- };
1489
- input: State$8;
1478
+ } | undefined;
1479
+ input: State$8 | undefined;
1490
1480
  settings: {
1491
1481
  locale: Locale;
1492
1482
  deanonymize: boolean;
@@ -1518,19 +1508,20 @@ declare function createStore(config: StoreConfig): _reduxjs_toolkit_dist_configu
1518
1508
  enableSuggestionFeedback: boolean;
1519
1509
  enableFeedbackForm: boolean;
1520
1510
  hasKeyboardInput: boolean;
1521
- };
1522
- profile: State$9;
1523
- search: State$b;
1524
- styleSuggestions: State$a;
1511
+ } | undefined;
1512
+ profile: State$9 | undefined;
1513
+ search: State$b | undefined;
1514
+ styleSuggestions: State$a | undefined;
1525
1515
  ui: {
1526
1516
  showTabHint: boolean;
1527
1517
  inputHasFocus: boolean;
1528
1518
  overlayCollapsed: boolean;
1529
1519
  openOverlayWhenTyping: boolean;
1530
1520
  overlayCollapsedUserOverwrite: boolean;
1531
- };
1532
- textSuggestions: TextSuggestionState;
1533
- }, redux.AnyAction, _reduxjs_toolkit.ThunkMiddleware<redux.CombinedState<{
1521
+ } | undefined;
1522
+ textSuggestions: TextSuggestionState | undefined;
1523
+ }>>;
1524
+ declare function createStore(config: StoreConfig): _reduxjs_toolkit.EnhancedStore<{
1534
1525
  assistants: State$2;
1535
1526
  auth: State$3;
1536
1527
  conversation: State$4;
@@ -1590,10 +1581,9 @@ declare function createStore(config: StoreConfig): _reduxjs_toolkit_dist_configu
1590
1581
  overlayCollapsedUserOverwrite: boolean;
1591
1582
  };
1592
1583
  textSuggestions: TextSuggestionState;
1593
- }>, redux.AnyAction, {
1594
- dynamicThunkObject: Record<string, unknown> | undefined;
1595
- deepdeskAPI: DeepdeskAPI;
1596
- }>[]>;
1584
+ }, redux.UnknownAction, Tuple<[redux.StoreEnhancer<{
1585
+ dispatch: {};
1586
+ }>, redux.StoreEnhancer]>>;
1597
1587
  type RootState = ReturnType<typeof reducers>;
1598
1588
  type Store = ReturnType<typeof createStore>;
1599
1589
 
@@ -2082,6 +2072,7 @@ declare class DeepdeskSDK {
2082
2072
  private inlineSuggestions;
2083
2073
  private aboveSuggestions;
2084
2074
  private floatingMenu;
2075
+ private widgetElement;
2085
2076
  private widgetRoot;
2086
2077
  private dynamicThunkObject;
2087
2078
  isMounted: boolean;
@@ -2089,7 +2080,7 @@ declare class DeepdeskSDK {
2089
2080
  private shouldRender;
2090
2081
  store: Store;
2091
2082
  constructor({ deepdeskUrl, version, locale, token, fetch, productName, createCustomChannel, }: SDKOptions);
2092
- get state(): redux.EmptyObject & {
2083
+ get state(): {
2093
2084
  assistants: State$2;
2094
2085
  auth: State$3;
2095
2086
  conversation: State$4;
@@ -2217,7 +2208,7 @@ declare class DeepdeskSDK {
2217
2208
  * Method to call when the conversation is updated, either by an incoming message
2218
2209
  * from the visitor, or a message sent by the agent.
2219
2210
  */
2220
- postMessages(messages: ConversationMessage[]): Promise<any>;
2211
+ postMessages(messages: ConversationMessage[]): Promise<void>;
2221
2212
  /**
2222
2213
  * Update converstation meta data
2223
2214
  */