@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,7 +1,8 @@
|
|
|
1
1
|
import { EventAction, EventCustom, RequestData } from '../types';
|
|
2
2
|
import { HtEvent } from './ht-event';
|
|
3
3
|
interface EventDataCustom {
|
|
4
|
-
action: EventAction.
|
|
4
|
+
action: EventAction.Custom;
|
|
5
|
+
custom_fields: Record<string, any>;
|
|
5
6
|
}
|
|
6
7
|
export declare class HtEventCustom extends HtEvent {
|
|
7
8
|
data: EventDataCustom;
|
|
@@ -6,16 +6,8 @@ const ht_event_1 = require("./ht-event");
|
|
|
6
6
|
class HtEventCustom extends ht_event_1.HtEvent {
|
|
7
7
|
constructor(event, requestData) {
|
|
8
8
|
super(event, requestData);
|
|
9
|
-
this.type =
|
|
10
|
-
|
|
11
|
-
? types_1.EventType.botevent
|
|
12
|
-
: types_1.EventType.webevent;
|
|
13
|
-
// Set in data with all attributs that start with 'custom_'
|
|
14
|
-
for (const key in event.data) {
|
|
15
|
-
if (key.startsWith(types_1.CUSTOM_PREFIX)) {
|
|
16
|
-
this.data[key] = event.data[key];
|
|
17
|
-
}
|
|
18
|
-
}
|
|
9
|
+
this.type = types_1.EventType.Webevent;
|
|
10
|
+
this.data.custom_fields = event.data.customFields;
|
|
19
11
|
}
|
|
20
12
|
}
|
|
21
13
|
exports.HtEventCustom = HtEventCustom;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ht-event-custom.js","sourceRoot":"","sources":["../../../src/event-models/ht-event-custom.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"ht-event-custom.js","sourceRoot":"","sources":["../../../src/event-models/ht-event-custom.ts"],"names":[],"mappings":";;;AAAA,oCAA2E;AAC3E,yCAAoC;AAOpC,MAAa,aAAc,SAAQ,kBAAO;IAGxC,YAAY,KAAkB,EAAE,WAAwB;QACtD,KAAK,CAAC,KAAK,EAAE,WAAW,CAAC,CAAA;QACzB,IAAI,CAAC,IAAI,GAAG,iBAAS,CAAC,QAAQ,CAAA;QAC9B,IAAI,CAAC,IAAI,CAAC,aAAa,GAAG,KAAK,CAAC,IAAI,CAAC,YAAY,CAAA;IACnD,CAAC;CACF;AARD,sCAQC"}
|
|
@@ -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;
|
|
@@ -6,8 +6,9 @@ const ht_event_1 = require("./ht-event");
|
|
|
6
6
|
class HtEventFallback extends ht_event_1.HtEvent {
|
|
7
7
|
constructor(event, requestData) {
|
|
8
8
|
super(event, requestData);
|
|
9
|
-
this.type = types_1.EventType.
|
|
10
|
-
this.data.
|
|
9
|
+
this.type = types_1.EventType.Botevent;
|
|
10
|
+
this.data.fallback_out = event.data.fallbackOut;
|
|
11
|
+
this.data.fallback_message_id = event.data.fallbackMessageId;
|
|
11
12
|
}
|
|
12
13
|
}
|
|
13
14
|
exports.HtEventFallback = HtEventFallback;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ht-event-fallback.js","sourceRoot":"","sources":["../../../src/event-models/ht-event-fallback.ts"],"names":[],"mappings":";;;AAAA,oCAA6E;AAC7E,yCAAoC;
|
|
1
|
+
{"version":3,"file":"ht-event-fallback.js","sourceRoot":"","sources":["../../../src/event-models/ht-event-fallback.ts"],"names":[],"mappings":";;;AAAA,oCAA6E;AAC7E,yCAAoC;AAQpC,MAAa,eAAgB,SAAQ,kBAAO;IAG1C,YAAY,KAAoB,EAAE,WAAwB;QACxD,KAAK,CAAC,KAAK,EAAE,WAAW,CAAC,CAAA;QACzB,IAAI,CAAC,IAAI,GAAG,iBAAS,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;AATD,0CASC"}
|
|
@@ -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;
|
|
@@ -6,7 +6,7 @@ const ht_event_1 = require("./ht-event");
|
|
|
6
6
|
class HtEventFeedback extends ht_event_1.HtEvent {
|
|
7
7
|
constructor(event, requestData) {
|
|
8
8
|
super(event, requestData);
|
|
9
|
-
this.type = types_1.EventType.
|
|
9
|
+
this.type = types_1.EventType.Feedback;
|
|
10
10
|
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
|
|
11
11
|
this.data.feedback_target_id = event.data.feedbackTargetId; // ?? case_id, message_id, conversation_id ???, webview_name
|
|
12
12
|
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;
|
|
@@ -6,7 +6,7 @@ const ht_event_1 = require("./ht-event");
|
|
|
6
6
|
class HtEventFlow extends ht_event_1.HtEvent {
|
|
7
7
|
constructor(event, requestData) {
|
|
8
8
|
super(event, requestData);
|
|
9
|
-
this.type = types_1.EventType.
|
|
9
|
+
this.type = types_1.EventType.Botevent;
|
|
10
10
|
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
|
|
11
11
|
this.data.flow_id = event.data.flowId;
|
|
12
12
|
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;
|
|
@@ -6,7 +6,7 @@ const ht_event_1 = require("./ht-event");
|
|
|
6
6
|
class HtEventHandoff extends ht_event_1.HtEvent {
|
|
7
7
|
constructor(event, requestData) {
|
|
8
8
|
super(event, requestData);
|
|
9
|
-
this.type = types_1.EventType.
|
|
9
|
+
this.type = types_1.EventType.Botevent;
|
|
10
10
|
this.data.handoff_queue_id = event.data.queueId;
|
|
11
11
|
this.data.handoff_queue_name = event.data.queueName;
|
|
12
12
|
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;
|
|
@@ -6,7 +6,7 @@ const ht_event_1 = require("./ht-event");
|
|
|
6
6
|
class HtEventIntentSmart extends ht_event_1.HtEvent {
|
|
7
7
|
constructor(event, requestData) {
|
|
8
8
|
super(event, requestData);
|
|
9
|
-
this.type = types_1.EventType.
|
|
9
|
+
this.type = types_1.EventType.Botevent;
|
|
10
10
|
this.data.nlu_intent_smart_title = event.data.nluIntentSmartTitle;
|
|
11
11
|
this.data.nlu_intent_smart_num_used = event.data.nluIntentSmartNumUsed;
|
|
12
12
|
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;
|
|
@@ -6,7 +6,7 @@ const ht_event_1 = require("./ht-event");
|
|
|
6
6
|
class HtEventIntent extends ht_event_1.HtEvent {
|
|
7
7
|
constructor(event, requestData) {
|
|
8
8
|
super(event, requestData);
|
|
9
|
-
this.type = types_1.EventType.
|
|
9
|
+
this.type = types_1.EventType.Botevent;
|
|
10
10
|
this.data.nlu_intent_label = event.data.nluIntentLabel;
|
|
11
11
|
this.data.nlu_intent_confidence = event.data.nluIntentConfidence;
|
|
12
12
|
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;
|
|
@@ -6,7 +6,7 @@ const ht_event_1 = require("./ht-event");
|
|
|
6
6
|
class HtEventKeyword extends ht_event_1.HtEvent {
|
|
7
7
|
constructor(event, requestData) {
|
|
8
8
|
super(event, requestData);
|
|
9
|
-
this.type = types_1.EventType.
|
|
9
|
+
this.type = types_1.EventType.Botevent;
|
|
10
10
|
this.data.nlu_keyword_id = event.data.nluKeywordId;
|
|
11
11
|
this.data.nlu_keyword_name = event.data.nluKeywordName;
|
|
12
12
|
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;
|
|
@@ -6,10 +6,12 @@ const ht_event_1 = require("./ht-event");
|
|
|
6
6
|
class HtEventKnowledgeBase extends ht_event_1.HtEvent {
|
|
7
7
|
constructor(event, requestData) {
|
|
8
8
|
super(event, requestData);
|
|
9
|
-
this.type = types_1.EventType.
|
|
9
|
+
this.type = types_1.EventType.Botevent;
|
|
10
|
+
this.data.knowledgebase_inference_id = event.data.knowledgebaseInferenceId;
|
|
10
11
|
this.data.knowledgebase_fail_reason = event.data.knowledgebaseFailReason;
|
|
11
12
|
this.data.knowledgebase_sources_ids = event.data.knowledgebaseSourcesIds;
|
|
12
13
|
this.data.knowledgebase_chunks_ids = event.data.knowledgebaseChunksIds;
|
|
14
|
+
this.data.knowledgebase_message_id = event.data.knowledgebaseMessageId;
|
|
13
15
|
}
|
|
14
16
|
}
|
|
15
17
|
exports.HtEventKnowledgeBase = HtEventKnowledgeBase;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ht-event-knowledge-base.js","sourceRoot":"","sources":["../../../src/event-models/ht-event-knowledge-base.ts"],"names":[],"mappings":";;;AAAA,oCAKiB;AACjB,yCAAoC;
|
|
1
|
+
{"version":3,"file":"ht-event-knowledge-base.js","sourceRoot":"","sources":["../../../src/event-models/ht-event-knowledge-base.ts"],"names":[],"mappings":";;;AAAA,oCAKiB;AACjB,yCAAoC;AAWpC,MAAa,oBAAqB,SAAQ,kBAAO;IAG/C,YAAY,KAAyB,EAAE,WAAwB;QAC7D,KAAK,CAAC,KAAK,EAAE,WAAW,CAAC,CAAA;QACzB,IAAI,CAAC,IAAI,GAAG,iBAAS,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;AAZD,oDAYC"}
|
|
@@ -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
|
}
|
|
@@ -6,7 +6,7 @@ const ht_event_1 = require("./ht-event");
|
|
|
6
6
|
class HtEventWebview extends ht_event_1.HtEvent {
|
|
7
7
|
constructor(event, requestData) {
|
|
8
8
|
super(event, requestData);
|
|
9
|
-
this.type = types_1.EventType.
|
|
9
|
+
this.type = types_1.EventType.Webevent;
|
|
10
10
|
this.data.webview_thread_id = event.data.webviewThreadId;
|
|
11
11
|
this.data.webview_name = event.data.webviewName;
|
|
12
12
|
this.data.webview_step_name = event.data.webviewStepName;
|
|
@@ -4,8 +4,6 @@ exports.HtEvent = void 0;
|
|
|
4
4
|
class HtEvent {
|
|
5
5
|
constructor(event, requestData) {
|
|
6
6
|
this.chat_id = requestData.userId;
|
|
7
|
-
this.channel = requestData.provider;
|
|
8
|
-
this.created_at = new Date().toISOString();
|
|
9
7
|
this.chat_language = requestData.language;
|
|
10
8
|
this.chat_country = requestData.country;
|
|
11
9
|
this.format_version = 2;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ht-event.js","sourceRoot":"","sources":["../../../src/event-models/ht-event.ts"],"names":[],"mappings":";;;AAEA,MAAa,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,MAAa,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;AApBD,0BAoBC"}
|
package/lib/cjs/index.js
CHANGED
|
@@ -20,10 +20,9 @@ class BotonicPluginHubtypeAnalytics {
|
|
|
20
20
|
return;
|
|
21
21
|
}
|
|
22
22
|
getUrl(request, eventType) {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
}
|
|
26
|
-
return `${this.baseUrl}/external/v2/conversational_apps/${request.session.bot.id}/bot_event/`;
|
|
23
|
+
const endpoint = eventType === types_1.EventType.Webevent ? 'web_event' : 'bot_event';
|
|
24
|
+
const botId = request.session.bot.id;
|
|
25
|
+
return `${this.baseUrl}/external/v2/conversational_apps/${botId}/${endpoint}/`;
|
|
27
26
|
}
|
|
28
27
|
getRequestData(request) {
|
|
29
28
|
return {
|
|
@@ -43,7 +42,7 @@ class BotonicPluginHubtypeAnalytics {
|
|
|
43
42
|
sendEvent(request, event) {
|
|
44
43
|
const url = this.getUrl(request, event.type);
|
|
45
44
|
const headers = { Authorization: `Bearer ${request.session._access_token}` };
|
|
46
|
-
const config = event.type !== types_1.EventType.
|
|
45
|
+
const config = event.type !== types_1.EventType.Webevent ? { headers } : undefined;
|
|
47
46
|
return axios_1.default.post(url, event, config);
|
|
48
47
|
}
|
|
49
48
|
}
|
package/lib/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;AACA,0DAAyB;AAGzB,mCAA8D;AAC9D,mCAAuC;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,MAAqB,6BAA6B;IAIhD,YAAY,OAAiC;QAC3C,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,eAAe,IAAI,yBAAyB,CAAA;QACvE,IAAI,CAAC,WAAW,GAAG,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,WAAW,KAAI,kBAAkB,CAAA;QAC7D,IAAI,CAAC,UAAU,GAAG,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,UAAU,KAAI,iBAAiB,CAAA;IAC5D,CAAC;IAED,IAAI;QACF,OAAM;IACR,CAAC;IAED,MAAM,CAAC,OAAmB,EAAE,SAAoB;QAC9C,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;AACA,0DAAyB;AAGzB,mCAA8D;AAC9D,mCAAuC;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,MAAqB,6BAA6B;IAIhD,YAAY,OAAiC;QAC3C,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,eAAe,IAAI,yBAAyB,CAAA;QACvE,IAAI,CAAC,WAAW,GAAG,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,WAAW,KAAI,kBAAkB,CAAA;QAC7D,IAAI,CAAC,UAAU,GAAG,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,UAAU,KAAI,iBAAiB,CAAA;IAC5D,CAAC;IAED,IAAI;QACF,OAAM;IACR,CAAC;IAED,MAAM,CAAC,OAAmB,EAAE,SAAoB;QAC9C,MAAM,QAAQ,GACZ,SAAS,KAAK,iBAAS,CAAC,QAAQ,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,WAAW,CAAA;QAC9D,MAAM,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAA;QACpC,OAAO,GAAG,IAAI,CAAC,OAAO,oCAAoC,KAAK,IAAI,QAAQ,GAAG,CAAA;IAChF,CAAC;IAED,cAAc,CAAC,OAAmB;QAChC,OAAO;YACL,QAAQ,EAAE,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC;YACnC,OAAO,EAAE,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC;YACjC,QAAQ,EAAE,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ;YACvC,MAAM,EAAE,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;SAChC,CAAA;IACH,CAAC;IAEK,UAAU,CAAC,OAAmB,EAAE,YAA0B;;YAC9D,MAAM,WAAW,GAAG,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,CAAA;YAChD,MAAM,KAAK,GAAG,IAAA,qBAAa,EAAC,WAAW,EAAE,YAAY,CAAC,CAAA;YAEtD,OAAO,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,KAAK,CAAC,CAAA;QACvC,CAAC;KAAA;IAEO,SAAS,CAAC,OAAmB,EAAE,KAAc;QACnD,MAAM,GAAG,GAAG,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,KAAK,CAAC,IAAI,CAAC,CAAA;QAC5C,MAAM,OAAO,GAAG,EAAE,aAAa,EAAE,UAAU,OAAO,CAAC,OAAO,CAAC,aAAa,EAAE,EAAE,CAAA;QAC5E,MAAM,MAAM,GAAG,KAAK,CAAC,IAAI,KAAK,iBAAS,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,SAAS,CAAA;QAC1E,OAAO,eAAK,CAAC,IAAI,CAAC,GAAG,EAAE,KAAK,EAAE,MAAM,CAAC,CAAA;IACvC,CAAC;CACF;AA3CD,gDA2CC;AAED,kDAAuB;AACvB,kDAAuB"}
|
package/lib/cjs/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/cjs/types.js
CHANGED
|
@@ -1,31 +1,34 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.KnowledgebaseFailReason = exports.EventAction = exports.EventType = void 0;
|
|
4
4
|
var EventType;
|
|
5
5
|
(function (EventType) {
|
|
6
|
-
EventType["
|
|
7
|
-
EventType["
|
|
8
|
-
EventType["
|
|
6
|
+
EventType["Feedback"] = "feedback";
|
|
7
|
+
EventType["Botevent"] = "botevent";
|
|
8
|
+
EventType["Webevent"] = "webevent";
|
|
9
9
|
})(EventType = exports.EventType || (exports.EventType = {}));
|
|
10
10
|
var EventAction;
|
|
11
11
|
(function (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["
|
|
26
|
-
EventAction["
|
|
27
|
-
EventAction["
|
|
28
|
-
EventAction["customWeb"] = "custom_web";
|
|
12
|
+
EventAction["FeedbackCase"] = "feedback_case";
|
|
13
|
+
EventAction["FeedbackMessage"] = "feddback_message";
|
|
14
|
+
EventAction["FeedbackConversation"] = "feddback_conversation";
|
|
15
|
+
EventAction["FeedbackWebview"] = "feddback_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";
|
|
29
28
|
})(EventAction = exports.EventAction || (exports.EventAction = {}));
|
|
30
|
-
|
|
29
|
+
var KnowledgebaseFailReason;
|
|
30
|
+
(function (KnowledgebaseFailReason) {
|
|
31
|
+
KnowledgebaseFailReason["NoKnowledge"] = "no_knowledge";
|
|
32
|
+
KnowledgebaseFailReason["Hallucination"] = "hallucination";
|
|
33
|
+
})(KnowledgebaseFailReason = exports.KnowledgebaseFailReason || (exports.KnowledgebaseFailReason = {}));
|
|
31
34
|
//# 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":";;;AAEA,IAAY,SAIX;AAJD,WAAY,SAAS;IACnB,kCAAqB,CAAA;IACrB,kCAAqB,CAAA;IACrB,kCAAqB,CAAA;AACvB,CAAC,EAJW,SAAS,GAAT,iBAAS,KAAT,iBAAS,QAIpB;AAED,IAAY,
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":";;;AAEA,IAAY,SAIX;AAJD,WAAY,SAAS;IACnB,kCAAqB,CAAA;IACrB,kCAAqB,CAAA;IACrB,kCAAqB,CAAA;AACvB,CAAC,EAJW,SAAS,GAAT,iBAAS,KAAT,iBAAS,QAIpB;AAED,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,GAAX,mBAAW,KAAX,mBAAW,QAiBtB;AAwGD,IAAY,uBAGX;AAHD,WAAY,uBAAuB;IACjC,uDAA4B,CAAA;IAC5B,0DAA+B,CAAA;AACjC,CAAC,EAHW,uBAAuB,GAAvB,+BAAuB,KAAvB,+BAAuB,QAGlC"}
|
package/lib/cjs/utils.js
CHANGED
|
@@ -5,31 +5,31 @@ const event_models_1 = require("./event-models");
|
|
|
5
5
|
const types_1 = require("./types");
|
|
6
6
|
function createHtEvent(requestData, htEventProps) {
|
|
7
7
|
switch (htEventProps.action) {
|
|
8
|
-
case types_1.EventAction.
|
|
9
|
-
case types_1.EventAction.
|
|
10
|
-
case types_1.EventAction.
|
|
11
|
-
case types_1.EventAction.
|
|
8
|
+
case types_1.EventAction.FeedbackCase:
|
|
9
|
+
case types_1.EventAction.FeedbackConversation:
|
|
10
|
+
case types_1.EventAction.FeedbackMessage:
|
|
11
|
+
case types_1.EventAction.FeedbackWebview:
|
|
12
12
|
return new event_models_1.HtEventFeedback(htEventProps, requestData);
|
|
13
|
-
case types_1.EventAction.
|
|
13
|
+
case types_1.EventAction.FlowNode:
|
|
14
14
|
return new event_models_1.HtEventFlow(htEventProps, requestData);
|
|
15
|
-
case types_1.EventAction.
|
|
16
|
-
case types_1.EventAction.
|
|
17
|
-
case types_1.EventAction.
|
|
15
|
+
case types_1.EventAction.HandoffOption:
|
|
16
|
+
case types_1.EventAction.HandoffSuccess:
|
|
17
|
+
case types_1.EventAction.HandoffFail:
|
|
18
18
|
return new event_models_1.HtEventHandoff(htEventProps, requestData);
|
|
19
|
-
case types_1.EventAction.
|
|
19
|
+
case types_1.EventAction.Intent:
|
|
20
20
|
return new event_models_1.HtEventIntent(htEventProps, requestData);
|
|
21
|
-
case types_1.EventAction.
|
|
21
|
+
case types_1.EventAction.Keyword:
|
|
22
22
|
return new event_models_1.HtEventKeyword(htEventProps, requestData);
|
|
23
|
-
case types_1.EventAction.
|
|
23
|
+
case types_1.EventAction.IntentSmart:
|
|
24
24
|
return new event_models_1.HtEventIntentSmart(htEventProps, requestData);
|
|
25
|
-
case types_1.EventAction.
|
|
25
|
+
case types_1.EventAction.Knowledgebase:
|
|
26
26
|
return new event_models_1.HtEventKnowledgeBase(htEventProps, requestData);
|
|
27
|
-
case types_1.EventAction.
|
|
27
|
+
case types_1.EventAction.Fallback:
|
|
28
28
|
return new event_models_1.HtEventFallback(htEventProps, requestData);
|
|
29
|
-
case types_1.EventAction.
|
|
29
|
+
case types_1.EventAction.WebviewStep:
|
|
30
|
+
case types_1.EventAction.WebviewEnd:
|
|
30
31
|
return new event_models_1.HtEventWebview(htEventProps, requestData);
|
|
31
|
-
case types_1.EventAction.
|
|
32
|
-
case types_1.EventAction.customWeb:
|
|
32
|
+
case types_1.EventAction.Custom:
|
|
33
33
|
return new event_models_1.HtEventCustom(htEventProps, requestData);
|
|
34
34
|
default:
|
|
35
35
|
return new event_models_1.HtEvent(htEventProps, requestData);
|
package/lib/cjs/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":";;;AAAA,iDAYuB;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,QAAQ;YACvB,OAAO,IAAI,0BAAW,CAAC,YAAY,EAAE,WAAW,CAAC,CAAA;QAEnD,KAAK,mBAAW,CAAC,aAAa,CAAC;QAC/B,KAAK,mBAAW,CAAC,cAAc,CAAC;QAChC,KAAK,mBAAW,CAAC,WAAW;YAC1B,OAAO,IAAI,6BAAc,CAAC,YAAY,EAAE,WAAW,CAAC,CAAA;QAEtD,KAAK,mBAAW,CAAC,MAAM;YACrB,OAAO,IAAI,4BAAa,CAAC,YAAY,EAAE,WAAW,CAAC,CAAA;QAErD,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;
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":";;;AAAA,iDAYuB;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,QAAQ;YACvB,OAAO,IAAI,0BAAW,CAAC,YAAY,EAAE,WAAW,CAAC,CAAA;QAEnD,KAAK,mBAAW,CAAC,aAAa,CAAC;QAC/B,KAAK,mBAAW,CAAC,cAAc,CAAC;QAChC,KAAK,mBAAW,CAAC,WAAW;YAC1B,OAAO,IAAI,6BAAc,CAAC,YAAY,EAAE,WAAW,CAAC,CAAA;QAEtD,KAAK,mBAAW,CAAC,MAAM;YACrB,OAAO,IAAI,4BAAa,CAAC,YAAY,EAAE,WAAW,CAAC,CAAA;QAErD,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,CAAC;QAC7B,KAAK,mBAAW,CAAC,UAAU;YACzB,OAAO,IAAI,6BAAc,CAAC,YAAY,EAAE,WAAW,CAAC,CAAA;QAEtD,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;AA5CD,sCA4CC"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { EventAction, EventCustom, RequestData } from '../types';
|
|
2
2
|
import { HtEvent } from './ht-event';
|
|
3
3
|
interface EventDataCustom {
|
|
4
|
-
action: EventAction.
|
|
4
|
+
action: EventAction.Custom;
|
|
5
|
+
custom_fields: Record<string, any>;
|
|
5
6
|
}
|
|
6
7
|
export declare class HtEventCustom extends HtEvent {
|
|
7
8
|
data: EventDataCustom;
|
|
@@ -1,18 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { EventType } from '../types';
|
|
2
2
|
import { HtEvent } from './ht-event';
|
|
3
3
|
export class HtEventCustom extends HtEvent {
|
|
4
4
|
constructor(event, requestData) {
|
|
5
5
|
super(event, requestData);
|
|
6
|
-
this.type =
|
|
7
|
-
|
|
8
|
-
? EventType.botevent
|
|
9
|
-
: EventType.webevent;
|
|
10
|
-
// Set in data with all attributs that start with 'custom_'
|
|
11
|
-
for (const key in event.data) {
|
|
12
|
-
if (key.startsWith(CUSTOM_PREFIX)) {
|
|
13
|
-
this.data[key] = event.data[key];
|
|
14
|
-
}
|
|
15
|
-
}
|
|
6
|
+
this.type = EventType.Webevent;
|
|
7
|
+
this.data.custom_fields = event.data.customFields;
|
|
16
8
|
}
|
|
17
9
|
}
|
|
18
10
|
//# sourceMappingURL=ht-event-custom.js.map
|