polfan-server-js-client 0.1.99937 → 0.1.99939

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.
@@ -1,5 +1,5 @@
1
1
  import { Envelope } from "./schemes/Envelope";
2
- import { Message, MessageType } from "./schemes/Message";
2
+ import { Message, MessageType, MessageAuthor } from "./schemes/Message";
3
3
  import { PermissionOverwritesValue } from "./schemes/PermissionOverwritesValue";
4
4
  import { Role } from "./schemes/Role";
5
5
  import { Room, RoomType, RoomFlag } from "./schemes/Room";
@@ -116,4 +116,4 @@ import { GetSpaceSummary } from "./schemes/commands/GetSpaceSummary";
116
116
  import { SpaceFlag } from "./schemes/Space";
117
117
  import { SpaceSummary as SpaceSummaryEvent } from "./schemes/events/SpaceSummary";
118
118
  import { RoomSummary as RoomSummaryEvent } from "./schemes/events/RoomSummary";
119
- export { Envelope, Message, MessageType, Role, Room, RoomFlag, RoomType, RoomMember, RoomSummary, RoomSummaryExtras, Space, SpaceFlag, SpaceMember, Topic, FollowedTopic, User, UserState, PermissionOverwritesValue, ChatLocation, SpaceSummary, SpaceDiscoverable, Emoticon, PermissionOverwritesTarget, BanObject, LeaveReason, RoomStream, RoomStreamType, Bye, Error, Messages, NewMessage, NewRole, NewRoom, NewTopic, TopicFollowed, TopicUnfollowed, FollowedTopics, FollowedTopicUpdated, ComputedPermissions, PermissionOverwrites, PermissionOverwritesUpdated, RoleDeleted, RoleUpdated, RoomDeleted, RoomUpdated, RoomJoined, RoomLeft, RoomMemberJoined, RoomMemberLeft, RoomMembers, RoomMemberUpdated, UserUpdated, Session, SpaceDeleted, SpaceUpdated, SpaceJoined, SpaceLeft, SpaceMemberJoined, SpaceMemberLeft, SpaceMembers, SpaceMemberUpdated, SpaceRooms, TopicDeleted, TopicUpdated, PermissionOverwriteTargets, Owners, Ok, DiscoverableSpaces, Emoticons, EmoticonDeleted, NewEmoticon, Bans, ClientData, SpaceSummaryEvent, RoomSummaryEvent, AssignRole, GetMessages, CreateMessage, Ack, CreateRole, CreateRoom, CreateSpace, CreateTopic, FollowTopic, UnfollowTopic, GetFollowedTopics, DeassignRole, DeleteRole, DeleteRoom, DeleteSpace, DeleteTopic, SetPermissionOverwrites, GetPermissionOverwrites, GetComputedPermissions, GetRoomMembers, GetSession, GetSpaceMembers, GetSpaceRooms, JoinRoom, JoinSpace, LeaveRoom, LeaveSpace, UpdateRole, UpdateSpace, UpdateRoom, UpdateTopic, GetPermissionOverwriteTargets, CreateOwner, DeleteOwner, GetOwners, Topics, GetTopics, GetDiscoverableSpaces, GetEmoticons, CreateEmoticon, DeleteEmoticon, Ban, Unban, GetBans, Kick, GetClientData, SetClientData, GetSpaceSummary, GetRoomSummary, };
119
+ export { Envelope, Message, MessageType, MessageAuthor, Role, Room, RoomFlag, RoomType, RoomMember, RoomSummary, RoomSummaryExtras, Space, SpaceFlag, SpaceMember, Topic, FollowedTopic, User, UserState, PermissionOverwritesValue, ChatLocation, SpaceSummary, SpaceDiscoverable, Emoticon, PermissionOverwritesTarget, BanObject, LeaveReason, RoomStream, RoomStreamType, Bye, Error, Messages, NewMessage, NewRole, NewRoom, NewTopic, TopicFollowed, TopicUnfollowed, FollowedTopics, FollowedTopicUpdated, ComputedPermissions, PermissionOverwrites, PermissionOverwritesUpdated, RoleDeleted, RoleUpdated, RoomDeleted, RoomUpdated, RoomJoined, RoomLeft, RoomMemberJoined, RoomMemberLeft, RoomMembers, RoomMemberUpdated, UserUpdated, Session, SpaceDeleted, SpaceUpdated, SpaceJoined, SpaceLeft, SpaceMemberJoined, SpaceMemberLeft, SpaceMembers, SpaceMemberUpdated, SpaceRooms, TopicDeleted, TopicUpdated, PermissionOverwriteTargets, Owners, Ok, DiscoverableSpaces, Emoticons, EmoticonDeleted, NewEmoticon, Bans, ClientData, SpaceSummaryEvent, RoomSummaryEvent, AssignRole, GetMessages, CreateMessage, Ack, CreateRole, CreateRoom, CreateSpace, CreateTopic, FollowTopic, UnfollowTopic, GetFollowedTopics, DeassignRole, DeleteRole, DeleteRoom, DeleteSpace, DeleteTopic, SetPermissionOverwrites, GetPermissionOverwrites, GetComputedPermissions, GetRoomMembers, GetSession, GetSpaceMembers, GetSpaceRooms, JoinRoom, JoinSpace, LeaveRoom, LeaveSpace, UpdateRole, UpdateSpace, UpdateRoom, UpdateTopic, GetPermissionOverwriteTargets, CreateOwner, DeleteOwner, GetOwners, Topics, GetTopics, GetDiscoverableSpaces, GetEmoticons, CreateEmoticon, DeleteEmoticon, Ban, Unban, GetBans, Kick, GetClientData, SetClientData, GetSpaceSummary, GetRoomSummary, };
@@ -1,12 +1,17 @@
1
1
  import { User } from "./User";
