@only-chat/types 0.2.0-beta.15 → 0.2.0-beta.16

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/store.d.ts +7 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@only-chat/types",
3
- "version": "0.2.0-beta.15",
3
+ "version": "0.2.0-beta.16",
4
4
  "description": "TypeScript definitions for only-chat",
5
5
  "homepage": "https://github.com/only-chat/node-backend/packages/types",
6
6
  "main": "",
package/store.d.ts CHANGED
@@ -94,6 +94,11 @@ export interface SaveResponse {
94
94
 
95
95
  export type ConversationLastMessages = Record<string, { latest?: Message, left?: Date }>
96
96
 
97
+ export interface ConversationIdResult {
98
+ id?: string
99
+ result?: string
100
+ }
101
+
97
102
  export interface ConversationsResult {
98
103
  conversations: Conversation[]
99
104
  from: number
@@ -105,9 +110,9 @@ export interface MessageStore {
105
110
  findMessages: (r: FindRequest) => Promise<FindResult>
106
111
  getLastMessagesTimestamps: (fromId: string, conversationId: string[]) => Promise<ConversationLastMessages>
107
112
  getParticipantConversationById: (participant: string | undefined, id: string) => Promise<Conversation | undefined>
108
- getParticipantConversations: (participant: string, ids: string[] | undefined, excludeIds: string[] | undefined, from: number | undefined, size: number | undefined) => Promise<ConversationsResult>
113
+ getParticipantConversations: (participant: string, ids?: string[], excludeIds?: string[], from?: number, size?: number) => Promise<ConversationsResult>
109
114
  getParticipantLastMessage: (participant: string, conversationId: string) => Promise<Message | undefined>
110
- getPeerToPeerConversationId(peer1: string, peer2: string): Promise<string | undefined>
115
+ getPeerToPeerConversationId(peer1: string, peer2: string): Promise<ConversationIdResult | undefined>
111
116
  saveConnection: (userId: string, instanceId: string) => Promise<SaveResponse>
112
117
  saveConversation: (c: Conversation) => Promise<SaveResponse>
113
118
  saveMessage: (m: Message) => Promise<SaveResponse>