@ibti-tech/chatbot 0.8.5 → 0.8.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.
package/dist/index.d.ts CHANGED
@@ -468,7 +468,7 @@ declare module '@ibti-tech/chatbot/contexts/Chatbot/useChatFeedbackBox' {
468
468
  };
469
469
  /**
470
470
  * Hook for the feedback modal: open/close and send rating.
471
- * Uses useChatbot() for apiURL, locale, chatMessages, publicHash, visitorId.
471
+ * Uses useChatbot() for apiURL, locale, publicHash, visitorId.
472
472
  *
473
473
  * @returns { opened, open, close, sendUserRating, loading } — loading true while submit in progress
474
474
  */
@@ -483,7 +483,7 @@ declare module '@ibti-tech/chatbot/contexts/Chatbot/useChatFeedbackBox' {
483
483
  //# sourceMappingURL=useChatFeedbackBox.d.ts.map
484
484
  }
485
485
  declare module '@ibti-tech/chatbot/contexts/Chatbot/useChatFeedbackBox.d.ts' {
486
- {"version":3,"file":"useChatFeedbackBox.d.ts","sourceRoot":"","sources":["../../../../../home/runner/work/ibti-chatbot/ibti-chatbot/src/contexts/Chatbot/useChatFeedbackBox.ts"],"names":[],"mappings":"AAIA,6DAA6D;AAC7D,KAAK,mBAAmB,GAAG;IACzB,+BAA+B;IAC/B,WAAW,EAAE,MAAM,CAAA;IACnB,mCAAmC;IACnC,WAAW,EAAE,MAAM,CAAA;CACpB,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB;;;;oDAkB1B,mBAAmB;;CA6BvB,CAAA"}
486
+ {"version":3,"file":"useChatFeedbackBox.d.ts","sourceRoot":"","sources":["../../../../../home/runner/work/ibti-chatbot/ibti-chatbot/src/contexts/Chatbot/useChatFeedbackBox.ts"],"names":[],"mappings":"AAIA,6DAA6D;AAC7D,KAAK,mBAAmB,GAAG;IACzB,+BAA+B;IAC/B,WAAW,EAAE,MAAM,CAAA;IACnB,mCAAmC;IACnC,WAAW,EAAE,MAAM,CAAA;CACpB,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB;;;;oDAkB1B,mBAAmB;;CAyBvB,CAAA"}
487
487
  }
488
488
  declare module '@ibti-tech/chatbot/contexts/Chatbot/useChatbot' {
489
489
  /**
@@ -950,16 +950,16 @@ declare module '@ibti-tech/chatbot/services/feedback/feedback.api' {
950
950
  /**
951
951
  * Sends user feedback (rating) for the current chat session.
952
952
  * Endpoint: POST /chat/feedback
953
- * Body: locale, rating_score, chat_context, message (optional), hash (optional), visitorId (optional).
953
+ * Body: hash, visitorId, locale, rating_score, message (optional). API resolves conversation by hash + visitorId.
954
954
  *
955
- * @param params - SendUserChatFeedbackParams: apiURL, locale, chatContext, ratingScore, optional description, publicHash, visitorId
955
+ * @param params - SendUserChatFeedbackParams: apiURL, locale, ratingScore, optional description, publicHash, visitorId
956
956
  * @returns Promise resolving to the fetch Response; check response.ok for success
957
957
  */
958
- export const sendUserChatFeedback: ({ apiURL, chatContext, locale, ratingScore, description, publicHash, visitorId, }: SendUserChatFeedbackParams) => Promise<Response>;
958
+ export const sendUserChatFeedback: ({ apiURL, locale, ratingScore, description, publicHash, visitorId, }: SendUserChatFeedbackParams) => Promise<Response>;
959
959
  //# sourceMappingURL=feedback.api.d.ts.map
960
960
  }
