polfan-server-js-client 0.2.45 → 0.2.47

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,8 +1,6 @@
1
- export declare enum UserRelationshipType {
2
- Ignore = "Ignore"
3
- }
1
+ import { User } from "./User";
2
+ export type UserRelationshipType = 'Ignore';
4
3
  export interface UserRelationship {
5
- userId: string;
6
- refUserId: string;
4
+ refUser: User;
7
5
  type: UserRelationshipType;
8
6
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "polfan-server-js-client",
3
- "version": "0.2.45",
3
+ "version": "0.2.47",
4
4
  "description": "JavaScript client library for handling communication with Polfan chat server.",
5
5
  "author": "Jarosław Żak",
6
6
  "license": "MIT",
@@ -10,7 +10,7 @@ import {PromiseRegistry} from "./AsyncUtils";
10
10
  import {ChatStateTracker} from "./ChatStateTracker";
11
11
 
12
12
  const getId = (refUserId: string, type: UserRelationshipType): string => `${refUserId}-${type}`;
13
- const getIdFromRelationship = (relationship: UserRelationship): string => getId(relationship.refUserId, relationship.type);
13
+ const getIdFromRelationship = (relationship: UserRelationship): string => getId(relationship.refUser.id, relationship.type);
14
14
 
15
15
  export class RelationshipsManager {
16
16
  private relationships: ObservableIndexedObjectCollection<UserRelationship> = new ObservableIndexedObjectCollection<UserRelationship>(getIdFromRelationship);
@@ -1,9 +1,8 @@
1
- export enum UserRelationshipType {
2
- Ignore = 'Ignore',
3
- }
1
+ import {User} from "./User";
2
+
3
+ export type UserRelationshipType = 'Ignore';
4
4
 
5
5
  export interface UserRelationship {
6
- userId: string;
7
- refUserId: string;
6
+ refUser: User;
8
7
  type: UserRelationshipType;
9
8
  }