@m1kad0/hannah-proto 3.7.0 → 3.7.1
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/descriptor.binpb +0 -0
- package/dist/messages.d.ts +8 -0
- package/dist/messages.js +46 -2
- package/package.json +1 -1
package/dist/descriptor.binpb
CHANGED
|
Binary file
|
package/dist/messages.d.ts
CHANGED
|
@@ -6,11 +6,19 @@ export interface Message {
|
|
|
6
6
|
content: string;
|
|
7
7
|
source: string;
|
|
8
8
|
createdAt: string;
|
|
9
|
+
/** 0 = system message (not reply-capable), see hannah#237 */
|
|
10
|
+
senderUserId: number;
|
|
11
|
+
/** 0 = not a reply; otherwise id of the Message being answered */
|
|
12
|
+
replyToId: number;
|
|
9
13
|
}
|
|
10
14
|
export interface CreateMessageRequest {
|
|
11
15
|
userId: number;
|
|
12
16
|
content: string;
|
|
13
17
|
source: string;
|
|
18
|
+
/** 0 = system message, same convention as Message.sender_user_id */
|
|
19
|
+
senderUserId: number;
|
|
20
|
+
/** 0 = not a reply */
|
|
21
|
+
replyToId: number;
|
|
14
22
|
}
|
|
15
23
|
export interface ListMessagesRequest {
|
|
16
24
|
requestorId: number;
|
package/dist/messages.js
CHANGED
|
@@ -10,7 +10,7 @@ exports.DeleteMessageRequest = exports.ListMessagesResponse = exports.ListMessag
|
|
|
10
10
|
const wire_1 = require("@bufbuild/protobuf/wire");
|
|
11
11
|
exports.protobufPackage = "hannah";
|
|
12
12
|
function createBaseMessage() {
|
|
13
|
-
return { id: 0, userId: 0, content: "", source: "", createdAt: "" };
|
|
13
|
+
return { id: 0, userId: 0, content: "", source: "", createdAt: "", senderUserId: 0, replyToId: 0 };
|
|
14
14
|
}
|
|
15
15
|
exports.Message = {
|
|
16
16
|
encode(message, writer = new wire_1.BinaryWriter()) {
|
|
@@ -29,6 +29,12 @@ exports.Message = {
|
|
|
29
29
|
if (message.createdAt !== "") {
|
|
30
30
|
writer.uint32(42).string(message.createdAt);
|
|
31
31
|
}
|
|
32
|
+
if (message.senderUserId !== 0) {
|
|
33
|
+
writer.uint32(48).int32(message.senderUserId);
|
|
34
|
+
}
|
|
35
|
+
if (message.replyToId !== 0) {
|
|
36
|
+
writer.uint32(56).int32(message.replyToId);
|
|
37
|
+
}
|
|
32
38
|
return writer;
|
|
33
39
|
},
|
|
34
40
|
decode(input, length) {
|
|
@@ -73,6 +79,20 @@ exports.Message = {
|
|
|
73
79
|
message.createdAt = reader.string();
|
|
74
80
|
continue;
|
|
75
81
|
}
|
|
82
|
+
case 6: {
|
|
83
|
+
if (tag !== 48) {
|
|
84
|
+
break;
|
|
85
|
+
}
|
|
86
|
+
message.senderUserId = reader.int32();
|
|
87
|
+
continue;
|
|
88
|
+
}
|
|
89
|
+
case 7: {
|
|
90
|
+
if (tag !== 56) {
|
|
91
|
+
break;
|
|
92
|
+
}
|
|
93
|
+
message.replyToId = reader.int32();
|
|
94
|
+
continue;
|
|
95
|
+
}
|
|
76
96
|
}
|
|
77
97
|
if ((tag & 7) === 4 || tag === 0) {
|
|
78
98
|
break;
|
|
@@ -91,11 +111,13 @@ exports.Message = {
|
|
|
91
111
|
message.content = object.content ?? "";
|
|
92
112
|
message.source = object.source ?? "";
|
|
93
113
|
message.createdAt = object.createdAt ?? "";
|
|
114
|
+
message.senderUserId = object.senderUserId ?? 0;
|
|
115
|
+
message.replyToId = object.replyToId ?? 0;
|
|
94
116
|
return message;
|
|
95
117
|
},
|
|
96
118
|
};
|
|
97
119
|
function createBaseCreateMessageRequest() {
|
|
98
|
-
return { userId: 0, content: "", source: "" };
|
|
120
|
+
return { userId: 0, content: "", source: "", senderUserId: 0, replyToId: 0 };
|
|
99
121
|
}
|
|
100
122
|
exports.CreateMessageRequest = {
|
|
101
123
|
encode(message, writer = new wire_1.BinaryWriter()) {
|
|
@@ -108,6 +130,12 @@ exports.CreateMessageRequest = {
|
|
|
108
130
|
if (message.source !== "") {
|
|
109
131
|
writer.uint32(26).string(message.source);
|
|
110
132
|
}
|
|
133
|
+
if (message.senderUserId !== 0) {
|
|
134
|
+
writer.uint32(32).int32(message.senderUserId);
|
|
135
|
+
}
|
|
136
|
+
if (message.replyToId !== 0) {
|
|
137
|
+
writer.uint32(40).int32(message.replyToId);
|
|
138
|
+
}
|
|
111
139
|
return writer;
|
|
112
140
|
},
|
|
113
141
|
decode(input, length) {
|
|
@@ -138,6 +166,20 @@ exports.CreateMessageRequest = {
|
|
|
138
166
|
message.source = reader.string();
|
|
139
167
|
continue;
|
|
140
168
|
}
|
|
169
|
+
case 4: {
|
|
170
|
+
if (tag !== 32) {
|
|
171
|
+
break;
|
|
172
|
+
}
|
|
173
|
+
message.senderUserId = reader.int32();
|
|
174
|
+
continue;
|
|
175
|
+
}
|
|
176
|
+
case 5: {
|
|
177
|
+
if (tag !== 40) {
|
|
178
|
+
break;
|
|
179
|
+
}
|
|
180
|
+
message.replyToId = reader.int32();
|
|
181
|
+
continue;
|
|
182
|
+
}
|
|
141
183
|
}
|
|
142
184
|
if ((tag & 7) === 4 || tag === 0) {
|
|
143
185
|
break;
|
|
@@ -154,6 +196,8 @@ exports.CreateMessageRequest = {
|
|
|
154
196
|
message.userId = object.userId ?? 0;
|
|
155
197
|
message.content = object.content ?? "";
|
|
156
198
|
message.source = object.source ?? "";
|
|
199
|
+
message.senderUserId = object.senderUserId ?? 0;
|
|
200
|
+
message.replyToId = object.replyToId ?? 0;
|
|
157
201
|
return message;
|
|
158
202
|
},
|
|
159
203
|
};
|
package/package.json
CHANGED