@botonic/plugin-hubtype-analytics 0.27.0-alpha.0 → 0.27.0-alpha.1
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/ht-event-custom.d.ts +2 -1
- package/lib/cjs/event-models/ht-event-custom.js +2 -10
- package/lib/cjs/event-models/ht-event-custom.js.map +1 -1
- package/lib/cjs/event-models/ht-event-fallback.d.ts +3 -2
- package/lib/cjs/event-models/ht-event-fallback.js +3 -2
- package/lib/cjs/event-models/ht-event-fallback.js.map +1 -1
- package/lib/cjs/event-models/ht-event-feedback.d.ts +1 -1
- package/lib/cjs/event-models/ht-event-feedback.js +1 -1
- package/lib/cjs/event-models/ht-event-flow.d.ts +2 -2
- package/lib/cjs/event-models/ht-event-flow.js +1 -1
- package/lib/cjs/event-models/ht-event-handoff.d.ts +1 -1
- package/lib/cjs/event-models/ht-event-handoff.js +1 -1
- package/lib/cjs/event-models/ht-event-intent-smart.d.ts +1 -1
- package/lib/cjs/event-models/ht-event-intent-smart.js +1 -1
- package/lib/cjs/event-models/ht-event-intent.d.ts +1 -1
- package/lib/cjs/event-models/ht-event-intent.js +1 -1
- package/lib/cjs/event-models/ht-event-keyword.d.ts +1 -1
- package/lib/cjs/event-models/ht-event-keyword.js +1 -1
- package/lib/cjs/event-models/ht-event-knowledge-base.d.ts +3 -1
- package/lib/cjs/event-models/ht-event-knowledge-base.js +3 -1
- package/lib/cjs/event-models/ht-event-knowledge-base.js.map +1 -1
- package/lib/cjs/event-models/ht-event-webview.d.ts +2 -2
- package/lib/cjs/event-models/ht-event-webview.js +1 -1
- package/lib/cjs/event-models/ht-event.js +0 -2
- package/lib/cjs/event-models/ht-event.js.map +1 -1
- package/lib/cjs/index.js +4 -5
- package/lib/cjs/index.js.map +1 -1
- package/lib/cjs/types.d.ts +43 -36
- package/lib/cjs/types.js +25 -22
- package/lib/cjs/types.js.map +1 -1
- package/lib/cjs/utils.js +16 -16
- package/lib/cjs/utils.js.map +1 -1
- package/lib/esm/event-models/ht-event-custom.d.ts +2 -1
- package/lib/esm/event-models/ht-event-custom.js +3 -11
- package/lib/esm/event-models/ht-event-custom.js.map +1 -1
- package/lib/esm/event-models/ht-event-fallback.d.ts +3 -2
- package/lib/esm/event-models/ht-event-fallback.js +3 -2
- package/lib/esm/event-models/ht-event-fallback.js.map +1 -1
- package/lib/esm/event-models/ht-event-feedback.d.ts +1 -1
- package/lib/esm/event-models/ht-event-feedback.js +1 -1
- package/lib/esm/event-models/ht-event-flow.d.ts +2 -2
- package/lib/esm/event-models/ht-event-flow.js +1 -1
- package/lib/esm/event-models/ht-event-handoff.d.ts +1 -1
- package/lib/esm/event-models/ht-event-handoff.js +1 -1
- package/lib/esm/event-models/ht-event-intent-smart.d.ts +1 -1
- package/lib/esm/event-models/ht-event-intent-smart.js +1 -1
- package/lib/esm/event-models/ht-event-intent.d.ts +1 -1
- package/lib/esm/event-models/ht-event-intent.js +1 -1
- package/lib/esm/event-models/ht-event-keyword.d.ts +1 -1
- package/lib/esm/event-models/ht-event-keyword.js +1 -1
- package/lib/esm/event-models/ht-event-knowledge-base.d.ts +3 -1
- package/lib/esm/event-models/ht-event-knowledge-base.js +3 -1
- package/lib/esm/event-models/ht-event-knowledge-base.js.map +1 -1
- package/lib/esm/event-models/ht-event-webview.d.ts +2 -2
- package/lib/esm/event-models/ht-event-webview.js +1 -1
- package/lib/esm/event-models/ht-event.js +0 -2
- package/lib/esm/event-models/ht-event.js.map +1 -1
- package/lib/esm/index.js +4 -5
- package/lib/esm/index.js.map +1 -1
- package/lib/esm/types.d.ts +43 -36
- package/lib/esm/types.js +24 -21
- package/lib/esm/types.js.map +1 -1
- package/lib/esm/utils.js +16 -16
- package/lib/esm/utils.js.map +1 -1
- package/package.json +2 -2
- package/src/event-models/ht-event-custom.ts +5 -19
- package/src/event-models/ht-event-fallback.ts +6 -4
- package/src/event-models/ht-event-feedback.ts +5 -5
- package/src/event-models/ht-event-flow.ts +3 -3
- package/src/event-models/ht-event-handoff.ts +4 -4
- package/src/event-models/ht-event-intent-smart.ts +2 -2
- package/src/event-models/ht-event-intent.ts +2 -2
- package/src/event-models/ht-event-keyword.ts +2 -2
- package/src/event-models/ht-event-knowledge-base.ts +6 -2
- package/src/event-models/ht-event-webview.ts +3 -3
- package/src/event-models/ht-event.ts +0 -2
- package/src/index.ts +5 -5
- package/src/types.ts +49 -42
- package/src/utils.ts +16 -16
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ht-event-custom.js","sourceRoot":"","sources":["../../../src/event-models/ht-event-custom.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"ht-event-custom.js","sourceRoot":"","sources":["../../../src/event-models/ht-event-custom.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4B,SAAS,EAAe,MAAM,UAAU,CAAA;AAC3E,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AAOpC,MAAM,OAAO,aAAc,SAAQ,OAAO;IAGxC,YAAY,KAAkB,EAAE,WAAwB;QACtD,KAAK,CAAC,KAAK,EAAE,WAAW,CAAC,CAAA;QACzB,IAAI,CAAC,IAAI,GAAG,SAAS,CAAC,QAAQ,CAAA;QAC9B,IAAI,CAAC,IAAI,CAAC,aAAa,GAAG,KAAK,CAAC,IAAI,CAAC,YAAY,CAAA;IACnD,CAAC;CACF"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { EventAction, EventFallback, RequestData } from '../types';
|
|
2
2
|
import { HtEvent } from './ht-event';
|
|
3
3
|
interface EventDataFallback {
|
|
4
|
-
action: EventAction.
|
|
5
|
-
|
|
4
|
+
action: EventAction.Fallback;
|
|
5
|
+
fallback_out: number;
|
|
6
|
+
fallback_message_id: string;
|
|
6
7
|
}
|
|
7
8
|
export declare class HtEventFallback extends HtEvent {
|
|
8
9
|
data: EventDataFallback;
|
|
@@ -3,8 +3,9 @@ import { HtEvent } from './ht-event';
|
|
|
3
3
|
export class HtEventFallback extends HtEvent {
|
|
4
4
|
constructor(event, requestData) {
|
|
5
5
|
super(event, requestData);
|
|
6
|
-
this.type = EventType.
|
|
7
|
-
this.data.
|
|
6
|
+
this.type = EventType.Botevent;
|
|
7
|
+
this.data.fallback_out = event.data.fallbackOut;
|
|
8
|
+
this.data.fallback_message_id = event.data.fallbackMessageId;
|
|
8
9
|
}
|
|
9
10
|
}
|
|
10
11
|
//# sourceMappingURL=ht-event-fallback.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ht-event-fallback.js","sourceRoot":"","sources":["../../../src/event-models/ht-event-fallback.ts"],"names":[],"mappings":"AAAA,OAAO,EAA8B,SAAS,EAAe,MAAM,UAAU,CAAA;AAC7E,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;
|
|
1
|
+
{"version":3,"file":"ht-event-fallback.js","sourceRoot":"","sources":["../../../src/event-models/ht-event-fallback.ts"],"names":[],"mappings":"AAAA,OAAO,EAA8B,SAAS,EAAe,MAAM,UAAU,CAAA;AAC7E,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AAQpC,MAAM,OAAO,eAAgB,SAAQ,OAAO;IAG1C,YAAY,KAAoB,EAAE,WAAwB;QACxD,KAAK,CAAC,KAAK,EAAE,WAAW,CAAC,CAAA;QACzB,IAAI,CAAC,IAAI,GAAG,SAAS,CAAC,QAAQ,CAAA;QAC9B,IAAI,CAAC,IAAI,CAAC,YAAY,GAAG,KAAK,CAAC,IAAI,CAAC,WAAW,CAAA;QAC/C,IAAI,CAAC,IAAI,CAAC,mBAAmB,GAAG,KAAK,CAAC,IAAI,CAAC,iBAAiB,CAAA;IAC9D,CAAC;CACF"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { EventAction, EventFeedback, RequestData } from '../types';
|
|
2
2
|
import { HtEvent } from './ht-event';
|
|
3
3
|
interface EventDataFeedback {
|
|
4
|
-
action: EventAction.
|
|
4
|
+
action: EventAction.FeedbackCase | EventAction.FeedbackConversation | EventAction.FeedbackMessage | EventAction.FeedbackWebview;
|
|
5
5
|
message_generated_by?: string;
|
|
6
6
|
feedback_target_id?: string;
|
|
7
7
|
feedback_group_id?: string;
|
|
@@ -3,7 +3,7 @@ import { HtEvent } from './ht-event';
|
|
|
3
3
|
export class HtEventFeedback extends HtEvent {
|
|
4
4
|
constructor(event, requestData) {
|
|
5
5
|
super(event, requestData);
|
|
6
|
-
this.type = EventType.
|
|
6
|
+
this.type = EventType.Feedback;
|
|
7
7
|
this.data.message_generated_by = event.data.messageGeneratedBy; // ?? nomes te valor quan action es message. Si es message de knowledge base => sources y chunks. Quan es un node de flow builder => content_id
|
|
8
8
|
this.data.feedback_target_id = event.data.feedbackTargetId; // ?? case_id, message_id, conversation_id ???, webview_name
|
|
9
9
|
this.data.feedback_group_id = event.data.feedbackGroupId; // ??
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { EventAction, EventFlow, RequestData } from '../types';
|
|
2
2
|
import { HtEvent } from './ht-event';
|
|
3
3
|
interface EventDataFlow {
|
|
4
|
-
action: EventAction.
|
|
4
|
+
action: EventAction.FlowNode;
|
|
5
5
|
flow_thread_id: string;
|
|
6
6
|
flow_id: string;
|
|
7
7
|
flow_name: string;
|
|
8
8
|
flow_node_id: string;
|
|
9
9
|
flow_node_content_id: string;
|
|
10
|
-
flow_node_is_meaningful
|
|
10
|
+
flow_node_is_meaningful: boolean;
|
|
11
11
|
}
|
|
12
12
|
export declare class HtEventFlow extends HtEvent {
|
|
13
13
|
data: EventDataFlow;
|
|
@@ -3,7 +3,7 @@ import { HtEvent } from './ht-event';
|
|
|
3
3
|
export class HtEventFlow extends HtEvent {
|
|
4
4
|
constructor(event, requestData) {
|
|
5
5
|
super(event, requestData);
|
|
6
|
-
this.type = EventType.
|
|
6
|
+
this.type = EventType.Botevent;
|
|
7
7
|
this.data.flow_thread_id = event.data.flowThreadId; // This value is managed by the flow builder plugin, stored in the session and updated every time the content connected to the conversation start is displayed
|
|
8
8
|
this.data.flow_id = event.data.flowId;
|
|
9
9
|
this.data.flow_name = event.data.flowName;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { EventAction, EventHandoff, RequestData } from '../types';
|
|
2
2
|
import { HtEvent } from './ht-event';
|
|
3
3
|
interface EventDataHandoff {
|
|
4
|
-
action: EventAction.
|
|
4
|
+
action: EventAction.HandoffOption | EventAction.HandoffSuccess | EventAction.HandoffFail;
|
|
5
5
|
handoff_queue_id: string;
|
|
6
6
|
handoff_queue_name: string;
|
|
7
7
|
handoff_case_id?: string;
|
|
@@ -3,7 +3,7 @@ import { HtEvent } from './ht-event';
|
|
|
3
3
|
export class HtEventHandoff extends HtEvent {
|
|
4
4
|
constructor(event, requestData) {
|
|
5
5
|
super(event, requestData);
|
|
6
|
-
this.type = EventType.
|
|
6
|
+
this.type = EventType.Botevent;
|
|
7
7
|
this.data.handoff_queue_id = event.data.queueId;
|
|
8
8
|
this.data.handoff_queue_name = event.data.queueName;
|
|
9
9
|
this.data.handoff_case_id = event.data.caseId;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { EventAction, EventIntentSmart, RequestData } from '../types';
|
|
2
2
|
import { HtEvent } from './ht-event';
|
|
3
3
|
interface EventDataIntentSmart {
|
|
4
|
-
action: EventAction.
|
|
4
|
+
action: EventAction.IntentSmart;
|
|
5
5
|
nlu_intent_smart_title: string;
|
|
6
6
|
nlu_intent_smart_num_used: number;
|
|
7
7
|
nlu_intent_smart_message_id: string;
|
|
@@ -3,7 +3,7 @@ import { HtEvent } from './ht-event';
|
|
|
3
3
|
export class HtEventIntentSmart extends HtEvent {
|
|
4
4
|
constructor(event, requestData) {
|
|
5
5
|
super(event, requestData);
|
|
6
|
-
this.type = EventType.
|
|
6
|
+
this.type = EventType.Botevent;
|
|
7
7
|
this.data.nlu_intent_smart_title = event.data.nluIntentSmartTitle;
|
|
8
8
|
this.data.nlu_intent_smart_num_used = event.data.nluIntentSmartNumUsed;
|
|
9
9
|
this.data.nlu_intent_smart_message_id = event.data.nluIntentSmartMessageId;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { EventAction, EventIntent, RequestData } from '../types';
|
|
2
2
|
import { HtEvent } from './ht-event';
|
|
3
3
|
interface EventDataIntent {
|
|
4
|
-
action: EventAction.
|
|
4
|
+
action: EventAction.Intent;
|
|
5
5
|
nlu_intent_label: string;
|
|
6
6
|
nlu_intent_confidence: number;
|
|
7
7
|
nlu_intent_threshold: number;
|
|
@@ -3,7 +3,7 @@ import { HtEvent } from './ht-event';
|
|
|
3
3
|
export class HtEventIntent extends HtEvent {
|
|
4
4
|
constructor(event, requestData) {
|
|
5
5
|
super(event, requestData);
|
|
6
|
-
this.type = EventType.
|
|
6
|
+
this.type = EventType.Botevent;
|
|
7
7
|
this.data.nlu_intent_label = event.data.nluIntentLabel;
|
|
8
8
|
this.data.nlu_intent_confidence = event.data.nluIntentConfidence;
|
|
9
9
|
this.data.nlu_intent_threshold = event.data.nluIntentThreshold;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { EventAction, EventKeyword, RequestData } from '../types';
|
|
2
2
|
import { HtEvent } from './ht-event';
|
|
3
3
|
interface EventDataKeyword {
|
|
4
|
-
action: EventAction.
|
|
4
|
+
action: EventAction.Keyword;
|
|
5
5
|
nlu_keyword_id: string;
|
|
6
6
|
nlu_keyword_name: string;
|
|
7
7
|
nlu_keyword_is_regex: boolean;
|
|
@@ -3,7 +3,7 @@ import { HtEvent } from './ht-event';
|
|
|
3
3
|
export class HtEventKeyword extends HtEvent {
|
|
4
4
|
constructor(event, requestData) {
|
|
5
5
|
super(event, requestData);
|
|
6
|
-
this.type = EventType.
|
|
6
|
+
this.type = EventType.Botevent;
|
|
7
7
|
this.data.nlu_keyword_id = event.data.nluKeywordId;
|
|
8
8
|
this.data.nlu_keyword_name = event.data.nluKeywordName;
|
|
9
9
|
this.data.nlu_keyword_is_regex = event.data.nluKeywordIsRegex || false;
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { EventAction, EventKnowledgeBase, RequestData } from '../types';
|
|
2
2
|
import { HtEvent } from './ht-event';
|
|
3
3
|
interface EventDataKnowledgeBase {
|
|
4
|
-
action: EventAction.
|
|
4
|
+
action: EventAction.Knowledgebase;
|
|
5
|
+
knowledgebase_inference_id: string;
|
|
5
6
|
knowledgebase_fail_reason?: string;
|
|
6
7
|
knowledgebase_sources_ids: string[];
|
|
7
8
|
knowledgebase_chunks_ids: string[];
|
|
9
|
+
knowledgebase_message_id: string;
|
|
8
10
|
}
|
|
9
11
|
export declare class HtEventKnowledgeBase extends HtEvent {
|
|
10
12
|
data: EventDataKnowledgeBase;
|
|
@@ -3,10 +3,12 @@ import { HtEvent } from './ht-event';
|
|
|
3
3
|
export class HtEventKnowledgeBase extends HtEvent {
|
|
4
4
|
constructor(event, requestData) {
|
|
5
5
|
super(event, requestData);
|
|
6
|
-
this.type = EventType.
|
|
6
|
+
this.type = EventType.Botevent;
|
|
7
|
+
this.data.knowledgebase_inference_id = event.data.knowledgebaseInferenceId;
|
|
7
8
|
this.data.knowledgebase_fail_reason = event.data.knowledgebaseFailReason;
|
|
8
9
|
this.data.knowledgebase_sources_ids = event.data.knowledgebaseSourcesIds;
|
|
9
10
|
this.data.knowledgebase_chunks_ids = event.data.knowledgebaseChunksIds;
|
|
11
|
+
this.data.knowledgebase_message_id = event.data.knowledgebaseMessageId;
|
|
10
12
|
}
|
|
11
13
|
}
|
|
12
14
|
//# sourceMappingURL=ht-event-knowledge-base.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ht-event-knowledge-base.js","sourceRoot":"","sources":["../../../src/event-models/ht-event-knowledge-base.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,SAAS,GAEV,MAAM,UAAU,CAAA;AACjB,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;
|
|
1
|
+
{"version":3,"file":"ht-event-knowledge-base.js","sourceRoot":"","sources":["../../../src/event-models/ht-event-knowledge-base.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,SAAS,GAEV,MAAM,UAAU,CAAA;AACjB,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AAWpC,MAAM,OAAO,oBAAqB,SAAQ,OAAO;IAG/C,YAAY,KAAyB,EAAE,WAAwB;QAC7D,KAAK,CAAC,KAAK,EAAE,WAAW,CAAC,CAAA;QACzB,IAAI,CAAC,IAAI,GAAG,SAAS,CAAC,QAAQ,CAAA;QAC9B,IAAI,CAAC,IAAI,CAAC,0BAA0B,GAAG,KAAK,CAAC,IAAI,CAAC,wBAAwB,CAAA;QAC1E,IAAI,CAAC,IAAI,CAAC,yBAAyB,GAAG,KAAK,CAAC,IAAI,CAAC,uBAAuB,CAAA;QACxE,IAAI,CAAC,IAAI,CAAC,yBAAyB,GAAG,KAAK,CAAC,IAAI,CAAC,uBAAuB,CAAA;QACxE,IAAI,CAAC,IAAI,CAAC,wBAAwB,GAAG,KAAK,CAAC,IAAI,CAAC,sBAAsB,CAAA;QACtE,IAAI,CAAC,IAAI,CAAC,wBAAwB,GAAG,KAAK,CAAC,IAAI,CAAC,sBAAsB,CAAA;IACxE,CAAC;CACF"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { EventAction, EventWebview, RequestData } from '../types';
|
|
2
2
|
import { HtEvent } from './ht-event';
|
|
3
3
|
interface EventDataWebview {
|
|
4
|
-
action: EventAction.
|
|
4
|
+
action: EventAction.WebviewStep | EventAction.WebviewEnd;
|
|
5
5
|
webview_thread_id: string;
|
|
6
6
|
webview_name: string;
|
|
7
|
-
webview_step_name
|
|
7
|
+
webview_step_name?: string;
|
|
8
8
|
webview_end_fail_type?: string;
|
|
9
9
|
webview_end_fail_message?: string;
|
|
10
10
|
}
|
|
@@ -3,7 +3,7 @@ import { HtEvent } from './ht-event';
|
|
|
3
3
|
export class HtEventWebview extends HtEvent {
|
|
4
4
|
constructor(event, requestData) {
|
|
5
5
|
super(event, requestData);
|
|
6
|
-
this.type = EventType.
|
|
6
|
+
this.type = EventType.Webevent;
|
|
7
7
|
this.data.webview_thread_id = event.data.webviewThreadId;
|
|
8
8
|
this.data.webview_name = event.data.webviewName;
|
|
9
9
|
this.data.webview_step_name = event.data.webviewStepName;
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
export class HtEvent {
|
|
2
2
|
constructor(event, requestData) {
|
|
3
3
|
this.chat_id = requestData.userId;
|
|
4
|
-
this.channel = requestData.provider;
|
|
5
|
-
this.created_at = new Date().toISOString();
|
|
6
4
|
this.chat_language = requestData.language;
|
|
7
5
|
this.chat_country = requestData.country;
|
|
8
6
|
this.format_version = 2;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ht-event.js","sourceRoot":"","sources":["../../../src/event-models/ht-event.ts"],"names":[],"mappings":"AAEA,MAAM,OAAO,OAAO;IAYlB,YAAY,KAAmB,EAAE,WAAwB;QACvD,IAAI,CAAC,OAAO,GAAG,WAAW,CAAC,MAAM,CAAA;QACjC,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"ht-event.js","sourceRoot":"","sources":["../../../src/event-models/ht-event.ts"],"names":[],"mappings":"AAEA,MAAM,OAAO,OAAO;IAYlB,YAAY,KAAmB,EAAE,WAAwB;QACvD,IAAI,CAAC,OAAO,GAAG,WAAW,CAAC,MAAM,CAAA;QACjC,IAAI,CAAC,aAAa,GAAG,WAAW,CAAC,QAAQ,CAAA;QACzC,IAAI,CAAC,YAAY,GAAG,WAAW,CAAC,OAAO,CAAA;QACvC,IAAI,CAAC,cAAc,GAAG,CAAC,CAAA;QACvB,IAAI,CAAC,IAAI,GAAG,EAAE,CAAA;QACd,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC,MAAM,CAAA;IACjC,CAAC;CACF"}
|
package/lib/esm/index.js
CHANGED
|
@@ -18,10 +18,9 @@ export default class BotonicPluginHubtypeAnalytics {
|
|
|
18
18
|
return;
|
|
19
19
|
}
|
|
20
20
|
getUrl(request, eventType) {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}
|
|
24
|
-
return `${this.baseUrl}/external/v2/conversational_apps/${request.session.bot.id}/bot_event/`;
|
|
21
|
+
const endpoint = eventType === EventType.Webevent ? 'web_event' : 'bot_event';
|
|
22
|
+
const botId = request.session.bot.id;
|
|
23
|
+
return `${this.baseUrl}/external/v2/conversational_apps/${botId}/${endpoint}/`;
|
|
25
24
|
}
|
|
26
25
|
getRequestData(request) {
|
|
27
26
|
return {
|
|
@@ -41,7 +40,7 @@ export default class BotonicPluginHubtypeAnalytics {
|
|
|
41
40
|
sendEvent(request, event) {
|
|
42
41
|
const url = this.getUrl(request, event.type);
|
|
43
42
|
const headers = { Authorization: `Bearer ${request.session._access_token}` };
|
|
44
|
-
const config = event.type !== EventType.
|
|
43
|
+
const config = event.type !== EventType.Webevent ? { headers } : undefined;
|
|
45
44
|
return axios.post(url, event, config);
|
|
46
45
|
}
|
|
47
46
|
}
|
package/lib/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AACA,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB,OAAO,EAAE,SAAS,EAA6B,MAAM,SAAS,CAAA;AAC9D,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAOvC,SAAS,kBAAkB,CAAC,OAAmB;IAC7C,OAAO,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAA;AACjD,CAAC;AAED,SAAS,iBAAiB,CAAC,OAAmB;IAC5C,OAAO,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,OAAO,CAAA;AAChD,CAAC;AAED,MAAM,CAAC,OAAO,OAAO,6BAA6B;IAIhD,YAAY,OAAiC;QAC3C,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,eAAe,IAAI,yBAAyB,CA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AACvB,cAAc,SAAS,CAAA"}
|
package/lib/esm/types.d.ts
CHANGED
|
@@ -1,33 +1,32 @@
|
|
|
1
1
|
import { PROVIDER } from '@botonic/core';
|
|
2
2
|
export declare enum EventType {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
Feedback = "feedback",
|
|
4
|
+
Botevent = "botevent",
|
|
5
|
+
Webevent = "webevent"
|
|
6
6
|
}
|
|
7
7
|
export declare enum EventAction {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
customWeb = "custom_web"
|
|
8
|
+
FeedbackCase = "feedback_case",
|
|
9
|
+
FeedbackMessage = "feddback_message",
|
|
10
|
+
FeedbackConversation = "feddback_conversation",
|
|
11
|
+
FeedbackWebview = "feddback_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"
|
|
25
24
|
}
|
|
26
25
|
export interface HtBaseEventProps {
|
|
27
26
|
action: EventAction;
|
|
28
27
|
}
|
|
29
28
|
export interface EventFeedback extends HtBaseEventProps {
|
|
30
|
-
action: EventAction.
|
|
29
|
+
action: EventAction.FeedbackCase | EventAction.FeedbackConversation | EventAction.FeedbackMessage | EventAction.FeedbackWebview;
|
|
31
30
|
data: EventPropsFeedback;
|
|
32
31
|
}
|
|
33
32
|
export interface EventPropsFeedback {
|
|
@@ -40,7 +39,7 @@ export interface EventPropsFeedback {
|
|
|
40
39
|
value: number;
|
|
41
40
|
}
|
|
42
41
|
export interface EventFlow extends HtBaseEventProps {
|
|
43
|
-
action: EventAction.
|
|
42
|
+
action: EventAction.FlowNode;
|
|
44
43
|
data: EventPropsFlow;
|
|
45
44
|
}
|
|
46
45
|
export interface EventPropsFlow {
|
|
@@ -52,7 +51,7 @@ export interface EventPropsFlow {
|
|
|
52
51
|
flowNodeIsMeaningful?: boolean;
|
|
53
52
|
}
|
|
54
53
|
export interface EventHandoff extends HtBaseEventProps {
|
|
55
|
-
action: EventAction.
|
|
54
|
+
action: EventAction.HandoffOption | EventAction.HandoffSuccess | EventAction.HandoffFail;
|
|
56
55
|
data: EventPropsHandoff;
|
|
57
56
|
}
|
|
58
57
|
export interface EventPropsHandoff {
|
|
@@ -64,7 +63,7 @@ export interface EventPropsHandoff {
|
|
|
64
63
|
isThresholdReached?: boolean;
|
|
65
64
|
}
|
|
66
65
|
export interface EventIntent extends HtBaseEventProps {
|
|
67
|
-
action: EventAction.
|
|
66
|
+
action: EventAction.Intent;
|
|
68
67
|
data: EventPropsIntent;
|
|
69
68
|
}
|
|
70
69
|
export interface EventPropsIntent {
|
|
@@ -74,7 +73,7 @@ export interface EventPropsIntent {
|
|
|
74
73
|
nluIntentMessageId: string;
|
|
75
74
|
}
|
|
76
75
|
export interface EventKeyword extends HtBaseEventProps {
|
|
77
|
-
action: EventAction.
|
|
76
|
+
action: EventAction.Keyword;
|
|
78
77
|
data: EventPropsKeyword;
|
|
79
78
|
}
|
|
80
79
|
export interface EventPropsKeyword {
|
|
@@ -84,7 +83,7 @@ export interface EventPropsKeyword {
|
|
|
84
83
|
nluKeywordMessageId: string;
|
|
85
84
|
}
|
|
86
85
|
export interface EventIntentSmart extends HtBaseEventProps {
|
|
87
|
-
action: EventAction.
|
|
86
|
+
action: EventAction.IntentSmart;
|
|
88
87
|
data: EventPropsIntentSmart;
|
|
89
88
|
}
|
|
90
89
|
export interface EventPropsIntentSmart {
|
|
@@ -93,38 +92,46 @@ export interface EventPropsIntentSmart {
|
|
|
93
92
|
nluIntentSmartMessageId: string;
|
|
94
93
|
}
|
|
95
94
|
export interface EventKnowledgeBase extends HtBaseEventProps {
|
|
96
|
-
action: EventAction.
|
|
95
|
+
action: EventAction.Knowledgebase;
|
|
97
96
|
data: EventPropsKnowledgeBase;
|
|
98
97
|
}
|
|
99
98
|
export interface EventPropsKnowledgeBase {
|
|
100
|
-
|
|
99
|
+
knowledgebaseInferenceId: string;
|
|
100
|
+
knowledgebaseFailReason?: KnowledgebaseFailReason;
|
|
101
101
|
knowledgebaseSourcesIds: string[];
|
|
102
102
|
knowledgebaseChunksIds: string[];
|
|
103
|
+
knowledgebaseMessageId: string;
|
|
104
|
+
}
|
|
105
|
+
export declare enum KnowledgebaseFailReason {
|
|
106
|
+
NoKnowledge = "no_knowledge",
|
|
107
|
+
Hallucination = "hallucination"
|
|
103
108
|
}
|
|
104
109
|
export interface EventFallback extends HtBaseEventProps {
|
|
105
|
-
action: EventAction.
|
|
110
|
+
action: EventAction.Fallback;
|
|
106
111
|
data: EventPropsFallbackBase;
|
|
107
112
|
}
|
|
108
113
|
export interface EventPropsFallbackBase {
|
|
109
|
-
|
|
114
|
+
fallbackOut: number;
|
|
115
|
+
fallbackMessageId: string;
|
|
110
116
|
}
|
|
111
117
|
export interface EventWebview extends HtBaseEventProps {
|
|
112
|
-
action: EventAction.
|
|
118
|
+
action: EventAction.WebviewStep | EventAction.WebviewEnd;
|
|
113
119
|
data: EventPropsWebview;
|
|
114
120
|
}
|
|
115
121
|
export interface EventPropsWebview {
|
|
116
122
|
webviewThreadId: string;
|
|
117
123
|
webviewName: string;
|
|
118
|
-
webviewStepName
|
|
124
|
+
webviewStepName?: string;
|
|
119
125
|
webviewEndFailType?: string;
|
|
120
126
|
webviewEndFailMessage?: string;
|
|
121
127
|
}
|
|
122
128
|
export interface EventCustom extends HtBaseEventProps {
|
|
123
|
-
action: EventAction.
|
|
124
|
-
data:
|
|
129
|
+
action: EventAction.Custom;
|
|
130
|
+
data: EventPropsCustom;
|
|
131
|
+
}
|
|
132
|
+
export interface EventPropsCustom {
|
|
133
|
+
customFields: Record<string, any>;
|
|
125
134
|
}
|
|
126
|
-
export declare const CUSTOM_PREFIX = "custom_";
|
|
127
|
-
export type CustomAttribute = `${typeof CUSTOM_PREFIX}${string}`;
|
|
128
135
|
export type HtEventProps = EventFeedback | EventFlow | EventHandoff | EventIntent | EventKeyword | EventIntentSmart | EventKnowledgeBase | EventFallback | EventWebview | EventCustom;
|
|
129
136
|
export interface RequestData {
|
|
130
137
|
language: string;
|
package/lib/esm/types.js
CHANGED
|
@@ -1,28 +1,31 @@
|
|
|
1
1
|
export var EventType;
|
|
2
2
|
(function (EventType) {
|
|
3
|
-
EventType["
|
|
4
|
-
EventType["
|
|
5
|
-
EventType["
|
|
3
|
+
EventType["Feedback"] = "feedback";
|
|
4
|
+
EventType["Botevent"] = "botevent";
|
|
5
|
+
EventType["Webevent"] = "webevent";
|
|
6
6
|
})(EventType || (EventType = {}));
|
|
7
7
|
export var EventAction;
|
|
8
8
|
(function (EventAction) {
|
|
9
|
-
EventAction["
|
|
10
|
-
EventAction["
|
|
11
|
-
EventAction["
|
|
12
|
-
EventAction["
|
|
13
|
-
EventAction["
|
|
14
|
-
EventAction["
|
|
15
|
-
EventAction["
|
|
16
|
-
EventAction["
|
|
17
|
-
EventAction["
|
|
18
|
-
EventAction["
|
|
19
|
-
EventAction["
|
|
20
|
-
EventAction["
|
|
21
|
-
EventAction["
|
|
22
|
-
EventAction["
|
|
23
|
-
EventAction["
|
|
24
|
-
EventAction["
|
|
25
|
-
EventAction["customWeb"] = "custom_web";
|
|
9
|
+
EventAction["FeedbackCase"] = "feedback_case";
|
|
10
|
+
EventAction["FeedbackMessage"] = "feddback_message";
|
|
11
|
+
EventAction["FeedbackConversation"] = "feddback_conversation";
|
|
12
|
+
EventAction["FeedbackWebview"] = "feddback_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";
|
|
26
25
|
})(EventAction || (EventAction = {}));
|
|
27
|
-
export
|
|
26
|
+
export var KnowledgebaseFailReason;
|
|
27
|
+
(function (KnowledgebaseFailReason) {
|
|
28
|
+
KnowledgebaseFailReason["NoKnowledge"] = "no_knowledge";
|
|
29
|
+
KnowledgebaseFailReason["Hallucination"] = "hallucination";
|
|
30
|
+
})(KnowledgebaseFailReason || (KnowledgebaseFailReason = {}));
|
|
28
31
|
//# 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":"AAEA,MAAM,CAAN,IAAY,SAIX;AAJD,WAAY,SAAS;IACnB,kCAAqB,CAAA;IACrB,kCAAqB,CAAA;IACrB,kCAAqB,CAAA;AACvB,CAAC,EAJW,SAAS,KAAT,SAAS,QAIpB;AAED,MAAM,CAAN,IAAY,
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAEA,MAAM,CAAN,IAAY,SAIX;AAJD,WAAY,SAAS;IACnB,kCAAqB,CAAA;IACrB,kCAAqB,CAAA;IACrB,kCAAqB,CAAA;AACvB,CAAC,EAJW,SAAS,KAAT,SAAS,QAIpB;AAED,MAAM,CAAN,IAAY,WAiBX;AAjBD,WAAY,WAAW;IACrB,6CAA8B,CAAA;IAC9B,mDAAoC,CAAA;IACpC,6DAA8C,CAAA;IAC9C,mDAAoC,CAAA;IACpC,qCAAsB,CAAA;IACtB,+CAAgC,CAAA;IAChC,iDAAkC,CAAA;IAClC,2CAA4B,CAAA;IAC5B,sCAAuB,CAAA;IACvB,oCAAqB,CAAA;IACrB,+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;AAwGD,MAAM,CAAN,IAAY,uBAGX;AAHD,WAAY,uBAAuB;IACjC,uDAA4B,CAAA;IAC5B,0DAA+B,CAAA;AACjC,CAAC,EAHW,uBAAuB,KAAvB,uBAAuB,QAGlC"}
|
package/lib/esm/utils.js
CHANGED
|
@@ -2,31 +2,31 @@ import { HtEvent, HtEventCustom, HtEventFallback, HtEventFeedback, HtEventFlow,
|
|
|
2
2
|
import { EventAction } from './types';
|
|
3
3
|
export function createHtEvent(requestData, htEventProps) {
|
|
4
4
|
switch (htEventProps.action) {
|
|
5
|
-
case EventAction.
|
|
6
|
-
case EventAction.
|
|
7
|
-
case EventAction.
|
|
8
|
-
case EventAction.
|
|
5
|
+
case EventAction.FeedbackCase:
|
|
6
|
+
case EventAction.FeedbackConversation:
|
|
7
|
+
case EventAction.FeedbackMessage:
|
|
8
|
+
case EventAction.FeedbackWebview:
|
|
9
9
|
return new HtEventFeedback(htEventProps, requestData);
|
|
10
|
-
case EventAction.
|
|
10
|
+
case EventAction.FlowNode:
|
|
11
11
|
return new HtEventFlow(htEventProps, requestData);
|
|
12
|
-
case EventAction.
|
|
13
|
-
case EventAction.
|
|
14
|
-
case EventAction.
|
|
12
|
+
case EventAction.HandoffOption:
|
|
13
|
+
case EventAction.HandoffSuccess:
|
|
14
|
+
case EventAction.HandoffFail:
|
|
15
15
|
return new HtEventHandoff(htEventProps, requestData);
|
|
16
|
-
case EventAction.
|
|
16
|
+
case EventAction.Intent:
|
|
17
17
|
return new HtEventIntent(htEventProps, requestData);
|
|
18
|
-
case EventAction.
|
|
18
|
+
case EventAction.Keyword:
|
|
19
19
|
return new HtEventKeyword(htEventProps, requestData);
|
|
20
|
-
case EventAction.
|
|
20
|
+
case EventAction.IntentSmart:
|
|
21
21
|
return new HtEventIntentSmart(htEventProps, requestData);
|
|
22
|
-
case EventAction.
|
|
22
|
+
case EventAction.Knowledgebase:
|
|
23
23
|
return new HtEventKnowledgeBase(htEventProps, requestData);
|
|
24
|
-
case EventAction.
|
|
24
|
+
case EventAction.Fallback:
|
|
25
25
|
return new HtEventFallback(htEventProps, requestData);
|
|
26
|
-
case EventAction.
|
|
26
|
+
case EventAction.WebviewStep:
|
|
27
|
+
case EventAction.WebviewEnd:
|
|
27
28
|
return new HtEventWebview(htEventProps, requestData);
|
|
28
|
-
case EventAction.
|
|
29
|
-
case EventAction.customWeb:
|
|
29
|
+
case EventAction.Custom:
|
|
30
30
|
return new HtEventCustom(htEventProps, requestData);
|
|
31
31
|
default:
|
|
32
32
|
return new HtEvent(htEventProps, requestData);
|
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,WAAW,EACX,cAAc,EACd,aAAa,EACb,kBAAkB,EAClB,cAAc,EACd,oBAAoB,EACpB,cAAc,GACf,MAAM,gBAAgB,CAAA;AACvB,OAAO,EAAE,WAAW,EAA6B,MAAM,SAAS,CAAA;AAEhE,MAAM,UAAU,aAAa,CAC3B,WAAwB,EACxB,YAA0B;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ACrB,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.27.0-alpha.
|
|
3
|
+
"version": "0.27.0-alpha.1",
|
|
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.21.0",
|
|
17
|
-
"@botonic/core": "^0.27.0-alpha.
|
|
17
|
+
"@botonic/core": "^0.27.0-alpha.1",
|
|
18
18
|
"axios": "^1.6.8"
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
|
@@ -1,14 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
CUSTOM_PREFIX,
|
|
3
|
-
EventAction,
|
|
4
|
-
EventCustom,
|
|
5
|
-
EventType,
|
|
6
|
-
RequestData,
|
|
7
|
-
} from '../types'
|
|
1
|
+
import { EventAction, EventCustom, EventType, RequestData } from '../types'
|
|
8
2
|
import { HtEvent } from './ht-event'
|
|
9
3
|
|
|
10
4
|
interface EventDataCustom {
|
|
11
|
-
action: EventAction.
|
|
5
|
+
action: EventAction.Custom
|
|
6
|
+
custom_fields: Record<string, any>
|
|
12
7
|
}
|
|
13
8
|
|
|
14
9
|
export class HtEventCustom extends HtEvent {
|
|
@@ -16,16 +11,7 @@ export class HtEventCustom extends HtEvent {
|
|
|
16
11
|
|
|
17
12
|
constructor(event: EventCustom, requestData: RequestData) {
|
|
18
13
|
super(event, requestData)
|
|
19
|
-
this.type =
|
|
20
|
-
|
|
21
|
-
? EventType.botevent
|
|
22
|
-
: EventType.webevent
|
|
23
|
-
|
|
24
|
-
// Set in data with all attributs that start with 'custom_'
|
|
25
|
-
for (const key in event.data) {
|
|
26
|
-
if (key.startsWith(CUSTOM_PREFIX)) {
|
|
27
|
-
this.data[key] = event.data[key]
|
|
28
|
-
}
|
|
29
|
-
}
|
|
14
|
+
this.type = EventType.Webevent
|
|
15
|
+
this.data.custom_fields = event.data.customFields
|
|
30
16
|
}
|
|
31
17
|
}
|