@miso.ai/client-sdk-ui 1.10.2-beta.3 → 1.10.2-beta.5
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/dist/cjs/actor/utils.js +0 -7
- package/dist/cjs/version.js +1 -1
- package/dist/cjs/workflow/explore.js +16 -4
- package/package.json +2 -2
- package/src/actor/utils.js +1 -8
- package/src/version.js +1 -1
- package/src/workflow/explore.js +7 -3
package/dist/cjs/actor/utils.js
CHANGED
|
@@ -25,12 +25,6 @@ function toInteraction(_ref, _ref2) {
|
|
|
25
25
|
values,
|
|
26
26
|
manual
|
|
27
27
|
} = _ref2;
|
|
28
|
-
let api_ts;
|
|
29
|
-
if (misoId) {
|
|
30
|
-
try {
|
|
31
|
-
api_ts = (0, _commons.uuidToTimestamp)(misoId);
|
|
32
|
-
} catch (e) {}
|
|
33
|
-
}
|
|
34
28
|
// TODO: ad-hoc
|
|
35
29
|
const question_source = request && request._meta && request._meta.question_source;
|
|
36
30
|
const isProductType = isProduct(property);
|
|
@@ -47,7 +41,6 @@ function toInteraction(_ref, _ref2) {
|
|
|
47
41
|
miso_id: misoId,
|
|
48
42
|
context: {
|
|
49
43
|
custom_context: (0, _commons.trimObj)({
|
|
50
|
-
api_ts,
|
|
51
44
|
property,
|
|
52
45
|
channel,
|
|
53
46
|
items,
|
package/dist/cjs/version.js
CHANGED
|
@@ -78,7 +78,10 @@ class Explore extends _base.default {
|
|
|
78
78
|
|
|
79
79
|
// lifecycle //
|
|
80
80
|
start() {
|
|
81
|
-
|
|
81
|
+
let {
|
|
82
|
+
relatedQuestions = true
|
|
83
|
+
} = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
84
|
+
if (relatedQuestions && this._linkFn === undefined) {
|
|
82
85
|
throw new Error('Define link mapping function before calling start()');
|
|
83
86
|
}
|
|
84
87
|
this._sessions.start();
|
|
@@ -87,9 +90,18 @@ class Explore extends _base.default {
|
|
|
87
90
|
const {
|
|
88
91
|
session
|
|
89
92
|
} = this;
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
+
if (relatedQuestions) {
|
|
94
|
+
this._hub.update(_index.fields.request(), (0, _options.mergeApiOptions)(this._options.resolved.api, {
|
|
95
|
+
session
|
|
96
|
+
}));
|
|
97
|
+
} else {
|
|
98
|
+
this.updateData({
|
|
99
|
+
session,
|
|
100
|
+
value: {
|
|
101
|
+
related_questions: []
|
|
102
|
+
}
|
|
103
|
+
});
|
|
104
|
+
}
|
|
93
105
|
return this;
|
|
94
106
|
}
|
|
95
107
|
notifyViewUpdate() {
|
package/package.json
CHANGED
package/src/actor/utils.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { trimObj
|
|
1
|
+
import { trimObj } from '@miso.ai/commons';
|
|
2
2
|
import { ROLE, EVENT_TYPE } from '../constants.js';
|
|
3
3
|
|
|
4
4
|
const PRODUCT_TYPED_PROPERTIES = new Set([
|
|
@@ -13,12 +13,6 @@ export function isProduct(property) {
|
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
export function toInteraction({ property, misoId, request }, { event, values, manual }) {
|
|
16
|
-
let api_ts;
|
|
17
|
-
if (misoId) {
|
|
18
|
-
try {
|
|
19
|
-
api_ts = uuidToTimestamp(misoId);
|
|
20
|
-
} catch (e) {}
|
|
21
|
-
}
|
|
22
16
|
// TODO: ad-hoc
|
|
23
17
|
const question_source = request && request._meta && request._meta.question_source;
|
|
24
18
|
const isProductType = isProduct(property);
|
|
@@ -38,7 +32,6 @@ export function toInteraction({ property, misoId, request }, { event, values, ma
|
|
|
38
32
|
miso_id: misoId,
|
|
39
33
|
context: {
|
|
40
34
|
custom_context: trimObj({
|
|
41
|
-
api_ts,
|
|
42
35
|
property,
|
|
43
36
|
channel,
|
|
44
37
|
items,
|
package/src/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export default '1.10.2-beta.
|
|
1
|
+
export default '1.10.2-beta.5';
|
package/src/workflow/explore.js
CHANGED
|
@@ -73,15 +73,19 @@ export default class Explore extends Workflow {
|
|
|
73
73
|
}
|
|
74
74
|
|
|
75
75
|
// lifecycle //
|
|
76
|
-
start() {
|
|
77
|
-
if (this._linkFn === undefined) {
|
|
76
|
+
start({ relatedQuestions = true } = {}) {
|
|
77
|
+
if (relatedQuestions && this._linkFn === undefined) {
|
|
78
78
|
throw new Error('Define link mapping function before calling start()');
|
|
79
79
|
}
|
|
80
80
|
this._sessions.start();
|
|
81
81
|
// in explore workflow, start() triggers query
|
|
82
82
|
// TODO: we should still make the query lifecycle
|
|
83
83
|
const { session } = this;
|
|
84
|
-
|
|
84
|
+
if (relatedQuestions) {
|
|
85
|
+
this._hub.update(fields.request(), mergeApiOptions(this._options.resolved.api, { session }));
|
|
86
|
+
} else {
|
|
87
|
+
this.updateData({ session, value: { related_questions: [] } });
|
|
88
|
+
}
|
|
85
89
|
return this;
|
|
86
90
|
}
|
|
87
91
|
|