heartraite 1.0.40 → 1.0.41

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.
@@ -7,3 +7,24 @@ export type Message = {
7
7
  created: string;
8
8
  delivered: boolean;
9
9
  };
10
+ export type Conversation = {
11
+ id: string;
12
+ created: string;
13
+ latestMessage: string;
14
+ lastMessageSeen: string;
15
+ latestMessageTimestamp?: string;
16
+ messages: Record<string, Message>;
17
+ members: Record<string, boolean>;
18
+ };
19
+ export type DBConversation = {
20
+ id: string;
21
+ created: string;
22
+ latestMessage: string;
23
+ latestMessageTimestamp?: string;
24
+ members: {
25
+ [id: string]: boolean;
26
+ };
27
+ };
28
+ export type UserConversation = Omit<DBConversation, "latestMessage" | "latestMessageTimestamp"> & {
29
+ lastMessageSeen: string;
30
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "heartraite",
3
- "version": "1.0.40",
3
+ "version": "1.0.41",
4
4
  "description": "Heartraite npm package for common functionality",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -7,3 +7,28 @@ export type Message = {
7
7
  created: string;
8
8
  delivered: boolean;
9
9
  };
10
+
11
+ export type Conversation = {
12
+ id: string;
13
+ created: string;
14
+ latestMessage: string;
15
+ lastMessageSeen: string;
16
+ latestMessageTimestamp?: string;
17
+ messages: Record<string, Message>;
18
+ members: Record<string, boolean>;
19
+ };
20
+
21
+ export type DBConversation = {
22
+ id: string;
23
+ created: string;
24
+ latestMessage: string;
25
+ latestMessageTimestamp?: string;
26
+ members: { [id: string]: boolean };
27
+ };
28
+
29
+ export type UserConversation = Omit<
30
+ DBConversation,
31
+ "latestMessage" | "latestMessageTimestamp"
32
+ > & {
33
+ lastMessageSeen: string;
34
+ };