http-request-manager 18.5.20 → 18.5.21
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.
|
@@ -736,18 +736,19 @@ class ChannelInfo {
|
|
|
736
736
|
}
|
|
737
737
|
|
|
738
738
|
class WSUser {
|
|
739
|
-
constructor(
|
|
740
|
-
this.
|
|
739
|
+
constructor(id = '', ldap = '', name = '', email = '') {
|
|
740
|
+
this.id = id;
|
|
741
741
|
this.ldap = ldap;
|
|
742
742
|
this.name = name;
|
|
743
743
|
this.email = email;
|
|
744
744
|
}
|
|
745
745
|
static adapt(item) {
|
|
746
|
-
const user = new WSUser(item?.
|
|
746
|
+
const user = new WSUser(item?.id || item?.sessionId, // Support both for backward compatibility
|
|
747
|
+
item?.ldap, item?.name, item?.email);
|
|
747
748
|
// Copy any additional properties
|
|
748
749
|
if (item) {
|
|
749
750
|
Object.keys(item).forEach(key => {
|
|
750
|
-
if (!['sessionId', 'ldap', 'name', 'email'].includes(key)) {
|
|
751
|
+
if (!['id', 'sessionId', 'ldap', 'name', 'email'].includes(key)) {
|
|
751
752
|
user[key] = item[key];
|
|
752
753
|
}
|
|
753
754
|
});
|
|
@@ -789,7 +790,10 @@ class WebsocketService {
|
|
|
789
790
|
const message = {
|
|
790
791
|
type: 'subscribe',
|
|
791
792
|
subscribedChannel: channelName,
|
|
792
|
-
content:
|
|
793
|
+
content: {
|
|
794
|
+
id: this.getSessionId(),
|
|
795
|
+
...user
|
|
796
|
+
}
|
|
793
797
|
};
|
|
794
798
|
this.socket.send(JSON.stringify(message));
|
|
795
799
|
this.isSubscribed = true; // Set the flag immediately after sending
|
|
@@ -2884,12 +2888,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
|
|
|
2884
2888
|
}], ctorParameters: () => [] });
|
|
2885
2889
|
|
|
2886
2890
|
class ChannelMessage {
|
|
2887
|
-
constructor(sessionId =
|
|
2891
|
+
constructor(sessionId = null, content = null) {
|
|
2888
2892
|
this.sessionId = sessionId;
|
|
2889
2893
|
this.content = content;
|
|
2890
2894
|
}
|
|
2891
2895
|
static adapt(item) {
|
|
2892
|
-
return new ChannelMessage(item?.sessionId
|
|
2896
|
+
return new ChannelMessage(item?.sessionId || item?.id, // Support both for backward compatibility
|
|
2897
|
+
item?.content);
|
|
2893
2898
|
}
|
|
2894
2899
|
}
|
|
2895
2900
|
|
|
@@ -2959,7 +2964,7 @@ class HTTPManagerStateService extends ComponentStore {
|
|
|
2959
2964
|
this.httpManagerService.disconnect();
|
|
2960
2965
|
}
|
|
2961
2966
|
if (message.type === 'success') {
|
|
2962
|
-
if (message.data.
|
|
2967
|
+
if (message.data.id !== this.user.value?.id) {
|
|
2963
2968
|
const user = WSUser.adapt(message.data);
|
|
2964
2969
|
this.user.next(user);
|
|
2965
2970
|
}
|
|
@@ -2987,7 +2992,7 @@ class HTTPManagerStateService extends ComponentStore {
|
|
|
2987
2992
|
break;
|
|
2988
2993
|
case 'stateMangerMessage':
|
|
2989
2994
|
;
|
|
2990
|
-
if (message.data.sessionId !== this.user.value?.
|
|
2995
|
+
if (message.data.sessionId !== this.user.value?.id) {
|
|
2991
2996
|
console.log('💬 Message:', message.data);
|
|
2992
2997
|
this.userAction.next(message.data);
|
|
2993
2998
|
this.fetchRecord(RequestOptions.adapt({ path: message.data.content.path }), message.data.content.method);
|
|
@@ -2995,17 +3000,17 @@ class HTTPManagerStateService extends ComponentStore {
|
|
|
2995
3000
|
break;
|
|
2996
3001
|
case 'channelMessage':
|
|
2997
3002
|
// Handle channel-based messages (from sendChannelMessage)
|
|
2998
|
-
// Structure: { type: 'channelMessage',
|
|
3003
|
+
// Structure: { type: 'channelMessage', channels: [...], sessionId: {id, ldap, name, email}, content: {message payload} }
|
|
2999
3004
|
// Skip messages from self
|
|
3000
|
-
const senderSessionId = message.
|
|
3001
|
-
if (senderSessionId === this.user.value?.
|
|
3005
|
+
const senderSessionId = message.sessionId?.id;
|
|
3006
|
+
if (senderSessionId === this.user.value?.id) {
|
|
3002
3007
|
break;
|
|
3003
3008
|
}
|
|
3004
3009
|
console.log('💬 Channel Message received:', message);
|
|
3005
|
-
if (message.
|
|
3010
|
+
if (message.content) {
|
|
3006
3011
|
this.appendMessages(ChannelMessage.adapt({
|
|
3007
|
-
sessionId: message.
|
|
3008
|
-
content: message.
|
|
3012
|
+
sessionId: message.sessionId,
|
|
3013
|
+
content: message.content,
|
|
3009
3014
|
}));
|
|
3010
3015
|
}
|
|
3011
3016
|
break;
|
|
@@ -4529,7 +4534,7 @@ class WsMessagingComponent {
|
|
|
4529
4534
|
const selectedChannels = this.channels.value;
|
|
4530
4535
|
const message = ChannelMessage.adapt({
|
|
4531
4536
|
sessionId: {
|
|
4532
|
-
|
|
4537
|
+
id: user.id,
|
|
4533
4538
|
ldap: user.ldap,
|
|
4534
4539
|
name: user.name,
|
|
4535
4540
|
email: user.email,
|