geniebox-shared-lib 2.5.3 → 2.5.5
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/chat.interface.d.ts +22 -0
- package/dist/chat.interface.js +82 -2
- package/dist/event.interface.d.ts +42 -1
- package/dist/event.interface.js +169 -2
- package/dist/generation.client.js +1 -2
- package/dist/generation.interface.d.ts +46 -447
- package/dist/generation.interface.js +69 -2081
- package/dist/index.d.ts +5 -5
- package/dist/index.js +23 -15
- package/dist/mcp.interface.d.ts +40 -0
- package/dist/mcp.interface.js +153 -1
- package/dist/shared.module.d.ts +0 -4
- package/dist/shared.module.js +12 -13
- package/package.json +2 -1
package/dist/chat.interface.d.ts
CHANGED
|
@@ -32,6 +32,15 @@ export interface CreateChatRequest {
|
|
|
32
32
|
[key: string]: any;
|
|
33
33
|
} | undefined;
|
|
34
34
|
}
|
|
35
|
+
export interface UpdateChatRequest {
|
|
36
|
+
id: string;
|
|
37
|
+
/** For authorization check */
|
|
38
|
+
userId: string;
|
|
39
|
+
title?: string | undefined;
|
|
40
|
+
metadata?: {
|
|
41
|
+
[key: string]: any;
|
|
42
|
+
} | undefined;
|
|
43
|
+
}
|
|
35
44
|
export interface GetChatRequest {
|
|
36
45
|
id: string;
|
|
37
46
|
/** For authorization check */
|
|
@@ -77,6 +86,7 @@ export declare const CHAT_PACKAGE_NAME = "chat";
|
|
|
77
86
|
export declare const Chat: MessageFns<Chat>;
|
|
78
87
|
export declare const ChatMessage: MessageFns<ChatMessage>;
|
|
79
88
|
export declare const CreateChatRequest: MessageFns<CreateChatRequest>;
|
|
89
|
+
export declare const UpdateChatRequest: MessageFns<UpdateChatRequest>;
|
|
80
90
|
export declare const GetChatRequest: MessageFns<GetChatRequest>;
|
|
81
91
|
export declare const ListChatsRequest: MessageFns<ListChatsRequest>;
|
|
82
92
|
export declare const DeleteChatRequest: MessageFns<DeleteChatRequest>;
|
|
@@ -89,6 +99,7 @@ export interface ChatServiceClient {
|
|
|
89
99
|
getChat(request: GetChatRequest, metadata?: Metadata): Observable<Chat>;
|
|
90
100
|
listChats(request: ListChatsRequest, metadata?: Metadata): Observable<ChatsResponse>;
|
|
91
101
|
deleteChat(request: DeleteChatRequest, metadata?: Metadata): Observable<Empty>;
|
|
102
|
+
updateChat(request: UpdateChatRequest, metadata?: Metadata): Observable<Chat>;
|
|
92
103
|
addMessage(request: AddMessageRequest, metadata?: Metadata): Observable<ChatMessage>;
|
|
93
104
|
getMessages(request: GetMessagesRequest, metadata?: Metadata): Observable<MessagesResponse>;
|
|
94
105
|
}
|
|
@@ -97,6 +108,7 @@ export interface ChatServiceController {
|
|
|
97
108
|
getChat(request: GetChatRequest, metadata?: Metadata): Promise<Chat> | Observable<Chat> | Chat;
|
|
98
109
|
listChats(request: ListChatsRequest, metadata?: Metadata): Promise<ChatsResponse> | Observable<ChatsResponse> | ChatsResponse;
|
|
99
110
|
deleteChat(request: DeleteChatRequest, metadata?: Metadata): void;
|
|
111
|
+
updateChat(request: UpdateChatRequest, metadata?: Metadata): Promise<Chat> | Observable<Chat> | Chat;
|
|
100
112
|
addMessage(request: AddMessageRequest, metadata?: Metadata): Promise<ChatMessage> | Observable<ChatMessage> | ChatMessage;
|
|
101
113
|
getMessages(request: GetMessagesRequest, metadata?: Metadata): Promise<MessagesResponse> | Observable<MessagesResponse> | MessagesResponse;
|
|
102
114
|
}
|
|
@@ -140,6 +152,15 @@ export declare const ChatServiceService: {
|
|
|
140
152
|
readonly responseSerialize: (value: Empty) => Buffer;
|
|
141
153
|
readonly responseDeserialize: (value: Buffer) => Empty;
|
|
142
154
|
};
|
|
155
|
+
readonly updateChat: {
|
|
156
|
+
readonly path: "/chat.ChatService/updateChat";
|
|
157
|
+
readonly requestStream: false;
|
|
158
|
+
readonly responseStream: false;
|
|
159
|
+
readonly requestSerialize: (value: UpdateChatRequest) => Buffer;
|
|
160
|
+
readonly requestDeserialize: (value: Buffer) => UpdateChatRequest;
|
|
161
|
+
readonly responseSerialize: (value: Chat) => Buffer;
|
|
162
|
+
readonly responseDeserialize: (value: Buffer) => Chat;
|
|
163
|
+
};
|
|
143
164
|
readonly addMessage: {
|
|
144
165
|
readonly path: "/chat.ChatService/addMessage";
|
|
145
166
|
readonly requestStream: false;
|
|
@@ -164,6 +185,7 @@ export interface ChatServiceServer extends UntypedServiceImplementation {
|
|
|
164
185
|
getChat: handleUnaryCall<GetChatRequest, Chat>;
|
|
165
186
|
listChats: handleUnaryCall<ListChatsRequest, ChatsResponse>;
|
|
166
187
|
deleteChat: handleUnaryCall<DeleteChatRequest, Empty>;
|
|
188
|
+
updateChat: handleUnaryCall<UpdateChatRequest, Chat>;
|
|
167
189
|
addMessage: handleUnaryCall<AddMessageRequest, ChatMessage>;
|
|
168
190
|
getMessages: handleUnaryCall<GetMessagesRequest, MessagesResponse>;
|
|
169
191
|
}
|
package/dist/chat.interface.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
// protoc v5.28.2
|
|
6
6
|
// source: chat.proto
|
|
7
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
-
exports.ChatServiceService = exports.CHAT_SERVICE_NAME = exports.MessagesResponse = exports.ChatsResponse = exports.GetMessagesRequest = exports.AddMessageRequest = exports.DeleteChatRequest = exports.ListChatsRequest = exports.GetChatRequest = exports.CreateChatRequest = exports.ChatMessage = exports.Chat = exports.CHAT_PACKAGE_NAME = exports.protobufPackage = void 0;
|
|
8
|
+
exports.ChatServiceService = exports.CHAT_SERVICE_NAME = exports.MessagesResponse = exports.ChatsResponse = exports.GetMessagesRequest = exports.AddMessageRequest = exports.DeleteChatRequest = exports.ListChatsRequest = exports.GetChatRequest = exports.UpdateChatRequest = exports.CreateChatRequest = exports.ChatMessage = exports.Chat = exports.CHAT_PACKAGE_NAME = exports.protobufPackage = void 0;
|
|
9
9
|
exports.ChatServiceControllerMethods = ChatServiceControllerMethods;
|
|
10
10
|
/* eslint-disable */
|
|
11
11
|
const wire_1 = require("@bufbuild/protobuf/wire");
|
|
@@ -234,6 +234,69 @@ exports.CreateChatRequest = {
|
|
|
234
234
|
return message;
|
|
235
235
|
},
|
|
236
236
|
};
|
|
237
|
+
function createBaseUpdateChatRequest() {
|
|
238
|
+
return { id: "", userId: "" };
|
|
239
|
+
}
|
|
240
|
+
exports.UpdateChatRequest = {
|
|
241
|
+
encode(message, writer = new wire_1.BinaryWriter()) {
|
|
242
|
+
if (message.id !== "") {
|
|
243
|
+
writer.uint32(10).string(message.id);
|
|
244
|
+
}
|
|
245
|
+
if (message.userId !== "") {
|
|
246
|
+
writer.uint32(18).string(message.userId);
|
|
247
|
+
}
|
|
248
|
+
if (message.title !== undefined) {
|
|
249
|
+
writer.uint32(26).string(message.title);
|
|
250
|
+
}
|
|
251
|
+
if (message.metadata !== undefined) {
|
|
252
|
+
struct_interface_1.Struct.encode(struct_interface_1.Struct.wrap(message.metadata), writer.uint32(34).fork()).join();
|
|
253
|
+
}
|
|
254
|
+
return writer;
|
|
255
|
+
},
|
|
256
|
+
decode(input, length) {
|
|
257
|
+
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
|
|
258
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
259
|
+
const message = createBaseUpdateChatRequest();
|
|
260
|
+
while (reader.pos < end) {
|
|
261
|
+
const tag = reader.uint32();
|
|
262
|
+
switch (tag >>> 3) {
|
|
263
|
+
case 1: {
|
|
264
|
+
if (tag !== 10) {
|
|
265
|
+
break;
|
|
266
|
+
}
|
|
267
|
+
message.id = reader.string();
|
|
268
|
+
continue;
|
|
269
|
+
}
|
|
270
|
+
case 2: {
|
|
271
|
+
if (tag !== 18) {
|
|
272
|
+
break;
|
|
273
|
+
}
|
|
274
|
+
message.userId = reader.string();
|
|
275
|
+
continue;
|
|
276
|
+
}
|
|
277
|
+
case 3: {
|
|
278
|
+
if (tag !== 26) {
|
|
279
|
+
break;
|
|
280
|
+
}
|
|
281
|
+
message.title = reader.string();
|
|
282
|
+
continue;
|
|
283
|
+
}
|
|
284
|
+
case 4: {
|
|
285
|
+
if (tag !== 34) {
|
|
286
|
+
break;
|
|
287
|
+
}
|
|
288
|
+
message.metadata = struct_interface_1.Struct.unwrap(struct_interface_1.Struct.decode(reader, reader.uint32()));
|
|
289
|
+
continue;
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
293
|
+
break;
|
|
294
|
+
}
|
|
295
|
+
reader.skip(tag & 7);
|
|
296
|
+
}
|
|
297
|
+
return message;
|
|
298
|
+
},
|
|
299
|
+
};
|
|
237
300
|
function createBaseGetChatRequest() {
|
|
238
301
|
return { id: "", userId: "" };
|
|
239
302
|
}
|
|
@@ -598,7 +661,15 @@ exports.MessagesResponse = {
|
|
|
598
661
|
protobufjs_1.wrappers[".google.protobuf.Struct"] = { fromObject: struct_interface_1.Struct.wrap, toObject: struct_interface_1.Struct.unwrap };
|
|
599
662
|
function ChatServiceControllerMethods() {
|
|
600
663
|
return function (constructor) {
|
|
601
|
-
const grpcMethods = [
|
|
664
|
+
const grpcMethods = [
|
|
665
|
+
"createChat",
|
|
666
|
+
"getChat",
|
|
667
|
+
"listChats",
|
|
668
|
+
"deleteChat",
|
|
669
|
+
"updateChat",
|
|
670
|
+
"addMessage",
|
|
671
|
+
"getMessages",
|
|
672
|
+
];
|
|
602
673
|
for (const method of grpcMethods) {
|
|
603
674
|
const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
604
675
|
(0, microservices_1.GrpcMethod)("ChatService", method)(constructor.prototype[method], method, descriptor);
|
|
@@ -648,6 +719,15 @@ exports.ChatServiceService = {
|
|
|
648
719
|
responseSerialize: (value) => Buffer.from(empty_interface_1.Empty.encode(value).finish()),
|
|
649
720
|
responseDeserialize: (value) => empty_interface_1.Empty.decode(value),
|
|
650
721
|
},
|
|
722
|
+
updateChat: {
|
|
723
|
+
path: "/chat.ChatService/updateChat",
|
|
724
|
+
requestStream: false,
|
|
725
|
+
responseStream: false,
|
|
726
|
+
requestSerialize: (value) => Buffer.from(exports.UpdateChatRequest.encode(value).finish()),
|
|
727
|
+
requestDeserialize: (value) => exports.UpdateChatRequest.decode(value),
|
|
728
|
+
responseSerialize: (value) => Buffer.from(exports.Chat.encode(value).finish()),
|
|
729
|
+
responseDeserialize: (value) => exports.Chat.decode(value),
|
|
730
|
+
},
|
|
651
731
|
addMessage: {
|
|
652
732
|
path: "/chat.ChatService/addMessage",
|
|
653
733
|
requestStream: false,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
|
2
|
-
import type { handleServerStreamingCall, Metadata, UntypedServiceImplementation } from "@grpc/grpc-js";
|
|
2
|
+
import type { handleServerStreamingCall, handleUnaryCall, Metadata, UntypedServiceImplementation } from "@grpc/grpc-js";
|
|
3
3
|
import { Observable } from "rxjs";
|
|
4
4
|
export declare const protobufPackage = "event";
|
|
5
5
|
export interface SubscribeRequest {
|
|
@@ -10,14 +10,35 @@ export interface EventMessage {
|
|
|
10
10
|
data: string;
|
|
11
11
|
requestId: string;
|
|
12
12
|
}
|
|
13
|
+
export interface EmitToUserRequest {
|
|
14
|
+
userId: string;
|
|
15
|
+
channel: string;
|
|
16
|
+
data: string;
|
|
17
|
+
requestId: string;
|
|
18
|
+
}
|
|
19
|
+
export interface BroadcastRequest {
|
|
20
|
+
channel: string;
|
|
21
|
+
data: string;
|
|
22
|
+
requestId: string;
|
|
23
|
+
}
|
|
24
|
+
export interface EmitResponse {
|
|
25
|
+
success: boolean;
|
|
26
|
+
}
|
|
13
27
|
export declare const EVENT_PACKAGE_NAME = "event";
|
|
14
28
|
export declare const SubscribeRequest: MessageFns<SubscribeRequest>;
|
|
15
29
|
export declare const EventMessage: MessageFns<EventMessage>;
|
|
30
|
+
export declare const EmitToUserRequest: MessageFns<EmitToUserRequest>;
|
|
31
|
+
export declare const BroadcastRequest: MessageFns<BroadcastRequest>;
|
|
32
|
+
export declare const EmitResponse: MessageFns<EmitResponse>;
|
|
16
33
|
export interface EventServiceClient {
|
|
17
34
|
subscribe(request: SubscribeRequest, metadata?: Metadata): Observable<EventMessage>;
|
|
35
|
+
emitToUser(request: EmitToUserRequest, metadata?: Metadata): Observable<EmitResponse>;
|
|
36
|
+
broadcast(request: BroadcastRequest, metadata?: Metadata): Observable<EmitResponse>;
|
|
18
37
|
}
|
|
19
38
|
export interface EventServiceController {
|
|
20
39
|
subscribe(request: SubscribeRequest, metadata?: Metadata): Observable<EventMessage>;
|
|
40
|
+
emitToUser(request: EmitToUserRequest, metadata?: Metadata): Promise<EmitResponse> | Observable<EmitResponse> | EmitResponse;
|
|
41
|
+
broadcast(request: BroadcastRequest, metadata?: Metadata): Promise<EmitResponse> | Observable<EmitResponse> | EmitResponse;
|
|
21
42
|
}
|
|
22
43
|
export declare function EventServiceControllerMethods(): (constructor: Function) => void;
|
|
23
44
|
export declare const EVENT_SERVICE_NAME = "EventService";
|
|
@@ -32,9 +53,29 @@ export declare const EventServiceService: {
|
|
|
32
53
|
readonly responseSerialize: (value: EventMessage) => Buffer;
|
|
33
54
|
readonly responseDeserialize: (value: Buffer) => EventMessage;
|
|
34
55
|
};
|
|
56
|
+
readonly emitToUser: {
|
|
57
|
+
readonly path: "/event.EventService/emitToUser";
|
|
58
|
+
readonly requestStream: false;
|
|
59
|
+
readonly responseStream: false;
|
|
60
|
+
readonly requestSerialize: (value: EmitToUserRequest) => Buffer;
|
|
61
|
+
readonly requestDeserialize: (value: Buffer) => EmitToUserRequest;
|
|
62
|
+
readonly responseSerialize: (value: EmitResponse) => Buffer;
|
|
63
|
+
readonly responseDeserialize: (value: Buffer) => EmitResponse;
|
|
64
|
+
};
|
|
65
|
+
readonly broadcast: {
|
|
66
|
+
readonly path: "/event.EventService/broadcast";
|
|
67
|
+
readonly requestStream: false;
|
|
68
|
+
readonly responseStream: false;
|
|
69
|
+
readonly requestSerialize: (value: BroadcastRequest) => Buffer;
|
|
70
|
+
readonly requestDeserialize: (value: Buffer) => BroadcastRequest;
|
|
71
|
+
readonly responseSerialize: (value: EmitResponse) => Buffer;
|
|
72
|
+
readonly responseDeserialize: (value: Buffer) => EmitResponse;
|
|
73
|
+
};
|
|
35
74
|
};
|
|
36
75
|
export interface EventServiceServer extends UntypedServiceImplementation {
|
|
37
76
|
subscribe: handleServerStreamingCall<SubscribeRequest, EventMessage>;
|
|
77
|
+
emitToUser: handleUnaryCall<EmitToUserRequest, EmitResponse>;
|
|
78
|
+
broadcast: handleUnaryCall<BroadcastRequest, EmitResponse>;
|
|
38
79
|
}
|
|
39
80
|
export interface MessageFns<T> {
|
|
40
81
|
encode(message: T, writer?: BinaryWriter): BinaryWriter;
|
package/dist/event.interface.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
// protoc v5.28.2
|
|
6
6
|
// source: event.proto
|
|
7
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
-
exports.EventServiceService = exports.EVENT_SERVICE_NAME = exports.EventMessage = exports.SubscribeRequest = exports.EVENT_PACKAGE_NAME = exports.protobufPackage = void 0;
|
|
8
|
+
exports.EventServiceService = exports.EVENT_SERVICE_NAME = exports.EmitResponse = exports.BroadcastRequest = exports.EmitToUserRequest = exports.EventMessage = exports.SubscribeRequest = exports.EVENT_PACKAGE_NAME = exports.protobufPackage = void 0;
|
|
9
9
|
exports.EventServiceControllerMethods = EventServiceControllerMethods;
|
|
10
10
|
/* eslint-disable */
|
|
11
11
|
const wire_1 = require("@bufbuild/protobuf/wire");
|
|
@@ -98,9 +98,158 @@ exports.EventMessage = {
|
|
|
98
98
|
return message;
|
|
99
99
|
},
|
|
100
100
|
};
|
|
101
|
+
function createBaseEmitToUserRequest() {
|
|
102
|
+
return { userId: "", channel: "", data: "", requestId: "" };
|
|
103
|
+
}
|
|
104
|
+
exports.EmitToUserRequest = {
|
|
105
|
+
encode(message, writer = new wire_1.BinaryWriter()) {
|
|
106
|
+
if (message.userId !== "") {
|
|
107
|
+
writer.uint32(10).string(message.userId);
|
|
108
|
+
}
|
|
109
|
+
if (message.channel !== "") {
|
|
110
|
+
writer.uint32(18).string(message.channel);
|
|
111
|
+
}
|
|
112
|
+
if (message.data !== "") {
|
|
113
|
+
writer.uint32(26).string(message.data);
|
|
114
|
+
}
|
|
115
|
+
if (message.requestId !== "") {
|
|
116
|
+
writer.uint32(34).string(message.requestId);
|
|
117
|
+
}
|
|
118
|
+
return writer;
|
|
119
|
+
},
|
|
120
|
+
decode(input, length) {
|
|
121
|
+
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
|
|
122
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
123
|
+
const message = createBaseEmitToUserRequest();
|
|
124
|
+
while (reader.pos < end) {
|
|
125
|
+
const tag = reader.uint32();
|
|
126
|
+
switch (tag >>> 3) {
|
|
127
|
+
case 1: {
|
|
128
|
+
if (tag !== 10) {
|
|
129
|
+
break;
|
|
130
|
+
}
|
|
131
|
+
message.userId = reader.string();
|
|
132
|
+
continue;
|
|
133
|
+
}
|
|
134
|
+
case 2: {
|
|
135
|
+
if (tag !== 18) {
|
|
136
|
+
break;
|
|
137
|
+
}
|
|
138
|
+
message.channel = reader.string();
|
|
139
|
+
continue;
|
|
140
|
+
}
|
|
141
|
+
case 3: {
|
|
142
|
+
if (tag !== 26) {
|
|
143
|
+
break;
|
|
144
|
+
}
|
|
145
|
+
message.data = reader.string();
|
|
146
|
+
continue;
|
|
147
|
+
}
|
|
148
|
+
case 4: {
|
|
149
|
+
if (tag !== 34) {
|
|
150
|
+
break;
|
|
151
|
+
}
|
|
152
|
+
message.requestId = reader.string();
|
|
153
|
+
continue;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
157
|
+
break;
|
|
158
|
+
}
|
|
159
|
+
reader.skip(tag & 7);
|
|
160
|
+
}
|
|
161
|
+
return message;
|
|
162
|
+
},
|
|
163
|
+
};
|
|
164
|
+
function createBaseBroadcastRequest() {
|
|
165
|
+
return { channel: "", data: "", requestId: "" };
|
|
166
|
+
}
|
|
167
|
+
exports.BroadcastRequest = {
|
|
168
|
+
encode(message, writer = new wire_1.BinaryWriter()) {
|
|
169
|
+
if (message.channel !== "") {
|
|
170
|
+
writer.uint32(10).string(message.channel);
|
|
171
|
+
}
|
|
172
|
+
if (message.data !== "") {
|
|
173
|
+
writer.uint32(18).string(message.data);
|
|
174
|
+
}
|
|
175
|
+
if (message.requestId !== "") {
|
|
176
|
+
writer.uint32(26).string(message.requestId);
|
|
177
|
+
}
|
|
178
|
+
return writer;
|
|
179
|
+
},
|
|
180
|
+
decode(input, length) {
|
|
181
|
+
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
|
|
182
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
183
|
+
const message = createBaseBroadcastRequest();
|
|
184
|
+
while (reader.pos < end) {
|
|
185
|
+
const tag = reader.uint32();
|
|
186
|
+
switch (tag >>> 3) {
|
|
187
|
+
case 1: {
|
|
188
|
+
if (tag !== 10) {
|
|
189
|
+
break;
|
|
190
|
+
}
|
|
191
|
+
message.channel = reader.string();
|
|
192
|
+
continue;
|
|
193
|
+
}
|
|
194
|
+
case 2: {
|
|
195
|
+
if (tag !== 18) {
|
|
196
|
+
break;
|
|
197
|
+
}
|
|
198
|
+
message.data = reader.string();
|
|
199
|
+
continue;
|
|
200
|
+
}
|
|
201
|
+
case 3: {
|
|
202
|
+
if (tag !== 26) {
|
|
203
|
+
break;
|
|
204
|
+
}
|
|
205
|
+
message.requestId = reader.string();
|
|
206
|
+
continue;
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
210
|
+
break;
|
|
211
|
+
}
|
|
212
|
+
reader.skip(tag & 7);
|
|
213
|
+
}
|
|
214
|
+
return message;
|
|
215
|
+
},
|
|
216
|
+
};
|
|
217
|
+
function createBaseEmitResponse() {
|
|
218
|
+
return { success: false };
|
|
219
|
+
}
|
|
220
|
+
exports.EmitResponse = {
|
|
221
|
+
encode(message, writer = new wire_1.BinaryWriter()) {
|
|
222
|
+
if (message.success !== false) {
|
|
223
|
+
writer.uint32(8).bool(message.success);
|
|
224
|
+
}
|
|
225
|
+
return writer;
|
|
226
|
+
},
|
|
227
|
+
decode(input, length) {
|
|
228
|
+
const reader = input instanceof wire_1.BinaryReader ? input : new wire_1.BinaryReader(input);
|
|
229
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
230
|
+
const message = createBaseEmitResponse();
|
|
231
|
+
while (reader.pos < end) {
|
|
232
|
+
const tag = reader.uint32();
|
|
233
|
+
switch (tag >>> 3) {
|
|
234
|
+
case 1: {
|
|
235
|
+
if (tag !== 8) {
|
|
236
|
+
break;
|
|
237
|
+
}
|
|
238
|
+
message.success = reader.bool();
|
|
239
|
+
continue;
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
243
|
+
break;
|
|
244
|
+
}
|
|
245
|
+
reader.skip(tag & 7);
|
|
246
|
+
}
|
|
247
|
+
return message;
|
|
248
|
+
},
|
|
249
|
+
};
|
|
101
250
|
function EventServiceControllerMethods() {
|
|
102
251
|
return function (constructor) {
|
|
103
|
-
const grpcMethods = ["subscribe"];
|
|
252
|
+
const grpcMethods = ["subscribe", "emitToUser", "broadcast"];
|
|
104
253
|
for (const method of grpcMethods) {
|
|
105
254
|
const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
106
255
|
(0, microservices_1.GrpcMethod)("EventService", method)(constructor.prototype[method], method, descriptor);
|
|
@@ -123,4 +272,22 @@ exports.EventServiceService = {
|
|
|
123
272
|
responseSerialize: (value) => Buffer.from(exports.EventMessage.encode(value).finish()),
|
|
124
273
|
responseDeserialize: (value) => exports.EventMessage.decode(value),
|
|
125
274
|
},
|
|
275
|
+
emitToUser: {
|
|
276
|
+
path: "/event.EventService/emitToUser",
|
|
277
|
+
requestStream: false,
|
|
278
|
+
responseStream: false,
|
|
279
|
+
requestSerialize: (value) => Buffer.from(exports.EmitToUserRequest.encode(value).finish()),
|
|
280
|
+
requestDeserialize: (value) => exports.EmitToUserRequest.decode(value),
|
|
281
|
+
responseSerialize: (value) => Buffer.from(exports.EmitResponse.encode(value).finish()),
|
|
282
|
+
responseDeserialize: (value) => exports.EmitResponse.decode(value),
|
|
283
|
+
},
|
|
284
|
+
broadcast: {
|
|
285
|
+
path: "/event.EventService/broadcast",
|
|
286
|
+
requestStream: false,
|
|
287
|
+
responseStream: false,
|
|
288
|
+
requestSerialize: (value) => Buffer.from(exports.BroadcastRequest.encode(value).finish()),
|
|
289
|
+
requestDeserialize: (value) => exports.BroadcastRequest.decode(value),
|
|
290
|
+
responseSerialize: (value) => Buffer.from(exports.EmitResponse.encode(value).finish()),
|
|
291
|
+
responseDeserialize: (value) => exports.EmitResponse.decode(value),
|
|
292
|
+
},
|
|
126
293
|
};
|
|
@@ -21,8 +21,7 @@ let GenerationClient = GenerationClient_1 = class GenerationClient {
|
|
|
21
21
|
this.logger = new common_1.Logger(GenerationClient_1.name);
|
|
22
22
|
}
|
|
23
23
|
onModuleInit() {
|
|
24
|
-
this.generationClient =
|
|
25
|
-
this.client.getService("GenerationService");
|
|
24
|
+
this.generationClient = this.client.getService("GenerationService");
|
|
26
25
|
this.logger.log("GenerationServiceClient initialized");
|
|
27
26
|
}
|
|
28
27
|
get service() {
|