2
2
  import { ChatLocation } from "./ChatLocation";
3
3
  export type MessageType = 'Text' | 'RoomJoin' | 'RoomLeave' | 'SpaceJoin' | 'SpaceLeave' | 'TopicChange';
4
+ export interface MessageAuthor {
5
+ user: User;
6
+ customNick?: string;
7
+ color?: string;
8
+ }
4
9
  export interface Message {
5
10
  id: string;
6
11
  location: ChatLocation;
7
12
  createdAt: string;
8
13
  type: MessageType;
9
- user: User;
14
+ author: MessageAuthor;
10
15
  content?: string;
11
16
  topicRef: string | null;
12
17
  attachments: string[] | null;
@@ -1,3 +1,4 @@
1
+ import { RoomType } from "./Room";
1
2
  export interface RoomSummaryExtras {
2
3
  isPrivate: boolean;
3
4
  }
@@ -5,5 +6,6 @@ export interface RoomSummary {
5
6
  id: string;
6
7
  name: string;
7
8
  description: string;
9
+ type: RoomType;
8
10
  extras?: RoomSummaryExtras;
9
11
  }
@@ -2,4 +2,5 @@ import { User } from "./User";
2
2
  export interface SpaceMember {
3
3
  user: User | null;
4
4
  roles: string[];
5
+ customNick: string | null;
5
6
  }
@@ -1,3 +1,4 @@
1
+ import { ChatLocation } from "../ChatLocation";
1
2
  export interface GetRoomSummary {
2
- id: string;
3
+ location: ChatLocation;
3
4
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "polfan-server-js-client",
3
- "version": "0.1.99937",
3
+ "version": "0.1.99939",
4
4
  "description": "JavaScript client library for handling communication with Polfan chat server.",
5
5
  "author": "Jarosław Żak",
6
6
  "license": "MIT",
@@ -215,7 +215,7 @@ export class MessagesManager {
215
215
  return;
216
216
  }
217
217
 
218
- const isMe = ev.message.user.id === this.tracker.me?.id;
218
+ const isMe = ev.message.author.user.id === this.tracker.me?.id;
219
219
 
220
220
  let update: Partial<FollowedTopic>;
221
221
 
@@ -14,8 +14,8 @@ export class UsersManager {
14
14
  tracker.client.on('SpaceMemberUpdated', event => this.handleMembers([event.member]));
15
15
  tracker.client.on('SpaceMembers', event => this.handleMembers(event.members));
16
16
  tracker.client.on('RoomMembers', event => this.handleMembers(event.members));
17
- tracker.client.on('Messages', event => this.handleUsers(event.messages.map(message => message.user)));
18
- tracker.client.on('NewMessage', event => this.handleUsers([event.message.user]));
17
+ tracker.client.on('Messages', event => this.handleUsers(event.messages.map(message => message.author.user)));
18
+ tracker.client.on('NewMessage', event => this.handleUsers([event.message.author.user]));
19
19
  tracker.client.on('Session', event => this.handleSession(event));
20
20
  }
21
21
 
@@ -1,5 +1,5 @@
1
1
  import {Envelope} from "./schemes/Envelope";
2
- import {Message, MessageType} from "./schemes/Message";
2
+ import {Message, MessageType, MessageAuthor} from "./schemes/Message";
3
3
  import {PermissionOverwritesValue} from "./schemes/PermissionOverwritesValue";
4
4
  import {Role} from "./schemes/Role";
5
5
  import {Room, RoomType, RoomFlag} from "./schemes/Room";
@@ -122,6 +122,7 @@ export {
122
122
  Envelope,
123
123
  Message,
124
124
  MessageType,
125
+ MessageAuthor,
125
126
  Role,
126
127
  Room,
127
128
  RoomFlag,
@@ -3,12 +3,18 @@ import {ChatLocation} from "./ChatLocation";
3
3
 
4
4
  export type MessageType = 'Text'|'RoomJoin'|'RoomLeave'|'SpaceJoin'|'SpaceLeave'|'TopicChange';
5
5
 
6
+ export interface MessageAuthor {
7
+ user: User;
8
+ customNick?: string;
9
+ color?: string;
10
+ }
11
+
6
12
  export interface Message {
7
13
  id: string;
8
14
  location: ChatLocation;
9
15
  createdAt: string;
10
16
  type: MessageType;
11
- user: User;
17
+ author: MessageAuthor;
12
18
  content?: string;
13
19
  topicRef: string | null;
14
20
  attachments: string[] | null;
@@ -1,3 +1,5 @@
1
+ import {RoomType} from "./Room";
2
+
1
3
  export interface RoomSummaryExtras {
2
4
  isPrivate: boolean;
3
5
  }
@@ -6,5 +8,6 @@ export interface RoomSummary {
6
8
  id: string;
7
9
  name: string;
8
10
  description: string;
11
+ type: RoomType;
9
12
  extras?: RoomSummaryExtras;
10
13
  }
@@ -3,4 +3,5 @@ import {User} from "./User";
3
3
  export interface SpaceMember {
4
4
  user: User | null;
5
5
  roles: string[];
6
+ customNick: string | null;
6
7
  }
@@ -1,3 +1,5 @@
1
+ import {ChatLocation} from "../ChatLocation";
2
+
1
3
  export interface GetRoomSummary {
2
- id: string;
4
+ location: ChatLocation;
3
5
  }