@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.
package/dist/cjs/version.js
CHANGED
|
@@ -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);
|
package/dist/cjs/workflow/ask.js
CHANGED
|
@@ -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
package/src/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export default '1.12.3-beta.
|
|
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);
|
package/src/workflow/ask.js
CHANGED
|
@@ -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,
|