@readytomog/contracts 1.3.0 → 1.3.2
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/event/auth/update-user.interface.d.ts +1 -1
- package/dist/event/chat/index.d.ts +1 -0
- package/dist/event/chat/index.js +17 -0
- package/dist/event/chat/send-message.interface.d.ts +6 -0
- package/dist/event/chat/send-message.interface.js +2 -0
- package/dist/event/index.d.ts +1 -0
- package/dist/event/index.js +1 -0
- package/gen/chat.d.ts +60 -0
- package/gen/chat.js +23 -0
- package/gen/chat.js.map +1 -0
- package/gen/chat.ts +12 -12
- package/gen/user.ts +2 -2
- package/package.json +1 -1
- package/proto/chat.proto +12 -12
- package/proto/user.proto +2 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./send-message.interface";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./send-message.interface"), exports);
|
package/dist/event/index.d.ts
CHANGED
package/dist/event/index.js
CHANGED
package/gen/chat.d.ts
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { Observable } from "rxjs";
|
|
2
|
+
export declare const protobufPackage = "chat.v1";
|
|
3
|
+
export interface CreateChatRequest {
|
|
4
|
+
participant: number;
|
|
5
|
+
}
|
|
6
|
+
export interface CreateChatResponse {
|
|
7
|
+
id: number;
|
|
8
|
+
participant1: number;
|
|
9
|
+
participant2: number;
|
|
10
|
+
}
|
|
11
|
+
export interface DeleteChatRequest {
|
|
12
|
+
chatId: number;
|
|
13
|
+
}
|
|
14
|
+
export interface DeleteChatResponse {
|
|
15
|
+
message: string;
|
|
16
|
+
}
|
|
17
|
+
export interface Mesage {
|
|
18
|
+
message: string;
|
|
19
|
+
senderId: number;
|
|
20
|
+
recieverId: number;
|
|
21
|
+
id: number;
|
|
22
|
+
}
|
|
23
|
+
export interface User {
|
|
24
|
+
id: number;
|
|
25
|
+
name: string;
|
|
26
|
+
surname: string;
|
|
27
|
+
avatar: string;
|
|
28
|
+
}
|
|
29
|
+
export interface Chat {
|
|
30
|
+
id: number;
|
|
31
|
+
users: User[];
|
|
32
|
+
lastMessage: string;
|
|
33
|
+
}
|
|
34
|
+
export interface GetMessagesRequest {
|
|
35
|
+
chatId: number;
|
|
36
|
+
}
|
|
37
|
+
export interface GetMessagesResponse {
|
|
38
|
+
mesages: Mesage[];
|
|
39
|
+
}
|
|
40
|
+
export interface GetChatsRequest {
|
|
41
|
+
userId: number;
|
|
42
|
+
}
|
|
43
|
+
export interface GetChatsResponse {
|
|
44
|
+
chats: Chat[];
|
|
45
|
+
}
|
|
46
|
+
export declare const CHAT_V1_PACKAGE_NAME = "chat.v1";
|
|
47
|
+
export interface ChatServiceClient {
|
|
48
|
+
createChat(request: CreateChatRequest): Observable<CreateChatResponse>;
|
|
49
|
+
deleteChat(request: DeleteChatRequest): Observable<DeleteChatResponse>;
|
|
50
|
+
getMessages(request: GetMessagesRequest): Observable<GetMessagesResponse>;
|
|
51
|
+
getChats(request: GetChatsRequest): Observable<GetChatsResponse>;
|
|
52
|
+
}
|
|
53
|
+
export interface ChatServiceController {
|
|
54
|
+
createChat(request: CreateChatRequest): Promise<CreateChatResponse> | Observable<CreateChatResponse> | CreateChatResponse;
|
|
55
|
+
deleteChat(request: DeleteChatRequest): Promise<DeleteChatResponse> | Observable<DeleteChatResponse> | DeleteChatResponse;
|
|
56
|
+
getMessages(request: GetMessagesRequest): Promise<GetMessagesResponse> | Observable<GetMessagesResponse> | GetMessagesResponse;
|
|
57
|
+
getChats(request: GetChatsRequest): Promise<GetChatsResponse> | Observable<GetChatsResponse> | GetChatsResponse;
|
|
58
|
+
}
|
|
59
|
+
export declare function ChatServiceControllerMethods(): (constructor: Function) => void;
|
|
60
|
+
export declare const CHAT_SERVICE_NAME = "ChatService";
|
package/gen/chat.js
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CHAT_SERVICE_NAME = exports.CHAT_V1_PACKAGE_NAME = exports.protobufPackage = void 0;
|
|
4
|
+
exports.ChatServiceControllerMethods = ChatServiceControllerMethods;
|
|
5
|
+
const microservices_1 = require("@nestjs/microservices");
|
|
6
|
+
exports.protobufPackage = "chat.v1";
|
|
7
|
+
exports.CHAT_V1_PACKAGE_NAME = "chat.v1";
|
|
8
|
+
function ChatServiceControllerMethods() {
|
|
9
|
+
return function (constructor) {
|
|
10
|
+
const grpcMethods = ["createChat", "deleteChat", "getMessages", "getChats"];
|
|
11
|
+
for (const method of grpcMethods) {
|
|
12
|
+
const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
13
|
+
(0, microservices_1.GrpcMethod)("ChatService", method)(constructor.prototype[method], method, descriptor);
|
|
14
|
+
}
|
|
15
|
+
const grpcStreamMethods = [];
|
|
16
|
+
for (const method of grpcStreamMethods) {
|
|
17
|
+
const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
18
|
+
(0, microservices_1.GrpcStreamMethod)("ChatService", method)(constructor.prototype[method], method, descriptor);
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
exports.CHAT_SERVICE_NAME = "ChatService";
|
|
23
|
+
//# sourceMappingURL=chat.js.map
|
package/gen/chat.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chat.js","sourceRoot":"","sources":["chat.ts"],"names":[],"mappings":";;;AA8FA,oEAaC;AApGD,yDAAqE;AAGxD,QAAA,eAAe,GAAG,SAAS,CAAC;AAwD5B,QAAA,oBAAoB,GAAG,SAAS,CAAC;AA4B9C,SAAgB,4BAA4B;IAC1C,OAAO,UAAU,WAAqB;QACpC,MAAM,WAAW,GAAa,CAAC,YAAY,EAAE,YAAY,EAAE,aAAa,EAAE,UAAU,CAAC,CAAC;QACtF,KAAK,MAAM,MAAM,IAAI,WAAW,EAAE,CAAC;YACjC,MAAM,UAAU,GAAQ,OAAO,CAAC,wBAAwB,CAAC,WAAW,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;YACxF,IAAA,0BAAU,EAAC,aAAa,EAAE,MAAM,CAAC,CAAC,WAAW,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,UAAU,CAAC,CAAC;QACvF,CAAC;QACD,MAAM,iBAAiB,GAAa,EAAE,CAAC;QACvC,KAAK,MAAM,MAAM,IAAI,iBAAiB,EAAE,CAAC;YACvC,MAAM,UAAU,GAAQ,OAAO,CAAC,wBAAwB,CAAC,WAAW,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;YACxF,IAAA,gCAAgB,EAAC,aAAa,EAAE,MAAM,CAAC,CAAC,WAAW,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,UAAU,CAAC,CAAC;QAC7F,CAAC;IACH,CAAC,CAAC;AACJ,CAAC;AAEY,QAAA,iBAAiB,GAAG,aAAa,CAAC"}
|
package/gen/chat.ts
CHANGED
|
@@ -11,17 +11,17 @@ import { Observable } from "rxjs";
|
|
|
11
11
|
export const protobufPackage = "chat.v1";
|
|
12
12
|
|
|
13
13
|
export interface CreateChatRequest {
|
|
14
|
-
participant:
|
|
14
|
+
participant: string;
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
export interface CreateChatResponse {
|
|
18
|
-
id:
|
|
19
|
-
participant1:
|
|
20
|
-
participant2:
|
|
18
|
+
id: string;
|
|
19
|
+
participant1: string;
|
|
20
|
+
participant2: string;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
export interface DeleteChatRequest {
|
|
24
|
-
chatId:
|
|
24
|
+
chatId: string;
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
export interface DeleteChatResponse {
|
|
@@ -30,26 +30,26 @@ export interface DeleteChatResponse {
|
|
|
30
30
|
|
|
31
31
|
export interface Mesage {
|
|
32
32
|
message: string;
|
|
33
|
-
senderId:
|
|
34
|
-
recieverId:
|
|
35
|
-
id:
|
|
33
|
+
senderId: string;
|
|
34
|
+
recieverId: string;
|
|
35
|
+
id: string;
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
export interface User {
|
|
39
|
-
id:
|
|
39
|
+
id: string;
|
|
40
40
|
name: string;
|
|
41
41
|
surname: string;
|
|
42
42
|
avatar: string;
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
export interface Chat {
|
|
46
|
-
id:
|
|
46
|
+
id: string;
|
|
47
47
|
users: User[];
|
|
48
48
|
lastMessage: string;
|
|
49
49
|
}
|
|
50
50
|
|
|
51
51
|
export interface GetMessagesRequest {
|
|
52
|
-
chatId:
|
|
52
|
+
chatId: string;
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
export interface GetMessagesResponse {
|
|
@@ -57,7 +57,7 @@ export interface GetMessagesResponse {
|
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
export interface GetChatsRequest {
|
|
60
|
-
userId:
|
|
60
|
+
userId: string;
|
|
61
61
|
}
|
|
62
62
|
|
|
63
63
|
export interface GetChatsResponse {
|
package/gen/user.ts
CHANGED
|
@@ -20,11 +20,11 @@ export enum Role {
|
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
export interface GetUserByIdRequst {
|
|
23
|
-
userId:
|
|
23
|
+
userId: string;
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
export interface GetUserByIdResponse {
|
|
27
|
-
userId:
|
|
27
|
+
userId: string;
|
|
28
28
|
name: string;
|
|
29
29
|
surname: string;
|
|
30
30
|
isOtpVerified: boolean;
|
package/package.json
CHANGED
package/proto/chat.proto
CHANGED
|
@@ -10,17 +10,17 @@ service ChatService {
|
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
message CreateChatRequest {
|
|
13
|
-
|
|
13
|
+
string participant = 1;
|
|
14
14
|
|
|
15
15
|
}
|
|
16
16
|
message CreateChatResponse {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
string id = 1;
|
|
18
|
+
string participant1 = 2;
|
|
19
|
+
string participant2 = 3;
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
message DeleteChatRequest {
|
|
23
|
-
|
|
23
|
+
string chatId = 1;
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
message DeleteChatResponse {
|
|
@@ -29,26 +29,26 @@ message DeleteChatResponse {
|
|
|
29
29
|
|
|
30
30
|
message Mesage {
|
|
31
31
|
string message = 1;
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
32
|
+
string senderId = 2;
|
|
33
|
+
string recieverId = 3;
|
|
34
|
+
string id = 4;
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
message User {
|
|
38
|
-
|
|
38
|
+
string id = 1;
|
|
39
39
|
string name = 2;
|
|
40
40
|
string surname =3;
|
|
41
41
|
string avatar =4;
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
message Chat {
|
|
45
|
-
|
|
45
|
+
string id = 1;
|
|
46
46
|
repeated User users = 2;
|
|
47
47
|
string lastMessage = 3;
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
message GetMessagesRequest {
|
|
51
|
-
|
|
51
|
+
string chatId = 1;
|
|
52
52
|
}
|
|
53
53
|
|
|
54
54
|
message GetMessagesResponse {
|
|
@@ -56,7 +56,7 @@ message GetMessagesResponse {
|
|
|
56
56
|
}
|
|
57
57
|
|
|
58
58
|
message GetChatsRequest {
|
|
59
|
-
|
|
59
|
+
string userId = 1;
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
message GetChatsResponse {
|
package/proto/user.proto
CHANGED
|
@@ -8,7 +8,7 @@ service UserService {
|
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
message GetUserByIdRequst {
|
|
11
|
-
|
|
11
|
+
string userId = 1;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
|
|
@@ -21,7 +21,7 @@ enum Role {
|
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
message GetUserByIdResponse{
|
|
24
|
-
|
|
24
|
+
string userId = 1;
|
|
25
25
|
string name = 2;
|
|
26
26
|
string surname = 3;
|
|
27
27
|
bool isOtpVerified = 4;
|