@miso.ai/client-sdk-core 1.11.0-beta.0 → 1.11.0-beta.10
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/api/ask.js +12 -7
- package/dist/cjs/plugin/page-info.js +1 -1
- package/dist/cjs/version.js +1 -1
- package/package.json +2 -2
- package/src/api/ask.js +15 -6
- package/src/plugin/page-info.js +1 -1
- package/src/version.js +1 -1
package/dist/cjs/api/ask.js
CHANGED
|
@@ -21,10 +21,8 @@ class Ask extends _base.default {
|
|
|
21
21
|
if (isId(payload)) {
|
|
22
22
|
return new Answer(this, payload, options);
|
|
23
23
|
}
|
|
24
|
-
const
|
|
25
|
-
|
|
26
|
-
} = await this._run(NAME.QUESTIONS, payload, options);
|
|
27
|
-
return new Answer(this, question_id, options);
|
|
24
|
+
const response = await this._run(NAME.QUESTIONS, payload, options);
|
|
25
|
+
return new Answer(this, response, options);
|
|
28
26
|
}
|
|
29
27
|
async _questions(payload, options) {
|
|
30
28
|
return this._run(NAME.QUESTIONS, payload, options);
|
|
@@ -44,16 +42,23 @@ class Ask extends _base.default {
|
|
|
44
42
|
return response.question_id ? new SearchResult(this, response, options) : response;
|
|
45
43
|
}
|
|
46
44
|
async _searchGet(questionId, options) {
|
|
47
|
-
return this._run(`${NAME.
|
|
45
|
+
return this._run(`${NAME.QUESTIONS}/${questionId}/answer`, undefined, Object.assign({}, options, {
|
|
48
46
|
method: 'GET'
|
|
49
47
|
}));
|
|
50
48
|
}
|
|
49
|
+
async autocomplete(payload, options) {
|
|
50
|
+
return this._run(NAME.AUTOCOMPLETE, payload, options);
|
|
51
|
+
}
|
|
52
|
+
async searchAutocomplete(payload, options) {
|
|
53
|
+
return this._run(NAME.SEARCH_AUTOCOMPLETE, payload, options);
|
|
54
|
+
}
|
|
51
55
|
}
|
|
52
56
|
exports.default = Ask;
|
|
53
57
|
class Answer extends _iterable.IdBasedIterableApiStub {
|
|
54
|
-
constructor(api,
|
|
58
|
+
constructor(api, response) {
|
|
55
59
|
let options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
56
|
-
super(api, '_questionGet',
|
|
60
|
+
super(api, '_questionGet', response.question_id, options);
|
|
61
|
+
this._response = response;
|
|
57
62
|
}
|
|
58
63
|
get questionId() {
|
|
59
64
|
return this._id;
|
package/dist/cjs/version.js
CHANGED
package/package.json
CHANGED
package/src/api/ask.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { API, defineValues
|
|
1
|
+
import { API, defineValues } from '@miso.ai/commons';
|
|
2
2
|
import ApiBase from './base.js';
|
|
3
3
|
import { IdBasedIterableApiStub } from './iterable.js';
|
|
4
4
|
|
|
@@ -14,8 +14,8 @@ export default class Ask extends ApiBase {
|
|
|
14
14
|
if (isId(payload)) {
|
|
15
15
|
return new Answer(this, payload, options);
|
|
16
16
|
}
|
|
17
|
-
const
|
|
18
|
-
return new Answer(this,
|
|
17
|
+
const response = await this._run(NAME.QUESTIONS, payload, options);
|
|
18
|
+
return new Answer(this, response, options);
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
async _questions(payload, options) {
|
|
@@ -36,15 +36,24 @@ export default class Ask extends ApiBase {
|
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
async _searchGet(questionId, options) {
|
|
39
|
-
return this._run(`${NAME.
|
|
39
|
+
return this._run(`${NAME.QUESTIONS}/${questionId}/answer`, undefined, { ...options, method: 'GET' });
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
async autocomplete(payload, options) {
|
|
43
|
+
return this._run(NAME.AUTOCOMPLETE, payload, options);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
async searchAutocomplete(payload, options) {
|
|
47
|
+
return this._run(NAME.SEARCH_AUTOCOMPLETE, payload, options);
|
|
40
48
|
}
|
|
41
49
|
|
|
42
50
|
}
|
|
43
51
|
|
|
44
52
|
class Answer extends IdBasedIterableApiStub {
|
|
45
53
|
|
|
46
|
-
constructor(api,
|
|
47
|
-
super(api, '_questionGet',
|
|
54
|
+
constructor(api, response, options = {}) {
|
|
55
|
+
super(api, '_questionGet', response.question_id, options);
|
|
56
|
+
this._response = response;
|
|
48
57
|
}
|
|
49
58
|
|
|
50
59
|
get questionId() {
|
package/src/plugin/page-info.js
CHANGED
package/src/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export default '1.11.0-beta.
|
|
1
|
+
export default '1.11.0-beta.10';
|