hububb-models 1.0.33 → 1.0.34

Sign up to get free protection for your applications and to get access to all the features.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hububb-models",
3
- "version": "1.0.33",
3
+ "version": "1.0.34",
4
4
  "description": "Models for Hububb application",
5
5
  "main": "index.js",
6
6
  "types": "./src/index.d.ts",
package/src/index.ts CHANGED
@@ -1,6 +1,6 @@
1
- export type { Listing, Picture, Address } from "./models/listing/listing";
1
+ export type { Listing, Picture, Address } from './models/listing/listing';
2
2
 
3
- export type { Reservation } from "./models/reservation/reservation";
4
- export type { User } from "./models/user/user";
5
- export type { Message } from "./models/thread/message";
6
- export type { Thread } from "./models/thread/thread";
3
+ export type { Reservation } from './models/reservation/reservation';
4
+ export type { User } from './models/user/user';
5
+ export type { ChatMessage } from './models/thread/message';
6
+ export type { ChatThread } from './models/thread/thread';
@@ -1,15 +1,13 @@
1
- import { Timestamp } from "@firebase/firestore-types";
1
+ import { ChatMember } from './thread';
2
2
 
3
- interface Attachment {
4
- id: string;
5
- url: string;
6
- }
7
-
8
- export interface Message {
9
- id: string;
10
- attachments: Attachment[];
11
- body: string;
12
- contentType: string;
13
- createdAt: Timestamp;
14
- authorId: string;
15
- }
3
+ type SeenBy = Record<string, number>;
4
+
5
+ export interface ChatMessage {
6
+ id: string;
7
+ threadId: string;
8
+ author: ChatMember;
9
+ content: string;
10
+ seen: SeenBy;
11
+ lastSeen?: number;
12
+ createdAt: number;
13
+ }
@@ -1,20 +1,17 @@
1
- import { Timestamp } from "@firebase/firestore-types"
2
- import { Message } from "./message";
1
+ import { ChatMessage } from './message';
3
2
 
4
-
5
-
6
- export interface Contact {
3
+ export interface ChatMember {
7
4
  id: string;
8
5
  avatar: string;
9
- lastActivity?: number;
6
+ email?: string;
10
7
  fullName: string;
11
8
  }
12
- export interface Thread {
13
- id?: string;
14
- messages: Message[];
15
- lastMessage?: Message;
16
- participantIds: string[];
17
- participants?: Contact[];
18
- type: "ONE_TO_ONE" | "GROUP";
19
- unreadCount?: number;
9
+
10
+ export interface ChatThread {
11
+ id: string;
12
+ subject: string;
13
+ lastMessage?: ChatMessage;
14
+ members: ChatMember[];
15
+ updatedAt: number;
16
+ createdAt: number;
20
17
  }