@quidgest/chatbot 0.0.2 → 0.0.3

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/index.js CHANGED
@@ -4007,19 +4007,6 @@
4007
4007
  initChat();
4008
4008
  vue.nextTick(scrollChatToBottom);
4009
4009
  });
4010
- const getParsedEndpoint = vue.computed(() => {
4011
- try {
4012
- let url = new URL(props.apiEndpoint).href;
4013
- if (url.charAt(url.length - 1) == "/") {
4014
- url = url.slice(0, -1);
4015
- }
4016
- return url;
4017
- } catch (ex) {
4018
- addChatMessage(props.texts.botIsSick);
4019
- isChatDisabled = true;
4020
- throw Error("Could not parse Endpoint URL:\n" + ex);
4021
- }
4022
- });
4023
4010
  const sortedMessages = vue.computed(() => {
4024
4011
  return messages.value.toSorted((a, b) => {
4025
4012
  const diff = new Date(a.timestamp).getTime() - new Date(b.timestamp).getTime();
@@ -4030,7 +4017,7 @@
4030
4017
  return messages.value.filter((m) => m.sender === "user");
4031
4018
  });
4032
4019
  function initChat() {
4033
- axios.post(getParsedEndpoint.value + "/auth/login", {
4020
+ axios.post(props.apiEndpoint + "/auth/login", {
4034
4021
  username: props.username,
4035
4022
  password: "test"
4036
4023
  }).then((response) => {
@@ -4129,7 +4116,7 @@
4129
4116
  };
4130
4117
  isLoading = true;
4131
4118
  axios({
4132
- url: getParsedEndpoint.value + "/prompt/message",
4119
+ url: props.apiEndpoint + "/prompt/message",
4133
4120
  method: "POST",
4134
4121
  data: params,
4135
4122
  onDownloadProgress: (progressEvent) => {
package/dist/index.mjs CHANGED
@@ -4004,19 +4004,6 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
4004
4004
  initChat();
4005
4005
  nextTick(scrollChatToBottom);
4006
4006
  });
4007
- const getParsedEndpoint = computed(() => {
4008
- try {
4009
- let url = new URL(props.apiEndpoint).href;
4010
- if (url.charAt(url.length - 1) == "/") {
4011
- url = url.slice(0, -1);
4012
- }
4013
- return url;
4014
- } catch (ex) {
4015
- addChatMessage(props.texts.botIsSick);
4016
- isChatDisabled = true;
4017
- throw Error("Could not parse Endpoint URL:\n" + ex);
4018
- }
4019
- });
4020
4007
  const sortedMessages = computed(() => {
4021
4008
  return messages.value.toSorted((a, b) => {
4022
4009
  const diff = new Date(a.timestamp).getTime() - new Date(b.timestamp).getTime();
@@ -4027,7 +4014,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
4027
4014
  return messages.value.filter((m) => m.sender === "user");
4028
4015
  });
4029
4016
  function initChat() {
4030
- axios.post(getParsedEndpoint.value + "/auth/login", {
4017
+ axios.post(props.apiEndpoint + "/auth/login", {
4031
4018
  username: props.username,
4032
4019
  password: "test"
4033
4020
  }).then((response) => {
@@ -4126,7 +4113,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
4126
4113
  };
4127
4114
  isLoading = true;
4128
4115
  axios({
4129
- url: getParsedEndpoint.value + "/prompt/message",
4116
+ url: props.apiEndpoint + "/prompt/message",
4130
4117
  method: "POST",
4131
4118
  data: params,
4132
4119
  onDownloadProgress: (progressEvent) => {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@quidgest/chatbot",
3
3
  "private": false,
4
- "version": "0.0.2",
4
+ "version": "0.0.3",
5
5
  "type": "module",
6
6
  "license": "UNLICENSED",
7
7
  "main": "dist/index.cjs",
@@ -62,22 +62,6 @@
62
62
  nextTick(scrollChatToBottom)
63
63
  })
64
64
 
65
- const getParsedEndpoint = computed(() => {
66
- try {
67
- let url = new URL(props.apiEndpoint).href
68
-
69
- if (url.charAt(url.length - 1) == '/') {
70
- url = url.slice(0, -1)
71
- }
72
- return url
73
- } catch (ex) {
74
- addChatMessage(props.texts.botIsSick)
75
-
76
- isChatDisabled = true
77
- throw Error('Could not parse Endpoint URL:\n' + ex)
78
- }
79
- })
80
-
81
65
  const sortedMessages = computed(() => {
82
66
  return messages.value.toSorted((a: ChatBotMessage, b: ChatBotMessage) => {
83
67
  const diff = new Date(a.timestamp).getTime() - new Date(b.timestamp).getTime()
@@ -90,7 +74,7 @@
90
74
  })
91
75
 
92
76
  function initChat() {
93
- Axios.post(getParsedEndpoint.value + '/auth/login', {
77
+ Axios.post(props.apiEndpoint + '/auth/login', {
94
78
  username: props.username,
95
79
  password: 'test'
96
80
  })
@@ -228,7 +212,7 @@
228
212
 
229
213
  isLoading = true
230
214
  Axios({
231
- url: getParsedEndpoint.value + '/prompt/message',
215
+ url: props.apiEndpoint + '/prompt/message',
232
216
  method: 'POST',
233
217
  data: params,
234
218
  onDownloadProgress: (progressEvent) => {