@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.
@@ -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,
@@ -4,4 +4,4 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
- var _default = exports.default = '1.10.2-beta.3';
7
+ var _default = exports.default = '1.10.2-beta.5';
@@ -78,7 +78,10 @@ class Explore extends _base.default {
78
78
 
79
79
  // lifecycle //
80
80
  start() {
81
- if (this._linkFn === undefined) {
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
- this._hub.update(_index.fields.request(), (0, _options.mergeApiOptions)(this._options.resolved.api, {
91
- session
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
@@ -26,7 +26,7 @@
26
26
  "url": "https://github.com/MisoAI/miso-client-js-sdk/issues"
27
27
  },
28
28
  "dependencies": {
29
- "@miso.ai/commons": "1.10.2-beta.3"
29
+ "@miso.ai/commons": "1.10.2-beta.5"
30
30
  },
31
- "version": "1.10.2-beta.3"
31
+ "version": "1.10.2-beta.5"
32
32
  }
@@ -1,4 +1,4 @@
1
- import { trimObj, uuidToTimestamp } from '@miso.ai/commons';
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.3';
1
+ export default '1.10.2-beta.5';
@@ -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
- this._hub.update(fields.request(), mergeApiOptions(this._options.resolved.api, { session }));
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