@botonic/plugin-flow-builder 0.27.1 → 0.27.3
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/content-fields/hubtype-fields/common.d.ts +1 -0
- package/lib/cjs/tracking.d.ts +3 -2
- package/lib/cjs/tracking.js +7 -2
- package/lib/cjs/tracking.js.map +1 -1
- package/lib/esm/content-fields/hubtype-fields/common.d.ts +1 -0
- package/lib/esm/tracking.d.ts +3 -2
- package/lib/esm/tracking.js +7 -2
- package/lib/esm/tracking.js.map +1 -1
- package/package.json +1 -1
- package/src/content-fields/hubtype-fields/common.ts +1 -0
- package/src/tracking.ts +6 -2
package/lib/cjs/tracking.d.ts
CHANGED
|
@@ -19,11 +19,12 @@ export declare function getContentEventArgs(request: ActionRequest, contentInfo:
|
|
|
19
19
|
flowId: string;
|
|
20
20
|
flowName: string;
|
|
21
21
|
id: string;
|
|
22
|
+
isMeaningful: boolean;
|
|
22
23
|
}): {
|
|
23
|
-
flowThreadId: string
|
|
24
|
+
flowThreadId: string;
|
|
24
25
|
flowId: string;
|
|
25
26
|
flowName: string;
|
|
26
27
|
flowNodeId: string;
|
|
27
28
|
flowNodeContentId: string;
|
|
28
|
-
flowNodeIsMeaningful:
|
|
29
|
+
flowNodeIsMeaningful: boolean;
|
|
29
30
|
};
|
package/lib/cjs/tracking.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getContentEventArgs = exports.trackFlowContent = exports.trackEvent = exports.KnowledgebaseFailReason = exports.EventAction = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
+
const uuid_1 = require("uuid");
|
|
5
6
|
const helpers_1 = require("./helpers");
|
|
6
7
|
var EventAction;
|
|
7
8
|
(function (EventAction) {
|
|
@@ -28,6 +29,7 @@ function trackEvent(request, eventAction, args) {
|
|
|
28
29
|
}
|
|
29
30
|
exports.trackEvent = trackEvent;
|
|
30
31
|
function trackFlowContent(request, contents) {
|
|
32
|
+
var _a;
|
|
31
33
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
32
34
|
const flowBuilderPlugin = (0, helpers_1.getFlowBuilderPlugin)(request.plugins);
|
|
33
35
|
const cmsApi = flowBuilderPlugin.cmsApi;
|
|
@@ -38,20 +40,23 @@ function trackFlowContent(request, contents) {
|
|
|
38
40
|
flowId: firstNodeContent.flow_id,
|
|
39
41
|
flowName,
|
|
40
42
|
id: firstNodeContent.id,
|
|
43
|
+
isMeaningful: (_a = firstNodeContent.is_meaningful) !== null && _a !== void 0 ? _a : false,
|
|
41
44
|
});
|
|
42
45
|
yield trackEvent(request, EventAction.FlowNode, eventArgs);
|
|
43
46
|
});
|
|
44
47
|
}
|
|
45
48
|
exports.trackFlowContent = trackFlowContent;
|
|
46
49
|
function getContentEventArgs(request, contentInfo) {
|
|
50
|
+
var _a;
|
|
47
51
|
const flowBuilderPlugin = (0, helpers_1.getFlowBuilderPlugin)(request.plugins);
|
|
52
|
+
const flowThreadId = (_a = request.session.flow_thread_id) !== null && _a !== void 0 ? _a : (0, uuid_1.v4)();
|
|
48
53
|
return {
|
|
49
|
-
flowThreadId
|
|
54
|
+
flowThreadId,
|
|
50
55
|
flowId: contentInfo.flowId,
|
|
51
56
|
flowName: flowBuilderPlugin.getFlowName(contentInfo.flowId),
|
|
52
57
|
flowNodeId: contentInfo.id,
|
|
53
58
|
flowNodeContentId: contentInfo.code,
|
|
54
|
-
flowNodeIsMeaningful:
|
|
59
|
+
flowNodeIsMeaningful: contentInfo.isMeaningful,
|
|
55
60
|
};
|
|
56
61
|
}
|
|
57
62
|
exports.getContentEventArgs = getContentEventArgs;
|
package/lib/cjs/tracking.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tracking.js","sourceRoot":"","sources":["../../src/tracking.ts"],"names":[],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"tracking.js","sourceR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OAAO;YAChC,QAAQ;YACR,EAAE,EAAE,gBAAgB,CAAC,EAAE;YACvB,YAAY,EAAE,MAAA,gBAAgB,CAAC,aAAa,mCAAI,KAAK;SACtD,CAAC,CAAA;QACF,MAAM,UAAU,CAAC,OAAO,EAAE,WAAW,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAA;;CAC3D;AAhBD,4CAgBC;AAED,SAAgB,mBAAmB,CACjC,OAAsB,EACtB,WAMC;;IAED,MAAM,iBAAiB,GAAG,IAAA,8BAAoB,EAAC,OAAO,CAAC,OAAO,CAAC,CAAA;IAC/D,MAAM,YAAY,GAAG,MAAA,OAAO,CAAC,OAAO,CAAC,cAAc,mCAAI,IAAA,SAAI,GAAE,CAAA;IAC7D,OAAO;QACL,YAAY;QACZ,MAAM,EAAE,WAAW,CAAC,MAAM;QAC1B,QAAQ,EAAE,iBAAiB,CAAC,WAAW,CAAC,WAAW,CAAC,MAAM,CAAC;QAC3D,UAAU,EAAE,WAAW,CAAC,EAAE;QAC1B,iBAAiB,EAAE,WAAW,CAAC,IAAI;QACnC,oBAAoB,EAAE,WAAW,CAAC,YAAY;KAC/C,CAAA;AACH,CAAC;AApBD,kDAoBC"}
|
package/lib/esm/tracking.d.ts
CHANGED
|
@@ -19,11 +19,12 @@ export declare function getContentEventArgs(request: ActionRequest, contentInfo:
|
|
|
19
19
|
flowId: string;
|
|
20
20
|
flowName: string;
|
|
21
21
|
id: string;
|
|
22
|
+
isMeaningful: boolean;
|
|
22
23
|
}): {
|
|
23
|
-
flowThreadId: string
|
|
24
|
+
flowThreadId: string;
|
|
24
25
|
flowId: string;
|
|
25
26
|
flowName: string;
|
|
26
27
|
flowNodeId: string;
|
|
27
28
|
flowNodeContentId: string;
|
|
28
|
-
flowNodeIsMeaningful:
|
|
29
|
+
flowNodeIsMeaningful: boolean;
|
|
29
30
|
};
|
package/lib/esm/tracking.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { __awaiter } from "tslib";
|
|
2
|
+
import { v4 as uuid } from 'uuid';
|
|
2
3
|
import { getFlowBuilderPlugin } from './helpers';
|
|
3
4
|
export var EventAction;
|
|
4
5
|
(function (EventAction) {
|
|
@@ -24,6 +25,7 @@ export function trackEvent(request, eventAction, args) {
|
|
|
24
25
|
});
|
|
25
26
|
}
|
|
26
27
|
export function trackFlowContent(request, contents) {
|
|
28
|
+
var _a;
|
|
27
29
|
return __awaiter(this, void 0, void 0, function* () {
|
|
28
30
|
const flowBuilderPlugin = getFlowBuilderPlugin(request.plugins);
|
|
29
31
|
const cmsApi = flowBuilderPlugin.cmsApi;
|
|
@@ -34,19 +36,22 @@ export function trackFlowContent(request, contents) {
|
|
|
34
36
|
flowId: firstNodeContent.flow_id,
|
|
35
37
|
flowName,
|
|
36
38
|
id: firstNodeContent.id,
|
|
39
|
+
isMeaningful: (_a = firstNodeContent.is_meaningful) !== null && _a !== void 0 ? _a : false,
|
|
37
40
|
});
|
|
38
41
|
yield trackEvent(request, EventAction.FlowNode, eventArgs);
|
|
39
42
|
});
|
|
40
43
|
}
|
|
41
44
|
export function getContentEventArgs(request, contentInfo) {
|
|
45
|
+
var _a;
|
|
42
46
|
const flowBuilderPlugin = getFlowBuilderPlugin(request.plugins);
|
|
47
|
+
const flowThreadId = (_a = request.session.flow_thread_id) !== null && _a !== void 0 ? _a : uuid();
|
|
43
48
|
return {
|
|
44
|
-
flowThreadId
|
|
49
|
+
flowThreadId,
|
|
45
50
|
flowId: contentInfo.flowId,
|
|
46
51
|
flowName: flowBuilderPlugin.getFlowName(contentInfo.flowId),
|
|
47
52
|
flowNodeId: contentInfo.id,
|
|
48
53
|
flowNodeContentId: contentInfo.code,
|
|
49
|
-
flowNodeIsMeaningful:
|
|
54
|
+
flowNodeIsMeaningful: contentInfo.isMeaningful,
|
|
50
55
|
};
|
|
51
56
|
}
|
|
52
57
|
//# sourceMappingURL=tracking.js.map
|
package/lib/esm/tracking.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tracking.js","sourceRoot":"","sources":["../../src/tracking.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"tracking.js","sourceRoot":"","sources":["../../src/tracking.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,EAAE,IAAI,IAAI,EAAE,MAAM,MAAM,CAAA;AAIjC,OAAO,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAA;AAEhD,MAAM,CAAN,IAAY,WAOX;AAPD,WAAY,WAAW;IACrB,qCAAsB,CAAA;IACtB,sCAAuB,CAAA;IACvB,oCAAqB,CAAA;IACrB,+CAAgC,CAAA;IAChC,8CAA+B,CAAA;IAC/B,oCAAqB,CAAA;AACvB,CAAC,EAPW,WAAW,KAAX,WAAW,QAOtB;AAED,MAAM,CAAN,IAAY,uBAGX;AAHD,WAAY,uBAAuB;IACjC,uDAA4B,CAAA;IAC5B,0DAA+B,CAAA;AACjC,CAAC,EAHW,uBAAuB,KAAvB,uBAAuB,QAGlC;AAED,MAAM,UAAgB,UAAU,CAC9B,OAAsB,EACtB,WAAwB,EACxB,IAA0B;;QAE1B,MAAM,iBAAiB,GAAG,oBAAoB,CAAC,OAAO,CAAC,OAAO,CAAC,CAAA;QAC/D,IAAI,iBAAiB,CAAC,UAAU,EAAE;YAChC,MAAM,iBAAiB,CAAC,UAAU,CAAC,OAAO,EAAE,WAAW,EAAE,IAAI,CAAC,CAAA;SAC/D;QACD,OAAM;IACR,CAAC;CAAA;AAED,MAAM,UAAgB,gBAAgB,CACpC,OAAsB,EACtB,QAAuB;;;QAEvB,MAAM,iBAAiB,GAAG,oBAAoB,CAAC,OAAO,CAAC,OAAO,CAAC,CAAA;QAC/D,MAAM,MAAM,GAAG,iBAAiB,CAAC,MAAM,CAAA;QACvC,MAAM,gBAAgB,GAAG,MAAM,CAAC,WAAW,CAAoB,QAAQ,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAA;QAC9E,MAAM,QAAQ,GAAG,iBAAiB,CAAC,WAAW,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAA;QACxE,MAAM,SAAS,GAAG,mBAAmB,CAAC,OAAO,EAAE;YAC7C,IAAI,EAAE,gBAAgB,CAAC,IAAI;YAC3B,MAAM,EAAE,gBAAgB,CAAC,OAAO;YAChC,QAAQ;YACR,EAAE,EAAE,gBAAgB,CAAC,EAAE;YACvB,YAAY,EAAE,MAAA,gBAAgB,CAAC,aAAa,mCAAI,KAAK;SACtD,CAAC,CAAA;QACF,MAAM,UAAU,CAAC,OAAO,EAAE,WAAW,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAA;;CAC3D;AAED,MAAM,UAAU,mBAAmB,CACjC,OAAsB,EACtB,WAMC;;IAED,MAAM,iBAAiB,GAAG,oBAAoB,CAAC,OAAO,CAAC,OAAO,CAAC,CAAA;IAC/D,MAAM,YAAY,GAAG,MAAA,OAAO,CAAC,OAAO,CAAC,cAAc,mCAAI,IAAI,EAAE,CAAA;IAC7D,OAAO;QACL,YAAY;QACZ,MAAM,EAAE,WAAW,CAAC,MAAM;QAC1B,QAAQ,EAAE,iBAAiB,CAAC,WAAW,CAAC,WAAW,CAAC,MAAM,CAAC;QAC3D,UAAU,EAAE,WAAW,CAAC,EAAE;QAC1B,iBAAiB,EAAE,WAAW,CAAC,IAAI;QACnC,oBAAoB,EAAE,WAAW,CAAC,YAAY;KAC/C,CAAA;AACH,CAAC"}
|
package/package.json
CHANGED
package/src/tracking.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ActionRequest } from '@botonic/react'
|
|
2
|
+
import { v4 as uuid } from 'uuid'
|
|
2
3
|
|
|
3
4
|
import { FlowContent } from './content-fields'
|
|
4
5
|
import { HtNodeWithContent } from './content-fields/hubtype-fields'
|
|
@@ -43,6 +44,7 @@ export async function trackFlowContent(
|
|
|
43
44
|
flowId: firstNodeContent.flow_id,
|
|
44
45
|
flowName,
|
|
45
46
|
id: firstNodeContent.id,
|
|
47
|
+
isMeaningful: firstNodeContent.is_meaningful ?? false,
|
|
46
48
|
})
|
|
47
49
|
await trackEvent(request, EventAction.FlowNode, eventArgs)
|
|
48
50
|
}
|
|
@@ -54,15 +56,17 @@ export function getContentEventArgs(
|
|
|
54
56
|
flowId: string
|
|
55
57
|
flowName: string
|
|
56
58
|
id: string
|
|
59
|
+
isMeaningful: boolean
|
|
57
60
|
}
|
|
58
61
|
) {
|
|
59
62
|
const flowBuilderPlugin = getFlowBuilderPlugin(request.plugins)
|
|
63
|
+
const flowThreadId = request.session.flow_thread_id ?? uuid()
|
|
60
64
|
return {
|
|
61
|
-
flowThreadId
|
|
65
|
+
flowThreadId,
|
|
62
66
|
flowId: contentInfo.flowId,
|
|
63
67
|
flowName: flowBuilderPlugin.getFlowName(contentInfo.flowId),
|
|
64
68
|
flowNodeId: contentInfo.id,
|
|
65
69
|
flowNodeContentId: contentInfo.code,
|
|
66
|
-
flowNodeIsMeaningful:
|
|
70
|
+
flowNodeIsMeaningful: contentInfo.isMeaningful,
|
|
67
71
|
}
|
|
68
72
|
}
|