@deepdesk/deepdesk-sdk 12.1.0 → 12.1.1-beta.0

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
@@ -291,7 +291,7 @@ declare abstract class InputMediator<HTMLElementType extends HTMLElement> {
291
291
  dispose(): void;
292
292
  }
293
293
 
294
- type State$g = {
294
+ type State$h = {
295
295
  startTime: Date | null;
296
296
  stopTime: Date | null;
297
297
  };
@@ -456,6 +456,12 @@ declare class DeepdeskBrokerAPI {
456
456
  closeStream(platformSessionId: string): void;
457
457
  }
458
458
 
459
+ type EvaluationOutput = CamelCaseKeys<Server.EvaluationOutput>;
460
+ type State$g = {
461
+ outputs: EvaluationOutput[];
462
+ fetchState: FetchState;
463
+ };
464
+
459
465
  interface StoreConfig {
460
466
  deepdeskAPI: DeepdeskAPI;
461
467
  deepdeskBrokerAPI?: DeepdeskBrokerAPI;
@@ -464,6 +470,7 @@ interface StoreConfig {
464
470
  preloadedState?: any;
465
471
  }
466
472
  declare const reducers: redux.Reducer<redux.CombinedState<{
473
+ assistants: State$g;
467
474
  answer: State$7;
468
475
  auth: State$f;
469
476
  autoflows: State$e;
@@ -473,7 +480,7 @@ declare const reducers: redux.Reducer<redux.CombinedState<{
473
480
  passwordlessToken: State$a;
474
481
  entities: State$9;
475
482
  knowledgeAssistant: State$8;
476
- handlingTime: State$g;
483
+ handlingTime: State$h;
477
484
  info: {
478
485
  agentInfo?: AgentInfo | undefined;
479
486
  agentSettings: unknown;
@@ -529,6 +536,7 @@ declare const reducers: redux.Reducer<redux.CombinedState<{
529
536
  textSuggestions: TextSuggestionState;
530
537
  }>, redux.AnyAction>;
531
538
  declare function createStore(config: StoreConfig): _reduxjs_toolkit_dist_configureStore.ToolkitStore<redux.EmptyObject & {
539
+ assistants: State$g;
532
540
  answer: State$7;
533
541
  auth: State$f;
534
542
  autoflows: State$e;
@@ -538,7 +546,7 @@ declare function createStore(config: StoreConfig): _reduxjs_toolkit_dist_configu
538
546
  passwordlessToken: State$a;
539
547
  entities: State$9;
540
548
  knowledgeAssistant: State$8;
541
- handlingTime: State$g;
549
+ handlingTime: State$h;
542
550
  info: {
543
551
  agentInfo?: AgentInfo | undefined;
544
552
  agentSettings: unknown;
@@ -593,6 +601,7 @@ declare function createStore(config: StoreConfig): _reduxjs_toolkit_dist_configu
593
601
  rules: State$1;
594
602
  textSuggestions: TextSuggestionState;
595
603
  }, redux.AnyAction, _reduxjs_toolkit.ThunkMiddleware<redux.CombinedState<{
604
+ assistants: State$g;
596
605
  answer: State$7;
597
606
  auth: State$f;
598
607
  autoflows: State$e;
@@ -602,7 +611,7 @@ declare function createStore(config: StoreConfig): _reduxjs_toolkit_dist_configu
602
611
  passwordlessToken: State$a;
603
612
  entities: State$9;
604
613
  knowledgeAssistant: State$8;
605
- handlingTime: State$g;
614
+ handlingTime: State$h;
606
615
  info: {
607
616
  agentInfo?: AgentInfo | undefined;
608
617
  agentSettings: unknown;
@@ -993,6 +1002,11 @@ declare namespace Server {
993
1002
  title: string;
994
1003
  rule: Pick<Rule, 'id' | 'name' | 'label' | 'description'>;
995
1004
  }
1005
+ interface EvaluationOutput {
1006
+ code: string;
1007
+ name: string;
1008
+ response: string;
1009
+ }
996
1010
  /**
997
1011
  * Handling time event data
998
1012
  */
@@ -1377,9 +1391,15 @@ declare class DeepdeskAPI {
1377
1391
  verifyLoginToken(token: string): Promise<{
1378
1392
  isLoggedIn: boolean;
1379
1393
  }>;
1394
+ /**
1395
+ * @deprecated in favour of evaluateAssistant
1396
+ */
1380
1397
  evaluateRule<Payload = unknown>(label: string, conversationId: string, payload: Payload, opts?: {
1381
1398
  raiseForFailingConditions?: boolean;
1382
1399
  }): Promise<CamelCaseKeys<Server.Cue[]>>;
1400
+ evaluateAssistant<TPayload = unknown>(assistantCode: string, payload: TPayload, options?: {
1401
+ conversationId?: string;
1402
+ }): Promise<CamelCaseKeys<Server.EvaluationOutput[]>>;
1383
1403
  getRules(): Promise<CamelCaseKeys<Server.Rule[]>>;
1384
1404
  translateMessages(params: TranslationRequest): Promise<TranslationResponse>;
1385
1405
  private handleDeepdeskVersionHeaders;
@@ -2044,6 +2064,7 @@ declare class DeepdeskSDK {
2044
2064
  store: Store;
2045
2065
  constructor({ deepdeskUrl, brokerUrl, version, locale, token, fetch, productName, createCustomChannel, }: SDKOptions);
2046
2066
  get state(): redux.EmptyObject & {
2067
+ assistants: State$g;
2047
2068
  answer: State$7;
2048
2069
  auth: State$f;
2049
2070
  autoflows: State$e;
@@ -2053,7 +2074,7 @@ declare class DeepdeskSDK {
2053
2074
  passwordlessToken: State$a;
2054
2075
  entities: State$9;
2055
2076
  knowledgeAssistant: State$8;
2056
- handlingTime: State$g;
2077
+ handlingTime: State$h;
2057
2078
  info: {
2058
2079
  agentInfo?: AgentInfo | undefined;
2059
2080
  agentSettings: unknown;
@@ -2224,6 +2245,7 @@ declare class DeepdeskSDK {
2224
2245
  refresh(): Promise<void>;
2225
2246
  notifyExternalSuggestion(suggestion: StageSuggestion): void;
2226
2247
  evaluateRule(label: string, params?: Record<string, any>, options?: EvaluateRuleOptions): Promise<Cue[]>;
2248
+ evaluateAssistant(assistantCode: string, payload?: Record<string, any>): Promise<void>;
2227
2249
  private handleKeyDown;
2228
2250
  private handleAfterSendMessage;
2229
2251
  handlingTimeStart(): void;
package/dist/index.d.ts CHANGED
@@ -291,7 +291,7 @@ declare abstract class InputMediator<HTMLElementType extends HTMLElement> {
291
291
  dispose(): void;
292
292
  }
293
293
 
294
- type State$g = {
294
+ type State$h = {
295
295
  startTime: Date | null;
296
296
  stopTime: Date | null;
297
297
  };
@@ -456,6 +456,12 @@ declare class DeepdeskBrokerAPI {
456
456
  closeStream(platformSessionId: string): void;
457
457
  }
458
458
 
459
+ type EvaluationOutput = CamelCaseKeys<Server.EvaluationOutput>;
460
+ type State$g = {
461
+ outputs: EvaluationOutput[];
462
+ fetchState: FetchState;
463
+ };
464
+
459
465
  interface StoreConfig {
460
466
  deepdeskAPI: DeepdeskAPI;
461
467
  deepdeskBrokerAPI?: DeepdeskBrokerAPI;
@@ -464,6 +470,7 @@ interface StoreConfig {
464
470
  preloadedState?: any;
465
471
  }
466
472
  declare const reducers: redux.Reducer<redux.CombinedState<{
473
+ assistants: State$g;
467
474
  answer: State$7;
468
475
  auth: State$f;
469
476
  autoflows: State$e;
@@ -473,7 +480,7 @@ declare const reducers: redux.Reducer<redux.CombinedState<{
473
480
  passwordlessToken: State$a;
474
481
  entities: State$9;
475
482
  knowledgeAssistant: State$8;
476
- handlingTime: State$g;
483
+ handlingTime: State$h;
477
484
  info: {
478
485
  agentInfo?: AgentInfo | undefined;
479
486
  agentSettings: unknown;
@@ -529,6 +536,7 @@ declare const reducers: redux.Reducer<redux.CombinedState<{
529
536
  textSuggestions: TextSuggestionState;
530
537
  }>, redux.AnyAction>;
531
538
  declare function createStore(config: StoreConfig): _reduxjs_toolkit_dist_configureStore.ToolkitStore<redux.EmptyObject & {
539
+ assistants: State$g;
532
540
  answer: State$7;
533
541
  auth: State$f;
534
542
  autoflows: State$e;
@@ -538,7 +546,7 @@ declare function createStore(config: StoreConfig): _reduxjs_toolkit_dist_configu
538
546
  passwordlessToken: State$a;
539
547
  entities: State$9;
540
548
  knowledgeAssistant: State$8;
541
- handlingTime: State$g;
549
+ handlingTime: State$h;
542
550
  info: {
543
551
  agentInfo?: AgentInfo | undefined;
544
552
  agentSettings: unknown;
@@ -593,6 +601,7 @@ declare function createStore(config: StoreConfig): _reduxjs_toolkit_dist_configu
593
601
  rules: State$1;
594
602
  textSuggestions: TextSuggestionState;
595
603
  }, redux.AnyAction, _reduxjs_toolkit.ThunkMiddleware<redux.CombinedState<{
604
+ assistants: State$g;
596
605
  answer: State$7;
597
606
  auth: State$f;
598
607
  autoflows: State$e;
@@ -602,7 +611,7 @@ declare function createStore(config: StoreConfig): _reduxjs_toolkit_dist_configu
602
611
  passwordlessToken: State$a;
603
612
  entities: State$9;
604
613
  knowledgeAssistant: State$8;
605
- handlingTime: State$g;
614
+ handlingTime: State$h;
606
615
  info: {
607
616
  agentInfo?: AgentInfo | undefined;
608
617
  agentSettings: unknown;
@@ -993,6 +1002,11 @@ declare namespace Server {
993
1002
  title: string;
994
1003
  rule: Pick<Rule, 'id' | 'name' | 'label' | 'description'>;
995
1004
  }
1005
+ interface EvaluationOutput {
1006
+ code: string;
1007
+ name: string;
1008
+ response: string;
1009
+ }
996
1010
  /**
997
1011
  * Handling time event data
998
1012
  */
@@ -1377,9 +1391,15 @@ declare class DeepdeskAPI {
1377
1391
  verifyLoginToken(token: string): Promise<{
1378
1392
  isLoggedIn: boolean;
1379
1393
  }>;
1394
+ /**
1395
+ * @deprecated in favour of evaluateAssistant
1396
+ */
1380
1397
  evaluateRule<Payload = unknown>(label: string, conversationId: string, payload: Payload, opts?: {
1381
1398
  raiseForFailingConditions?: boolean;
1382
1399
  }): Promise<CamelCaseKeys<Server.Cue[]>>;
1400
+ evaluateAssistant<TPayload = unknown>(assistantCode: string, payload: TPayload, options?: {
1401
+ conversationId?: string;
1402
+ }): Promise<CamelCaseKeys<Server.EvaluationOutput[]>>;
1383
1403
  getRules(): Promise<CamelCaseKeys<Server.Rule[]>>;
1384
1404
  translateMessages(params: TranslationRequest): Promise<TranslationResponse>;
1385
1405
  private handleDeepdeskVersionHeaders;
@@ -2044,6 +2064,7 @@ declare class DeepdeskSDK {
2044
2064
  store: Store;
2045
2065
  constructor({ deepdeskUrl, brokerUrl, version, locale, token, fetch, productName, createCustomChannel, }: SDKOptions);
2046
2066
  get state(): redux.EmptyObject & {
2067
+ assistants: State$g;
2047
2068
  answer: State$7;
2048
2069
  auth: State$f;
2049
2070
  autoflows: State$e;
@@ -2053,7 +2074,7 @@ declare class DeepdeskSDK {
2053
2074
  passwordlessToken: State$a;
2054
2075
  entities: State$9;
2055
2076
  knowledgeAssistant: State$8;
2056
- handlingTime: State$g;
2077
+ handlingTime: State$h;
2057
2078
  info: {
2058
2079
  agentInfo?: AgentInfo | undefined;
2059
2080
  agentSettings: unknown;
@@ -2224,6 +2245,7 @@ declare class DeepdeskSDK {
2224
2245
  refresh(): Promise<void>;
2225
2246
  notifyExternalSuggestion(suggestion: StageSuggestion): void;
2226
2247
  evaluateRule(label: string, params?: Record<string, any>, options?: EvaluateRuleOptions): Promise<Cue[]>;
2248
+ evaluateAssistant(assistantCode: string, payload?: Record<string, any>): Promise<void>;
2227
2249
  private handleKeyDown;
2228
2250
  private handleAfterSendMessage;
2229
2251
  handlingTimeStart(): void;