@hivegpt/hiveai-angular 0.0.214 → 0.0.215

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.
@@ -687,6 +687,7 @@
687
687
  this.closeBot = new i0.EventEmitter();
688
688
  this.connectWithUser = new i0.EventEmitter();
689
689
  this.scheduleMeeting = new i0.EventEmitter();
690
+ this.refreshToken = new i0.EventEmitter();
690
691
  this.autogenKey = "Autogen_eDJTtEU-NB0RtIpzq1w";
691
692
  this.addToMyAgendaAction = "add_to_my_agenda";
692
693
  this.myUpcomingSessionAction = "my_upcomming_session";
@@ -767,6 +768,21 @@
767
768
  // this.isIOSDevice = true;
768
769
  // }
769
770
  }
771
+ ChatDrawerComponent.prototype.ngOnChanges = function (changes) {
772
+ if (changes.s27Token) {
773
+ if (changes.s27Token.currentValue != changes.s27Token.previousValue) {
774
+ this.s27Token = changes.s27Token.currentValue;
775
+ if (this.is401) {
776
+ if (this.isFetchDataFor) {
777
+ this.fetchDataFor(this.msg, this.chat);
778
+ }
779
+ else {
780
+ this.fetchData();
781
+ }
782
+ }
783
+ }
784
+ }
785
+ };
770
786
  ChatDrawerComponent.prototype.ngOnInit = function () {
771
787
  var _this = this;
772
788
  this.environment = this.isDev ? dev_environment : prod_environment;
@@ -1131,6 +1147,18 @@
1131
1147
  agents: this.agents.filter(function (p) { return p.selected; }).map(function (p) { return p.id; }),
1132
1148
  conversation_id: this.conversationKey,
1133
1149
  }),
1150
+ })
1151
+ .then(function (response) {
1152
+ if (response.status === 401) {
1153
+ _this.is401 = true;
1154
+ _this.refreshToken.emit();
1155
+ }
1156
+ return response.json(); // Continue processing the response
1157
+ })
1158
+ .then(function (data) {
1159
+ // Handle the response data
1160
+ _this.is401 = false;
1161
+ console.log(data);
1134
1162
  })
1135
1163
  .catch(function (err) {
1136
1164
  console.error('Error: ', err);
@@ -1177,6 +1205,21 @@
1177
1205
  agents: this.agents.filter(function (p) { return p.selected; }).map(function (p) { return p.id; }),
1178
1206
  conversation_id: this.conversationKey,
1179
1207
  }),
1208
+ })
1209
+ .then(function (response) {
1210
+ if (response.status === 401) {
1211
+ _this.msg = msg;
1212
+ _this.chat = chat;
1213
+ _this.is401 = true;
1214
+ _this.isFetchDataFor = true;
1215
+ _this.refreshToken.emit();
1216
+ }
1217
+ return response.json(); // Continue processing the response
1218
+ })
1219
+ .then(function (data) {
1220
+ // Handle the response data
1221
+ _this.is401 = false;
1222
+ console.log(data);
1180
1223
  })
1181
1224
  .catch(function (err) {
1182
1225
  console.error('Error: ', err);
@@ -1810,7 +1853,8 @@
1810
1853
  sessionActions: [{ type: i0.Output }],
1811
1854
  closeBot: [{ type: i0.Output }],
1812
1855
  connectWithUser: [{ type: i0.Output }],
1813
- scheduleMeeting: [{ type: i0.Output }]
1856
+ scheduleMeeting: [{ type: i0.Output }],
1857
+ refreshToken: [{ type: i0.Output }]
1814
1858
  };
1815
1859
 
1816
1860
  var ChatBotComponent = /** @class */ (function () {