@miso.ai/client-sdk-ui 1.12.3-beta.2 → 1.12.3-beta.4

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.
@@ -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.12.3-beta.2';
7
+ var _default = exports.default = '1.12.3-beta.4';
@@ -160,7 +160,7 @@ class AnswerBasedWorkflow extends _base.default {
160
160
  }
161
161
  query(args) {
162
162
  // TODO: also accept "question", "questionSource"?
163
- if (!args.q) {
163
+ if (!args.q && !args.questionId) {
164
164
  throw new Error(`q is required in query() call`);
165
165
  }
166
166
  this._hub.update(_index.fields.query(), args);
@@ -12,7 +12,7 @@ var _index2 = require("../layout/index.js");
12
12
  var _processors = require("./processors.js");
13
13
  var _index3 = require("./options/index.js");
14
14
  var _templates = require("../defaults/ask/templates.js");
15
- const _excluded = ["q", "qs"];
15
+ const _excluded = ["q", "qs", "questionId"];
16
16
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
17
17
  function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
18
18
  const DEFAULT_API_OPTIONS = Object.freeze(Object.assign({}, _answerBased.default.DEFAULT_API_OPTIONS, {
@@ -130,9 +130,16 @@ class Ask extends _answerBased.default {
130
130
  _buildPayload(_ref = {}) {
131
131
  let {
132
132
  q,
133
- qs
133
+ qs,
134
+ questionId
134
135
  } = _ref,
135
136
  options = _objectWithoutPropertiesLoose(_ref, _excluded);
137
+ if (questionId) {
138
+ return (0, _commons.trimObj)(Object.assign({}, options, {
139
+ question_id: questionId
140
+ // TODO: specify this is a replayed session
141
+ }));
142
+ }
136
143
  const {
137
144
  parentQuestionId
138
145
  } = this;
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.12.3-beta.2"
29
+ "@miso.ai/commons": "1.12.3-beta.4"
30
30
  },
31
- "version": "1.12.3-beta.2"
31
+ "version": "1.12.3-beta.4"
32
32
  }
package/src/version.js CHANGED
@@ -1 +1 @@
1
- export default '1.12.3-beta.2';
1
+ export default '1.12.3-beta.4';
@@ -151,7 +151,7 @@ export default class AnswerBasedWorkflow extends Workflow {
151
151
 
152
152
  query(args) {
153
153
  // TODO: also accept "question", "questionSource"?
154
- if (!args.q) {
154
+ if (!args.q && !args.questionId) {
155
155
  throw new Error(`q is required in query() call`);
156
156
  }
157
157
  this._hub.update(fields.query(), args);
@@ -125,7 +125,14 @@ export default class Ask extends AnswerBasedWorkflow {
125
125
  }
126
126
 
127
127
  // query //
128
- _buildPayload({ q, qs, ...options } = {}) {
128
+ _buildPayload({ q, qs, questionId, ...options } = {}) {
129
+ if (questionId) {
130
+ return trimObj({
131
+ ...options,
132
+ question_id: questionId,
133
+ // TODO: specify this is a replayed session
134
+ });
135
+ }
129
136
  const { parentQuestionId } = this;
130
137
  let payload = trimObj({
131
138
  ...options,