@barumetric/contracts 1.4.18 → 1.4.19
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/gen/ts/google/protobuf/empty.ts +2 -2
- package/gen/ts/google/protobuf/timestamp.ts +10 -9
- package/package.json +1 -1
- package/proto/account.proto +74 -74
- package/proto/auth.proto +153 -153
- package/proto/balance.proto +29 -29
- package/proto/images.proto +29 -29
- package/proto/listings.proto +126 -126
- package/proto/messages.proto +153 -153
- package/proto/session.proto +61 -61
- package/dist/events/account/email-changed.interface.d.ts +0 -4
- package/dist/events/account/email-changed.interface.js +0 -2
- package/dist/events/account/index.d.ts +0 -2
- package/dist/events/account/index.js +0 -18
- package/dist/events/account/phone-changed.interface.d.ts +0 -4
- package/dist/events/account/phone-changed.interface.js +0 -2
- package/dist/events/auth/index.d.ts +0 -1
- package/dist/events/auth/index.js +0 -17
- package/dist/events/auth/otp-requested.interface.d.ts +0 -5
- package/dist/events/auth/otp-requested.interface.js +0 -2
- package/dist/events/balance/index.d.ts +0 -1
- package/dist/events/balance/index.js +0 -17
- package/dist/events/balance/top-up.interface.d.ts +0 -5
- package/dist/events/balance/top-up.interface.js +0 -2
- package/dist/events/images/index.d.ts +0 -1
- package/dist/events/images/index.js +0 -17
- package/dist/events/images/process-images.interface.d.ts +0 -9
- package/dist/events/images/process-images.interface.js +0 -2
- package/dist/events/index.d.ts +0 -7
- package/dist/events/index.js +0 -23
- package/dist/events/listings/create-listing.interface.d.ts +0 -16
- package/dist/events/listings/create-listing.interface.js +0 -2
- package/dist/events/listings/delete-listing.interface.d.ts +0 -4
- package/dist/events/listings/delete-listing.interface.js +0 -2
- package/dist/events/listings/index.d.ts +0 -3
- package/dist/events/listings/index.js +0 -19
- package/dist/events/listings/update-listing.interface.d.ts +0 -17
- package/dist/events/listings/update-listing.interface.js +0 -2
- package/dist/events/messages/index.d.ts +0 -5
- package/dist/events/messages/index.js +0 -21
- package/dist/events/messages/mark-as-read-command.interface.d.ts +0 -9
- package/dist/events/messages/mark-as-read-command.interface.js +0 -2
- package/dist/events/messages/message-read-event.interface.d.ts +0 -13
- package/dist/events/messages/message-read-event.interface.js +0 -2
- package/dist/events/messages/message-sent-event.interface.d.ts +0 -32
- package/dist/events/messages/message-sent-event.interface.js +0 -2
- package/dist/events/messages/message-types.d.ts +0 -1
- package/dist/events/messages/message-types.js +0 -2
- package/dist/events/messages/send-message-command.interface.d.ts +0 -17
- package/dist/events/messages/send-message-command.interface.js +0 -2
- package/dist/events/payment/index.d.ts +0 -2
- package/dist/events/payment/index.js +0 -18
- package/dist/events/payment/payment-failed.interface.d.ts +0 -6
- package/dist/events/payment/payment-failed.interface.js +0 -2
- package/dist/events/payment/payment-succeeded.interface.d.ts +0 -6
- package/dist/events/payment/payment-succeeded.interface.js +0 -2
- package/dist/index.d.ts +0 -2
- package/dist/index.js +0 -18
- package/dist/proto/index.d.ts +0 -1
- package/dist/proto/index.js +0 -17
- package/dist/proto/paths.d.ts +0 -14
- package/dist/proto/paths.js +0 -18
- package/gen/ts/account.ts +0 -133
- package/gen/ts/auth.ts +0 -236
- package/gen/ts/balance.ts +0 -67
- package/gen/ts/categories.ts +0 -354
- package/gen/ts/google/protobuf/struct.ts +0 -197
- package/gen/ts/images.ts +0 -60
- package/gen/ts/listings.ts +0 -202
- package/gen/ts/media.ts +0 -77
- package/gen/ts/messages.ts +0 -211
- package/gen/ts/payment.ts +0 -190
- package/gen/ts/presence.ts +0 -127
- package/gen/ts/session.ts +0 -110
- package/gen/ts/users.ts +0 -277
package/proto/listings.proto
CHANGED
|
@@ -1,126 +1,126 @@
|
|
|
1
|
-
syntax = "proto3";
|
|
2
|
-
|
|
3
|
-
package listings.v1;
|
|
4
|
-
|
|
5
|
-
import "google/protobuf/empty.proto";
|
|
6
|
-
import "google/protobuf/struct.proto";
|
|
7
|
-
|
|
8
|
-
service ListingsService {
|
|
9
|
-
rpc GetListing (GetListingRequest) returns (GetListingResponse);
|
|
10
|
-
rpc GetListingsByUser (GetListingsByUserRequest) returns (GetListingsByUserResponse);
|
|
11
|
-
rpc GetListingsByCategory (GetListingsByCategoryRequest) returns (GetListingsByCategoryResponse);
|
|
12
|
-
|
|
13
|
-
rpc CreateListing (CreateListingRequest) returns (CreateListingResponse);
|
|
14
|
-
rpc UpdateListing (UpdateListingRequest) returns (UpdateListingResponse);
|
|
15
|
-
rpc DeleteListing (DeleteListingRequest) returns (DeleteListingResponse);
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
message CreateListingRequest {
|
|
19
|
-
string user_id = 1;
|
|
20
|
-
string title = 2;
|
|
21
|
-
optional string description = 3;
|
|
22
|
-
optional float price = 4;
|
|
23
|
-
string category_id = 5;
|
|
24
|
-
optional float latitude = 6;
|
|
25
|
-
optional float longitude = 7;
|
|
26
|
-
optional string video_url = 8;
|
|
27
|
-
optional string status = 9;
|
|
28
|
-
optional google.protobuf.Struct attributes = 10;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
message CreateListingResponse {
|
|
32
|
-
string id = 1;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
message UpdateListingRequest {
|
|
36
|
-
string id = 1;
|
|
37
|
-
string user_id = 2;
|
|
38
|
-
string title = 3;
|
|
39
|
-
optional string description = 4;
|
|
40
|
-
optional float price = 5;
|
|
41
|
-
string category_id = 6;
|
|
42
|
-
optional float latitude = 7;
|
|
43
|
-
optional float longitude = 8;
|
|
44
|
-
optional string video_url = 9;
|
|
45
|
-
optional string status = 10;
|
|
46
|
-
optional google.protobuf.Struct attributes = 11;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
message UpdateListingResponse {
|
|
50
|
-
string id = 1;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
message GetListingRequest {
|
|
54
|
-
string id = 1;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
message DeleteListingRequest {
|
|
58
|
-
string id = 1;
|
|
59
|
-
string user_id = 2;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
message DeleteListingResponse {
|
|
63
|
-
bool ok = 1;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
message GetListingsByUserRequest {
|
|
67
|
-
string user_id = 1;
|
|
68
|
-
optional ListingStatus status = 2;
|
|
69
|
-
optional int32 take = 3;
|
|
70
|
-
optional int32 skip = 4;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
message GetListingsByCategoryRequest {
|
|
74
|
-
string category_id = 1;
|
|
75
|
-
optional ListingStatus status = 2;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
// Ответы
|
|
79
|
-
message GetListingResponse {
|
|
80
|
-
Listing listing = 1;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
message GetListingsByUserResponse {
|
|
84
|
-
repeated Listing listings = 1;
|
|
85
|
-
int32 total = 2;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
message GetListingsByCategoryResponse {
|
|
89
|
-
repeated Listing listings = 1;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
// Модели
|
|
93
|
-
message Listing {
|
|
94
|
-
string id = 1;
|
|
95
|
-
string title = 2;
|
|
96
|
-
optional string description = 3;
|
|
97
|
-
optional float price = 4;
|
|
98
|
-
string category_id = 5;
|
|
99
|
-
string user_id = 6;
|
|
100
|
-
optional float latitude = 7;
|
|
101
|
-
optional float longitude = 8;
|
|
102
|
-
optional string video_url = 9;
|
|
103
|
-
ListingStatus status = 10;
|
|
104
|
-
int64 views_count = 11;
|
|
105
|
-
int64 favorites_count = 12;
|
|
106
|
-
int32 images_count = 13;
|
|
107
|
-
string attributes = 14; // JSON строка
|
|
108
|
-
string created_at = 15;
|
|
109
|
-
string updated_at = 16;
|
|
110
|
-
optional string published_at = 17;
|
|
111
|
-
optional string deleted_at = 18;
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
// Статусы объявлений
|
|
115
|
-
enum ListingStatus {
|
|
116
|
-
UNSPECIFIED = 0;
|
|
117
|
-
DRAFT = 1; // Черновик
|
|
118
|
-
ACTIVE = 2; // Активные
|
|
119
|
-
UNPUBLISHED = 3; // Неопубликованные
|
|
120
|
-
WITH_ERRORS = 4; // С ошибками
|
|
121
|
-
ARCHIVED = 5; // Архив
|
|
122
|
-
DELETED = 6; // Удаленные
|
|
123
|
-
PENDING_REVIEW = 7; // На модерации (внутренний)
|
|
124
|
-
REJECTED = 8; // Отклонено (внутренний)
|
|
125
|
-
SUSPENDED = 9; // Приостановлено (внутренний)
|
|
126
|
-
}
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package listings.v1;
|
|
4
|
+
|
|
5
|
+
import "google/protobuf/empty.proto";
|
|
6
|
+
import "google/protobuf/struct.proto";
|
|
7
|
+
|
|
8
|
+
service ListingsService {
|
|
9
|
+
rpc GetListing (GetListingRequest) returns (GetListingResponse);
|
|
10
|
+
rpc GetListingsByUser (GetListingsByUserRequest) returns (GetListingsByUserResponse);
|
|
11
|
+
rpc GetListingsByCategory (GetListingsByCategoryRequest) returns (GetListingsByCategoryResponse);
|
|
12
|
+
|
|
13
|
+
rpc CreateListing (CreateListingRequest) returns (CreateListingResponse);
|
|
14
|
+
rpc UpdateListing (UpdateListingRequest) returns (UpdateListingResponse);
|
|
15
|
+
rpc DeleteListing (DeleteListingRequest) returns (DeleteListingResponse);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
message CreateListingRequest {
|
|
19
|
+
string user_id = 1;
|
|
20
|
+
string title = 2;
|
|
21
|
+
optional string description = 3;
|
|
22
|
+
optional float price = 4;
|
|
23
|
+
string category_id = 5;
|
|
24
|
+
optional float latitude = 6;
|
|
25
|
+
optional float longitude = 7;
|
|
26
|
+
optional string video_url = 8;
|
|
27
|
+
optional string status = 9;
|
|
28
|
+
optional google.protobuf.Struct attributes = 10;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
message CreateListingResponse {
|
|
32
|
+
string id = 1;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
message UpdateListingRequest {
|
|
36
|
+
string id = 1;
|
|
37
|
+
string user_id = 2;
|
|
38
|
+
string title = 3;
|
|
39
|
+
optional string description = 4;
|
|
40
|
+
optional float price = 5;
|
|
41
|
+
string category_id = 6;
|
|
42
|
+
optional float latitude = 7;
|
|
43
|
+
optional float longitude = 8;
|
|
44
|
+
optional string video_url = 9;
|
|
45
|
+
optional string status = 10;
|
|
46
|
+
optional google.protobuf.Struct attributes = 11;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
message UpdateListingResponse {
|
|
50
|
+
string id = 1;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
message GetListingRequest {
|
|
54
|
+
string id = 1;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
message DeleteListingRequest {
|
|
58
|
+
string id = 1;
|
|
59
|
+
string user_id = 2;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
message DeleteListingResponse {
|
|
63
|
+
bool ok = 1;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
message GetListingsByUserRequest {
|
|
67
|
+
string user_id = 1;
|
|
68
|
+
optional ListingStatus status = 2;
|
|
69
|
+
optional int32 take = 3;
|
|
70
|
+
optional int32 skip = 4;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
message GetListingsByCategoryRequest {
|
|
74
|
+
string category_id = 1;
|
|
75
|
+
optional ListingStatus status = 2;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
// Ответы
|
|
79
|
+
message GetListingResponse {
|
|
80
|
+
Listing listing = 1;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
message GetListingsByUserResponse {
|
|
84
|
+
repeated Listing listings = 1;
|
|
85
|
+
int32 total = 2;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
message GetListingsByCategoryResponse {
|
|
89
|
+
repeated Listing listings = 1;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
// Модели
|
|
93
|
+
message Listing {
|
|
94
|
+
string id = 1;
|
|
95
|
+
string title = 2;
|
|
96
|
+
optional string description = 3;
|
|
97
|
+
optional float price = 4;
|
|
98
|
+
string category_id = 5;
|
|
99
|
+
string user_id = 6;
|
|
100
|
+
optional float latitude = 7;
|
|
101
|
+
optional float longitude = 8;
|
|
102
|
+
optional string video_url = 9;
|
|
103
|
+
ListingStatus status = 10;
|
|
104
|
+
int64 views_count = 11;
|
|
105
|
+
int64 favorites_count = 12;
|
|
106
|
+
int32 images_count = 13;
|
|
107
|
+
string attributes = 14; // JSON строка
|
|
108
|
+
string created_at = 15;
|
|
109
|
+
string updated_at = 16;
|
|
110
|
+
optional string published_at = 17;
|
|
111
|
+
optional string deleted_at = 18;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
// Статусы объявлений
|
|
115
|
+
enum ListingStatus {
|
|
116
|
+
UNSPECIFIED = 0;
|
|
117
|
+
DRAFT = 1; // Черновик
|
|
118
|
+
ACTIVE = 2; // Активные
|
|
119
|
+
UNPUBLISHED = 3; // Неопубликованные
|
|
120
|
+
WITH_ERRORS = 4; // С ошибками
|
|
121
|
+
ARCHIVED = 5; // Архив
|
|
122
|
+
DELETED = 6; // Удаленные
|
|
123
|
+
PENDING_REVIEW = 7; // На модерации (внутренний)
|
|
124
|
+
REJECTED = 8; // Отклонено (внутренний)
|
|
125
|
+
SUSPENDED = 9; // Приостановлено (внутренний)
|
|
126
|
+
}
|
package/proto/messages.proto
CHANGED
|
@@ -1,153 +1,153 @@
|
|
|
1
|
-
syntax = "proto3";
|
|
2
|
-
|
|
3
|
-
package messages.v1;
|
|
4
|
-
|
|
5
|
-
import "google/protobuf/timestamp.proto";
|
|
6
|
-
|
|
7
|
-
service MessagesService {
|
|
8
|
-
rpc GetConversations(GetConversationsRequest) returns (GetConversationsResponse);
|
|
9
|
-
rpc GetConversation(GetConversationRequest) returns (GetConversationResponse);
|
|
10
|
-
rpc CreateConversation(CreateConversationRequest) returns (CreateConversationResponse);
|
|
11
|
-
|
|
12
|
-
rpc GetMessages(GetMessagesRequest) returns (GetMessagesResponse);
|
|
13
|
-
rpc SendMessage(SendMessageRequest) returns (SendMessageResponse);
|
|
14
|
-
rpc MarkAsRead(MarkAsReadRequest) returns (MarkAsReadResponse);
|
|
15
|
-
|
|
16
|
-
rpc SearchMessages(SearchMessagesRequest) returns (SearchMessagesResponse);
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
message GetConversationsRequest {
|
|
20
|
-
string user_id = 1;
|
|
21
|
-
optional int32 take = 2;
|
|
22
|
-
optional int32 skip = 3;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
message GetConversationsResponse {
|
|
26
|
-
repeated Conversation conversations = 1;
|
|
27
|
-
int32 total = 2;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
message GetConversationRequest {
|
|
31
|
-
string conversation_id = 1;
|
|
32
|
-
string user_id = 2;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
message GetConversationResponse {
|
|
36
|
-
Conversation conversation = 1;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
message CreateConversationRequest {
|
|
40
|
-
string user_id = 1;
|
|
41
|
-
string listing_id = 2;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
message CreateConversationResponse {
|
|
45
|
-
string id = 1;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
message GetMessagesRequest {
|
|
49
|
-
string conversation_id = 1;
|
|
50
|
-
string user_id = 2;
|
|
51
|
-
optional int32 take = 3;
|
|
52
|
-
optional int32 skip = 4;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
message GetMessagesResponse {
|
|
56
|
-
repeated Message messages = 1;
|
|
57
|
-
int32 total = 2;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
message SendMessageRequest {
|
|
61
|
-
string conversation_id = 1;
|
|
62
|
-
string sender_id = 2;
|
|
63
|
-
|
|
64
|
-
optional string text = 3;
|
|
65
|
-
MessageType type = 4;
|
|
66
|
-
|
|
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;
|
|
72
|
-
|
|
73
|
-
repeated string reply_to_ids = 10;
|
|
74
|
-
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
message SendMessageResponse {
|
|
78
|
-
Message message = 1;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
message MarkAsReadRequest {
|
|
82
|
-
string conversation_id = 1;
|
|
83
|
-
string user_id = 2;
|
|
84
|
-
repeated string message_ids = 3; // if empty -> all unread from other participant
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
message MarkAsReadResponse {
|
|
88
|
-
int32 marked_count = 1;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
message SearchMessagesRequest {
|
|
92
|
-
string user_id = 1;
|
|
93
|
-
string conversation_id = 2;
|
|
94
|
-
string query = 3;
|
|
95
|
-
optional int32 take = 4;
|
|
96
|
-
optional int32 skip = 5;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
message SearchMessagesResponse {
|
|
100
|
-
repeated Message messages = 1;
|
|
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_count = 8;
|
|
117
|
-
|
|
118
|
-
google.protobuf.Timestamp created_at = 9;
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
message Message {
|
|
122
|
-
string id = 1;
|
|
123
|
-
string conversation_id = 2;
|
|
124
|
-
string sender_id = 3;
|
|
125
|
-
|
|
126
|
-
optional string text = 4;
|
|
127
|
-
MessageType type = 5;
|
|
128
|
-
|
|
129
|
-
optional string image_url = 6;
|
|
130
|
-
optional string file_url = 7;
|
|
131
|
-
optional string file_name = 8;
|
|
132
|
-
optional int64 file_size = 9;
|
|
133
|
-
optional string mime_type = 10;
|
|
134
|
-
|
|
135
|
-
bool read = 11;
|
|
136
|
-
optional google.protobuf.Timestamp read_at = 12;
|
|
137
|
-
bool delivered = 13;
|
|
138
|
-
optional google.protobuf.Timestamp delivered_at = 14;
|
|
139
|
-
|
|
140
|
-
repeated string reply_to_ids = 15;
|
|
141
|
-
|
|
142
|
-
google.protobuf.Timestamp created_at = 16;
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
enum MessageType {
|
|
146
|
-
UNSPECIFIED = 0;
|
|
147
|
-
TEXT = 1;
|
|
148
|
-
IMAGE = 2;
|
|
149
|
-
FILE = 3;
|
|
150
|
-
VOICE = 4;
|
|
151
|
-
LOCATION = 5;
|
|
152
|
-
SYSTEM = 6;
|
|
153
|
-
}
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package messages.v1;
|
|
4
|
+
|
|
5
|
+
import "google/protobuf/timestamp.proto";
|
|
6
|
+
|
|
7
|
+
service MessagesService {
|
|
8
|
+
rpc GetConversations(GetConversationsRequest) returns (GetConversationsResponse);
|
|
9
|
+
rpc GetConversation(GetConversationRequest) returns (GetConversationResponse);
|
|
10
|
+
rpc CreateConversation(CreateConversationRequest) returns (CreateConversationResponse);
|
|
11
|
+
|
|
12
|
+
rpc GetMessages(GetMessagesRequest) returns (GetMessagesResponse);
|
|
13
|
+
rpc SendMessage(SendMessageRequest) returns (SendMessageResponse);
|
|
14
|
+
rpc MarkAsRead(MarkAsReadRequest) returns (MarkAsReadResponse);
|
|
15
|
+
|
|
16
|
+
rpc SearchMessages(SearchMessagesRequest) returns (SearchMessagesResponse);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
message GetConversationsRequest {
|
|
20
|
+
string user_id = 1;
|
|
21
|
+
optional int32 take = 2;
|
|
22
|
+
optional int32 skip = 3;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
message GetConversationsResponse {
|
|
26
|
+
repeated Conversation conversations = 1;
|
|
27
|
+
int32 total = 2;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
message GetConversationRequest {
|
|
31
|
+
string conversation_id = 1;
|
|
32
|
+
string user_id = 2;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
message GetConversationResponse {
|
|
36
|
+
Conversation conversation = 1;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
message CreateConversationRequest {
|
|
40
|
+
string user_id = 1;
|
|
41
|
+
string listing_id = 2;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
message CreateConversationResponse {
|
|
45
|
+
string id = 1;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
message GetMessagesRequest {
|
|
49
|
+
string conversation_id = 1;
|
|
50
|
+
string user_id = 2;
|
|
51
|
+
optional int32 take = 3;
|
|
52
|
+
optional int32 skip = 4;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
message GetMessagesResponse {
|
|
56
|
+
repeated Message messages = 1;
|
|
57
|
+
int32 total = 2;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
message SendMessageRequest {
|
|
61
|
+
string conversation_id = 1;
|
|
62
|
+
string sender_id = 2;
|
|
63
|
+
|
|
64
|
+
optional string text = 3;
|
|
65
|
+
MessageType type = 4;
|
|
66
|
+
|
|
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;
|
|
72
|
+
|
|
73
|
+
repeated string reply_to_ids = 10;
|
|
74
|
+
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
message SendMessageResponse {
|
|
78
|
+
Message message = 1;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
message MarkAsReadRequest {
|
|
82
|
+
string conversation_id = 1;
|
|
83
|
+
string user_id = 2;
|
|
84
|
+
repeated string message_ids = 3; // if empty -> all unread from other participant
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
message MarkAsReadResponse {
|
|
88
|
+
int32 marked_count = 1;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
message SearchMessagesRequest {
|
|
92
|
+
string user_id = 1;
|
|
93
|
+
string conversation_id = 2;
|
|
94
|
+
string query = 3;
|
|
95
|
+
optional int32 take = 4;
|
|
96
|
+
optional int32 skip = 5;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
message SearchMessagesResponse {
|
|
100
|
+
repeated Message messages = 1;
|
|
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_count = 8;
|
|
117
|
+
|
|
118
|
+
google.protobuf.Timestamp created_at = 9;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
message Message {
|
|
122
|
+
string id = 1;
|
|
123
|
+
string conversation_id = 2;
|
|
124
|
+
string sender_id = 3;
|
|
125
|
+
|
|
126
|
+
optional string text = 4;
|
|
127
|
+
MessageType type = 5;
|
|
128
|
+
|
|
129
|
+
optional string image_url = 6;
|
|
130
|
+
optional string file_url = 7;
|
|
131
|
+
optional string file_name = 8;
|
|
132
|
+
optional int64 file_size = 9;
|
|
133
|
+
optional string mime_type = 10;
|
|
134
|
+
|
|
135
|
+
bool read = 11;
|
|
136
|
+
optional google.protobuf.Timestamp read_at = 12;
|
|
137
|
+
bool delivered = 13;
|
|
138
|
+
optional google.protobuf.Timestamp delivered_at = 14;
|
|
139
|
+
|
|
140
|
+
repeated string reply_to_ids = 15;
|
|
141
|
+
|
|
142
|
+
google.protobuf.Timestamp created_at = 16;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
enum MessageType {
|
|
146
|
+
UNSPECIFIED = 0;
|
|
147
|
+
TEXT = 1;
|
|
148
|
+
IMAGE = 2;
|
|
149
|
+
FILE = 3;
|
|
150
|
+
VOICE = 4;
|
|
151
|
+
LOCATION = 5;
|
|
152
|
+
SYSTEM = 6;
|
|
153
|
+
}
|
package/proto/session.proto
CHANGED
|
@@ -1,61 +1,61 @@
|
|
|
1
|
-
syntax = "proto3";
|
|
2
|
-
|
|
3
|
-
package session.v1;
|
|
4
|
-
|
|
5
|
-
import "google/protobuf/timestamp.proto";
|
|
6
|
-
|
|
7
|
-
service SessionService {
|
|
8
|
-
rpc ListSessions (ListSessionsRequest) returns (ListSessionsResponse);
|
|
9
|
-
rpc RevokeSession (RevokeSessionRequest) returns (RevokeSessionResponse);
|
|
10
|
-
rpc RevokeAllOtherSessions (RevokeAllOtherSessionsRequest) returns (RevokeAllOtherSessionsResponse);
|
|
11
|
-
|
|
12
|
-
rpc GetSession (GetSessionRequest) returns (GetSessionResponse);
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
message ListSessionsRequest {
|
|
16
|
-
string user_id = 1;
|
|
17
|
-
string session_token = 2;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
message ListSessionsResponse {
|
|
21
|
-
repeated Session sessions = 1;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
message GetSessionRequest {
|
|
25
|
-
optional string id = 1;
|
|
26
|
-
string user_id = 2;
|
|
27
|
-
optional string session_token = 3;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
message GetSessionResponse {
|
|
31
|
-
Session session = 1;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
message RevokeSessionRequest {
|
|
35
|
-
string id = 1;
|
|
36
|
-
string user_id = 2;
|
|
37
|
-
optional string session_token = 3;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
message RevokeSessionResponse {
|
|
41
|
-
bool ok = 1;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
message RevokeAllOtherSessionsRequest {
|
|
45
|
-
string user_id = 1;
|
|
46
|
-
optional string session_token = 2;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
message RevokeAllOtherSessionsResponse {
|
|
50
|
-
bool ok = 1;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
message Session {
|
|
54
|
-
string id = 1;
|
|
55
|
-
google.protobuf.Timestamp created_at = 2;
|
|
56
|
-
string country = 3;
|
|
57
|
-
string city = 4;
|
|
58
|
-
string browser = 5;
|
|
59
|
-
string os = 6;
|
|
60
|
-
string ip = 7;
|
|
61
|
-
}
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package session.v1;
|
|
4
|
+
|
|
5
|
+
import "google/protobuf/timestamp.proto";
|
|
6
|
+
|
|
7
|
+
service SessionService {
|
|
8
|
+
rpc ListSessions (ListSessionsRequest) returns (ListSessionsResponse);
|
|
9
|
+
rpc RevokeSession (RevokeSessionRequest) returns (RevokeSessionResponse);
|
|
10
|
+
rpc RevokeAllOtherSessions (RevokeAllOtherSessionsRequest) returns (RevokeAllOtherSessionsResponse);
|
|
11
|
+
|
|
12
|
+
rpc GetSession (GetSessionRequest) returns (GetSessionResponse);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
message ListSessionsRequest {
|
|
16
|
+
string user_id = 1;
|
|
17
|
+
string session_token = 2;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
message ListSessionsResponse {
|
|
21
|
+
repeated Session sessions = 1;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
message GetSessionRequest {
|
|
25
|
+
optional string id = 1;
|
|
26
|
+
string user_id = 2;
|
|
27
|
+
optional string session_token = 3;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
message GetSessionResponse {
|
|
31
|
+
Session session = 1;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
message RevokeSessionRequest {
|
|
35
|
+
string id = 1;
|
|
36
|
+
string user_id = 2;
|
|
37
|
+
optional string session_token = 3;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
message RevokeSessionResponse {
|
|
41
|
+
bool ok = 1;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
message RevokeAllOtherSessionsRequest {
|
|
45
|
+
string user_id = 1;
|
|
46
|
+
optional string session_token = 2;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
message RevokeAllOtherSessionsResponse {
|
|
50
|
+
bool ok = 1;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
message Session {
|
|
54
|
+
string id = 1;
|
|
55
|
+
google.protobuf.Timestamp created_at = 2;
|
|
56
|
+
string country = 3;
|
|
57
|
+
string city = 4;
|
|
58
|
+
string browser = 5;
|
|
59
|
+
string os = 6;
|
|
60
|
+
string ip = 7;
|
|
61
|
+
}
|