@deepdesk/deepdesk-sdk 14.1.1-beta.1 → 14.1.1-beta.3
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.cjs.js +8 -8
- package/dist/index.d.mts +123 -97
- package/dist/index.d.ts +123 -97
- package/dist/index.esm.js +8 -8
- package/dist/index.iife.js +14 -14
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -292,7 +292,7 @@ declare abstract class InputMediator<HTMLElementType extends HTMLElement> {
|
|
|
292
292
|
dispose(): void;
|
|
293
293
|
}
|
|
294
294
|
|
|
295
|
-
type State$
|
|
295
|
+
type State$g = {
|
|
296
296
|
startTime: Date | null;
|
|
297
297
|
stopTime: Date | null;
|
|
298
298
|
};
|
|
@@ -458,10 +458,15 @@ declare class DeepdeskBrokerAPI {
|
|
|
458
458
|
}
|
|
459
459
|
|
|
460
460
|
type EvaluationOutput = CamelCaseKeys<Server.EvaluationOutput>;
|
|
461
|
-
type State$
|
|
461
|
+
type State$f = {
|
|
462
462
|
outputs: EvaluationOutput[];
|
|
463
463
|
fetchState: FetchState;
|
|
464
464
|
};
|
|
465
|
+
type Transcript = Array<{
|
|
466
|
+
source: string;
|
|
467
|
+
text: string;
|
|
468
|
+
}>;
|
|
469
|
+
type TranscriptOption = 'in-memory-transcript' | 'stored-transcript' | Transcript;
|
|
465
470
|
|
|
466
471
|
interface StoreConfig {
|
|
467
472
|
deepdeskAPI: DeepdeskAPI;
|
|
@@ -471,17 +476,17 @@ interface StoreConfig {
|
|
|
471
476
|
preloadedState?: any;
|
|
472
477
|
}
|
|
473
478
|
declare const reducers: redux.Reducer<redux.CombinedState<{
|
|
474
|
-
assistants: State$
|
|
475
|
-
answer: State$
|
|
476
|
-
auth: State$
|
|
477
|
-
autoflows: State$
|
|
478
|
-
conversation: State$
|
|
479
|
-
contentTypes: State$
|
|
480
|
-
customMessages: State$
|
|
481
|
-
passwordlessToken: State$
|
|
482
|
-
entities: State$
|
|
483
|
-
knowledgeAssistant: State$
|
|
484
|
-
handlingTime: State$
|
|
479
|
+
assistants: State$f;
|
|
480
|
+
answer: State$6;
|
|
481
|
+
auth: State$e;
|
|
482
|
+
autoflows: State$d;
|
|
483
|
+
conversation: State$c;
|
|
484
|
+
contentTypes: State$b;
|
|
485
|
+
customMessages: State$a;
|
|
486
|
+
passwordlessToken: State$9;
|
|
487
|
+
entities: State$8;
|
|
488
|
+
knowledgeAssistant: State$7;
|
|
489
|
+
handlingTime: State$g;
|
|
485
490
|
info: {
|
|
486
491
|
agentInfo?: AgentInfo | undefined;
|
|
487
492
|
agentSettings: unknown;
|
|
@@ -490,7 +495,7 @@ declare const reducers: redux.Reducer<redux.CombinedState<{
|
|
|
490
495
|
platformVariables?: VariableMapping | undefined;
|
|
491
496
|
fetchState: FetchState;
|
|
492
497
|
};
|
|
493
|
-
input: State$
|
|
498
|
+
input: State$5;
|
|
494
499
|
settings: {
|
|
495
500
|
locale: Locale;
|
|
496
501
|
deanonymize: boolean;
|
|
@@ -523,9 +528,8 @@ declare const reducers: redux.Reducer<redux.CombinedState<{
|
|
|
523
528
|
enableFeedbackForm: boolean;
|
|
524
529
|
hasKeyboardInput: boolean;
|
|
525
530
|
};
|
|
526
|
-
profile: State$
|
|
527
|
-
search: State$
|
|
528
|
-
summary: State$3;
|
|
531
|
+
profile: State$4;
|
|
532
|
+
search: State$3;
|
|
529
533
|
styleSuggestions: State$2;
|
|
530
534
|
ui: {
|
|
531
535
|
showTabHint: boolean;
|
|
@@ -538,17 +542,17 @@ declare const reducers: redux.Reducer<redux.CombinedState<{
|
|
|
538
542
|
textSuggestions: TextSuggestionState;
|
|
539
543
|
}>, redux.AnyAction>;
|
|
540
544
|
declare function createStore(config: StoreConfig): _reduxjs_toolkit_dist_configureStore.ToolkitStore<redux.EmptyObject & {
|
|
541
|
-
assistants: State$
|
|
542
|
-
answer: State$
|
|
543
|
-
auth: State$
|
|
544
|
-
autoflows: State$
|
|
545
|
-
conversation: State$
|
|
546
|
-
contentTypes: State$
|
|
547
|
-
customMessages: State$
|
|
548
|
-
passwordlessToken: State$
|
|
549
|
-
entities: State$
|
|
550
|
-
knowledgeAssistant: State$
|
|
551
|
-
handlingTime: State$
|
|
545
|
+
assistants: State$f;
|
|
546
|
+
answer: State$6;
|
|
547
|
+
auth: State$e;
|
|
548
|
+
autoflows: State$d;
|
|
549
|
+
conversation: State$c;
|
|
550
|
+
contentTypes: State$b;
|
|
551
|
+
customMessages: State$a;
|
|
552
|
+
passwordlessToken: State$9;
|
|
553
|
+
entities: State$8;
|
|
554
|
+
knowledgeAssistant: State$7;
|
|
555
|
+
handlingTime: State$g;
|
|
552
556
|
info: {
|
|
553
557
|
agentInfo?: AgentInfo | undefined;
|
|
554
558
|
agentSettings: unknown;
|
|
@@ -557,7 +561,7 @@ declare function createStore(config: StoreConfig): _reduxjs_toolkit_dist_configu
|
|
|
557
561
|
platformVariables?: VariableMapping | undefined;
|
|
558
562
|
fetchState: FetchState;
|
|
559
563
|
};
|
|
560
|
-
input: State$
|
|
564
|
+
input: State$5;
|
|
561
565
|
settings: {
|
|
562
566
|
locale: Locale;
|
|
563
567
|
deanonymize: boolean;
|
|
@@ -590,9 +594,8 @@ declare function createStore(config: StoreConfig): _reduxjs_toolkit_dist_configu
|
|
|
590
594
|
enableFeedbackForm: boolean;
|
|
591
595
|
hasKeyboardInput: boolean;
|
|
592
596
|
};
|
|
593
|
-
profile: State$
|
|
594
|
-
search: State$
|
|
595
|
-
summary: State$3;
|
|
597
|
+
profile: State$4;
|
|
598
|
+
search: State$3;
|
|
596
599
|
styleSuggestions: State$2;
|
|
597
600
|
ui: {
|
|
598
601
|
showTabHint: boolean;
|
|
@@ -604,17 +607,17 @@ declare function createStore(config: StoreConfig): _reduxjs_toolkit_dist_configu
|
|
|
604
607
|
rules: State$1;
|
|
605
608
|
textSuggestions: TextSuggestionState;
|
|
606
609
|
}, redux.AnyAction, _reduxjs_toolkit.ThunkMiddleware<redux.CombinedState<{
|
|
607
|
-
assistants: State$
|
|
608
|
-
answer: State$
|
|
609
|
-
auth: State$
|
|
610
|
-
autoflows: State$
|
|
611
|
-
conversation: State$
|
|
612
|
-
contentTypes: State$
|
|
613
|
-
customMessages: State$
|
|
614
|
-
passwordlessToken: State$
|
|
615
|
-
entities: State$
|
|
616
|
-
knowledgeAssistant: State$
|
|
617
|
-
handlingTime: State$
|
|
610
|
+
assistants: State$f;
|
|
611
|
+
answer: State$6;
|
|
612
|
+
auth: State$e;
|
|
613
|
+
autoflows: State$d;
|
|
614
|
+
conversation: State$c;
|
|
615
|
+
contentTypes: State$b;
|
|
616
|
+
customMessages: State$a;
|
|
617
|
+
passwordlessToken: State$9;
|
|
618
|
+
entities: State$8;
|
|
619
|
+
knowledgeAssistant: State$7;
|
|
620
|
+
handlingTime: State$g;
|
|
618
621
|
info: {
|
|
619
622
|
agentInfo?: AgentInfo | undefined;
|
|
620
623
|
agentSettings: unknown;
|
|
@@ -623,7 +626,7 @@ declare function createStore(config: StoreConfig): _reduxjs_toolkit_dist_configu
|
|
|
623
626
|
platformVariables?: VariableMapping | undefined;
|
|
624
627
|
fetchState: FetchState;
|
|
625
628
|
};
|
|
626
|
-
input: State$
|
|
629
|
+
input: State$5;
|
|
627
630
|
settings: {
|
|
628
631
|
locale: Locale;
|
|
629
632
|
deanonymize: boolean;
|
|
@@ -656,9 +659,8 @@ declare function createStore(config: StoreConfig): _reduxjs_toolkit_dist_configu
|
|
|
656
659
|
enableFeedbackForm: boolean;
|
|
657
660
|
hasKeyboardInput: boolean;
|
|
658
661
|
};
|
|
659
|
-
profile: State$
|
|
660
|
-
search: State$
|
|
661
|
-
summary: State$3;
|
|
662
|
+
profile: State$4;
|
|
663
|
+
search: State$3;
|
|
662
664
|
styleSuggestions: State$2;
|
|
663
665
|
ui: {
|
|
664
666
|
showTabHint: boolean;
|
|
@@ -677,7 +679,7 @@ declare function createStore(config: StoreConfig): _reduxjs_toolkit_dist_configu
|
|
|
677
679
|
type RootState = ReturnType<typeof reducers>;
|
|
678
680
|
type Store = ReturnType<typeof createStore>;
|
|
679
681
|
|
|
680
|
-
interface State$
|
|
682
|
+
interface State$e {
|
|
681
683
|
isLoggedIn: boolean | null;
|
|
682
684
|
loginFetchState: FetchState;
|
|
683
685
|
verifyFetchState: FetchState;
|
|
@@ -687,24 +689,24 @@ interface State$f {
|
|
|
687
689
|
type Autoflow = CamelCaseKeys<Server$1.Autoflow> & {
|
|
688
690
|
isBusy?: boolean;
|
|
689
691
|
};
|
|
690
|
-
interface State$
|
|
692
|
+
interface State$d {
|
|
691
693
|
list: Autoflow[];
|
|
692
694
|
fetchState: FetchState;
|
|
693
695
|
}
|
|
694
696
|
|
|
695
|
-
interface State$
|
|
697
|
+
interface State$c {
|
|
696
698
|
current: Conversation | null;
|
|
697
699
|
isSupported: boolean | null;
|
|
698
700
|
}
|
|
699
701
|
|
|
700
702
|
type ContentType = CamelCaseKeys<Server.ContentType>;
|
|
701
|
-
type State$
|
|
703
|
+
type State$b = {
|
|
702
704
|
data: ContentType[] | null;
|
|
703
705
|
fetchState: FetchState;
|
|
704
706
|
};
|
|
705
707
|
|
|
706
708
|
type CustomMessage = CamelCaseKeys<Server$1.CustomMessage>;
|
|
707
|
-
interface State$
|
|
709
|
+
interface State$a {
|
|
708
710
|
list: CustomMessage[];
|
|
709
711
|
fetchState: FetchState;
|
|
710
712
|
sentSuggestions: string[];
|
|
@@ -712,17 +714,17 @@ interface State$b {
|
|
|
712
714
|
answeredSuggestions: string[];
|
|
713
715
|
}
|
|
714
716
|
|
|
715
|
-
type State$
|
|
717
|
+
type State$9 = {
|
|
716
718
|
token: string | null;
|
|
717
719
|
interval: NodeJS.Timer | null;
|
|
718
720
|
};
|
|
719
721
|
|
|
720
|
-
type State$
|
|
722
|
+
type State$8 = {
|
|
721
723
|
data: Entity[] | null;
|
|
722
724
|
fetchState: FetchState;
|
|
723
725
|
};
|
|
724
726
|
|
|
725
|
-
type State$
|
|
727
|
+
type State$7 = {
|
|
726
728
|
data: KnowledgeAssistant | null;
|
|
727
729
|
fetchState: FetchState;
|
|
728
730
|
};
|
|
@@ -745,7 +747,7 @@ interface KnowledgeResponse {
|
|
|
745
747
|
question: string;
|
|
746
748
|
answer: KnowledgeAnswer;
|
|
747
749
|
}
|
|
748
|
-
type State$
|
|
750
|
+
type State$6 = {
|
|
749
751
|
data: KnowledgeResponse[];
|
|
750
752
|
fetchState: FetchState;
|
|
751
753
|
};
|
|
@@ -1092,7 +1094,15 @@ declare namespace Server {
|
|
|
1092
1094
|
summarizer: boolean;
|
|
1093
1095
|
summarizer_prompt_instruction: string;
|
|
1094
1096
|
summarizer_model: string;
|
|
1097
|
+
/**
|
|
1098
|
+
* Old rule group
|
|
1099
|
+
* @deprecated in favor of `summarizer_assistant_new`
|
|
1100
|
+
*/
|
|
1095
1101
|
summarizer_assistant?: string;
|
|
1102
|
+
summarizer_assistant_new?: string;
|
|
1103
|
+
conversation_accepted_assistant?: string;
|
|
1104
|
+
conversation_new_message_assistant?: string;
|
|
1105
|
+
conversation_ended_assistant?: string;
|
|
1096
1106
|
knowledge_assistant: string;
|
|
1097
1107
|
active_config: {
|
|
1098
1108
|
default_locale: string;
|
|
@@ -1233,7 +1243,7 @@ type SendEventV2ArgumentMap = {
|
|
|
1233
1243
|
}>;
|
|
1234
1244
|
'conversation summarized': EventV2<{
|
|
1235
1245
|
summary: string;
|
|
1236
|
-
|
|
1246
|
+
assistant?: string;
|
|
1237
1247
|
}>;
|
|
1238
1248
|
'style suggested': EventV2<{
|
|
1239
1249
|
keywordMatches: {
|
|
@@ -1351,15 +1361,6 @@ declare class DeepdeskAPI {
|
|
|
1351
1361
|
getEntities(messages: Array<{
|
|
1352
1362
|
text: string;
|
|
1353
1363
|
}>): Promise<Entity[]>;
|
|
1354
|
-
getSummary(messages: Array<{
|
|
1355
|
-
source: string;
|
|
1356
|
-
text: string;
|
|
1357
|
-
}>, options?: {
|
|
1358
|
-
model?: string;
|
|
1359
|
-
promptInstruction?: string;
|
|
1360
|
-
agentId?: string;
|
|
1361
|
-
externalConversationId?: string;
|
|
1362
|
-
}): Promise<CamelCaseKeys<Server.Summary>>;
|
|
1363
1364
|
/**
|
|
1364
1365
|
* Get a temporary exchange / login token
|
|
1365
1366
|
*/
|
|
@@ -1416,9 +1417,14 @@ declare class DeepdeskAPI {
|
|
|
1416
1417
|
evaluateRule<Payload = unknown>(label: string, conversationId: string, payload: Payload, opts?: {
|
|
1417
1418
|
raiseForFailingConditions?: boolean;
|
|
1418
1419
|
}): Promise<CamelCaseKeys<Server.Cue[]>>;
|
|
1419
|
-
evaluateAssistant<
|
|
1420
|
+
evaluateAssistant<TInput = Record<string, unknown>>(assistantCode: string, options: {
|
|
1421
|
+
input: TInput;
|
|
1422
|
+
transcript?: Array<{
|
|
1423
|
+
source: string;
|
|
1424
|
+
text: string;
|
|
1425
|
+
}>;
|
|
1420
1426
|
conversationId?: string;
|
|
1421
|
-
}): Promise<CamelCaseKeys<Server.EvaluationOutput[]
|
|
1427
|
+
}): Promise<CamelCaseKeys<Server.EvaluationOutput[]> | string>;
|
|
1422
1428
|
getRules(): Promise<CamelCaseKeys<Server.Rule[]>>;
|
|
1423
1429
|
translateMessages(params: TranslationRequest): Promise<TranslationResponse>;
|
|
1424
1430
|
private handleDeepdeskVersionHeaders;
|
|
@@ -1590,7 +1596,7 @@ type MetricState = {
|
|
|
1590
1596
|
textSuggestions: SuggestionMetrics[];
|
|
1591
1597
|
cuts: any[];
|
|
1592
1598
|
};
|
|
1593
|
-
type State$
|
|
1599
|
+
type State$5 = {
|
|
1594
1600
|
text: string;
|
|
1595
1601
|
html: string | null;
|
|
1596
1602
|
selection: SelectionRange;
|
|
@@ -1605,7 +1611,7 @@ type State$6 = {
|
|
|
1605
1611
|
selectedSuggestionIndex: number;
|
|
1606
1612
|
};
|
|
1607
1613
|
|
|
1608
|
-
type State$
|
|
1614
|
+
type State$4 = {
|
|
1609
1615
|
data: Profile | null;
|
|
1610
1616
|
fetchState: FetchState;
|
|
1611
1617
|
};
|
|
@@ -1619,7 +1625,7 @@ declare enum SearchResultDefaultType {
|
|
|
1619
1625
|
}
|
|
1620
1626
|
type SearchResultType = string | SearchResultDefaultType;
|
|
1621
1627
|
type SearchResult = SearchSuggestion;
|
|
1622
|
-
interface State$
|
|
1628
|
+
interface State$3 {
|
|
1623
1629
|
list: Array<SearchResult>;
|
|
1624
1630
|
page: string;
|
|
1625
1631
|
fetchState: FetchState;
|
|
@@ -1627,12 +1633,6 @@ interface State$4 {
|
|
|
1627
1633
|
aggregates: Record<string, number>;
|
|
1628
1634
|
}
|
|
1629
1635
|
|
|
1630
|
-
type State$3 = {
|
|
1631
|
-
data: string | null;
|
|
1632
|
-
model?: string;
|
|
1633
|
-
fetchState: FetchState;
|
|
1634
|
-
};
|
|
1635
|
-
|
|
1636
1636
|
type StyleSuggestion = CamelCaseKeys<Server.StyleSuggestion>;
|
|
1637
1637
|
interface State$2 {
|
|
1638
1638
|
list: StyleSuggestion;
|
|
@@ -2099,17 +2099,17 @@ declare class DeepdeskSDK {
|
|
|
2099
2099
|
store: Store;
|
|
2100
2100
|
constructor({ deepdeskUrl, brokerUrl, version, locale, token, fetch, productName, createCustomChannel, }: SDKOptions);
|
|
2101
2101
|
get state(): redux.EmptyObject & {
|
|
2102
|
-
assistants: State$
|
|
2103
|
-
answer: State$
|
|
2104
|
-
auth: State$
|
|
2105
|
-
autoflows: State$
|
|
2106
|
-
conversation: State$
|
|
2107
|
-
contentTypes: State$
|
|
2108
|
-
customMessages: State$
|
|
2109
|
-
passwordlessToken: State$
|
|
2110
|
-
entities: State$
|
|
2111
|
-
knowledgeAssistant: State$
|
|
2112
|
-
handlingTime: State$
|
|
2102
|
+
assistants: State$f;
|
|
2103
|
+
answer: State$6;
|
|
2104
|
+
auth: State$e;
|
|
2105
|
+
autoflows: State$d;
|
|
2106
|
+
conversation: State$c;
|
|
2107
|
+
contentTypes: State$b;
|
|
2108
|
+
customMessages: State$a;
|
|
2109
|
+
passwordlessToken: State$9;
|
|
2110
|
+
entities: State$8;
|
|
2111
|
+
knowledgeAssistant: State$7;
|
|
2112
|
+
handlingTime: State$g;
|
|
2113
2113
|
info: {
|
|
2114
2114
|
agentInfo?: AgentInfo | undefined;
|
|
2115
2115
|
agentSettings: unknown;
|
|
@@ -2118,7 +2118,7 @@ declare class DeepdeskSDK {
|
|
|
2118
2118
|
platformVariables?: VariableMapping | undefined;
|
|
2119
2119
|
fetchState: FetchState;
|
|
2120
2120
|
};
|
|
2121
|
-
input: State$
|
|
2121
|
+
input: State$5;
|
|
2122
2122
|
settings: {
|
|
2123
2123
|
locale: Locale;
|
|
2124
2124
|
deanonymize: boolean;
|
|
@@ -2151,9 +2151,8 @@ declare class DeepdeskSDK {
|
|
|
2151
2151
|
enableFeedbackForm: boolean;
|
|
2152
2152
|
hasKeyboardInput: boolean;
|
|
2153
2153
|
};
|
|
2154
|
-
profile: State$
|
|
2155
|
-
search: State$
|
|
2156
|
-
summary: State$3;
|
|
2154
|
+
profile: State$4;
|
|
2155
|
+
search: State$3;
|
|
2157
2156
|
styleSuggestions: State$2;
|
|
2158
2157
|
ui: {
|
|
2159
2158
|
showTabHint: boolean;
|
|
@@ -2241,10 +2240,6 @@ declare class DeepdeskSDK {
|
|
|
2241
2240
|
* Reset conversation
|
|
2242
2241
|
*/
|
|
2243
2242
|
resetConversation(): void;
|
|
2244
|
-
/**
|
|
2245
|
-
* Get summary from conversation
|
|
2246
|
-
*/
|
|
2247
|
-
getSummary(): Promise<string>;
|
|
2248
2243
|
/**
|
|
2249
2244
|
* Change settings value
|
|
2250
2245
|
*/
|
|
@@ -2275,8 +2270,39 @@ declare class DeepdeskSDK {
|
|
|
2275
2270
|
*/
|
|
2276
2271
|
refresh(): Promise<void>;
|
|
2277
2272
|
notifyExternalSuggestion(suggestion: StageSuggestion): void;
|
|
2273
|
+
/**
|
|
2274
|
+
* @deprecated in favor of `evaluateAssistant`
|
|
2275
|
+
*/
|
|
2278
2276
|
evaluateRule(label: string, params?: Record<string, any>, options?: EvaluateRuleOptions): Promise<Cue[]>;
|
|
2279
|
-
|
|
2277
|
+
/**
|
|
2278
|
+
* Evaluate assistant
|
|
2279
|
+
* By default will show cues in widget
|
|
2280
|
+
*/
|
|
2281
|
+
evaluateAssistant(assistantCode: string, options?: {
|
|
2282
|
+
input?: Record<string, any>;
|
|
2283
|
+
transcript?: TranscriptOption;
|
|
2284
|
+
includeTags?: boolean;
|
|
2285
|
+
showCuesInWidget?: boolean;
|
|
2286
|
+
}): Promise<EvaluationOutput[] | string>;
|
|
2287
|
+
/**
|
|
2288
|
+
* @deprecated in favor of passing `payload` through `options` argument
|
|
2289
|
+
* TODO: remove when integrations use first call signature
|
|
2290
|
+
*/
|
|
2291
|
+
evaluateAssistant(assistantCode: string, payload?: Record<string, any>): Promise<EvaluationOutput[] | string>;
|
|
2292
|
+
/**
|
|
2293
|
+
* Evaluate conversation lifecycle assistant
|
|
2294
|
+
* Convenient wrapper around `evaluateAssistant`.
|
|
2295
|
+
* By default includes 'stored-transcript' and 'tags'.
|
|
2296
|
+
*/
|
|
2297
|
+
evaluateConversationAssistant(event: 'accepted' | 'new-message' | 'ended', options?: {
|
|
2298
|
+
payload?: Record<string, any>;
|
|
2299
|
+
include?: Array<'in-memory-transcript' | 'stored-transcript' | 'tags'>;
|
|
2300
|
+
showCuesInWidget?: boolean;
|
|
2301
|
+
}): Promise<void>;
|
|
2302
|
+
/**
|
|
2303
|
+
* Get summary from conversation
|
|
2304
|
+
*/
|
|
2305
|
+
getSummary(): Promise<string | null>;
|
|
2280
2306
|
private handleKeyDown;
|
|
2281
2307
|
private handleAfterSendMessage;
|
|
2282
2308
|
handlingTimeStart(): void;
|