@miso.ai/client-sdk-ui 1.9.5-beta.0 → 1.9.5-beta.1

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.9.5-beta.0';
7
+ var _default = exports.default = '1.9.5-beta.1';
@@ -10,7 +10,7 @@ var _options = require("./options.js");
10
10
  var _index = require("../actor/index.js");
11
11
  var _constants = require("../constants.js");
12
12
  var _index2 = require("../layout/index.js");
13
- const _excluded = ["q", "s"];
13
+ const _excluded = ["q", "qs"];
14
14
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
15
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
16
16
  const DEFAULT_API_OPTIONS = Object.freeze({
@@ -118,7 +118,7 @@ class Ask extends _base.default {
118
118
  } = this._autoQuery = options;
119
119
  const searchParams = new URLSearchParams(window.location.search);
120
120
  const q = searchParams.get('q');
121
- const s = searchParams.get('s');
121
+ const qs = searchParams.get('qs');
122
122
  const {
123
123
  layout
124
124
  } = this._views.get(_constants.ROLE.QUERY);
@@ -133,7 +133,7 @@ class Ask extends _base.default {
133
133
  if (q) {
134
134
  this.query({
135
135
  q,
136
- s
136
+ qs
137
137
  });
138
138
  }
139
139
  }
@@ -141,7 +141,7 @@ class Ask extends _base.default {
141
141
  let _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
142
142
  let {
143
143
  q: question,
144
- s: source
144
+ qs: questionSource
145
145
  } = _ref,
146
146
  payload = _objectWithoutPropertiesLoose(_ref, _excluded);
147
147
  payload = Object.assign({}, payload, {
@@ -150,8 +150,8 @@ class Ask extends _base.default {
150
150
  if (this.parentQuestionId) {
151
151
  payload.parent_question_id = this.parentQuestionId;
152
152
  }
153
- if (source) {
154
- (payload._meta || (payload._meta = {})).question_source = source;
153
+ if (questionSource) {
154
+ (payload._meta || (payload._meta = {})).question_source = questionSource;
155
155
  }
156
156
 
157
157
  // clear question id from previous session
@@ -163,8 +163,8 @@ class Ask extends _base.default {
163
163
  const {
164
164
  session
165
165
  } = this;
166
- if (source) {
167
- session.meta.question_source = source;
166
+ if (questionSource) {
167
+ session.meta.question_source = questionSource;
168
168
  }
169
169
  this._hub.update(_index.fields.request(), (0, _options.mergeApiOptions)(this._options.resolved.api, {
170
170
  payload,
@@ -139,7 +139,7 @@ class Explore extends _base.default {
139
139
  }
140
140
  const url = this._linkFn(text);
141
141
  if (this._productId) {
142
- return `${url}&s=${encodeURIComponent(this._productId)}`;
142
+ return `${url}&qs=${encodeURIComponent(this._productId)}`;
143
143
  }
144
144
  }
145
145
  }
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.9.5-beta.0"
29
+ "@miso.ai/commons": "1.9.5-beta.1"
30
30
  },
31
- "version": "1.9.5-beta.0"
31
+ "version": "1.9.5-beta.1"
32
32
  }
package/src/version.js CHANGED
@@ -1 +1 @@
1
- export default '1.9.5-beta.0';
1
+ export default '1.9.5-beta.1';
@@ -101,7 +101,7 @@ export default class Ask extends Workflow {
101
101
  const { setValue = true, focus = true } = this._autoQuery = options;
102
102
  const searchParams = new URLSearchParams(window.location.search);
103
103
  const q = searchParams.get('q');
104
- const s = searchParams.get('s');
104
+ const qs = searchParams.get('qs');
105
105
  const { layout } = this._views.get(ROLE.QUERY);
106
106
  if (layout) {
107
107
  if (q && setValue) {
@@ -112,18 +112,18 @@ export default class Ask extends Workflow {
112
112
  }
113
113
  }
114
114
  if (q) {
115
- this.query({ q, s });
115
+ this.query({ q, qs });
116
116
  }
117
117
  }
118
118
 
119
- query({ q: question, s: source, ...payload } = {}) {
119
+ query({ q: question, qs: questionSource, ...payload } = {}) {
120
120
  payload = { ...payload, question };
121
121
 
122
122
  if (this.parentQuestionId) {
123
123
  payload.parent_question_id = this.parentQuestionId;
124
124
  }
125
- if (source) {
126
- (payload._meta || (payload._meta = {})).question_source = source;
125
+ if (questionSource) {
126
+ (payload._meta || (payload._meta = {})).question_source = questionSource;
127
127
  }
128
128
 
129
129
  // clear question id from previous session
@@ -135,8 +135,8 @@ export default class Ask extends Workflow {
135
135
  this.restart();
136
136
 
137
137
  const { session } = this;
138
- if (source) {
139
- session.meta.question_source = source;
138
+ if (questionSource) {
139
+ session.meta.question_source = questionSource;
140
140
  }
141
141
  this._hub.update(fields.request(), mergeApiOptions(this._options.resolved.api, { payload, session }));
142
142
 
@@ -121,7 +121,7 @@ export default class Explore extends Workflow {
121
121
  }
122
122
  const url = this._linkFn(text);
123
123
  if (this._productId) {
124
- return `${url}&s=${encodeURIComponent(this._productId)}`;
124
+ return `${url}&qs=${encodeURIComponent(this._productId)}`;
125
125
  }
126
126
  }
127
127