@getlupa/vue 0.3.3 → 0.3.5
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/lupaSearch.js +61 -34
- package/dist/lupaSearch.mjs +61 -34
- package/package.json +1 -1
package/dist/lupaSearch.js
CHANGED
|
@@ -16079,6 +16079,7 @@ const defaultConfig = {
|
|
|
16079
16079
|
method: "POST",
|
|
16080
16080
|
headers: { "Content-Type": "application/json" }
|
|
16081
16081
|
};
|
|
16082
|
+
const headers = defaultConfig.headers;
|
|
16082
16083
|
const getApiUrl = (environment, customBaseUrl) => {
|
|
16083
16084
|
if (customBaseUrl) {
|
|
16084
16085
|
return customBaseUrl;
|
|
@@ -16086,58 +16087,84 @@ const getApiUrl = (environment, customBaseUrl) => {
|
|
|
16086
16087
|
return Env[environment] || Env["production"];
|
|
16087
16088
|
};
|
|
16088
16089
|
const suggestSearchChatPhrases = (options, request) => __async(exports, null, function* () {
|
|
16090
|
+
var _a, _b;
|
|
16089
16091
|
const { environment, customBaseUrl } = options;
|
|
16090
|
-
|
|
16091
|
-
|
|
16092
|
-
|
|
16093
|
-
|
|
16094
|
-
|
|
16095
|
-
|
|
16092
|
+
try {
|
|
16093
|
+
const res = yield fetch(`${getApiUrl(environment, customBaseUrl)}chat/`, __spreadProps(__spreadValues({}, defaultConfig), {
|
|
16094
|
+
body: JSON.stringify(request),
|
|
16095
|
+
headers: __spreadValues(__spreadValues({}, headers), (_a = options.customHeaders) != null ? _a : {})
|
|
16096
|
+
}));
|
|
16097
|
+
if (res.status < 400) {
|
|
16098
|
+
const data = yield res.json();
|
|
16099
|
+
return __spreadProps(__spreadValues({}, data), { success: true });
|
|
16100
|
+
}
|
|
16101
|
+
const errors = yield res.json();
|
|
16102
|
+
return { success: false, errors };
|
|
16103
|
+
} catch (e) {
|
|
16104
|
+
(_b = options == null ? void 0 : options.onError) == null ? void 0 : _b.call(options, e);
|
|
16105
|
+
return { success: false, errors: [e] };
|
|
16096
16106
|
}
|
|
16097
|
-
const errors = yield res.json();
|
|
16098
|
-
return { success: false, errors };
|
|
16099
16107
|
});
|
|
16100
16108
|
const suggestPhraseAlternatives = (_0, _1) => __async(exports, [_0, _1], function* (options, { phrases }) {
|
|
16109
|
+
var _a, _b;
|
|
16101
16110
|
const { environment, customBaseUrl } = options;
|
|
16102
|
-
|
|
16103
|
-
|
|
16104
|
-
|
|
16105
|
-
|
|
16106
|
-
|
|
16107
|
-
|
|
16111
|
+
try {
|
|
16112
|
+
const res = yield fetch(`${getApiUrl(environment, customBaseUrl)}chat/phraseAlternatives`, __spreadProps(__spreadValues({}, defaultConfig), {
|
|
16113
|
+
body: JSON.stringify({ phrases }),
|
|
16114
|
+
headers: __spreadValues(__spreadValues({}, headers), (_a = options.customHeaders) != null ? _a : {})
|
|
16115
|
+
}));
|
|
16116
|
+
if (res.status < 400) {
|
|
16117
|
+
const data = yield res.json();
|
|
16118
|
+
return __spreadProps(__spreadValues({}, data), { success: true });
|
|
16119
|
+
}
|
|
16120
|
+
const errors = yield res.json();
|
|
16121
|
+
return { success: false, errors };
|
|
16122
|
+
} catch (e) {
|
|
16123
|
+
(_b = options == null ? void 0 : options.onError) == null ? void 0 : _b.call(options, e);
|
|
16124
|
+
return { success: false, errors: [e] };
|
|
16108
16125
|
}
|
|
16109
|
-
const errors = yield res.json();
|
|
16110
|
-
return { success: false, errors };
|
|
16111
16126
|
});
|
|
16112
16127
|
const suggestSimplifiedPhrases = (_0, _1) => __async(exports, [_0, _1], function* (options, { phrases }) {
|
|
16128
|
+
var _a, _b;
|
|
16113
16129
|
const { environment, customBaseUrl } = options;
|
|
16114
|
-
|
|
16115
|
-
|
|
16116
|
-
|
|
16117
|
-
|
|
16118
|
-
|
|
16119
|
-
|
|
16120
|
-
|
|
16130
|
+
try {
|
|
16131
|
+
const res = yield fetch(`${getApiUrl(environment, customBaseUrl)}chat/simplify`, __spreadProps(__spreadValues({}, defaultConfig), {
|
|
16132
|
+
body: JSON.stringify({ phrases }),
|
|
16133
|
+
headers: __spreadValues(__spreadValues({}, headers), (_a = options.customHeaders) != null ? _a : {})
|
|
16134
|
+
}));
|
|
16135
|
+
if (res.status < 400) {
|
|
16136
|
+
const data = yield res.json();
|
|
16137
|
+
return __spreadProps(__spreadValues({}, data), { success: true });
|
|
16138
|
+
}
|
|
16139
|
+
const errors = yield res.json();
|
|
16140
|
+
return { success: false, errors };
|
|
16141
|
+
} catch (e) {
|
|
16142
|
+
(_b = options == null ? void 0 : options.onError) == null ? void 0 : _b.call(options, e);
|
|
16143
|
+
return { success: false, errors: [e] };
|
|
16121
16144
|
}
|
|
16122
|
-
const errors = yield res.json();
|
|
16123
|
-
return { success: false, errors };
|
|
16124
16145
|
});
|
|
16125
16146
|
const suggestBestProductMatches = (_0, _1) => __async(exports, [_0, _1], function* (options, {
|
|
16126
16147
|
initialQuery,
|
|
16127
16148
|
productStrings,
|
|
16128
16149
|
messageHistory
|
|
16129
16150
|
}) {
|
|
16151
|
+
var _a, _b;
|
|
16130
16152
|
const { environment, customBaseUrl } = options;
|
|
16131
|
-
|
|
16132
|
-
|
|
16133
|
-
|
|
16134
|
-
|
|
16135
|
-
|
|
16136
|
-
|
|
16137
|
-
|
|
16153
|
+
try {
|
|
16154
|
+
const res = yield fetch(`${getApiUrl(environment, customBaseUrl)}chat/bestProducts`, __spreadProps(__spreadValues({}, defaultConfig), {
|
|
16155
|
+
body: JSON.stringify({ initialQuery, messageHistory, productStrings }),
|
|
16156
|
+
headers: __spreadValues(__spreadValues({}, headers), (_a = options.customHeaders) != null ? _a : {})
|
|
16157
|
+
}));
|
|
16158
|
+
if (res.status < 400) {
|
|
16159
|
+
const data = yield res.json();
|
|
16160
|
+
return __spreadProps(__spreadValues({}, data), { success: true });
|
|
16161
|
+
}
|
|
16162
|
+
const errors = yield res.json();
|
|
16163
|
+
return { success: false, errors };
|
|
16164
|
+
} catch (e) {
|
|
16165
|
+
(_b = options == null ? void 0 : options.onError) == null ? void 0 : _b.call(options, e);
|
|
16166
|
+
return { success: false, errors: [e] };
|
|
16138
16167
|
}
|
|
16139
|
-
const errors = yield res.json();
|
|
16140
|
-
return { success: false, errors };
|
|
16141
16168
|
});
|
|
16142
16169
|
const prepareChatHistory = (chatLog) => {
|
|
16143
16170
|
var _a, _b;
|
package/dist/lupaSearch.mjs
CHANGED
|
@@ -16077,6 +16077,7 @@ const defaultConfig = {
|
|
|
16077
16077
|
method: "POST",
|
|
16078
16078
|
headers: { "Content-Type": "application/json" }
|
|
16079
16079
|
};
|
|
16080
|
+
const headers = defaultConfig.headers;
|
|
16080
16081
|
const getApiUrl = (environment, customBaseUrl) => {
|
|
16081
16082
|
if (customBaseUrl) {
|
|
16082
16083
|
return customBaseUrl;
|
|
@@ -16084,58 +16085,84 @@ const getApiUrl = (environment, customBaseUrl) => {
|
|
|
16084
16085
|
return Env[environment] || Env["production"];
|
|
16085
16086
|
};
|
|
16086
16087
|
const suggestSearchChatPhrases = (options, request) => __async(void 0, null, function* () {
|
|
16088
|
+
var _a, _b;
|
|
16087
16089
|
const { environment, customBaseUrl } = options;
|
|
16088
|
-
|
|
16089
|
-
|
|
16090
|
-
|
|
16091
|
-
|
|
16092
|
-
|
|
16093
|
-
|
|
16090
|
+
try {
|
|
16091
|
+
const res = yield fetch(`${getApiUrl(environment, customBaseUrl)}chat/`, __spreadProps(__spreadValues({}, defaultConfig), {
|
|
16092
|
+
body: JSON.stringify(request),
|
|
16093
|
+
headers: __spreadValues(__spreadValues({}, headers), (_a = options.customHeaders) != null ? _a : {})
|
|
16094
|
+
}));
|
|
16095
|
+
if (res.status < 400) {
|
|
16096
|
+
const data = yield res.json();
|
|
16097
|
+
return __spreadProps(__spreadValues({}, data), { success: true });
|
|
16098
|
+
}
|
|
16099
|
+
const errors = yield res.json();
|
|
16100
|
+
return { success: false, errors };
|
|
16101
|
+
} catch (e) {
|
|
16102
|
+
(_b = options == null ? void 0 : options.onError) == null ? void 0 : _b.call(options, e);
|
|
16103
|
+
return { success: false, errors: [e] };
|
|
16094
16104
|
}
|
|
16095
|
-
const errors = yield res.json();
|
|
16096
|
-
return { success: false, errors };
|
|
16097
16105
|
});
|
|
16098
16106
|
const suggestPhraseAlternatives = (_0, _1) => __async(void 0, [_0, _1], function* (options, { phrases }) {
|
|
16107
|
+
var _a, _b;
|
|
16099
16108
|
const { environment, customBaseUrl } = options;
|
|
16100
|
-
|
|
16101
|
-
|
|
16102
|
-
|
|
16103
|
-
|
|
16104
|
-
|
|
16105
|
-
|
|
16109
|
+
try {
|
|
16110
|
+
const res = yield fetch(`${getApiUrl(environment, customBaseUrl)}chat/phraseAlternatives`, __spreadProps(__spreadValues({}, defaultConfig), {
|
|
16111
|
+
body: JSON.stringify({ phrases }),
|
|
16112
|
+
headers: __spreadValues(__spreadValues({}, headers), (_a = options.customHeaders) != null ? _a : {})
|
|
16113
|
+
}));
|
|
16114
|
+
if (res.status < 400) {
|
|
16115
|
+
const data = yield res.json();
|
|
16116
|
+
return __spreadProps(__spreadValues({}, data), { success: true });
|
|
16117
|
+
}
|
|
16118
|
+
const errors = yield res.json();
|
|
16119
|
+
return { success: false, errors };
|
|
16120
|
+
} catch (e) {
|
|
16121
|
+
(_b = options == null ? void 0 : options.onError) == null ? void 0 : _b.call(options, e);
|
|
16122
|
+
return { success: false, errors: [e] };
|
|
16106
16123
|
}
|
|
16107
|
-
const errors = yield res.json();
|
|
16108
|
-
return { success: false, errors };
|
|
16109
16124
|
});
|
|
16110
16125
|
const suggestSimplifiedPhrases = (_0, _1) => __async(void 0, [_0, _1], function* (options, { phrases }) {
|
|
16126
|
+
var _a, _b;
|
|
16111
16127
|
const { environment, customBaseUrl } = options;
|
|
16112
|
-
|
|
16113
|
-
|
|
16114
|
-
|
|
16115
|
-
|
|
16116
|
-
|
|
16117
|
-
|
|
16118
|
-
|
|
16128
|
+
try {
|
|
16129
|
+
const res = yield fetch(`${getApiUrl(environment, customBaseUrl)}chat/simplify`, __spreadProps(__spreadValues({}, defaultConfig), {
|
|
16130
|
+
body: JSON.stringify({ phrases }),
|
|
16131
|
+
headers: __spreadValues(__spreadValues({}, headers), (_a = options.customHeaders) != null ? _a : {})
|
|
16132
|
+
}));
|
|
16133
|
+
if (res.status < 400) {
|
|
16134
|
+
const data = yield res.json();
|
|
16135
|
+
return __spreadProps(__spreadValues({}, data), { success: true });
|
|
16136
|
+
}
|
|
16137
|
+
const errors = yield res.json();
|
|
16138
|
+
return { success: false, errors };
|
|
16139
|
+
} catch (e) {
|
|
16140
|
+
(_b = options == null ? void 0 : options.onError) == null ? void 0 : _b.call(options, e);
|
|
16141
|
+
return { success: false, errors: [e] };
|
|
16119
16142
|
}
|
|
16120
|
-
const errors = yield res.json();
|
|
16121
|
-
return { success: false, errors };
|
|
16122
16143
|
});
|
|
16123
16144
|
const suggestBestProductMatches = (_0, _1) => __async(void 0, [_0, _1], function* (options, {
|
|
16124
16145
|
initialQuery,
|
|
16125
16146
|
productStrings,
|
|
16126
16147
|
messageHistory
|
|
16127
16148
|
}) {
|
|
16149
|
+
var _a, _b;
|
|
16128
16150
|
const { environment, customBaseUrl } = options;
|
|
16129
|
-
|
|
16130
|
-
|
|
16131
|
-
|
|
16132
|
-
|
|
16133
|
-
|
|
16134
|
-
|
|
16135
|
-
|
|
16151
|
+
try {
|
|
16152
|
+
const res = yield fetch(`${getApiUrl(environment, customBaseUrl)}chat/bestProducts`, __spreadProps(__spreadValues({}, defaultConfig), {
|
|
16153
|
+
body: JSON.stringify({ initialQuery, messageHistory, productStrings }),
|
|
16154
|
+
headers: __spreadValues(__spreadValues({}, headers), (_a = options.customHeaders) != null ? _a : {})
|
|
16155
|
+
}));
|
|
16156
|
+
if (res.status < 400) {
|
|
16157
|
+
const data = yield res.json();
|
|
16158
|
+
return __spreadProps(__spreadValues({}, data), { success: true });
|
|
16159
|
+
}
|
|
16160
|
+
const errors = yield res.json();
|
|
16161
|
+
return { success: false, errors };
|
|
16162
|
+
} catch (e) {
|
|
16163
|
+
(_b = options == null ? void 0 : options.onError) == null ? void 0 : _b.call(options, e);
|
|
16164
|
+
return { success: false, errors: [e] };
|
|
16136
16165
|
}
|
|
16137
|
-
const errors = yield res.json();
|
|
16138
|
-
return { success: false, errors };
|
|
16139
16166
|
});
|
|
16140
16167
|
const prepareChatHistory = (chatLog) => {
|
|
16141
16168
|
var _a, _b;
|