@botonic/plugin-hubtype-analytics 0.36.1 → 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.
- package/lib/cjs/event-models/index.d.ts +0 -1
- package/lib/cjs/event-models/index.js +1 -3
- package/lib/cjs/event-models/index.js.map +1 -1
- package/lib/cjs/types.d.ts +3 -151
- package/lib/cjs/types.js +3 -32
- package/lib/cjs/types.js.map +1 -1
- package/lib/cjs/utils.js +0 -2
- package/lib/cjs/utils.js.map +1 -1
- package/lib/esm/event-models/index.d.ts +0 -1
- package/lib/esm/event-models/index.js +0 -1
- package/lib/esm/event-models/index.js.map +1 -1
- package/lib/esm/types.d.ts +3 -151
- package/lib/esm/types.js +2 -31
- package/lib/esm/types.js.map +1 -1
- package/lib/esm/utils.js +1 -3
- package/lib/esm/utils.js.map +1 -1
- package/package.json +2 -2
- package/src/event-models/index.ts +0 -1
- package/src/types.ts +32 -172
- package/src/utils.ts +0 -4
- package/lib/cjs/event-models/ht-event-intent.d.ts +0 -13
- package/lib/cjs/event-models/ht-event-intent.js +0 -22
- package/lib/cjs/event-models/ht-event-intent.js.map +0 -1
- package/lib/esm/event-models/ht-event-intent.d.ts +0 -13
- package/lib/esm/event-models/ht-event-intent.js +0 -18
- package/lib/esm/event-models/ht-event-intent.js.map +0 -1
- package/src/event-models/ht-event-intent.ts +0 -27
|
@@ -6,7 +6,6 @@ export { HtEventFeedbackKnowledgebase } from './ht-event-feedback-knowledgebase'
|
|
|
6
6
|
export { HtEventFlow } from './ht-event-flow';
|
|
7
7
|
export { HtEventHandoff } from './ht-event-handoff';
|
|
8
8
|
export { HtEventHandoffOption } from './ht-event-handoff-option';
|
|
9
|
-
export { HtEventIntent } from './ht-event-intent';
|
|
10
9
|
export { HtEventIntentSmart } from './ht-event-intent-smart';
|
|
11
10
|
export { HtEventKeyword } from './ht-event-keyword';
|
|
12
11
|
export { HtEventKnowledgeBase } from './ht-event-knowledge-base';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.HtEventWebviewStep = exports.HtEventWebviewEnd = exports.HtEventKnowledgeBase = exports.HtEventKeyword = exports.HtEventIntentSmart = exports.
|
|
3
|
+
exports.HtEventWebviewStep = exports.HtEventWebviewEnd = exports.HtEventKnowledgeBase = exports.HtEventKeyword = exports.HtEventIntentSmart = exports.HtEventHandoffOption = exports.HtEventHandoff = exports.HtEventFlow = exports.HtEventFeedbackKnowledgebase = exports.HtEventFeedback = exports.HtEventFallback = exports.HtEventCustom = exports.HtEvent = void 0;
|
|
4
4
|
var ht_event_1 = require("./ht-event");
|
|
5
5
|
Object.defineProperty(exports, "HtEvent", { enumerable: true, get: function () { return ht_event_1.HtEvent; } });
|
|
6
6
|
var ht_event_custom_1 = require("./ht-event-custom");
|
|
@@ -17,8 +17,6 @@ var ht_event_handoff_1 = require("./ht-event-handoff");
|
|
|
17
17
|
Object.defineProperty(exports, "HtEventHandoff", { enumerable: true, get: function () { return ht_event_handoff_1.HtEventHandoff; } });
|
|
18
18
|
var ht_event_handoff_option_1 = require("./ht-event-handoff-option");
|
|
19
19
|
Object.defineProperty(exports, "HtEventHandoffOption", { enumerable: true, get: function () { return ht_event_handoff_option_1.HtEventHandoffOption; } });
|
|
20
|
-
var ht_event_intent_1 = require("./ht-event-intent");
|
|
21
|
-
Object.defineProperty(exports, "HtEventIntent", { enumerable: true, get: function () { return ht_event_intent_1.HtEventIntent; } });
|
|
22
20
|
var ht_event_intent_smart_1 = require("./ht-event-intent-smart");
|
|
23
21
|
Object.defineProperty(exports, "HtEventIntentSmart", { enumerable: true, get: function () { return ht_event_intent_smart_1.HtEventIntentSmart; } });
|
|
24
22
|
var ht_event_keyword_1 = require("./ht-event-keyword");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/event-models/index.ts"],"names":[],"mappings":";;;AAAA,uCAAoC;AAA3B,mGAAA,OAAO,OAAA;AAChB,qDAAiD;AAAxC,gHAAA,aAAa,OAAA;AACtB,yDAAqD;AAA5C,oHAAA,eAAe,OAAA;AACxB,yDAAqD;AAA5C,oHAAA,eAAe,OAAA;AACxB,qFAAgF;AAAvE,+IAAA,4BAA4B,OAAA;AACrC,iDAA6C;AAApC,4GAAA,WAAW,OAAA;AACpB,uDAAmD;AAA1C,kHAAA,cAAc,OAAA;AACvB,qEAAgE;AAAvD,+HAAA,oBAAoB,OAAA;AAC7B,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/event-models/index.ts"],"names":[],"mappings":";;;AAAA,uCAAoC;AAA3B,mGAAA,OAAO,OAAA;AAChB,qDAAiD;AAAxC,gHAAA,aAAa,OAAA;AACtB,yDAAqD;AAA5C,oHAAA,eAAe,OAAA;AACxB,yDAAqD;AAA5C,oHAAA,eAAe,OAAA;AACxB,qFAAgF;AAAvE,+IAAA,4BAA4B,OAAA;AACrC,iDAA6C;AAApC,4GAAA,WAAW,OAAA;AACpB,uDAAmD;AAA1C,kHAAA,cAAc,OAAA;AACvB,qEAAgE;AAAvD,+HAAA,oBAAoB,OAAA;AAC7B,iEAA4D;AAAnD,2HAAA,kBAAkB,OAAA;AAC3B,uDAAmD;AAA1C,kHAAA,cAAc,OAAA;AACvB,qEAAgE;AAAvD,+HAAA,oBAAoB,OAAA;AAC7B,+DAA0D;AAAjD,yHAAA,iBAAiB,OAAA;AAC1B,iEAA4D;AAAnD,2HAAA,kBAAkB,OAAA"}
|
package/lib/cjs/types.d.ts
CHANGED
|
@@ -1,158 +1,9 @@
|
|
|
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
|
|
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
|
-
Intent = "nlu_intent",
|
|
17
|
-
IntentSmart = "nlu_intent_smart",
|
|
18
|
-
Knowledgebase = "knowledgebase",
|
|
19
|
-
Fallback = "fallback",
|
|
20
|
-
WebviewStep = "webview_step",
|
|
21
|
-
WebviewEnd = "webview_end",
|
|
22
|
-
Custom = "custom"
|
|
23
|
-
}
|
|
24
|
-
export interface HtBaseEventProps {
|
|
25
|
-
action: EventAction;
|
|
26
|
-
}
|
|
27
|
-
export interface EventFeedback extends HtBaseEventProps {
|
|
28
|
-
action: EventAction.FeedbackCase | EventAction.FeedbackConversation | EventAction.FeedbackMessage | EventAction.FeedbackWebview;
|
|
29
|
-
feedbackTargetId: string;
|
|
30
|
-
feedbackGroupId: string;
|
|
31
|
-
possibleOptions: string[];
|
|
32
|
-
possibleValues?: number[];
|
|
33
|
-
option: string;
|
|
34
|
-
value?: number;
|
|
35
|
-
comment?: string;
|
|
36
|
-
}
|
|
37
|
-
export interface EventFeedbackKnowledgebase extends HtBaseEventProps {
|
|
38
|
-
action: EventAction.FeedbackKnowledgebase;
|
|
39
|
-
knowledgebaseInferenceId: string;
|
|
40
|
-
feedbackBotInteractionId: string;
|
|
41
|
-
feedbackTargetId: string;
|
|
42
|
-
feedbackGroupId: string;
|
|
43
|
-
possibleOptions: string[];
|
|
44
|
-
possibleValues?: number[];
|
|
45
|
-
option: string;
|
|
46
|
-
value?: number;
|
|
47
|
-
comment?: string;
|
|
48
|
-
}
|
|
49
|
-
export interface EventFlow extends HtBaseEventProps {
|
|
50
|
-
action: EventAction.FlowNode;
|
|
51
|
-
flowThreadId: string;
|
|
52
|
-
flowId: string;
|
|
53
|
-
flowName: string;
|
|
54
|
-
flowNodeId: string;
|
|
55
|
-
flowNodeContentId: string;
|
|
56
|
-
flowNodeIsMeaningful?: boolean;
|
|
57
|
-
}
|
|
58
|
-
export interface EventHandoff extends HtBaseEventProps {
|
|
59
|
-
action: EventAction.HandoffSuccess | EventAction.HandoffFail;
|
|
60
|
-
flowThreadId?: string;
|
|
61
|
-
queueId: string;
|
|
62
|
-
queueName: string;
|
|
63
|
-
caseId?: string;
|
|
64
|
-
isQueueOpen?: boolean;
|
|
65
|
-
isAvailableAgent?: boolean;
|
|
66
|
-
isThresholdReached?: boolean;
|
|
67
|
-
}
|
|
68
|
-
export interface EventHandoffOption extends HtBaseEventProps {
|
|
69
|
-
action: EventAction.HandoffOption;
|
|
70
|
-
flowThreadId?: string;
|
|
71
|
-
queueId?: string;
|
|
72
|
-
queueName?: string;
|
|
73
|
-
}
|
|
74
|
-
export interface EventIntent extends HtBaseEventProps {
|
|
75
|
-
action: EventAction.Intent;
|
|
76
|
-
flowThreadId: string;
|
|
77
|
-
flowId: string;
|
|
78
|
-
flowNodeId: string;
|
|
79
|
-
nluIntentLabel: string;
|
|
80
|
-
nluIntentConfidence: number;
|
|
81
|
-
nluIntentThreshold: number;
|
|
82
|
-
nluIntentMessageId: string;
|
|
83
|
-
userInput: string;
|
|
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
|
-
export interface EventIntentSmart extends HtBaseEventProps {
|
|
96
|
-
action: EventAction.IntentSmart;
|
|
97
|
-
flowThreadId: string;
|
|
98
|
-
flowId: string;
|
|
99
|
-
flowNodeId: string;
|
|
100
|
-
nluIntentSmartTitle: string;
|
|
101
|
-
nluIntentSmartNumUsed: number;
|
|
102
|
-
nluIntentSmartMessageId: string;
|
|
103
|
-
userInput: string;
|
|
104
|
-
}
|
|
105
|
-
export interface EventKnowledgeBase extends HtBaseEventProps {
|
|
106
|
-
action: EventAction.Knowledgebase;
|
|
107
|
-
flowThreadId: string;
|
|
108
|
-
flowId: string;
|
|
109
|
-
flowNodeId: string;
|
|
110
|
-
knowledgebaseInferenceId: string;
|
|
111
|
-
knowledgebaseFailReason?: KnowledgebaseFailReason;
|
|
112
|
-
knowledgebaseSourcesIds: string[];
|
|
113
|
-
knowledgebaseChunksIds: string[];
|
|
114
|
-
knowledgebaseMessageId: string;
|
|
115
|
-
userInput: string;
|
|
116
|
-
}
|
|
117
|
-
export declare enum KnowledgebaseFailReason {
|
|
118
|
-
NoKnowledge = "no_knowledge",
|
|
119
|
-
Hallucination = "hallucination"
|
|
120
|
-
}
|
|
121
|
-
export interface EventFallback extends HtBaseEventProps {
|
|
122
|
-
action: EventAction.Fallback;
|
|
123
|
-
userInput: string;
|
|
124
|
-
fallbackOut: number;
|
|
125
|
-
fallbackMessageId: string;
|
|
126
|
-
}
|
|
127
|
-
export interface EventWebviewStep extends HtBaseEventProps {
|
|
128
|
-
action: EventAction.WebviewStep;
|
|
129
|
-
flowThreadId?: string;
|
|
130
|
-
webviewThreadId: string;
|
|
131
|
-
webviewName: string;
|
|
132
|
-
webviewStepName: string;
|
|
133
|
-
webviewStepNumber: number;
|
|
134
|
-
}
|
|
135
|
-
export interface EventWebviewEnd extends HtBaseEventProps {
|
|
136
|
-
action: EventAction.WebviewEnd;
|
|
137
|
-
flowThreadId?: string;
|
|
138
|
-
webviewThreadId: string;
|
|
139
|
-
webviewName: string;
|
|
140
|
-
webviewStepName?: string;
|
|
141
|
-
webviewStepNumber?: number;
|
|
142
|
-
webviewEndFailType?: WebviewEndFailType;
|
|
143
|
-
webviewEndFailMessage?: string;
|
|
144
|
-
}
|
|
145
|
-
export declare enum WebviewEndFailType {
|
|
146
|
-
CanceledByUser = "canceled_by_user",
|
|
147
|
-
ApiError = "api_error",
|
|
148
|
-
NeedsEscalation = "needs_escalation"
|
|
149
|
-
}
|
|
150
|
-
export interface EventCustom extends HtBaseEventProps {
|
|
151
|
-
action: EventAction.Custom;
|
|
152
|
-
customFields?: Record<string, any>;
|
|
153
|
-
customSensitiveFields?: Record<string, any>;
|
|
154
|
-
}
|
|
155
|
-
export type HtEventProps = EventFeedback | EventFeedbackKnowledgebase | EventFlow | EventHandoff | EventHandoffOption | EventIntent | EventKeyword | EventIntentSmart | EventKnowledgeBase | EventFallback | EventWebviewStep | EventWebviewEnd | EventCustom;
|
|
6
|
+
export type HtEventProps = EventFeedback | EventFeedbackKnowledgebase | EventFlow | EventHandoff | EventHandoffOption | EventKeyword | EventIntentSmart | EventKnowledgeBase | EventFallback | EventWebviewStep | EventWebviewEnd | EventCustom;
|
|
156
7
|
export interface RequestData {
|
|
157
8
|
userId?: string;
|
|
158
9
|
botInteractionId: string;
|
|
@@ -160,3 +11,4 @@ export interface RequestData {
|
|
|
160
11
|
userCountry: string;
|
|
161
12
|
systemLocale: string;
|
|
162
13
|
}
|
|
14
|
+
export { EventAction, EventCustom, EventFallback, EventFeedback, EventFeedbackKnowledgebase, EventFlow, EventHandoff, EventHandoffOption, EventIntentSmart, EventKeyword, EventKnowledgeBase, EventWebviewEnd, EventWebviewStep, };
|
package/lib/cjs/types.js
CHANGED
|
@@ -1,40 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
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["Intent"] = "nlu_intent";
|
|
22
|
-
EventAction["IntentSmart"] = "nlu_intent_smart";
|
|
23
|
-
EventAction["Knowledgebase"] = "knowledgebase";
|
|
24
|
-
EventAction["Fallback"] = "fallback";
|
|
25
|
-
EventAction["WebviewStep"] = "webview_step";
|
|
26
|
-
EventAction["WebviewEnd"] = "webview_end";
|
|
27
|
-
EventAction["Custom"] = "custom";
|
|
28
|
-
})(EventAction = exports.EventAction || (exports.EventAction = {}));
|
|
29
|
-
var KnowledgebaseFailReason;
|
|
30
|
-
(function (KnowledgebaseFailReason) {
|
|
31
|
-
KnowledgebaseFailReason["NoKnowledge"] = "no_knowledge";
|
|
32
|
-
KnowledgebaseFailReason["Hallucination"] = "hallucination";
|
|
33
|
-
})(KnowledgebaseFailReason = exports.KnowledgebaseFailReason || (exports.KnowledgebaseFailReason = {}));
|
|
34
|
-
var WebviewEndFailType;
|
|
35
|
-
(function (WebviewEndFailType) {
|
|
36
|
-
WebviewEndFailType["CanceledByUser"] = "canceled_by_user";
|
|
37
|
-
WebviewEndFailType["ApiError"] = "api_error";
|
|
38
|
-
WebviewEndFailType["NeedsEscalation"] = "needs_escalation";
|
|
39
|
-
})(WebviewEndFailType = exports.WebviewEndFailType || (exports.WebviewEndFailType = {}));
|
|
40
11
|
//# sourceMappingURL=types.js.map
|
package/lib/cjs/types.js.map
CHANGED
|
@@ -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
|
|
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"}
|
package/lib/cjs/utils.js
CHANGED
|
@@ -19,8 +19,6 @@ function createHtEvent(requestData, htEventProps) {
|
|
|
19
19
|
case types_1.EventAction.HandoffSuccess:
|
|
20
20
|
case types_1.EventAction.HandoffFail:
|
|
21
21
|
return new event_models_1.HtEventHandoff(htEventProps, requestData);
|
|
22
|
-
case types_1.EventAction.Intent:
|
|
23
|
-
return new event_models_1.HtEventIntent(htEventProps, requestData);
|
|
24
22
|
case types_1.EventAction.Keyword:
|
|
25
23
|
return new event_models_1.HtEventKeyword(htEventProps, requestData);
|
|
26
24
|
case types_1.EventAction.IntentSmart:
|
package/lib/cjs/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":";;;AAAA,iDAcuB;AACvB,mCAAgE;AAEhE,SAAgB,aAAa,CAC3B,WAAwB,EACxB,YAA0B;IAE1B,QAAQ,YAAY,CAAC,MAAM,EAAE;QAC3B,KAAK,mBAAW,CAAC,YAAY,CAAC;QAC9B,KAAK,mBAAW,CAAC,oBAAoB,CAAC;QACtC,KAAK,mBAAW,CAAC,eAAe,CAAC;QACjC,KAAK,mBAAW,CAAC,eAAe;YAC9B,OAAO,IAAI,8BAAe,CAAC,YAAY,EAAE,WAAW,CAAC,CAAA;QAEvD,KAAK,mBAAW,CAAC,qBAAqB;YACpC,OAAO,IAAI,2CAA4B,CAAC,YAAY,EAAE,WAAW,CAAC,CAAA;QAEpE,KAAK,mBAAW,CAAC,QAAQ;YACvB,OAAO,IAAI,0BAAW,CAAC,YAAY,EAAE,WAAW,CAAC,CAAA;QAEnD,KAAK,mBAAW,CAAC,aAAa;YAC5B,OAAO,IAAI,mCAAoB,CAAC,YAAY,EAAE,WAAW,CAAC,CAAA;QAE5D,KAAK,mBAAW,CAAC,cAAc,CAAC;QAChC,KAAK,mBAAW,CAAC,WAAW;YAC1B,OAAO,IAAI,6BAAc,CAAC,YAAY,EAAE,WAAW,CAAC,CAAA;QAEtD,KAAK,mBAAW,CAAC,OAAO;YACtB,OAAO,IAAI,6BAAc,CAAC,YAAY,EAAE,WAAW,CAAC,CAAA;QAEtD,KAAK,mBAAW,CAAC,WAAW;YAC1B,OAAO,IAAI,iCAAkB,CAAC,YAAY,EAAE,WAAW,CAAC,CAAA;QAE1D,KAAK,mBAAW,CAAC,aAAa;YAC5B,OAAO,IAAI,mCAAoB,CAAC,YAAY,EAAE,WAAW,CAAC,CAAA;QAE5D,KAAK,mBAAW,CAAC,QAAQ;YACvB,OAAO,IAAI,8BAAe,CAAC,YAAY,EAAE,WAAW,CAAC,CAAA;QAEvD,KAAK,mBAAW,CAAC,WAAW;YAC1B,OAAO,IAAI,iCAAkB,CAAC,YAAY,EAAE,WAAW,CAAC,CAAA;QAE1D,KAAK,mBAAW,CAAC,UAAU;YACzB,OAAO,IAAI,gCAAiB,CAAC,YAAY,EAAE,WAAW,CAAC,CAAA;QAEzD,KAAK,mBAAW,CAAC,MAAM;YACrB,OAAO,IAAI,4BAAa,CAAC,YAAY,EAAE,WAAW,CAAC,CAAA;QAErD;YACE,OAAO,IAAI,sBAAO,CAAC,YAAY,EAAE,WAAW,CAAC,CAAA;KAChD;AACH,CAAC;AAhDD,sCAgDC"}
|
|
@@ -6,7 +6,6 @@ export { HtEventFeedbackKnowledgebase } from './ht-event-feedback-knowledgebase'
|
|
|
6
6
|
export { HtEventFlow } from './ht-event-flow';
|
|
7
7
|
export { HtEventHandoff } from './ht-event-handoff';
|
|
8
8
|
export { HtEventHandoffOption } from './ht-event-handoff-option';
|
|
9
|
-
export { HtEventIntent } from './ht-event-intent';
|
|
10
9
|
export { HtEventIntentSmart } from './ht-event-intent-smart';
|
|
11
10
|
export { HtEventKeyword } from './ht-event-keyword';
|
|
12
11
|
export { HtEventKnowledgeBase } from './ht-event-knowledge-base';
|
|
@@ -6,7 +6,6 @@ export { HtEventFeedbackKnowledgebase } from './ht-event-feedback-knowledgebase'
|
|
|
6
6
|
export { HtEventFlow } from './ht-event-flow';
|
|
7
7
|
export { HtEventHandoff } from './ht-event-handoff';
|
|
8
8
|
export { HtEventHandoffOption } from './ht-event-handoff-option';
|
|
9
|
-
export { HtEventIntent } from './ht-event-intent';
|
|
10
9
|
export { HtEventIntentSmart } from './ht-event-intent-smart';
|
|
11
10
|
export { HtEventKeyword } from './ht-event-keyword';
|
|
12
11
|
export { HtEventKnowledgeBase } from './ht-event-knowledge-base';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/event-models/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AACpC,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AACrD,OAAO,EAAE,4BAA4B,EAAE,MAAM,mCAAmC,CAAA;AAChF,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAC7C,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAA;AACnD,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAA;AAChE,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/event-models/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AACpC,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AACrD,OAAO,EAAE,4BAA4B,EAAE,MAAM,mCAAmC,CAAA;AAChF,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAC7C,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAA;AACnD,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAA;AAChE,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAA;AACnD,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAA;AAChE,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAA;AAC1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA"}
|
package/lib/esm/types.d.ts
CHANGED
|
@@ -1,158 +1,9 @@
|
|
|
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
|
|
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
|
-
Intent = "nlu_intent",
|
|
17
|
-
IntentSmart = "nlu_intent_smart",
|
|
18
|
-
Knowledgebase = "knowledgebase",
|
|
19
|
-
Fallback = "fallback",
|
|
20
|
-
WebviewStep = "webview_step",
|
|
21
|
-
WebviewEnd = "webview_end",
|
|
22
|
-
Custom = "custom"
|
|
23
|
-
}
|
|
24
|
-
export interface HtBaseEventProps {
|
|
25
|
-
action: EventAction;
|
|
26
|
-
}
|
|
27
|
-
export interface EventFeedback extends HtBaseEventProps {
|
|
28
|
-
action: EventAction.FeedbackCase | EventAction.FeedbackConversation | EventAction.FeedbackMessage | EventAction.FeedbackWebview;
|
|
29
|
-
feedbackTargetId: string;
|
|
30
|
-
feedbackGroupId: string;
|
|
31
|
-
possibleOptions: string[];
|
|
32
|
-
possibleValues?: number[];
|
|
33
|
-
option: string;
|
|
34
|
-
value?: number;
|
|
35
|
-
comment?: string;
|
|
36
|
-
}
|
|
37
|
-
export interface EventFeedbackKnowledgebase extends HtBaseEventProps {
|
|
38
|
-
action: EventAction.FeedbackKnowledgebase;
|
|
39
|
-
knowledgebaseInferenceId: string;
|
|
40
|
-
feedbackBotInteractionId: string;
|
|
41
|
-
feedbackTargetId: string;
|
|
42
|
-
feedbackGroupId: string;
|
|
43
|
-
possibleOptions: string[];
|
|
44
|
-
possibleValues?: number[];
|
|
45
|
-
option: string;
|
|
46
|
-
value?: number;
|
|
47
|
-
comment?: string;
|
|
48
|
-
}
|
|
49
|
-
export interface EventFlow extends HtBaseEventProps {
|
|
50
|
-
action: EventAction.FlowNode;
|
|
51
|
-
flowThreadId: string;
|
|
52
|
-
flowId: string;
|
|
53
|
-
flowName: string;
|
|
54
|
-
flowNodeId: string;
|
|
55
|
-
flowNodeContentId: string;
|
|
56
|
-
flowNodeIsMeaningful?: boolean;
|
|
57
|
-
}
|
|
58
|
-
export interface EventHandoff extends HtBaseEventProps {
|
|
59
|
-
action: EventAction.HandoffSuccess | EventAction.HandoffFail;
|
|
60
|
-
flowThreadId?: string;
|
|
61
|
-
queueId: string;
|
|
62
|
-
queueName: string;
|
|
63
|
-
caseId?: string;
|
|
64
|
-
isQueueOpen?: boolean;
|
|
65
|
-
isAvailableAgent?: boolean;
|
|
66
|
-
isThresholdReached?: boolean;
|
|
67
|
-
}
|
|
68
|
-
export interface EventHandoffOption extends HtBaseEventProps {
|
|
69
|
-
action: EventAction.HandoffOption;
|
|
70
|
-
flowThreadId?: string;
|
|
71
|
-
queueId?: string;
|
|
72
|
-
queueName?: string;
|
|
73
|
-
}
|
|
74
|
-
export interface EventIntent extends HtBaseEventProps {
|
|
75
|
-
action: EventAction.Intent;
|
|
76
|
-
flowThreadId: string;
|
|
77
|
-
flowId: string;
|
|
78
|
-
flowNodeId: string;
|
|
79
|
-
nluIntentLabel: string;
|
|
80
|
-
nluIntentConfidence: number;
|
|
81
|
-
nluIntentThreshold: number;
|
|
82
|
-
nluIntentMessageId: string;
|
|
83
|
-
userInput: string;
|
|
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
|
-
export interface EventIntentSmart extends HtBaseEventProps {
|
|
96
|
-
action: EventAction.IntentSmart;
|
|
97
|
-
flowThreadId: string;
|
|
98
|
-
flowId: string;
|
|
99
|
-
flowNodeId: string;
|
|
100
|
-
nluIntentSmartTitle: string;
|
|
101
|
-
nluIntentSmartNumUsed: number;
|
|
102
|
-
nluIntentSmartMessageId: string;
|
|
103
|
-
userInput: string;
|
|
104
|
-
}
|
|
105
|
-
export interface EventKnowledgeBase extends HtBaseEventProps {
|
|
106
|
-
action: EventAction.Knowledgebase;
|
|
107
|
-
flowThreadId: string;
|
|
108
|
-
flowId: string;
|
|
109
|
-
flowNodeId: string;
|
|
110
|
-
knowledgebaseInferenceId: string;
|
|
111
|
-
knowledgebaseFailReason?: KnowledgebaseFailReason;
|
|
112
|
-
knowledgebaseSourcesIds: string[];
|
|
113
|
-
knowledgebaseChunksIds: string[];
|
|
114
|
-
knowledgebaseMessageId: string;
|
|
115
|
-
userInput: string;
|
|
116
|
-
}
|
|
117
|
-
export declare enum KnowledgebaseFailReason {
|
|
118
|
-
NoKnowledge = "no_knowledge",
|
|
119
|
-
Hallucination = "hallucination"
|
|
120
|
-
}
|
|
121
|
-
export interface EventFallback extends HtBaseEventProps {
|
|
122
|
-
action: EventAction.Fallback;
|
|
123
|
-
userInput: string;
|
|
124
|
-
fallbackOut: number;
|
|
125
|
-
fallbackMessageId: string;
|
|
126
|
-
}
|
|
127
|
-
export interface EventWebviewStep extends HtBaseEventProps {
|
|
128
|
-
action: EventAction.WebviewStep;
|
|
129
|
-
flowThreadId?: string;
|
|
130
|
-
webviewThreadId: string;
|
|
131
|
-
webviewName: string;
|
|
132
|
-
webviewStepName: string;
|
|
133
|
-
webviewStepNumber: number;
|
|
134
|
-
}
|
|
135
|
-
export interface EventWebviewEnd extends HtBaseEventProps {
|
|
136
|
-
action: EventAction.WebviewEnd;
|
|
137
|
-
flowThreadId?: string;
|
|
138
|
-
webviewThreadId: string;
|
|
139
|
-
webviewName: string;
|
|
140
|
-
webviewStepName?: string;
|
|
141
|
-
webviewStepNumber?: number;
|
|
142
|
-
webviewEndFailType?: WebviewEndFailType;
|
|
143
|
-
webviewEndFailMessage?: string;
|
|
144
|
-
}
|
|
145
|
-
export declare enum WebviewEndFailType {
|
|
146
|
-
CanceledByUser = "canceled_by_user",
|
|
147
|
-
ApiError = "api_error",
|
|
148
|
-
NeedsEscalation = "needs_escalation"
|
|
149
|
-
}
|
|
150
|
-
export interface EventCustom extends HtBaseEventProps {
|
|
151
|
-
action: EventAction.Custom;
|
|
152
|
-
customFields?: Record<string, any>;
|
|
153
|
-
customSensitiveFields?: Record<string, any>;
|
|
154
|
-
}
|
|
155
|
-
export type HtEventProps = EventFeedback | EventFeedbackKnowledgebase | EventFlow | EventHandoff | EventHandoffOption | EventIntent | EventKeyword | EventIntentSmart | EventKnowledgeBase | EventFallback | EventWebviewStep | EventWebviewEnd | EventCustom;
|
|
6
|
+
export type HtEventProps = EventFeedback | EventFeedbackKnowledgebase | EventFlow | EventHandoff | EventHandoffOption | EventKeyword | EventIntentSmart | EventKnowledgeBase | EventFallback | EventWebviewStep | EventWebviewEnd | EventCustom;
|
|
156
7
|
export interface RequestData {
|
|
157
8
|
userId?: string;
|
|
158
9
|
botInteractionId: string;
|
|
@@ -160,3 +11,4 @@ export interface RequestData {
|
|
|
160
11
|
userCountry: string;
|
|
161
12
|
systemLocale: string;
|
|
162
13
|
}
|
|
14
|
+
export { EventAction, EventCustom, EventFallback, EventFeedback, EventFeedbackKnowledgebase, EventFlow, EventHandoff, EventHandoffOption, EventIntentSmart, EventKeyword, EventKnowledgeBase, EventWebviewEnd, EventWebviewStep, };
|
package/lib/esm/types.js
CHANGED
|
@@ -1,37 +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
|
|
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["Intent"] = "nlu_intent";
|
|
19
|
-
EventAction["IntentSmart"] = "nlu_intent_smart";
|
|
20
|
-
EventAction["Knowledgebase"] = "knowledgebase";
|
|
21
|
-
EventAction["Fallback"] = "fallback";
|
|
22
|
-
EventAction["WebviewStep"] = "webview_step";
|
|
23
|
-
EventAction["WebviewEnd"] = "webview_end";
|
|
24
|
-
EventAction["Custom"] = "custom";
|
|
25
|
-
})(EventAction || (EventAction = {}));
|
|
26
|
-
export var KnowledgebaseFailReason;
|
|
27
|
-
(function (KnowledgebaseFailReason) {
|
|
28
|
-
KnowledgebaseFailReason["NoKnowledge"] = "no_knowledge";
|
|
29
|
-
KnowledgebaseFailReason["Hallucination"] = "hallucination";
|
|
30
|
-
})(KnowledgebaseFailReason || (KnowledgebaseFailReason = {}));
|
|
31
|
-
export var WebviewEndFailType;
|
|
32
|
-
(function (WebviewEndFailType) {
|
|
33
|
-
WebviewEndFailType["CanceledByUser"] = "canceled_by_user";
|
|
34
|
-
WebviewEndFailType["ApiError"] = "api_error";
|
|
35
|
-
WebviewEndFailType["NeedsEscalation"] = "needs_escalation";
|
|
36
|
-
})(WebviewEndFailType || (WebviewEndFailType = {}));
|
|
7
|
+
export { EventAction, };
|
|
37
8
|
//# sourceMappingURL=types.js.map
|
package/lib/esm/types.js.map
CHANGED
|
@@ -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;
|
|
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/lib/esm/utils.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { HtEvent, HtEventCustom, HtEventFallback, HtEventFeedback, HtEventFeedbackKnowledgebase, HtEventFlow, HtEventHandoff, HtEventHandoffOption,
|
|
1
|
+
import { HtEvent, HtEventCustom, HtEventFallback, HtEventFeedback, HtEventFeedbackKnowledgebase, HtEventFlow, HtEventHandoff, HtEventHandoffOption, HtEventIntentSmart, HtEventKeyword, HtEventKnowledgeBase, HtEventWebviewEnd, HtEventWebviewStep, } from './event-models';
|
|
2
2
|
import { EventAction } from './types';
|
|
3
3
|
export function createHtEvent(requestData, htEventProps) {
|
|
4
4
|
switch (htEventProps.action) {
|
|
@@ -16,8 +16,6 @@ export function createHtEvent(requestData, htEventProps) {
|
|
|
16
16
|
case EventAction.HandoffSuccess:
|
|
17
17
|
case EventAction.HandoffFail:
|
|
18
18
|
return new HtEventHandoff(htEventProps, requestData);
|
|
19
|
-
case EventAction.Intent:
|
|
20
|
-
return new HtEventIntent(htEventProps, requestData);
|
|
21
19
|
case EventAction.Keyword:
|
|
22
20
|
return new HtEventKeyword(htEventProps, requestData);
|
|
23
21
|
case EventAction.IntentSmart:
|
package/lib/esm/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EACP,aAAa,EACb,eAAe,EACf,eAAe,EACf,4BAA4B,EAC5B,WAAW,EACX,cAAc,EACd,oBAAoB,EACpB,
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EACP,aAAa,EACb,eAAe,EACf,eAAe,EACf,4BAA4B,EAC5B,WAAW,EACX,cAAc,EACd,oBAAoB,EACpB,kBAAkB,EAClB,cAAc,EACd,oBAAoB,EACpB,iBAAiB,EACjB,kBAAkB,GACnB,MAAM,gBAAgB,CAAA;AACvB,OAAO,EAAE,WAAW,EAA6B,MAAM,SAAS,CAAA;AAEhE,MAAM,UAAU,aAAa,CAC3B,WAAwB,EACxB,YAA0B;IAE1B,QAAQ,YAAY,CAAC,MAAM,EAAE;QAC3B,KAAK,WAAW,CAAC,YAAY,CAAC;QAC9B,KAAK,WAAW,CAAC,oBAAoB,CAAC;QACtC,KAAK,WAAW,CAAC,eAAe,CAAC;QACjC,KAAK,WAAW,CAAC,eAAe;YAC9B,OAAO,IAAI,eAAe,CAAC,YAAY,EAAE,WAAW,CAAC,CAAA;QAEvD,KAAK,WAAW,CAAC,qBAAqB;YACpC,OAAO,IAAI,4BAA4B,CAAC,YAAY,EAAE,WAAW,CAAC,CAAA;QAEpE,KAAK,WAAW,CAAC,QAAQ;YACvB,OAAO,IAAI,WAAW,CAAC,YAAY,EAAE,WAAW,CAAC,CAAA;QAEnD,KAAK,WAAW,CAAC,aAAa;YAC5B,OAAO,IAAI,oBAAoB,CAAC,YAAY,EAAE,WAAW,CAAC,CAAA;QAE5D,KAAK,WAAW,CAAC,cAAc,CAAC;QAChC,KAAK,WAAW,CAAC,WAAW;YAC1B,OAAO,IAAI,cAAc,CAAC,YAAY,EAAE,WAAW,CAAC,CAAA;QAEtD,KAAK,WAAW,CAAC,OAAO;YACtB,OAAO,IAAI,cAAc,CAAC,YAAY,EAAE,WAAW,CAAC,CAAA;QAEtD,KAAK,WAAW,CAAC,WAAW;YAC1B,OAAO,IAAI,kBAAkB,CAAC,YAAY,EAAE,WAAW,CAAC,CAAA;QAE1D,KAAK,WAAW,CAAC,aAAa;YAC5B,OAAO,IAAI,oBAAoB,CAAC,YAAY,EAAE,WAAW,CAAC,CAAA;QAE5D,KAAK,WAAW,CAAC,QAAQ;YACvB,OAAO,IAAI,eAAe,CAAC,YAAY,EAAE,WAAW,CAAC,CAAA;QAEvD,KAAK,WAAW,CAAC,WAAW;YAC1B,OAAO,IAAI,kBAAkB,CAAC,YAAY,EAAE,WAAW,CAAC,CAAA;QAE1D,KAAK,WAAW,CAAC,UAAU;YACzB,OAAO,IAAI,iBAAiB,CAAC,YAAY,EAAE,WAAW,CAAC,CAAA;QAEzD,KAAK,WAAW,CAAC,MAAM;YACrB,OAAO,IAAI,aAAa,CAAC,YAAY,EAAE,WAAW,CAAC,CAAA;QAErD;YACE,OAAO,IAAI,OAAO,CAAC,YAAY,EAAE,WAAW,CAAC,CAAA;KAChD;AACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@botonic/plugin-hubtype-analytics",
|
|
3
|
-
"version": "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": "
|
|
17
|
+
"@botonic/core": "0.37.1-alpha.0",
|
|
18
18
|
"axios": "^1.10.0"
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
|
@@ -6,7 +6,6 @@ export { HtEventFeedbackKnowledgebase } from './ht-event-feedback-knowledgebase'
|
|
|
6
6
|
export { HtEventFlow } from './ht-event-flow'
|
|
7
7
|
export { HtEventHandoff } from './ht-event-handoff'
|
|
8
8
|
export { HtEventHandoffOption } from './ht-event-handoff-option'
|
|
9
|
-
export { HtEventIntent } from './ht-event-intent'
|
|
10
9
|
export { HtEventIntentSmart } from './ht-event-intent-smart'
|
|
11
10
|
export { HtEventKeyword } from './ht-event-keyword'
|
|
12
11
|
export { HtEventKnowledgeBase } from './ht-event-knowledge-base'
|
package/src/types.ts
CHANGED
|
@@ -1,186 +1,30 @@
|
|
|
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
|
-
Intent = 'nlu_intent',
|
|
18
|
-
IntentSmart = 'nlu_intent_smart',
|
|
19
|
-
Knowledgebase = 'knowledgebase',
|
|
20
|
-
Fallback = 'fallback',
|
|
21
|
-
WebviewStep = 'webview_step',
|
|
22
|
-
WebviewEnd = 'webview_end',
|
|
23
|
-
Custom = 'custom',
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
export interface HtBaseEventProps {
|
|
27
|
-
action: EventAction
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
export interface EventFeedback extends HtBaseEventProps {
|
|
31
|
-
action:
|
|
32
|
-
| EventAction.FeedbackCase
|
|
33
|
-
| EventAction.FeedbackConversation
|
|
34
|
-
| EventAction.FeedbackMessage
|
|
35
|
-
| EventAction.FeedbackWebview
|
|
36
|
-
feedbackTargetId: string
|
|
37
|
-
feedbackGroupId: string
|
|
38
|
-
possibleOptions: string[]
|
|
39
|
-
possibleValues?: number[]
|
|
40
|
-
option: string
|
|
41
|
-
value?: number
|
|
42
|
-
comment?: string
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
export interface EventFeedbackKnowledgebase extends HtBaseEventProps {
|
|
46
|
-
action: EventAction.FeedbackKnowledgebase
|
|
47
|
-
knowledgebaseInferenceId: string
|
|
48
|
-
feedbackBotInteractionId: string
|
|
49
|
-
feedbackTargetId: string
|
|
50
|
-
feedbackGroupId: string
|
|
51
|
-
possibleOptions: string[]
|
|
52
|
-
possibleValues?: number[]
|
|
53
|
-
option: string
|
|
54
|
-
value?: number
|
|
55
|
-
comment?: string
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
export interface EventFlow extends HtBaseEventProps {
|
|
59
|
-
action: EventAction.FlowNode
|
|
60
|
-
flowThreadId: string
|
|
61
|
-
flowId: string
|
|
62
|
-
flowName: string
|
|
63
|
-
flowNodeId: string
|
|
64
|
-
flowNodeContentId: string
|
|
65
|
-
flowNodeIsMeaningful?: boolean
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
export interface EventHandoff extends HtBaseEventProps {
|
|
69
|
-
action: EventAction.HandoffSuccess | EventAction.HandoffFail
|
|
70
|
-
flowThreadId?: string
|
|
71
|
-
queueId: string
|
|
72
|
-
queueName: string
|
|
73
|
-
caseId?: string
|
|
74
|
-
isQueueOpen?: boolean
|
|
75
|
-
isAvailableAgent?: boolean
|
|
76
|
-
isThresholdReached?: boolean
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
export interface EventHandoffOption extends HtBaseEventProps {
|
|
80
|
-
action: EventAction.HandoffOption
|
|
81
|
-
flowThreadId?: string
|
|
82
|
-
queueId?: string
|
|
83
|
-
queueName?: string
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
export interface EventIntent extends HtBaseEventProps {
|
|
87
|
-
action: EventAction.Intent
|
|
88
|
-
flowThreadId: string
|
|
89
|
-
flowId: string
|
|
90
|
-
flowNodeId: string
|
|
91
|
-
nluIntentLabel: string
|
|
92
|
-
nluIntentConfidence: number
|
|
93
|
-
nluIntentThreshold: number
|
|
94
|
-
nluIntentMessageId: string
|
|
95
|
-
userInput: string
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
export interface EventKeyword extends HtBaseEventProps {
|
|
99
|
-
action: EventAction.Keyword
|
|
100
|
-
flowThreadId: string
|
|
101
|
-
flowId: string
|
|
102
|
-
flowNodeId: string
|
|
103
|
-
nluKeywordName: string
|
|
104
|
-
nluKeywordIsRegex?: boolean
|
|
105
|
-
nluKeywordMessageId: string
|
|
106
|
-
userInput: string
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
export interface EventIntentSmart extends HtBaseEventProps {
|
|
110
|
-
action: EventAction.IntentSmart
|
|
111
|
-
flowThreadId: string
|
|
112
|
-
flowId: string
|
|
113
|
-
flowNodeId: string
|
|
114
|
-
nluIntentSmartTitle: string
|
|
115
|
-
nluIntentSmartNumUsed: number
|
|
116
|
-
nluIntentSmartMessageId: string
|
|
117
|
-
userInput: string
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
export interface EventKnowledgeBase extends HtBaseEventProps {
|
|
121
|
-
action: EventAction.Knowledgebase
|
|
122
|
-
flowThreadId: string
|
|
123
|
-
flowId: string
|
|
124
|
-
flowNodeId: string
|
|
125
|
-
knowledgebaseInferenceId: string
|
|
126
|
-
knowledgebaseFailReason?: KnowledgebaseFailReason
|
|
127
|
-
knowledgebaseSourcesIds: string[]
|
|
128
|
-
knowledgebaseChunksIds: string[]
|
|
129
|
-
knowledgebaseMessageId: string
|
|
130
|
-
userInput: string
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
export enum KnowledgebaseFailReason {
|
|
134
|
-
NoKnowledge = 'no_knowledge',
|
|
135
|
-
Hallucination = 'hallucination',
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
export interface EventFallback extends HtBaseEventProps {
|
|
139
|
-
action: EventAction.Fallback
|
|
140
|
-
userInput: string
|
|
141
|
-
fallbackOut: number
|
|
142
|
-
fallbackMessageId: string
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
export interface EventWebviewStep extends HtBaseEventProps {
|
|
146
|
-
action: EventAction.WebviewStep
|
|
147
|
-
flowThreadId?: string
|
|
148
|
-
webviewThreadId: string
|
|
149
|
-
webviewName: string
|
|
150
|
-
webviewStepName: string
|
|
151
|
-
webviewStepNumber: number
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
export interface EventWebviewEnd extends HtBaseEventProps {
|
|
155
|
-
action: EventAction.WebviewEnd
|
|
156
|
-
flowThreadId?: string
|
|
157
|
-
webviewThreadId: string
|
|
158
|
-
webviewName: string
|
|
159
|
-
webviewStepName?: string
|
|
160
|
-
webviewStepNumber?: number
|
|
161
|
-
webviewEndFailType?: WebviewEndFailType
|
|
162
|
-
webviewEndFailMessage?: string
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
export enum WebviewEndFailType {
|
|
166
|
-
CanceledByUser = 'canceled_by_user',
|
|
167
|
-
ApiError = 'api_error',
|
|
168
|
-
NeedsEscalation = 'needs_escalation',
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
export interface EventCustom extends HtBaseEventProps {
|
|
172
|
-
action: EventAction.Custom
|
|
173
|
-
customFields?: Record<string, any>
|
|
174
|
-
customSensitiveFields?: Record<string, any>
|
|
175
|
-
}
|
|
176
|
-
|
|
177
22
|
export type HtEventProps =
|
|
178
23
|
| EventFeedback
|
|
179
24
|
| EventFeedbackKnowledgebase
|
|
180
25
|
| EventFlow
|
|
181
26
|
| EventHandoff
|
|
182
27
|
| EventHandoffOption
|
|
183
|
-
| EventIntent
|
|
184
28
|
| EventKeyword
|
|
185
29
|
| EventIntentSmart
|
|
186
30
|
| EventKnowledgeBase
|
|
@@ -196,3 +40,19 @@ export interface RequestData {
|
|
|
196
40
|
userCountry: string
|
|
197
41
|
systemLocale: string
|
|
198
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
|
+
}
|
package/src/utils.ts
CHANGED
|
@@ -7,7 +7,6 @@ import {
|
|
|
7
7
|
HtEventFlow,
|
|
8
8
|
HtEventHandoff,
|
|
9
9
|
HtEventHandoffOption,
|
|
10
|
-
HtEventIntent,
|
|
11
10
|
HtEventIntentSmart,
|
|
12
11
|
HtEventKeyword,
|
|
13
12
|
HtEventKnowledgeBase,
|
|
@@ -40,9 +39,6 @@ export function createHtEvent(
|
|
|
40
39
|
case EventAction.HandoffFail:
|
|
41
40
|
return new HtEventHandoff(htEventProps, requestData)
|
|
42
41
|
|
|
43
|
-
case EventAction.Intent:
|
|
44
|
-
return new HtEventIntent(htEventProps, requestData)
|
|
45
|
-
|
|
46
42
|
case EventAction.Keyword:
|
|
47
43
|
return new HtEventKeyword(htEventProps, requestData)
|
|
48
44
|
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { EventIntent, RequestData } from '../types';
|
|
2
|
-
import { HtEvent } from './ht-event';
|
|
3
|
-
export declare class HtEventIntent extends HtEvent {
|
|
4
|
-
nlu_intent_label: string;
|
|
5
|
-
nlu_intent_confidence: number;
|
|
6
|
-
nlu_intent_threshold: number;
|
|
7
|
-
nlu_intent_message_id: string;
|
|
8
|
-
user_input: string;
|
|
9
|
-
flow_thread_id: string;
|
|
10
|
-
flow_id: string;
|
|
11
|
-
flow_node_id: string;
|
|
12
|
-
constructor(event: EventIntent, requestData: RequestData);
|
|
13
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.HtEventIntent = void 0;
|
|
4
|
-
const types_1 = require("../types");
|
|
5
|
-
const ht_event_1 = require("./ht-event");
|
|
6
|
-
class HtEventIntent extends ht_event_1.HtEvent {
|
|
7
|
-
constructor(event, requestData) {
|
|
8
|
-
super(event, requestData);
|
|
9
|
-
this.type = types_1.EventType.BotEvent;
|
|
10
|
-
this.action = types_1.EventAction.Intent;
|
|
11
|
-
this.nlu_intent_label = event.nluIntentLabel;
|
|
12
|
-
this.nlu_intent_confidence = event.nluIntentConfidence;
|
|
13
|
-
this.nlu_intent_threshold = event.nluIntentThreshold;
|
|
14
|
-
this.nlu_intent_message_id = event.nluIntentMessageId;
|
|
15
|
-
this.user_input = event.userInput;
|
|
16
|
-
this.flow_thread_id = event.flowThreadId;
|
|
17
|
-
this.flow_id = event.flowId;
|
|
18
|
-
this.flow_node_id = event.flowNodeId;
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
exports.HtEventIntent = HtEventIntent;
|
|
22
|
-
//# sourceMappingURL=ht-event-intent.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ht-event-intent.js","sourceRoot":"","sources":["../../../src/event-models/ht-event-intent.ts"],"names":[],"mappings":";;;AAAA,oCAA2E;AAC3E,yCAAoC;AAEpC,MAAa,aAAc,SAAQ,kBAAO;IAUxC,YAAY,KAAkB,EAAE,WAAwB;QACtD,KAAK,CAAC,KAAK,EAAE,WAAW,CAAC,CAAA;QACzB,IAAI,CAAC,IAAI,GAAG,iBAAS,CAAC,QAAQ,CAAA;QAC9B,IAAI,CAAC,MAAM,GAAG,mBAAW,CAAC,MAAM,CAAA;QAChC,IAAI,CAAC,gBAAgB,GAAG,KAAK,CAAC,cAAc,CAAA;QAC5C,IAAI,CAAC,qBAAqB,GAAG,KAAK,CAAC,mBAAmB,CAAA;QACtD,IAAI,CAAC,oBAAoB,GAAG,KAAK,CAAC,kBAAkB,CAAA;QACpD,IAAI,CAAC,qBAAqB,GAAG,KAAK,CAAC,kBAAkB,CAAA;QACrD,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC,SAAS,CAAA;QACjC,IAAI,CAAC,cAAc,GAAG,KAAK,CAAC,YAAY,CAAA;QACxC,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC,MAAM,CAAA;QAC3B,IAAI,CAAC,YAAY,GAAG,KAAK,CAAC,UAAU,CAAA;IACtC,CAAC;CACF;AAvBD,sCAuBC"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { EventIntent, RequestData } from '../types';
|
|
2
|
-
import { HtEvent } from './ht-event';
|
|
3
|
-
export declare class HtEventIntent extends HtEvent {
|
|
4
|
-
nlu_intent_label: string;
|
|
5
|
-
nlu_intent_confidence: number;
|
|
6
|
-
nlu_intent_threshold: number;
|
|
7
|
-
nlu_intent_message_id: string;
|
|
8
|
-
user_input: string;
|
|
9
|
-
flow_thread_id: string;
|
|
10
|
-
flow_id: string;
|
|
11
|
-
flow_node_id: string;
|
|
12
|
-
constructor(event: EventIntent, requestData: RequestData);
|
|
13
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { EventAction, EventType } from '../types';
|
|
2
|
-
import { HtEvent } from './ht-event';
|
|
3
|
-
export class HtEventIntent extends HtEvent {
|
|
4
|
-
constructor(event, requestData) {
|
|
5
|
-
super(event, requestData);
|
|
6
|
-
this.type = EventType.BotEvent;
|
|
7
|
-
this.action = EventAction.Intent;
|
|
8
|
-
this.nlu_intent_label = event.nluIntentLabel;
|
|
9
|
-
this.nlu_intent_confidence = event.nluIntentConfidence;
|
|
10
|
-
this.nlu_intent_threshold = event.nluIntentThreshold;
|
|
11
|
-
this.nlu_intent_message_id = event.nluIntentMessageId;
|
|
12
|
-
this.user_input = event.userInput;
|
|
13
|
-
this.flow_thread_id = event.flowThreadId;
|
|
14
|
-
this.flow_id = event.flowId;
|
|
15
|
-
this.flow_node_id = event.flowNodeId;
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
//# sourceMappingURL=ht-event-intent.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ht-event-intent.js","sourceRoot":"","sources":["../../../src/event-models/ht-event-intent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAe,SAAS,EAAe,MAAM,UAAU,CAAA;AAC3E,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AAEpC,MAAM,OAAO,aAAc,SAAQ,OAAO;IAUxC,YAAY,KAAkB,EAAE,WAAwB;QACtD,KAAK,CAAC,KAAK,EAAE,WAAW,CAAC,CAAA;QACzB,IAAI,CAAC,IAAI,GAAG,SAAS,CAAC,QAAQ,CAAA;QAC9B,IAAI,CAAC,MAAM,GAAG,WAAW,CAAC,MAAM,CAAA;QAChC,IAAI,CAAC,gBAAgB,GAAG,KAAK,CAAC,cAAc,CAAA;QAC5C,IAAI,CAAC,qBAAqB,GAAG,KAAK,CAAC,mBAAmB,CAAA;QACtD,IAAI,CAAC,oBAAoB,GAAG,KAAK,CAAC,kBAAkB,CAAA;QACpD,IAAI,CAAC,qBAAqB,GAAG,KAAK,CAAC,kBAAkB,CAAA;QACrD,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC,SAAS,CAAA;QACjC,IAAI,CAAC,cAAc,GAAG,KAAK,CAAC,YAAY,CAAA;QACxC,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC,MAAM,CAAA;QAC3B,IAAI,CAAC,YAAY,GAAG,KAAK,CAAC,UAAU,CAAA;IACtC,CAAC;CACF"}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { EventAction, EventIntent, EventType, RequestData } from '../types'
|
|
2
|
-
import { HtEvent } from './ht-event'
|
|
3
|
-
|
|
4
|
-
export class HtEventIntent extends HtEvent {
|
|
5
|
-
nlu_intent_label: string
|
|
6
|
-
nlu_intent_confidence: number
|
|
7
|
-
nlu_intent_threshold: number
|
|
8
|
-
nlu_intent_message_id: string
|
|
9
|
-
user_input: string
|
|
10
|
-
flow_thread_id: string
|
|
11
|
-
flow_id: string
|
|
12
|
-
flow_node_id: string
|
|
13
|
-
|
|
14
|
-
constructor(event: EventIntent, requestData: RequestData) {
|
|
15
|
-
super(event, requestData)
|
|
16
|
-
this.type = EventType.BotEvent
|
|
17
|
-
this.action = EventAction.Intent
|
|
18
|
-
this.nlu_intent_label = event.nluIntentLabel
|
|
19
|
-
this.nlu_intent_confidence = event.nluIntentConfidence
|
|
20
|
-
this.nlu_intent_threshold = event.nluIntentThreshold
|
|
21
|
-
this.nlu_intent_message_id = event.nluIntentMessageId
|
|
22
|
-
this.user_input = event.userInput
|
|
23
|
-
this.flow_thread_id = event.flowThreadId
|
|
24
|
-
this.flow_id = event.flowId
|
|
25
|
-
this.flow_node_id = event.flowNodeId
|
|
26
|
-
}
|
|
27
|
-
}
|