961
961
  declare module '@ibti-tech/chatbot/services/feedback/feedback.api.d.ts' {
962
- {"version":3,"file":"feedback.api.d.ts","sourceRoot":"","sources":["../../../../../home/runner/work/ibti-chatbot/ibti-chatbot/src/services/feedback/feedback.api.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,UAAU,CAAA;AAE1D;;;;;;;GAOG;AACH,eAAO,MAAM,oBAAoB,GAAU,mFAQxC,0BAA0B,KAAG,OAAO,CAAC,QAAQ,CAa/C,CAAA"}
962
+ {"version":3,"file":"feedback.api.d.ts","sourceRoot":"","sources":["../../../../../home/runner/work/ibti-chatbot/ibti-chatbot/src/services/feedback/feedback.api.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,UAAU,CAAA;AAE1D;;;;;;;GAOG;AACH,eAAO,MAAM,oBAAoB,GAAU,sEAOxC,0BAA0B,KAAG,OAAO,CAAC,QAAQ,CAY/C,CAAA"}
963
963
  }
964
964
  declare module '@ibti-tech/chatbot/services/index' {
965
965
  /**
@@ -1040,8 +1040,6 @@ declare module '@ibti-tech/chatbot/services/types/feedback.types' {
1040
1040
  publicHash?: string;
1041
1041
  /** Optional. Visitor id to associate feedback with the conversation. */
1042
1042
  visitorId?: string;
1043
- /** Current conversation context (role + content) for the session being rated. */
1044
- chatContext: Pick<ChatbotTypes.ChatMessage, 'content' | 'role'>[];
1045
1043
  /** Rating score (e.g. 1–5). */
1046
1044
  ratingScore: number;
1047
1045
  /** Optional. Free-text feedback. */
@@ -1050,7 +1048,7 @@ declare module '@ibti-tech/chatbot/services/types/feedback.types' {
1050
1048
  //# sourceMappingURL=feedback.types.d.ts.map
1051
1049
  }
1052
1050
  declare module '@ibti-tech/chatbot/services/types/feedback.types.d.ts' {
1053
- {"version":3,"file":"feedback.types.d.ts","sourceRoot":"","sources":["../../../../../home/runner/work/ibti-chatbot/ibti-chatbot/src/services/types/feedback.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,OAAO,CAAA;AAEpC;;;GAGG;AACH,MAAM,MAAM,0BAA0B,GAAG;IACvC,kCAAkC;IAClC,MAAM,EAAE,YAAY,CAAC,MAAM,CAAA;IAC3B,mCAAmC;IACnC,MAAM,EAAE,MAAM,CAAA;IACd,4CAA4C;IAC5C,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,wEAAwE;IACxE,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,iFAAiF;IACjF,WAAW,EAAE,IAAI,CAAC,YAAY,CAAC,WAAW,EAAE,SAAS,GAAG,MAAM,CAAC,EAAE,CAAA;IACjE,+BAA+B;IAC/B,WAAW,EAAE,MAAM,CAAA;IACnB,oCAAoC;IACpC,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB,CAAA"}
1051
+ {"version":3,"file":"feedback.types.d.ts","sourceRoot":"","sources":["../../../../../home/runner/work/ibti-chatbot/ibti-chatbot/src/services/types/feedback.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,OAAO,CAAA;AAEpC;;;GAGG;AACH,MAAM,MAAM,0BAA0B,GAAG;IACvC,kCAAkC;IAClC,MAAM,EAAE,YAAY,CAAC,MAAM,CAAA;IAC3B,mCAAmC;IACnC,MAAM,EAAE,MAAM,CAAA;IACd,4CAA4C;IAC5C,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,wEAAwE;IACxE,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,+BAA+B;IAC/B,WAAW,EAAE,MAAM,CAAA;IACnB,oCAAoC;IACpC,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB,CAAA"}
1054
1052
  }
1055
1053
  declare module '@ibti-tech/chatbot/services/types/index' {
1056
1054
  export * from '@ibti-tech/chatbot/services/types/chat.types';
package/dist/index.mjs CHANGED
@@ -279,7 +279,6 @@ var getWelcomeMessage = /* @__PURE__ */ __name(async (apiUrl, locale = "en", pub
279
279
  // src/services/feedback/feedback.api.ts
280
280
  var sendUserChatFeedback = /* @__PURE__ */ __name(async ({
281
281
  apiURL,
282
- chatContext,
283
282
  locale = "en",
284
283
  ratingScore,
285
284
  description,
@@ -292,7 +291,6 @@ var sendUserChatFeedback = /* @__PURE__ */ __name(async ({
292
291
  body: JSON.stringify({
293
292
  locale,
294
293
  rating_score: ratingScore,
295
- chat_context: chatContext,
296
294
  message: description,
297
295
  ...publicHash && { hash: publicHash },
298
296
  ...visitorId && { visitorId }
@@ -2815,7 +2813,7 @@ var ChatUserFeedbackRating = /* @__PURE__ */ __name(({
2815
2813
  // src/contexts/Chatbot/useChatFeedbackBox.ts
2816
2814
  import { useState as useState9 } from "react";
2817
2815
  var useChatFeedbackBox = /* @__PURE__ */ __name(() => {
2818
- const { chatMessages, apiURL, locale, publicHash, visitorId } = useChatbot_default();
2816
+ const { apiURL, locale, publicHash, visitorId } = useChatbot_default();
2819
2817
  const [rated, setRated] = useState9(false);
2820
2818
  const [opened, setOpened] = useState9(false);
2821
2819
  const [loading, setLoading] = useState9(false);
@@ -2836,10 +2834,6 @@ var useChatFeedbackBox = /* @__PURE__ */ __name(() => {
2836
2834
  apiURL,
2837
2835
  publicHash,
2838
2836
  visitorId,
2839
- chatContext: chatMessages.map((item) => ({
2840
- role: item.role,
2841
- content: item.content
2842
- })),
2843
2837
  locale,
2844
2838
  ratingScore,
2845
2839
  description
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ibti-tech/chatbot",
3
- "version": "0.8.5",
3
+ "version": "0.8.6",
4
4
  "description": "Chatbot system developed to be embedded in any website",
5
5
  "packageManager": "yarn@3.6.4",
6
6
  "main": "./dist/index.mjs",