@botonic/plugin-hubtype-analytics 0.37.0 → 0.37.1-alpha.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.
@@ -1,145 +1,8 @@
1
+ import { EventAction, EventCustom, EventFallback, EventFeedback, EventFeedbackKnowledgebase, EventFlow, EventHandoff, EventHandoffOption, EventIntentSmart, EventKeyword, EventKnowledgeBase, EventWebviewEnd, EventWebviewStep } from '@botonic/core';
1
2
  export declare enum EventType {
2
3
  BotEvent = "botevent",
3
4
  WebEvent = "webevent"
4
5
  }
5
- export declare enum EventAction {
6
- FeedbackCase = "feedback_case",
7
- FeedbackMessage = "feedback_message",
8
- FeedbackConversation = "feedback_conversation",
9
- FeedbackKnowledgebase = "feedback_knowledgebase",
10
- FeedbackWebview = "feedback_webview",
11
- FlowNode = "flow_node",
12
- HandoffOption = "handoff_option",
13
- HandoffSuccess = "handoff_success",
14
- HandoffFail = "handoff_fail",
15
- Keyword = "nlu_keyword",
16
- IntentSmart = "nlu_intent_smart",
17
- Knowledgebase = "knowledgebase",
18
- Fallback = "fallback",
19
- WebviewStep = "webview_step",
20
- WebviewEnd = "webview_end",
21
- Custom = "custom"
22
- }
23
- export interface HtBaseEventProps {
24
- action: EventAction;
25
- }
26
- export interface EventFeedback extends HtBaseEventProps {
27
- action: EventAction.FeedbackCase | EventAction.FeedbackConversation | EventAction.FeedbackMessage | EventAction.FeedbackWebview;
28
- feedbackTargetId: string;
29
- feedbackGroupId: string;
30
- possibleOptions: string[];
31
- possibleValues?: number[];
32
- option: string;
33
- value?: number;
34
- comment?: string;
35
- }
36
- export interface EventFeedbackKnowledgebase extends HtBaseEventProps {
37
- action: EventAction.FeedbackKnowledgebase;
38
- knowledgebaseInferenceId: string;
39
- feedbackBotInteractionId: string;
40
- feedbackTargetId: string;
41
- feedbackGroupId: string;
42
- possibleOptions: string[];
43
- possibleValues?: number[];
44
- option: string;
45
- value?: number;
46
- comment?: string;
47
- }
48
- export interface EventFlow extends HtBaseEventProps {
49
- action: EventAction.FlowNode;
50
- flowThreadId: string;
51
- flowId: string;
52
- flowName: string;
53
- flowNodeId: string;
54
- flowNodeContentId: string;
55
- flowNodeIsMeaningful?: boolean;
56
- }
57
- export interface EventHandoff extends HtBaseEventProps {
58
- action: EventAction.HandoffSuccess | EventAction.HandoffFail;
59
- flowThreadId?: string;
60
- queueId: string;
61
- queueName: string;
62
- caseId?: string;
63
- isQueueOpen?: boolean;
64
- isAvailableAgent?: boolean;
65
- isThresholdReached?: boolean;
66
- }
67
- export interface EventHandoffOption extends HtBaseEventProps {
68
- action: EventAction.HandoffOption;
69
- flowThreadId?: string;
70
- queueId?: string;
71
- queueName?: string;
72
- }
73
- export interface EventKeyword extends HtBaseEventProps {
74
- action: EventAction.Keyword;
75
- flowThreadId: string;
76
- flowId: string;
77
- flowNodeId: string;
78
- nluKeywordName: string;
79
- nluKeywordIsRegex?: boolean;
80
- nluKeywordMessageId: string;
81
- userInput: string;
82
- }
83
- export interface EventIntentSmart extends HtBaseEventProps {
84
- action: EventAction.IntentSmart;
85
- flowThreadId: string;
86
- flowId: string;
87
- flowNodeId: string;
88
- nluIntentSmartTitle: string;
89
- nluIntentSmartNumUsed: number;
90
- nluIntentSmartMessageId: string;
91
- userInput: string;
92
- }
93
- export interface EventKnowledgeBase extends HtBaseEventProps {
94
- action: EventAction.Knowledgebase;
95
- flowThreadId: string;
96
- flowId: string;
97
- flowNodeId: string;
98
- knowledgebaseInferenceId: string;
99
- knowledgebaseFailReason?: KnowledgebaseFailReason;
100
- knowledgebaseSourcesIds: string[];
101
- knowledgebaseChunksIds: string[];
102
- knowledgebaseMessageId: string;
103
- userInput: string;
104
- }
105
- export declare enum KnowledgebaseFailReason {
106
- NoKnowledge = "no_knowledge",
107
- Hallucination = "hallucination"
108
- }
109
- export interface EventFallback extends HtBaseEventProps {
110
- action: EventAction.Fallback;
111
- userInput: string;
112
- fallbackOut: number;
113
- fallbackMessageId: string;
114
- }
115
- export interface EventWebviewStep extends HtBaseEventProps {
116
- action: EventAction.WebviewStep;
117
- flowThreadId?: string;
118
- webviewThreadId: string;
119
- webviewName: string;
120
- webviewStepName: string;
121
- webviewStepNumber: number;
122
- }
123
- export interface EventWebviewEnd extends HtBaseEventProps {
124
- action: EventAction.WebviewEnd;
125
- flowThreadId?: string;
126
- webviewThreadId: string;
127
- webviewName: string;
128
- webviewStepName?: string;
129
- webviewStepNumber?: number;
130
- webviewEndFailType?: WebviewEndFailType;
131
- webviewEndFailMessage?: string;
132
- }
133
- export declare enum WebviewEndFailType {
134
- CanceledByUser = "canceled_by_user",
135
- ApiError = "api_error",
136
- NeedsEscalation = "needs_escalation"
137
- }
138
- export interface EventCustom extends HtBaseEventProps {
139
- action: EventAction.Custom;
140
- customFields?: Record<string, any>;
141
- customSensitiveFields?: Record<string, any>;
142
- }
143
6
  export type HtEventProps = EventFeedback | EventFeedbackKnowledgebase | EventFlow | EventHandoff | EventHandoffOption | EventKeyword | EventIntentSmart | EventKnowledgeBase | EventFallback | EventWebviewStep | EventWebviewEnd | EventCustom;
