@vitalfit/sdk 0.4.2 → 0.4.4

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.cjs CHANGED
@@ -31,6 +31,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
31
31
  var index_exports = {};
32
32
  __export(index_exports, {
33
33
  APIError: () => APIError,
34
+ ChatRole: () => ChatRole,
34
35
  UserGender: () => UserGender,
35
36
  VitalFit: () => VitalFit,
36
37
  isAPIError: () => isAPIError,
@@ -2730,6 +2731,7 @@ var RoutineService = class {
2730
2731
  this.getInstructorRoutines = this.getInstructorRoutines.bind(this);
2731
2732
  this.getRoutineById = this.getRoutineById.bind(this);
2732
2733
  this.getAllRoutines = this.getAllRoutines.bind(this);
2734
+ this.markRoutineCompletion = this.markRoutineCompletion.bind(this);
2733
2735
  }
2734
2736
  async createRoutine(data, jwt) {
2735
2737
  const response = await this.client.post({
@@ -2839,6 +2841,50 @@ var RoutineService = class {
2839
2841
  });
2840
2842
  return response;
2841
2843
  }
2844
+ async markRoutineCompletion(userRoutineId, jwt) {
2845
+ await this.client.post({
2846
+ url: `/routines/my-routines/${userRoutineId}/complete`,
2847
+ jwt
2848
+ });
2849
+ }
2850
+ };
2851
+
2852
+ // src/services/LLM.ts
2853
+ var LLMService = class {
2854
+ client;
2855
+ constructor(client) {
2856
+ this.client = client;
2857
+ this.chat = this.chat.bind(this);
2858
+ this.getHistory = this.getHistory.bind(this);
2859
+ this.resetChat = this.resetChat.bind(this);
2860
+ }
2861
+ async chat(data, jwt) {
2862
+ const response = await this.client.post({
2863
+ url: "/llm/chat",
2864
+ jwt,
2865
+ data
2866
+ });
2867
+ return response;
2868
+ }
2869
+ async getHistory(jwt, { page = 1, limit = 50, sort = "desc" } = {}) {
2870
+ const response = await this.client.get({
2871
+ url: "/llm/history",
2872
+ jwt,
2873
+ params: {
2874
+ page,
2875
+ limit,
2876
+ sort
2877
+ }
2878
+ });
2879
+ return response;
2880
+ }
2881
+ async resetChat(jwt) {
2882
+ const response = await this.client.post({
2883
+ url: "/llm/reset",
2884
+ jwt
2885
+ });
2886
+ return response;
2887
+ }
2842
2888
  };
2843
2889
 
2844
2890
  // src/types/auth.ts
@@ -2941,6 +2987,18 @@ var mainCurrencies = [
2941
2987
  }
2942
2988
  ];
2943
2989
 
2990
+ // src/types/LLM.ts
2991
+ var ChatRole = /* @__PURE__ */ ((ChatRole2) => {
2992
+ ChatRole2["User"] = "user";
2993
+ ChatRole2["Recepcionist"] = "recepcionist";
2994
+ ChatRole2["Instructor"] = "instructor";
2995
+ ChatRole2["Client"] = "client";
2996
+ ChatRole2["System"] = "system";
2997
+ ChatRole2["Tool"] = "tool";
2998
+ ChatRole2["Assistant"] = "assistant";
2999
+ return ChatRole2;
3000
+ })(ChatRole || {});
3001
+
2944
3002
  // src/index.ts
2945
3003
  var VitalFit = class _VitalFit {
2946
3004
  static instance;
@@ -2969,6 +3027,7 @@ var VitalFit = class _VitalFit {
2969
3027
  notification;
2970
3028
  exports;
2971
3029
  routine;
3030
+ llm;
2972
3031
  constructor(isDevMode, origin) {
2973
3032
  this.client = new Client(isDevMode, origin);
2974
3033
  this.auth = new AuthService(this.client);
@@ -2995,6 +3054,7 @@ var VitalFit = class _VitalFit {
2995
3054
  this.notification = new NotificationService(this.client);
2996
3055
  this.exports = new ExportsService(this.client);
2997
3056
  this.routine = new RoutineService(this.client);
3057
+ this.llm = new LLMService(this.client);
2998
3058
  }
2999
3059
  static getInstance(isDevMode = false) {
3000
3060
  if (!_VitalFit.instance) {
@@ -3003,12 +3063,13 @@ var VitalFit = class _VitalFit {
3003
3063
  return _VitalFit.instance;
3004
3064
  }
3005
3065
  version() {
3006
- return "0.4.2";
3066
+ return "0.4.4";
3007
3067
  }
3008
3068
  };
3009
3069
  // Annotate the CommonJS export names for ESM import in node:
3010
3070
  0 && (module.exports = {
3011
3071
  APIError,
3072
+ ChatRole,
3012
3073
  UserGender,
3013
3074
  VitalFit,
3014
3075
  isAPIError,