@readytomog/contracts 1.3.9 → 1.4.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/gen/chat.ts +16 -8
- package/package.json +2 -2
- package/proto/chat.proto +2 -3
package/gen/chat.ts
CHANGED
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
|
|
7
7
|
/* eslint-disable */
|
|
8
8
|
import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices";
|
|
9
|
+
import { wrappers } from "protobufjs";
|
|
9
10
|
import { Observable } from "rxjs";
|
|
10
|
-
import { Timestamp } from "./google/protobuf/timestamp";
|
|
11
11
|
|
|
12
12
|
export const protobufPackage = "chat.v1";
|
|
13
13
|
|
|
@@ -28,13 +28,12 @@ export interface DeleteChatResponse {
|
|
|
28
28
|
message: string;
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
export interface
|
|
31
|
+
export interface Message {
|
|
32
32
|
message: string;
|
|
33
33
|
senderId: string;
|
|
34
|
-
recieverId: string;
|
|
35
34
|
id: string;
|
|
36
|
-
createdAt:
|
|
37
|
-
updatedAt:
|
|
35
|
+
createdAt: Date | undefined;
|
|
36
|
+
updatedAt: Date | undefined;
|
|
38
37
|
}
|
|
39
38
|
|
|
40
39
|
export interface User {
|
|
@@ -48,8 +47,8 @@ export interface Chat {
|
|
|
48
47
|
id: string;
|
|
49
48
|
users: User[];
|
|
50
49
|
lastMessage: string;
|
|
51
|
-
createdAt:
|
|
52
|
-
updatedAt:
|
|
50
|
+
createdAt: Date | undefined;
|
|
51
|
+
updatedAt: Date | undefined;
|
|
53
52
|
}
|
|
54
53
|
|
|
55
54
|
export interface GetMessagesRequest {
|
|
@@ -57,7 +56,7 @@ export interface GetMessagesRequest {
|
|
|
57
56
|
}
|
|
58
57
|
|
|
59
58
|
export interface GetMessagesResponse {
|
|
60
|
-
messages:
|
|
59
|
+
messages: Message[];
|
|
61
60
|
}
|
|
62
61
|
|
|
63
62
|
export interface GetChatsRequest {
|
|
@@ -70,6 +69,15 @@ export interface GetChatsResponse {
|
|
|
70
69
|
|
|
71
70
|
export const CHAT_V1_PACKAGE_NAME = "chat.v1";
|
|
72
71
|
|
|
72
|
+
wrappers[".google.protobuf.Timestamp"] = {
|
|
73
|
+
fromObject(value: Date) {
|
|
74
|
+
return { seconds: value.getTime() / 1000, nanos: (value.getTime() % 1000) * 1e6 };
|
|
75
|
+
},
|
|
76
|
+
toObject(message: { seconds: number; nanos: number }) {
|
|
77
|
+
return new Date(message.seconds * 1000 + message.nanos / 1e6);
|
|
78
|
+
},
|
|
79
|
+
} as any;
|
|
80
|
+
|
|
73
81
|
export interface ChatServiceClient {
|
|
74
82
|
createChat(request: CreateChatRequest): Observable<CreateChatResponse>;
|
|
75
83
|
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@readytomog/contracts",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.1",
|
|
4
4
|
"description": "Protobuf definitions and generated Typescript types",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
7
7
|
"scripts": {
|
|
8
|
-
"generate": "protoc -I ./proto ./proto/*.proto --ts_proto_out=./gen --ts_proto_opt=nestJs=true,package=omit",
|
|
8
|
+
"generate": "protoc -I ./proto ./proto/*.proto --ts_proto_out=./gen --ts_proto_opt=useDate=true,nestJs=true,package=omit",
|
|
9
9
|
"build": "tsc -p tsconfig.build.json"
|
|
10
10
|
},
|
|
11
11
|
"files": [
|
package/proto/chat.proto
CHANGED
|
@@ -28,10 +28,9 @@ message DeleteChatResponse {
|
|
|
28
28
|
string message = 1;
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
message
|
|
31
|
+
message Message {
|
|
32
32
|
string message = 1;
|
|
33
33
|
string senderId = 2;
|
|
34
|
-
string recieverId = 3;
|
|
35
34
|
string id = 4;
|
|
36
35
|
google.protobuf.Timestamp created_at = 5;
|
|
37
36
|
google.protobuf.Timestamp updated_at = 6;
|
|
@@ -57,7 +56,7 @@ message GetMessagesRequest {
|
|
|
57
56
|
}
|
|
58
57
|
|
|
59
58
|
message GetMessagesResponse {
|
|
60
|
-
repeated
|
|
59
|
+
repeated Message messages = 1;
|
|
61
60
|
}
|
|
62
61
|
|
|
63
62
|
message GetChatsRequest {
|