@barumetric/contracts 1.4.11 → 1.4.13
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.
- package/dist/events/messages/send-message-command.interface.d.ts +3 -3
- package/gen/ts/account.ts +1 -1
- package/gen/ts/auth.ts +1 -1
- package/gen/ts/balance.ts +1 -1
- package/gen/ts/categories.ts +1 -1
- package/gen/ts/google/protobuf/empty.ts +1 -1
- package/gen/ts/google/protobuf/struct.ts +1 -1
- package/gen/ts/google/protobuf/timestamp.ts +1 -1
- package/gen/ts/images.ts +1 -1
- package/gen/ts/listings.ts +1 -1
- package/gen/ts/media.ts +1 -1
- package/gen/ts/messages.ts +60 -61
- package/gen/ts/payment.ts +1 -1
- package/gen/ts/presence.ts +1 -1
- package/gen/ts/session.ts +1 -1
- package/gen/ts/users.ts +1 -1
- package/package.json +1 -1
- package/proto/messages.proto +70 -74
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type { MessageType } from
|
|
1
|
+
import type { MessageType } from "./message-types";
|
|
2
2
|
/**
|
|
3
|
-
* RMQ
|
|
3
|
+
* RMQ event
|
|
4
4
|
* pattern: `messages.message.send`
|
|
5
5
|
*/
|
|
6
|
-
export interface
|
|
6
|
+
export interface SendMessageEvent {
|
|
7
7
|
conversationId: string;
|
|
8
8
|
senderId: string;
|
|
9
9
|
text?: string;
|
package/gen/ts/account.ts
CHANGED
package/gen/ts/auth.ts
CHANGED
package/gen/ts/balance.ts
CHANGED
package/gen/ts/categories.ts
CHANGED
package/gen/ts/images.ts
CHANGED
package/gen/ts/listings.ts
CHANGED
package/gen/ts/media.ts
CHANGED
package/gen/ts/messages.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
2
2
|
// versions:
|
|
3
|
-
// protoc-gen-ts_proto v2.11.
|
|
3
|
+
// protoc-gen-ts_proto v2.11.1
|
|
4
4
|
// protoc v3.21.12
|
|
5
5
|
// source: messages.proto
|
|
6
6
|
|
|
@@ -12,59 +12,25 @@ import { Timestamp } from "./google/protobuf/timestamp";
|
|
|
12
12
|
export const protobufPackage = "messages.v1";
|
|
13
13
|
|
|
14
14
|
export enum MessageType {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
15
|
+
UNSPECIFIED = 0,
|
|
16
|
+
TEXT = 1,
|
|
17
|
+
IMAGE = 2,
|
|
18
|
+
FILE = 3,
|
|
19
|
+
VOICE = 4,
|
|
20
|
+
LOCATION = 5,
|
|
21
|
+
SYSTEM = 6,
|
|
22
22
|
UNRECOGNIZED = -1,
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
export interface Conversation {
|
|
26
|
-
id: string;
|
|
27
|
-
listingId: string;
|
|
28
|
-
sellerId: string;
|
|
29
|
-
buyerId: string;
|
|
30
|
-
lastMessageAt: Timestamp | undefined;
|
|
31
|
-
lastMessageId: string;
|
|
32
|
-
lastMessagePreview: string;
|
|
33
|
-
unreadForSeller: number;
|
|
34
|
-
unreadForBuyer: number;
|
|
35
|
-
createdAt: Timestamp | undefined;
|
|
36
|
-
updatedAt: Timestamp | undefined;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
export interface Message {
|
|
40
|
-
id: string;
|
|
41
|
-
conversationId: string;
|
|
42
|
-
senderId: string;
|
|
43
|
-
text: string;
|
|
44
|
-
type: MessageType;
|
|
45
|
-
imageUrl: string;
|
|
46
|
-
fileUrl: string;
|
|
47
|
-
fileName: string;
|
|
48
|
-
fileSize: number;
|
|
49
|
-
mimeType: string;
|
|
50
|
-
read: boolean;
|
|
51
|
-
readAt: Timestamp | undefined;
|
|
52
|
-
delivered: boolean;
|
|
53
|
-
deliveredAt: Timestamp | undefined;
|
|
54
|
-
replyToIds: string[];
|
|
55
|
-
createdAt: Timestamp | undefined;
|
|
56
|
-
updatedAt: Timestamp | undefined;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
25
|
export interface GetConversationsRequest {
|
|
60
26
|
userId: string;
|
|
61
|
-
|
|
62
|
-
|
|
27
|
+
take?: number | undefined;
|
|
28
|
+
skip?: number | undefined;
|
|
63
29
|
}
|
|
64
30
|
|
|
65
31
|
export interface GetConversationsResponse {
|
|
66
32
|
conversations: Conversation[];
|
|
67
|
-
|
|
33
|
+
total: number;
|
|
68
34
|
}
|
|
69
35
|
|
|
70
36
|
export interface GetConversationRequest {
|
|
@@ -77,39 +43,37 @@ export interface GetConversationResponse {
|
|
|
77
43
|
}
|
|
78
44
|
|
|
79
45
|
export interface CreateConversationRequest {
|
|
80
|
-
|
|
81
|
-
buyerId: string;
|
|
46
|
+
userId: string;
|
|
82
47
|
listingId: string;
|
|
83
48
|
}
|
|
84
49
|
|
|
85
50
|
export interface CreateConversationResponse {
|
|
86
|
-
|
|
51
|
+
id: string;
|
|
87
52
|
}
|
|
88
53
|
|
|
89
54
|
export interface GetMessagesRequest {
|
|
90
55
|
conversationId: string;
|
|
91
56
|
userId: string;
|
|
92
|
-
|
|
93
|
-
|
|
57
|
+
take?: number | undefined;
|
|
58
|
+
skip?: number | undefined;
|
|
94
59
|
}
|
|
95
60
|
|
|
96
61
|
export interface GetMessagesResponse {
|
|
97
62
|
messages: Message[];
|
|
98
|
-
|
|
63
|
+
total: number;
|
|
99
64
|
}
|
|
100
65
|
|
|
101
66
|
export interface SendMessageRequest {
|
|
102
67
|
conversationId: string;
|
|
103
68
|
senderId: string;
|
|
104
|
-
text
|
|
69
|
+
text?: string | undefined;
|
|
105
70
|
type: MessageType;
|
|
106
|
-
imageUrl
|
|
107
|
-
fileUrl
|
|
108
|
-
fileName
|
|
109
|
-
fileSize
|
|
110
|
-
mimeType
|
|
71
|
+
imageUrl?: string | undefined;
|
|
72
|
+
fileUrl?: string | undefined;
|
|
73
|
+
fileName?: string | undefined;
|
|
74
|
+
fileSize?: number | undefined;
|
|
75
|
+
mimeType?: string | undefined;
|
|
111
76
|
replyToIds: string[];
|
|
112
|
-
clientMessageId: string;
|
|
113
77
|
}
|
|
114
78
|
|
|
115
79
|
export interface SendMessageResponse {
|
|
@@ -119,6 +83,7 @@ export interface SendMessageResponse {
|
|
|
119
83
|
export interface MarkAsReadRequest {
|
|
120
84
|
conversationId: string;
|
|
121
85
|
userId: string;
|
|
86
|
+
/** if empty -> all unread from other participant */
|
|
122
87
|
messageIds: string[];
|
|
123
88
|
}
|
|
124
89
|
|
|
@@ -130,13 +95,47 @@ export interface SearchMessagesRequest {
|
|
|
130
95
|
userId: string;
|
|
131
96
|
conversationId: string;
|
|
132
97
|
query: string;
|
|
133
|
-
|
|
134
|
-
|
|
98
|
+
take?: number | undefined;
|
|
99
|
+
skip?: number | undefined;
|
|
135
100
|
}
|
|
136
101
|
|
|
137
102
|
export interface SearchMessagesResponse {
|
|
138
103
|
messages: Message[];
|
|
139
|
-
|
|
104
|
+
total: number;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
export interface Conversation {
|
|
108
|
+
id: string;
|
|
109
|
+
/** optional */
|
|
110
|
+
listingId: string;
|
|
111
|
+
/** participants */
|
|
112
|
+
sellerId: string;
|
|
113
|
+
buyerId: string;
|
|
114
|
+
lastMessageAt?: Timestamp | undefined;
|
|
115
|
+
lastMessageId?: string | undefined;
|
|
116
|
+
lastMessagePreview?: string | undefined;
|
|
117
|
+
unreadForSeller: number;
|
|
118
|
+
unreadForBuyer: number;
|
|
119
|
+
createdAt: Timestamp | undefined;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
export interface Message {
|
|
123
|
+
id: string;
|
|
124
|
+
conversationId: string;
|
|
125
|
+
senderId: string;
|
|
126
|
+
text?: string | undefined;
|
|
127
|
+
type: MessageType;
|
|
128
|
+
imageUrl?: string | undefined;
|
|
129
|
+
fileUrl?: string | undefined;
|
|
130
|
+
fileName?: string | undefined;
|
|
131
|
+
fileSize?: number | undefined;
|
|
132
|
+
mimeType?: string | undefined;
|
|
133
|
+
read: boolean;
|
|
134
|
+
readAt?: Timestamp | undefined;
|
|
135
|
+
delivered: boolean;
|
|
136
|
+
deliveredAt?: Timestamp | undefined;
|
|
137
|
+
replyToIds: string[];
|
|
138
|
+
createdAt: Timestamp | undefined;
|
|
140
139
|
}
|
|
141
140
|
|
|
142
141
|
export const MESSAGES_V1_PACKAGE_NAME = "messages.v1";
|
package/gen/ts/payment.ts
CHANGED
package/gen/ts/presence.ts
CHANGED
package/gen/ts/session.ts
CHANGED
package/gen/ts/users.ts
CHANGED
package/package.json
CHANGED
package/proto/messages.proto
CHANGED
|
@@ -16,68 +16,15 @@ service MessagesService {
|
|
|
16
16
|
rpc SearchMessages(SearchMessagesRequest) returns (SearchMessagesResponse);
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
message Conversation {
|
|
20
|
-
string id = 1;
|
|
21
|
-
string listing_id = 2;
|
|
22
|
-
|
|
23
|
-
string seller_id = 3;
|
|
24
|
-
string buyer_id = 4;
|
|
25
|
-
|
|
26
|
-
google.protobuf.Timestamp last_message_at = 5;
|
|
27
|
-
string last_message_id = 6;
|
|
28
|
-
string last_message_preview = 7;
|
|
29
|
-
|
|
30
|
-
int32 unread_for_seller = 8;
|
|
31
|
-
int32 unread_for_buyer = 9;
|
|
32
|
-
|
|
33
|
-
google.protobuf.Timestamp created_at = 10;
|
|
34
|
-
google.protobuf.Timestamp updated_at = 11;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
enum MessageType {
|
|
38
|
-
MESSAGE_TYPE_UNSPECIFIED = 0;
|
|
39
|
-
MESSAGE_TYPE_TEXT = 1;
|
|
40
|
-
MESSAGE_TYPE_IMAGE = 2;
|
|
41
|
-
MESSAGE_TYPE_FILE = 3;
|
|
42
|
-
MESSAGE_TYPE_VOICE = 4;
|
|
43
|
-
MESSAGE_TYPE_LOCATION = 5;
|
|
44
|
-
MESSAGE_TYPE_SYSTEM = 6;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
message Message {
|
|
48
|
-
string id = 1;
|
|
49
|
-
string conversation_id = 2;
|
|
50
|
-
string sender_id = 3;
|
|
51
|
-
|
|
52
|
-
string text = 4;
|
|
53
|
-
MessageType type = 5;
|
|
54
|
-
|
|
55
|
-
string image_url = 6;
|
|
56
|
-
string file_url = 7;
|
|
57
|
-
string file_name = 8;
|
|
58
|
-
int64 file_size = 9;
|
|
59
|
-
string mime_type = 10;
|
|
60
|
-
|
|
61
|
-
bool read = 11;
|
|
62
|
-
google.protobuf.Timestamp read_at = 12;
|
|
63
|
-
bool delivered = 13;
|
|
64
|
-
google.protobuf.Timestamp delivered_at = 14;
|
|
65
|
-
|
|
66
|
-
repeated string reply_to_ids = 15;
|
|
67
|
-
|
|
68
|
-
google.protobuf.Timestamp created_at = 16;
|
|
69
|
-
google.protobuf.Timestamp updated_at = 17;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
19
|
message GetConversationsRequest {
|
|
73
20
|
string user_id = 1;
|
|
74
|
-
int32
|
|
75
|
-
|
|
21
|
+
optional int32 take = 2;
|
|
22
|
+
optional int32 skip = 3;
|
|
76
23
|
}
|
|
77
24
|
|
|
78
25
|
message GetConversationsResponse {
|
|
79
26
|
repeated Conversation conversations = 1;
|
|
80
|
-
|
|
27
|
+
int32 total = 2;
|
|
81
28
|
}
|
|
82
29
|
|
|
83
30
|
message GetConversationRequest {
|
|
@@ -90,43 +37,41 @@ message GetConversationResponse {
|
|
|
90
37
|
}
|
|
91
38
|
|
|
92
39
|
message CreateConversationRequest {
|
|
93
|
-
string
|
|
94
|
-
string
|
|
95
|
-
string listing_id = 3;
|
|
40
|
+
string user_id = 1;
|
|
41
|
+
string listing_id = 2;
|
|
96
42
|
}
|
|
97
43
|
|
|
98
44
|
message CreateConversationResponse {
|
|
99
|
-
|
|
45
|
+
string id = 1;
|
|
100
46
|
}
|
|
101
47
|
|
|
102
48
|
message GetMessagesRequest {
|
|
103
49
|
string conversation_id = 1;
|
|
104
50
|
string user_id = 2;
|
|
105
|
-
int32
|
|
106
|
-
|
|
51
|
+
optional int32 take = 3;
|
|
52
|
+
optional int32 skip = 4;
|
|
107
53
|
}
|
|
108
54
|
|
|
109
55
|
message GetMessagesResponse {
|
|
110
56
|
repeated Message messages = 1;
|
|
111
|
-
|
|
57
|
+
int32 total = 2;
|
|
112
58
|
}
|
|
113
59
|
|
|
114
60
|
message SendMessageRequest {
|
|
115
61
|
string conversation_id = 1;
|
|
116
62
|
string sender_id = 2;
|
|
117
63
|
|
|
118
|
-
string text = 3;
|
|
64
|
+
optional string text = 3;
|
|
119
65
|
MessageType type = 4;
|
|
120
66
|
|
|
121
|
-
string image_url = 5;
|
|
122
|
-
string file_url = 6;
|
|
123
|
-
string file_name = 7;
|
|
124
|
-
int64 file_size = 8;
|
|
125
|
-
string mime_type = 9;
|
|
67
|
+
optional string image_url = 5;
|
|
68
|
+
optional string file_url = 6;
|
|
69
|
+
optional string file_name = 7;
|
|
70
|
+
optional int64 file_size = 8;
|
|
71
|
+
optional string mime_type = 9;
|
|
126
72
|
|
|
127
73
|
repeated string reply_to_ids = 10;
|
|
128
74
|
|
|
129
|
-
string client_message_id = 11;
|
|
130
75
|
}
|
|
131
76
|
|
|
132
77
|
message SendMessageResponse {
|
|
@@ -136,7 +81,7 @@ message SendMessageResponse {
|
|
|
136
81
|
message MarkAsReadRequest {
|
|
137
82
|
string conversation_id = 1;
|
|
138
83
|
string user_id = 2;
|
|
139
|
-
repeated string message_ids = 3;
|
|
84
|
+
repeated string message_ids = 3; // if empty -> all unread from other participant
|
|
140
85
|
}
|
|
141
86
|
|
|
142
87
|
message MarkAsReadResponse {
|
|
@@ -147,12 +92,63 @@ message SearchMessagesRequest {
|
|
|
147
92
|
string user_id = 1;
|
|
148
93
|
string conversation_id = 2;
|
|
149
94
|
string query = 3;
|
|
150
|
-
int32
|
|
151
|
-
|
|
95
|
+
optional int32 take = 4;
|
|
96
|
+
optional int32 skip = 5;
|
|
152
97
|
}
|
|
153
98
|
|
|
154
99
|
message SearchMessagesResponse {
|
|
155
100
|
repeated Message messages = 1;
|
|
156
|
-
|
|
101
|
+
int32 total = 2;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
message Conversation {
|
|
105
|
+
string id = 1;
|
|
106
|
+
string listing_id = 2; // optional
|
|
107
|
+
|
|
108
|
+
// participants
|
|
109
|
+
string seller_id = 3;
|
|
110
|
+
string buyer_id = 4;
|
|
111
|
+
|
|
112
|
+
optional google.protobuf.Timestamp last_message_at = 5;
|
|
113
|
+
optional string last_message_id = 6;
|
|
114
|
+
optional string last_message_preview = 7;
|
|
115
|
+
|
|
116
|
+
int32 unread_for_seller = 8;
|
|
117
|
+
int32 unread_for_buyer = 9;
|
|
118
|
+
|
|
119
|
+
google.protobuf.Timestamp created_at = 10;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
message Message {
|
|
123
|
+
string id = 1;
|
|
124
|
+
string conversation_id = 2;
|
|
125
|
+
string sender_id = 3;
|
|
126
|
+
|
|
127
|
+
optional string text = 4;
|
|
128
|
+
MessageType type = 5;
|
|
129
|
+
|
|
130
|
+
optional string image_url = 6;
|
|
131
|
+
optional string file_url = 7;
|
|
132
|
+
optional string file_name = 8;
|
|
133
|
+
optional int64 file_size = 9;
|
|
134
|
+
optional string mime_type = 10;
|
|
135
|
+
|
|
136
|
+
bool read = 11;
|
|
137
|
+
optional google.protobuf.Timestamp read_at = 12;
|
|
138
|
+
bool delivered = 13;
|
|
139
|
+
optional google.protobuf.Timestamp delivered_at = 14;
|
|
140
|
+
|
|
141
|
+
repeated string reply_to_ids = 15;
|
|
142
|
+
|
|
143
|
+
google.protobuf.Timestamp created_at = 16;
|
|
157
144
|
}
|
|
158
145
|
|
|
146
|
+
enum MessageType {
|
|
147
|
+
UNSPECIFIED = 0;
|
|
148
|
+
TEXT = 1;
|
|
149
|
+
IMAGE = 2;
|
|
150
|
+
FILE = 3;
|
|
151
|
+
VOICE = 4;
|
|
152
|
+
LOCATION = 5;
|
|
153
|
+
SYSTEM = 6;
|
|
154
|
+
}
|