144
7
  export interface RequestData {
145
8
  userId?: string;
@@ -148,3 +11,4 @@ export interface RequestData {
148
11
  userCountry: string;
149
12
  systemLocale: string;
150
13
  }
14
+ export { EventAction, EventCustom, EventFallback, EventFeedback, EventFeedbackKnowledgebase, EventFlow, EventHandoff, EventHandoffOption, EventIntentSmart, EventKeyword, EventKnowledgeBase, EventWebviewEnd, EventWebviewStep, };
package/lib/cjs/types.js CHANGED
@@ -1,39 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.WebviewEndFailType = exports.KnowledgebaseFailReason = exports.EventAction = exports.EventType = void 0;
3
+ exports.EventAction = exports.EventType = void 0;
4
+ const core_1 = require("@botonic/core");
5
+ Object.defineProperty(exports, "EventAction", { enumerable: true, get: function () { return core_1.EventAction; } });
4
6
  var EventType;
5
7
  (function (EventType) {
6
8
  EventType["BotEvent"] = "botevent";
7
9
  EventType["WebEvent"] = "webevent";
8
10
  })(EventType = exports.EventType || (exports.EventType = {}));
9
- var EventAction;
10
- (function (EventAction) {
11
- EventAction["FeedbackCase"] = "feedback_case";
12
- EventAction["FeedbackMessage"] = "feedback_message";
13
- EventAction["FeedbackConversation"] = "feedback_conversation";
14
- EventAction["FeedbackKnowledgebase"] = "feedback_knowledgebase";
15
- EventAction["FeedbackWebview"] = "feedback_webview";
16
- EventAction["FlowNode"] = "flow_node";
17
- EventAction["HandoffOption"] = "handoff_option";
18
- EventAction["HandoffSuccess"] = "handoff_success";
19
- EventAction["HandoffFail"] = "handoff_fail";
20
- EventAction["Keyword"] = "nlu_keyword";
21
- EventAction["IntentSmart"] = "nlu_intent_smart";
22
- EventAction["Knowledgebase"] = "knowledgebase";
23
- EventAction["Fallback"] = "fallback";
24
- EventAction["WebviewStep"] = "webview_step";
25
- EventAction["WebviewEnd"] = "webview_end";
26
- EventAction["Custom"] = "custom";
27
- })(EventAction = exports.EventAction || (exports.EventAction = {}));
28
- var KnowledgebaseFailReason;
29
- (function (KnowledgebaseFailReason) {
30
- KnowledgebaseFailReason["NoKnowledge"] = "no_knowledge";
31
- KnowledgebaseFailReason["Hallucination"] = "hallucination";
32
- })(KnowledgebaseFailReason = exports.KnowledgebaseFailReason || (exports.KnowledgebaseFailReason = {}));
33
- var WebviewEndFailType;
34
- (function (WebviewEndFailType) {
35
- WebviewEndFailType["CanceledByUser"] = "canceled_by_user";
36
- WebviewEndFailType["ApiError"] = "api_error";
37
- WebviewEndFailType["NeedsEscalation"] = "needs_escalation";
38
- })(WebviewEndFailType = exports.WebviewEndFailType || (exports.WebviewEndFailType = {}));
39
11
  //# sourceMappingURL=types.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":";;;AAAA,IAAY,SAGX;AAHD,WAAY,SAAS;IACnB,kCAAqB,CAAA;IACrB,kCAAqB,CAAA;AACvB,CAAC,EAHW,SAAS,GAAT,iBAAS,KAAT,iBAAS,QAGpB;AAED,IAAY,WAiBX;AAjBD,WAAY,WAAW;IACrB,6CAA8B,CAAA;IAC9B,mDAAoC,CAAA;IACpC,6DAA8C,CAAA;IAC9C,+DAAgD,CAAA;IAChD,mDAAoC,CAAA;IACpC,qCAAsB,CAAA;IACtB,+CAAgC,CAAA;IAChC,iDAAkC,CAAA;IAClC,2CAA4B,CAAA;IAC5B,sCAAuB,CAAA;IACvB,+CAAgC,CAAA;IAChC,8CAA+B,CAAA;IAC/B,oCAAqB,CAAA;IACrB,2CAA4B,CAAA;IAC5B,yCAA0B,CAAA;IAC1B,gCAAiB,CAAA;AACnB,CAAC,EAjBW,WAAW,GAAX,mBAAW,KAAX,mBAAW,QAiBtB;AAiGD,IAAY,uBAGX;AAHD,WAAY,uBAAuB;IACjC,uDAA4B,CAAA;IAC5B,0DAA+B,CAAA;AACjC,CAAC,EAHW,uBAAuB,GAAvB,+BAAuB,KAAvB,+BAAuB,QAGlC;AA6BD,IAAY,kBAIX;AAJD,WAAY,kBAAkB;IAC5B,yDAAmC,CAAA;IACnC,4CAAsB,CAAA;IACtB,0DAAoC,CAAA;AACtC,CAAC,EAJW,kBAAkB,GAAlB,0BAAkB,KAAlB,0BAAkB,QAI7B"}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":";;;AAAA,wCAcsB;AA8BpB,4FA3CA,kBAAW,OA2CA;AA5Bb,IAAY,SAGX;AAHD,WAAY,SAAS;IACnB,kCAAqB,CAAA;IACrB,kCAAqB,CAAA;AACvB,CAAC,EAHW,SAAS,GAAT,iBAAS,KAAT,iBAAS,QAGpB"}
@@ -1,145 +1,8 @@
1
+ import { EventAction, EventCustom, EventFallback, EventFeedback, EventFeedbackKnowledgebase, EventFlow, EventHandoff, EventHandoffOption, EventIntentSmart, EventKeyword, EventKnowledgeBase, EventWebviewEnd, EventWebviewStep } from '@botonic/core';
1
2
  export declare enum EventType {
2
3
  BotEvent = "botevent",
3
4
  WebEvent = "webevent"
4
5
  }
5
- export declare enum EventAction {
6
- FeedbackCase = "feedback_case",
7
- FeedbackMessage = "feedback_message",
8
- FeedbackConversation = "feedback_conversation",
9
- FeedbackKnowledgebase = "feedback_knowledgebase",
10
- FeedbackWebview = "feedback_webview",
11
- FlowNode = "flow_node",
12
- HandoffOption = "handoff_option",
13
- HandoffSuccess = "handoff_success",
14
- HandoffFail = "handoff_fail",
15
- Keyword = "nlu_keyword",
16
- IntentSmart = "nlu_intent_smart",
17
- Knowledgebase = "knowledgebase",
18
- Fallback = "fallback",
19
- WebviewStep = "webview_step",
20
- WebviewEnd = "webview_end",
21
- Custom = "custom"
22
- }
23
- export interface HtBaseEventProps {
24
- action: EventAction;
25
- }
26
- export interface EventFeedback extends HtBaseEventProps {
27
- action: EventAction.FeedbackCase | EventAction.FeedbackConversation | EventAction.FeedbackMessage | EventAction.FeedbackWebview;
28
- feedbackTargetId: string;
29
- feedbackGroupId: string;
30
- possibleOptions: string[];
31
- possibleValues?: number[];
32
- option: string;
33
- value?: number;
34
- comment?: string;
35
- }
36
- export interface EventFeedbackKnowledgebase extends HtBaseEventProps {
37
- action: EventAction.FeedbackKnowledgebase;
38
- knowledgebaseInferenceId: string;
39
- feedbackBotInteractionId: string;
40
- feedbackTargetId: string;
41
- feedbackGroupId: string;
42
- possibleOptions: string[];
43
- possibleValues?: number[];
44
- option: string;
45
- value?: number;
46
- comment?: string;
47
- }
48
- export interface EventFlow extends HtBaseEventProps {
49
- action: EventAction.FlowNode;
50
- flowThreadId: string;
51
- flowId: string;
52
- flowName: string;
53
- flowNodeId: string;
54
- flowNodeContentId: string;
55
- flowNodeIsMeaningful?: boolean;
56
- }
57
- export interface EventHandoff extends HtBaseEventProps {
58
- action: EventAction.HandoffSuccess | EventAction.HandoffFail;
59
- flowThreadId?: string;
60
- queueId: string;
61
- queueName: string;
62
- caseId?: string;
63
- isQueueOpen?: boolean;
64
- isAvailableAgent?: boolean;
65
- isThresholdReached?: boolean;
66
- }
67
- export interface EventHandoffOption extends HtBaseEventProps {
68
- action: EventAction.HandoffOption;
69
- flowThreadId?: string;
70
- queueId?: string;
71
- queueName?: string;
72
- }
73
- export interface EventKeyword extends HtBaseEventProps {
74
- action: EventAction.Keyword;
75
- flowThreadId: string;
76
- flowId: string;
77
- flowNodeId: string;
78
- nluKeywordName: string;
79
- nluKeywordIsRegex?: boolean;
80
- nluKeywordMessageId: string;
81
- userInput: string;
82
- }
83
- export interface EventIntentSmart extends HtBaseEventProps {
84
- action: EventAction.IntentSmart;
85
- flowThreadId: string;
86
- flowId: string;
87
- flowNodeId: string;
88
- nluIntentSmartTitle: string;
89
- nluIntentSmartNumUsed: number;
90
- nluIntentSmartMessageId: string;
91
- userInput: string;
92
- }
93
- export interface EventKnowledgeBase extends HtBaseEventProps {
94
- action: EventAction.Knowledgebase;
95
- flowThreadId: string;
96
- flowId: string;
97
- flowNodeId: string;
98
- knowledgebaseInferenceId: string;
99
- knowledgebaseFailReason?: KnowledgebaseFailReason;
100
- knowledgebaseSourcesIds: string[];
101
- knowledgebaseChunksIds: string[];
102
- knowledgebaseMessageId: string;
103
- userInput: string;
104
- }
105
- export declare enum KnowledgebaseFailReason {
106
- NoKnowledge = "no_knowledge",
107
- Hallucination = "hallucination"
108
- }
109
- export interface EventFallback extends HtBaseEventProps {
110
- action: EventAction.Fallback;
111
- userInput: string;
112
- fallbackOut: number;
113
- fallbackMessageId: string;
114
- }
115
- export interface EventWebviewStep extends HtBaseEventProps {
116
- action: EventAction.WebviewStep;
117
- flowThreadId?: string;
118
- webviewThreadId: string;
119
- webviewName: string;
120
- webviewStepName: string;
121
- webviewStepNumber: number;
122
- }
123
- export interface EventWebviewEnd extends HtBaseEventProps {
124
- action: EventAction.WebviewEnd;
125
- flowThreadId?: string;
126
- webviewThreadId: string;
127
- webviewName: string;
128
- webviewStepName?: string;
129
- webviewStepNumber?: number;
130
- webviewEndFailType?: WebviewEndFailType;
131
- webviewEndFailMessage?: string;
132
- }
133
- export declare enum WebviewEndFailType {
134
- CanceledByUser = "canceled_by_user",
135
- ApiError = "api_error",
136
- NeedsEscalation = "needs_escalation"
137
- }
138
- export interface EventCustom extends HtBaseEventProps {
139
- action: EventAction.Custom;
140
- customFields?: Record<string, any>;
141
- customSensitiveFields?: Record<string, any>;
142
- }
143
6
  export type HtEventProps = EventFeedback | EventFeedbackKnowledgebase | EventFlow | EventHandoff | EventHandoffOption | EventKeyword | EventIntentSmart | EventKnowledgeBase | EventFallback | EventWebviewStep | EventWebviewEnd | EventCustom;
144
7
  export interface RequestData {
145
8
  userId?: string;
@@ -148,3 +11,4 @@ export interface RequestData {
148
11
  userCountry: string;
149
12
  systemLocale: string;
150
13
  }
14
+ export { EventAction, EventCustom, EventFallback, EventFeedback, EventFeedbackKnowledgebase, EventFlow, EventHandoff, EventHandoffOption, EventIntentSmart, EventKeyword, EventKnowledgeBase, EventWebviewEnd, EventWebviewStep, };
package/lib/esm/types.js CHANGED
@@ -1,36 +1,8 @@
1
+ import { EventAction, } from '@botonic/core';
1
2
  export var EventType;
2
3
  (function (EventType) {
3
4
  EventType["BotEvent"] = "botevent";
4
5
  EventType["WebEvent"] = "webevent";
5
6
  })(EventType || (EventType = {}));
6
- export var EventAction;
7
- (function (EventAction) {
8
- EventAction["FeedbackCase"] = "feedback_case";
9
- EventAction["FeedbackMessage"] = "feedback_message";
10
- EventAction["FeedbackConversation"] = "feedback_conversation";
11
- EventAction["FeedbackKnowledgebase"] = "feedback_knowledgebase";
12
- EventAction["FeedbackWebview"] = "feedback_webview";
13
- EventAction["FlowNode"] = "flow_node";
14
- EventAction["HandoffOption"] = "handoff_option";
15
- EventAction["HandoffSuccess"] = "handoff_success";
16
- EventAction["HandoffFail"] = "handoff_fail";
17
- EventAction["Keyword"] = "nlu_keyword";
18
- EventAction["IntentSmart"] = "nlu_intent_smart";
19
- EventAction["Knowledgebase"] = "knowledgebase";
20
- EventAction["Fallback"] = "fallback";
21
- EventAction["WebviewStep"] = "webview_step";
22
- EventAction["WebviewEnd"] = "webview_end";
23
- EventAction["Custom"] = "custom";
24
- })(EventAction || (EventAction = {}));
25
- export var KnowledgebaseFailReason;
26
- (function (KnowledgebaseFailReason) {
27
- KnowledgebaseFailReason["NoKnowledge"] = "no_knowledge";
28
- KnowledgebaseFailReason["Hallucination"] = "hallucination";
29
- })(KnowledgebaseFailReason || (KnowledgebaseFailReason = {}));
30
- export var WebviewEndFailType;
31
- (function (WebviewEndFailType) {
32
- WebviewEndFailType["CanceledByUser"] = "canceled_by_user";
33
- WebviewEndFailType["ApiError"] = "api_error";
34
- WebviewEndFailType["NeedsEscalation"] = "needs_escalation";
35
- })(WebviewEndFailType || (WebviewEndFailType = {}));
7
+ export { EventAction, };
36
8
  //# sourceMappingURL=types.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,SAGX;AAHD,WAAY,SAAS;IACnB,kCAAqB,CAAA;IACrB,kCAAqB,CAAA;AACvB,CAAC,EAHW,SAAS,KAAT,SAAS,QAGpB;AAED,MAAM,CAAN,IAAY,WAiBX;AAjBD,WAAY,WAAW;IACrB,6CAA8B,CAAA;IAC9B,mDAAoC,CAAA;IACpC,6DAA8C,CAAA;IAC9C,+DAAgD,CAAA;IAChD,mDAAoC,CAAA;IACpC,qCAAsB,CAAA;IACtB,+CAAgC,CAAA;IAChC,iDAAkC,CAAA;IAClC,2CAA4B,CAAA;IAC5B,sCAAuB,CAAA;IACvB,+CAAgC,CAAA;IAChC,8CAA+B,CAAA;IAC/B,oCAAqB,CAAA;IACrB,2CAA4B,CAAA;IAC5B,yCAA0B,CAAA;IAC1B,gCAAiB,CAAA;AACnB,CAAC,EAjBW,WAAW,KAAX,WAAW,QAiBtB;AAiGD,MAAM,CAAN,IAAY,uBAGX;AAHD,WAAY,uBAAuB;IACjC,uDAA4B,CAAA;IAC5B,0DAA+B,CAAA;AACjC,CAAC,EAHW,uBAAuB,KAAvB,uBAAuB,QAGlC;AA6BD,MAAM,CAAN,IAAY,kBAIX;AAJD,WAAY,kBAAkB;IAC5B,yDAAmC,CAAA;IACnC,4CAAsB,CAAA;IACtB,0DAAoC,CAAA;AACtC,CAAC,EAJW,kBAAkB,KAAlB,kBAAkB,QAI7B"}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,GAaZ,MAAM,eAAe,CAAA;AAEtB,MAAM,CAAN,IAAY,SAGX;AAHD,WAAY,SAAS;IACnB,kCAAqB,CAAA;IACrB,kCAAqB,CAAA;AACvB,CAAC,EAHW,SAAS,KAAT,SAAS,QAGpB;AAwBD,OAAO,EACL,WAAW,GAaZ,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@botonic/plugin-hubtype-analytics",
3
- "version": "0.37.0",
3
+ "version": "0.37.1-alpha.0",
4
4
  "description": "Plugin for tracking in the Hubtype backend to see the results in the Hubtype Dashbord",
5
5
  "main": "./lib/cjs/index.js",
6
6
  "module": "./lib/esm/index.js",
@@ -14,7 +14,7 @@
14
14
  },
15
15
  "dependencies": {
16
16
  "@babel/runtime": "^7.26.0",
17
- "@botonic/core": "^0.37.0",
17
+ "@botonic/core": "0.37.1-alpha.0",
18
18
  "axios": "^1.10.0"
19
19
  },
20
20
  "devDependencies": {
package/src/types.ts CHANGED
@@ -1,166 +1,24 @@
1
+ import {
2
+ EventAction,
3
+ EventCustom,
4
+ EventFallback,
5
+ EventFeedback,
6
+ EventFeedbackKnowledgebase,
7
+ EventFlow,
8
+ EventHandoff,
9
+ EventHandoffOption,
10
+ EventIntentSmart,
11
+ EventKeyword,
12
+ EventKnowledgeBase,
13
+ EventWebviewEnd,
14
+ EventWebviewStep,
15
+ } from '@botonic/core'
16
+
1
17
  export enum EventType {
2
18
  BotEvent = 'botevent',
3
19
  WebEvent = 'webevent',
4
20
  }
5
21
 
6
- export enum EventAction {
7
- FeedbackCase = 'feedback_case',
8
- FeedbackMessage = 'feedback_message',
9
- FeedbackConversation = 'feedback_conversation',
10
- FeedbackKnowledgebase = 'feedback_knowledgebase',
11
- FeedbackWebview = 'feedback_webview',
12
- FlowNode = 'flow_node',
13
- HandoffOption = 'handoff_option',
14
- HandoffSuccess = 'handoff_success',
15
- HandoffFail = 'handoff_fail',
16
- Keyword = 'nlu_keyword',
17
- IntentSmart = 'nlu_intent_smart',
18
- Knowledgebase = 'knowledgebase',
19
- Fallback = 'fallback',
20
- WebviewStep = 'webview_step',
21
- WebviewEnd = 'webview_end',
22
- Custom = 'custom',
23
- }
24
-
25
- export interface HtBaseEventProps {
26
- action: EventAction
27
- }
28
-
29
- export interface EventFeedback extends HtBaseEventProps {
30
- action:
31
- | EventAction.FeedbackCase
32
- | EventAction.FeedbackConversation
33
- | EventAction.FeedbackMessage
34
- | EventAction.FeedbackWebview
35
- feedbackTargetId: string
36
- feedbackGroupId: string
37
- possibleOptions: string[]
38
- possibleValues?: number[]
39
- option: string
40
- value?: number
41
- comment?: string
42
- }
43
-
44
- export interface EventFeedbackKnowledgebase extends HtBaseEventProps {
45
- action: EventAction.FeedbackKnowledgebase
46
- knowledgebaseInferenceId: string
47
- feedbackBotInteractionId: string
48
- feedbackTargetId: string
49
- feedbackGroupId: string
50
- possibleOptions: string[]
51
- possibleValues?: number[]
52
- option: string
53
- value?: number
54
- comment?: string
55
- }
56
-
57
- export interface EventFlow extends HtBaseEventProps {
58
- action: EventAction.FlowNode
59
- flowThreadId: string
60
- flowId: string
61
- flowName: string
62
- flowNodeId: string
63
- flowNodeContentId: string
64
- flowNodeIsMeaningful?: boolean
65
- }
66
-
67
- export interface EventHandoff extends HtBaseEventProps {
68
- action: EventAction.HandoffSuccess | EventAction.HandoffFail
69
- flowThreadId?: string
70
- queueId: string
71
- queueName: string
72
- caseId?: string
73
- isQueueOpen?: boolean
74
- isAvailableAgent?: boolean
75
- isThresholdReached?: boolean
76
- }
77
-
78
- export interface EventHandoffOption extends HtBaseEventProps {
79
- action: EventAction.HandoffOption
80
- flowThreadId?: string
81
- queueId?: string
82
- queueName?: string
83
- }
84
-
85
- export interface EventKeyword extends HtBaseEventProps {
86
- action: EventAction.Keyword
87
- flowThreadId: string
88
- flowId: string
89
- flowNodeId: string
90
- nluKeywordName: string
91
- nluKeywordIsRegex?: boolean
92
- nluKeywordMessageId: string
93
- userInput: string
94
- }
95
-
96
- export interface EventIntentSmart extends HtBaseEventProps {
97
- action: EventAction.IntentSmart
98
- flowThreadId: string
99
- flowId: string
100
- flowNodeId: string
101
- nluIntentSmartTitle: string
102
- nluIntentSmartNumUsed: number
103
- nluIntentSmartMessageId: string
104
- userInput: string
105
- }
106
-
107
- export interface EventKnowledgeBase extends HtBaseEventProps {
108
- action: EventAction.Knowledgebase
109
- flowThreadId: string
110
- flowId: string
111
- flowNodeId: string
112
- knowledgebaseInferenceId: string
113
- knowledgebaseFailReason?: KnowledgebaseFailReason
114
- knowledgebaseSourcesIds: string[]
115
- knowledgebaseChunksIds: string[]
116
- knowledgebaseMessageId: string
117
- userInput: string
118
- }
119
-
120
- export enum KnowledgebaseFailReason {
121
- NoKnowledge = 'no_knowledge',
122
- Hallucination = 'hallucination',
123
- }
124
-
125
- export interface EventFallback extends HtBaseEventProps {
126
- action: EventAction.Fallback
127
- userInput: string
128
- fallbackOut: number
129
- fallbackMessageId: string
130
- }
131
-
132
- export interface EventWebviewStep extends HtBaseEventProps {
133
- action: EventAction.WebviewStep
134
- flowThreadId?: string
135
- webviewThreadId: string
136
- webviewName: string
137
- webviewStepName: string
138
- webviewStepNumber: number
139
- }
140
-
141
- export interface EventWebviewEnd extends HtBaseEventProps {
142
- action: EventAction.WebviewEnd
143
- flowThreadId?: string
144
- webviewThreadId: string
145
- webviewName: string
146
- webviewStepName?: string
147
- webviewStepNumber?: number
148
- webviewEndFailType?: WebviewEndFailType
149
- webviewEndFailMessage?: string
150
- }
151
-
152
- export enum WebviewEndFailType {
153
- CanceledByUser = 'canceled_by_user',
154
- ApiError = 'api_error',
155
- NeedsEscalation = 'needs_escalation',
156
- }
157
-
158
- export interface EventCustom extends HtBaseEventProps {
159
- action: EventAction.Custom
160
- customFields?: Record<string, any>
161
- customSensitiveFields?: Record<string, any>
162
- }
163
-
164
22
  export type HtEventProps =
165
23
  | EventFeedback
166
24
  | EventFeedbackKnowledgebase
@@ -182,3 +40,19 @@ export interface RequestData {
182
40
  userCountry: string
183
41
  systemLocale: string
184
42
  }
43
+
44
+ export {
45
+ EventAction,
46
+ EventCustom,
47
+ EventFallback,
48
+ EventFeedback,
49
+ EventFeedbackKnowledgebase,
50
+ EventFlow,
51
+ EventHandoff,
52
+ EventHandoffOption,
53
+ EventIntentSmart,
54
+ EventKeyword,
55
+ EventKnowledgeBase,
56
+ EventWebviewEnd,
57
+ EventWebviewStep,
58
+ }