@getlupa/client 1.3.4 → 1.3.6

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.
@@ -20713,9 +20713,11 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20713
20713
  return Env[environment] || Env["production"];
20714
20714
  };
20715
20715
  const suggestSearchChatPhrases = (options, request) => __async(void 0, null, function* () {
20716
+ var _a;
20716
20717
  const { environment, customBaseUrl } = options;
20717
20718
  const res = yield fetch(`${getApiUrl(environment, customBaseUrl)}chat/`, __spreadProps2(__spreadValues2({}, defaultConfig), {
20718
- body: JSON.stringify(request)
20719
+ body: JSON.stringify(request),
20720
+ headers: (_a = options.customHeaders) != null ? _a : {}
20719
20721
  }));
20720
20722
  if (res.status < 400) {
20721
20723
  const data = yield res.json();
@@ -20725,9 +20727,11 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20725
20727
  return { success: false, errors };
20726
20728
  });
20727
20729
  const suggestPhraseAlternatives = (_0, _1) => __async(void 0, [_0, _1], function* (options, { phrases }) {
20730
+ var _a;
20728
20731
  const { environment, customBaseUrl } = options;
20729
20732
  const res = yield fetch(`${getApiUrl(environment, customBaseUrl)}chat/phraseAlternatives`, __spreadProps2(__spreadValues2({}, defaultConfig), {
20730
- body: JSON.stringify({ phrases })
20733
+ body: JSON.stringify({ phrases }),
20734
+ headers: (_a = options.customHeaders) != null ? _a : {}
20731
20735
  }));
20732
20736
  if (res.status < 400) {
20733
20737
  const data = yield res.json();
@@ -20737,9 +20741,11 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20737
20741
  return { success: false, errors };
20738
20742
  });
20739
20743
  const suggestSimplifiedPhrases = (_0, _1) => __async(void 0, [_0, _1], function* (options, { phrases }) {
20744
+ var _a;
20740
20745
  const { environment, customBaseUrl } = options;
20741
20746
  const res = yield fetch(`${getApiUrl(environment, customBaseUrl)}chat/simplify`, __spreadProps2(__spreadValues2({}, defaultConfig), {
20742
- body: JSON.stringify({ phrases })
20747
+ body: JSON.stringify({ phrases }),
20748
+ headers: (_a = options.customHeaders) != null ? _a : {}
20743
20749
  }));
20744
20750
  if (res.status < 400) {
20745
20751
  const data = yield res.json();
@@ -20754,9 +20760,11 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20754
20760
  productStrings,
20755
20761
  messageHistory
20756
20762
  }) {
20763
+ var _a;
20757
20764
  const { environment, customBaseUrl } = options;
20758
20765
  const res = yield fetch(`${getApiUrl(environment, customBaseUrl)}chat/bestProducts`, __spreadProps2(__spreadValues2({}, defaultConfig), {
20759
- body: JSON.stringify({ initialQuery, messageHistory, productStrings })
20766
+ body: JSON.stringify({ initialQuery, messageHistory, productStrings }),
20767
+ headers: (_a = options.customHeaders) != null ? _a : {}
20760
20768
  }));
20761
20769
  if (res.status < 400) {
20762
20770
  const data = yield res.json();
@@ -20713,9 +20713,11 @@ const getApiUrl = (environment, customBaseUrl) => {
20713
20713
  return Env[environment] || Env["production"];
20714
20714
  };
20715
20715
  const suggestSearchChatPhrases = (options, request) => __async(void 0, null, function* () {
20716
+ var _a;
20716
20717
  const { environment, customBaseUrl } = options;
20717
20718
  const res = yield fetch(`${getApiUrl(environment, customBaseUrl)}chat/`, __spreadProps2(__spreadValues2({}, defaultConfig), {
20718
- body: JSON.stringify(request)
20719
+ body: JSON.stringify(request),
20720
+ headers: (_a = options.customHeaders) != null ? _a : {}
20719
20721
  }));
20720
20722
  if (res.status < 400) {
20721
20723
  const data = yield res.json();
@@ -20725,9 +20727,11 @@ const suggestSearchChatPhrases = (options, request) => __async(void 0, null, fun
20725
20727
  return { success: false, errors };
20726
20728
  });
20727
20729
  const suggestPhraseAlternatives = (_0, _1) => __async(void 0, [_0, _1], function* (options, { phrases }) {
20730
+ var _a;
20728
20731
  const { environment, customBaseUrl } = options;
20729
20732
  const res = yield fetch(`${getApiUrl(environment, customBaseUrl)}chat/phraseAlternatives`, __spreadProps2(__spreadValues2({}, defaultConfig), {
20730
- body: JSON.stringify({ phrases })
20733
+ body: JSON.stringify({ phrases }),
20734
+ headers: (_a = options.customHeaders) != null ? _a : {}
20731
20735
  }));
20732
20736
  if (res.status < 400) {
20733
20737
  const data = yield res.json();
@@ -20737,9 +20741,11 @@ const suggestPhraseAlternatives = (_0, _1) => __async(void 0, [_0, _1], function
20737
20741
  return { success: false, errors };
20738
20742
  });
20739
20743
  const suggestSimplifiedPhrases = (_0, _1) => __async(void 0, [_0, _1], function* (options, { phrases }) {
20744
+ var _a;
20740
20745
  const { environment, customBaseUrl } = options;
20741
20746
  const res = yield fetch(`${getApiUrl(environment, customBaseUrl)}chat/simplify`, __spreadProps2(__spreadValues2({}, defaultConfig), {
20742
- body: JSON.stringify({ phrases })
20747
+ body: JSON.stringify({ phrases }),
20748
+ headers: (_a = options.customHeaders) != null ? _a : {}
20743
20749
  }));
20744
20750
  if (res.status < 400) {
20745
20751
  const data = yield res.json();
@@ -20754,9 +20760,11 @@ const suggestBestProductMatches = (_0, _1) => __async(void 0, [_0, _1], function
20754
20760
  productStrings,
20755
20761
  messageHistory
20756
20762
  }) {
20763
+ var _a;
20757
20764
  const { environment, customBaseUrl } = options;
20758
20765
  const res = yield fetch(`${getApiUrl(environment, customBaseUrl)}chat/bestProducts`, __spreadProps2(__spreadValues2({}, defaultConfig), {
20759
- body: JSON.stringify({ initialQuery, messageHistory, productStrings })
20766
+ body: JSON.stringify({ initialQuery, messageHistory, productStrings }),
20767
+ headers: (_a = options.customHeaders) != null ? _a : {}
20760
20768
  }));
20761
20769
  if (res.status < 400) {
20762
20770
  const data = yield res.json();
@@ -20711,9 +20711,11 @@ const getApiUrl = (environment, customBaseUrl) => {
20711
20711
  return Env[environment] || Env["production"];
20712
20712
  };
20713
20713
  const suggestSearchChatPhrases = (options, request) => __async(void 0, null, function* () {
20714
+ var _a;
20714
20715
  const { environment, customBaseUrl } = options;
20715
20716
  const res = yield fetch(`${getApiUrl(environment, customBaseUrl)}chat/`, __spreadProps2(__spreadValues2({}, defaultConfig), {
20716
- body: JSON.stringify(request)
20717
+ body: JSON.stringify(request),
20718
+ headers: (_a = options.customHeaders) != null ? _a : {}
20717
20719
  }));
20718
20720
  if (res.status < 400) {
20719
20721
  const data = yield res.json();
@@ -20723,9 +20725,11 @@ const suggestSearchChatPhrases = (options, request) => __async(void 0, null, fun
20723
20725
  return { success: false, errors };
20724
20726
  });
20725
20727
  const suggestPhraseAlternatives = (_0, _1) => __async(void 0, [_0, _1], function* (options, { phrases }) {
20728
+ var _a;
20726
20729
  const { environment, customBaseUrl } = options;
20727
20730
  const res = yield fetch(`${getApiUrl(environment, customBaseUrl)}chat/phraseAlternatives`, __spreadProps2(__spreadValues2({}, defaultConfig), {
20728
- body: JSON.stringify({ phrases })
20731
+ body: JSON.stringify({ phrases }),
20732
+ headers: (_a = options.customHeaders) != null ? _a : {}
20729
20733
  }));
20730
20734
  if (res.status < 400) {
20731
20735
  const data = yield res.json();
@@ -20735,9 +20739,11 @@ const suggestPhraseAlternatives = (_0, _1) => __async(void 0, [_0, _1], function
20735
20739
  return { success: false, errors };
20736
20740
  });
20737
20741
  const suggestSimplifiedPhrases = (_0, _1) => __async(void 0, [_0, _1], function* (options, { phrases }) {
20742
+ var _a;
20738
20743
  const { environment, customBaseUrl } = options;
20739
20744
  const res = yield fetch(`${getApiUrl(environment, customBaseUrl)}chat/simplify`, __spreadProps2(__spreadValues2({}, defaultConfig), {
20740
- body: JSON.stringify({ phrases })
20745
+ body: JSON.stringify({ phrases }),
20746
+ headers: (_a = options.customHeaders) != null ? _a : {}
20741
20747
  }));
20742
20748
  if (res.status < 400) {
20743
20749
  const data = yield res.json();
@@ -20752,9 +20758,11 @@ const suggestBestProductMatches = (_0, _1) => __async(void 0, [_0, _1], function
20752
20758
  productStrings,
20753
20759
  messageHistory
20754
20760
  }) {
20761
+ var _a;
20755
20762
  const { environment, customBaseUrl } = options;
20756
20763
  const res = yield fetch(`${getApiUrl(environment, customBaseUrl)}chat/bestProducts`, __spreadProps2(__spreadValues2({}, defaultConfig), {
20757
- body: JSON.stringify({ initialQuery, messageHistory, productStrings })
20764
+ body: JSON.stringify({ initialQuery, messageHistory, productStrings }),
20765
+ headers: (_a = options.customHeaders) != null ? _a : {}
20758
20766
  }));
20759
20767
  if (res.status < 400) {
20760
20768
  const data = yield res.json();
@@ -20715,9 +20715,11 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20715
20715
  return Env[environment] || Env["production"];
20716
20716
  };
20717
20717
  const suggestSearchChatPhrases = (options, request) => __async(void 0, null, function* () {
20718
+ var _a;
20718
20719
  const { environment, customBaseUrl } = options;
20719
20720
  const res = yield fetch(`${getApiUrl(environment, customBaseUrl)}chat/`, __spreadProps2(__spreadValues2({}, defaultConfig), {
20720
- body: JSON.stringify(request)
20721
+ body: JSON.stringify(request),
20722
+ headers: (_a = options.customHeaders) != null ? _a : {}
20721
20723
  }));
20722
20724
  if (res.status < 400) {
20723
20725
  const data = yield res.json();
@@ -20727,9 +20729,11 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20727
20729
  return { success: false, errors };
20728
20730
  });
20729
20731
  const suggestPhraseAlternatives = (_0, _1) => __async(void 0, [_0, _1], function* (options, { phrases }) {
20732
+ var _a;
20730
20733
  const { environment, customBaseUrl } = options;
20731
20734
  const res = yield fetch(`${getApiUrl(environment, customBaseUrl)}chat/phraseAlternatives`, __spreadProps2(__spreadValues2({}, defaultConfig), {
20732
- body: JSON.stringify({ phrases })
20735
+ body: JSON.stringify({ phrases }),
20736
+ headers: (_a = options.customHeaders) != null ? _a : {}
20733
20737
  }));
20734
20738
  if (res.status < 400) {
20735
20739
  const data = yield res.json();
@@ -20739,9 +20743,11 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20739
20743
  return { success: false, errors };
20740
20744
  });
20741
20745
  const suggestSimplifiedPhrases = (_0, _1) => __async(void 0, [_0, _1], function* (options, { phrases }) {
20746
+ var _a;
20742
20747
  const { environment, customBaseUrl } = options;
20743
20748
  const res = yield fetch(`${getApiUrl(environment, customBaseUrl)}chat/simplify`, __spreadProps2(__spreadValues2({}, defaultConfig), {
20744
- body: JSON.stringify({ phrases })
20749
+ body: JSON.stringify({ phrases }),
20750
+ headers: (_a = options.customHeaders) != null ? _a : {}
20745
20751
  }));
20746
20752
  if (res.status < 400) {
20747
20753
  const data = yield res.json();
@@ -20756,9 +20762,11 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20756
20762
  productStrings,
20757
20763
  messageHistory
20758
20764
  }) {
20765
+ var _a;
20759
20766
  const { environment, customBaseUrl } = options;
20760
20767
  const res = yield fetch(`${getApiUrl(environment, customBaseUrl)}chat/bestProducts`, __spreadProps2(__spreadValues2({}, defaultConfig), {
20761
- body: JSON.stringify({ initialQuery, messageHistory, productStrings })
20768
+ body: JSON.stringify({ initialQuery, messageHistory, productStrings }),
20769
+ headers: (_a = options.customHeaders) != null ? _a : {}
20762
20770
  }));
20763
20771
  if (res.status < 400) {
20764
20772
  const data = yield res.json();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@getlupa/client",
3
- "version": "1.3.4",
3
+ "version": "1.3.6",
4
4
  "main": "dist/lupaSearch.js",
5
5
  "module": "dist/index.mjs",
6
6
  "types": "dist/src/index.d.ts",
@@ -20,7 +20,7 @@
20
20
  },
21
21
  "devDependencies": {
22
22
  "@getlupa/client-sdk": "^1.3.4",
23
- "@getlupa/vue": "0.3.3",
23
+ "@getlupa/vue": "0.3.4",
24
24
  "@rushstack/eslint-patch": "^1.3.2",
25
25
  "@tsconfig/node18": "^2.0.1",
26
26
  "@types/jsdom": "^21.1.1",