@barupost/contracts 0.0.1 → 0.0.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/generated/account.d.ts +0 -1
- package/dist/generated/account.js +1 -2
- package/dist/generated/auth.d.ts +0 -1
- package/dist/generated/auth.js +2 -10
- package/dist/generated/media.d.ts +0 -1
- package/dist/generated/media.js +1 -2
- package/dist/generated/posts.d.ts +0 -9
- package/dist/generated/posts.js +1 -2
- package/dist/generated/session.d.ts +0 -1
- package/dist/generated/session.js +2 -8
- package/dist/generated/users.d.ts +0 -1
- package/dist/generated/users.js +2 -8
- package/gen/ts/account.ts +0 -4
- package/gen/ts/auth.ts +0 -4
- package/gen/ts/google/protobuf/empty.ts +0 -4
- package/gen/ts/google/protobuf/timestamp.ts +0 -4
- package/gen/ts/media.ts +0 -4
- package/gen/ts/posts.ts +2 -30
- package/gen/ts/session.ts +0 -4
- package/gen/ts/users.ts +0 -4
- package/package.json +2 -2
- package/proto/posts.proto +14 -33
|
@@ -51,7 +51,6 @@ export interface ConfirmPhoneChangeRequest {
|
|
|
51
51
|
export interface ConfirmPhoneChangeResponse {
|
|
52
52
|
ok: boolean;
|
|
53
53
|
}
|
|
54
|
-
export declare const ACCOUNT_V1_PACKAGE_NAME = "account.v1";
|
|
55
54
|
export interface AccountServiceClient {
|
|
56
55
|
getAccount(request: GetAccountRequest): Observable<GetAccountResponse>;
|
|
57
56
|
initEmailChange(request: InitEmailChangeRequest): Observable<InitEmailChangeResponse>;
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
// protoc v6.33.2
|
|
6
6
|
// source: account.proto
|
|
7
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
-
exports.ACCOUNT_SERVICE_NAME = exports.
|
|
8
|
+
exports.ACCOUNT_SERVICE_NAME = exports.Role = void 0;
|
|
9
9
|
exports.AccountServiceControllerMethods = AccountServiceControllerMethods;
|
|
10
10
|
/* eslint-disable */
|
|
11
11
|
const microservices_1 = require("@nestjs/microservices");
|
|
@@ -21,7 +21,6 @@ var Role;
|
|
|
21
21
|
Role[Role["SUPERADMIN"] = 7] = "SUPERADMIN";
|
|
22
22
|
Role[Role["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
|
|
23
23
|
})(Role || (exports.Role = Role = {}));
|
|
24
|
-
exports.ACCOUNT_V1_PACKAGE_NAME = "account.v1";
|
|
25
24
|
function AccountServiceControllerMethods() {
|
|
26
25
|
return function (constructor) {
|
|
27
26
|
const grpcMethods = [
|
package/dist/generated/auth.d.ts
CHANGED
|
@@ -62,7 +62,6 @@ export interface DeviceInfo {
|
|
|
62
62
|
os: string;
|
|
63
63
|
type: string;
|
|
64
64
|
}
|
|
65
|
-
export declare const AUTH_V1_PACKAGE_NAME = "auth.v1";
|
|
66
65
|
export interface AuthServiceClient {
|
|
67
66
|
sendOtp(request: SendOtpRequest): Observable<SendOtpResponse>;
|
|
68
67
|
verifyOtp(request: VerifyOtpRequest): Observable<VerifyOtpResponse>;
|
package/dist/generated/auth.js
CHANGED
|
@@ -5,21 +5,13 @@
|
|
|
5
5
|
// protoc v6.33.2
|
|
6
6
|
// source: auth.proto
|
|
7
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
-
exports.AUTH_SERVICE_NAME =
|
|
8
|
+
exports.AUTH_SERVICE_NAME = void 0;
|
|
9
9
|
exports.AuthServiceControllerMethods = AuthServiceControllerMethods;
|
|
10
10
|
/* eslint-disable */
|
|
11
11
|
const microservices_1 = require("@nestjs/microservices");
|
|
12
|
-
exports.AUTH_V1_PACKAGE_NAME = "auth.v1";
|
|
13
12
|
function AuthServiceControllerMethods() {
|
|
14
13
|
return function (constructor) {
|
|
15
|
-
const grpcMethods = [
|
|
16
|
-
"sendOtp",
|
|
17
|
-
"verifyOtp",
|
|
18
|
-
"refresh",
|
|
19
|
-
"logout",
|
|
20
|
-
"vkInit",
|
|
21
|
-
"vkVerify",
|
|
22
|
-
];
|
|
14
|
+
const grpcMethods = ["sendOtp", "verifyOtp", "refresh", "logout", "vkInit", "vkVerify"];
|
|
23
15
|
for (const method of grpcMethods) {
|
|
24
16
|
const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
25
17
|
(0, microservices_1.GrpcMethod)("AuthService", method)(constructor.prototype[method], method, descriptor);
|
|
@@ -97,7 +97,6 @@ export interface CompleteMultipartUploadResponse {
|
|
|
97
97
|
/** Публичный Url файла */
|
|
98
98
|
url: string;
|
|
99
99
|
}
|
|
100
|
-
export declare const MEDIA_V1_PACKAGE_NAME = "media.v1";
|
|
101
100
|
export interface MediaServiceClient {
|
|
102
101
|
/** Существующие методы */
|
|
103
102
|
upload(request: UploadRequest): Observable<UploadResponse>;
|
package/dist/generated/media.js
CHANGED
|
@@ -5,11 +5,10 @@
|
|
|
5
5
|
// protoc v6.33.2
|
|
6
6
|
// source: media.proto
|
|
7
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
-
exports.MEDIA_SERVICE_NAME =
|
|
8
|
+
exports.MEDIA_SERVICE_NAME = void 0;
|
|
9
9
|
exports.MediaServiceControllerMethods = MediaServiceControllerMethods;
|
|
10
10
|
/* eslint-disable */
|
|
11
11
|
const microservices_1 = require("@nestjs/microservices");
|
|
12
|
-
exports.MEDIA_V1_PACKAGE_NAME = "media.v1";
|
|
13
12
|
function MediaServiceControllerMethods() {
|
|
14
13
|
return function (constructor) {
|
|
15
14
|
const grpcMethods = [
|
|
@@ -82,8 +82,6 @@ export interface FinalizePostResponse {
|
|
|
82
82
|
/** === Получение поста === */
|
|
83
83
|
export interface GetPostRequest {
|
|
84
84
|
postId: string;
|
|
85
|
-
/** Для проверки лайка текущего пользователя */
|
|
86
|
-
userId?: string | undefined;
|
|
87
85
|
}
|
|
88
86
|
export interface GetPostResponse {
|
|
89
87
|
post: Post | undefined;
|
|
@@ -109,8 +107,6 @@ export interface DeletePostResponse {
|
|
|
109
107
|
}
|
|
110
108
|
/** === Лента постов === */
|
|
111
109
|
export interface GetFeedRequest {
|
|
112
|
-
/** Для фильтрации и проверки лайков */
|
|
113
|
-
userId: string;
|
|
114
110
|
page: number;
|
|
115
111
|
/** Максимум 50 */
|
|
116
112
|
limit: number;
|
|
@@ -126,8 +122,6 @@ export interface GetFeedResponse {
|
|
|
126
122
|
export interface GetUserPostsRequest {
|
|
127
123
|
/** ID пользователя, чьи посты запрашиваем */
|
|
128
124
|
userId: string;
|
|
129
|
-
/** Для проверки лайков */
|
|
130
|
-
currentUserId: string;
|
|
131
125
|
page: number;
|
|
132
126
|
limit: number;
|
|
133
127
|
cursor?: string | undefined;
|
|
@@ -198,8 +192,6 @@ export interface Post {
|
|
|
198
192
|
/** Статистика */
|
|
199
193
|
likesCount: number;
|
|
200
194
|
viewsCount: number;
|
|
201
|
-
/** Для текущего пользователя */
|
|
202
|
-
isLiked: boolean;
|
|
203
195
|
createdAt: Timestamp | undefined;
|
|
204
196
|
updatedAt: Timestamp | undefined;
|
|
205
197
|
}
|
|
@@ -212,7 +204,6 @@ export interface PostMedia {
|
|
|
212
204
|
/** Порядок отображения */
|
|
213
205
|
order: number;
|
|
214
206
|
}
|
|
215
|
-
export declare const POSTS_V1_PACKAGE_NAME = "posts.v1";
|
|
216
207
|
export interface PostsServiceClient {
|
|
217
208
|
/** Инициализация и финализация поста */
|
|
218
209
|
createPostInit(request: CreatePostInitRequest): Observable<CreatePostInitResponse>;
|
package/dist/generated/posts.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
// protoc v6.33.2
|
|
6
6
|
// source: posts.proto
|
|
7
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
-
exports.POSTS_SERVICE_NAME = exports.
|
|
8
|
+
exports.POSTS_SERVICE_NAME = exports.MediaType = exports.PostStatus = void 0;
|
|
9
9
|
exports.PostsServiceControllerMethods = PostsServiceControllerMethods;
|
|
10
10
|
/* eslint-disable */
|
|
11
11
|
const microservices_1 = require("@nestjs/microservices");
|
|
@@ -24,7 +24,6 @@ var MediaType;
|
|
|
24
24
|
MediaType[MediaType["VIDEO"] = 2] = "VIDEO";
|
|
25
25
|
MediaType[MediaType["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
|
|
26
26
|
})(MediaType || (exports.MediaType = MediaType = {}));
|
|
27
|
-
exports.POSTS_V1_PACKAGE_NAME = "posts.v1";
|
|
28
27
|
function PostsServiceControllerMethods() {
|
|
29
28
|
return function (constructor) {
|
|
30
29
|
const grpcMethods = [
|
|
@@ -39,7 +39,6 @@ export interface Session {
|
|
|
39
39
|
os: string;
|
|
40
40
|
ip: string;
|
|
41
41
|
}
|
|
42
|
-
export declare const SESSION_V1_PACKAGE_NAME = "session.v1";
|
|
43
42
|
export interface SessionServiceClient {
|
|
44
43
|
listSessions(request: ListSessionsRequest): Observable<ListSessionsResponse>;
|
|
45
44
|
revokeSession(request: RevokeSessionRequest): Observable<RevokeSessionResponse>;
|
|
@@ -5,19 +5,13 @@
|
|
|
5
5
|
// protoc v6.33.2
|
|
6
6
|
// source: session.proto
|
|
7
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
-
exports.SESSION_SERVICE_NAME =
|
|
8
|
+
exports.SESSION_SERVICE_NAME = void 0;
|
|
9
9
|
exports.SessionServiceControllerMethods = SessionServiceControllerMethods;
|
|
10
10
|
/* eslint-disable */
|
|
11
11
|
const microservices_1 = require("@nestjs/microservices");
|
|
12
|
-
exports.SESSION_V1_PACKAGE_NAME = "session.v1";
|
|
13
12
|
function SessionServiceControllerMethods() {
|
|
14
13
|
return function (constructor) {
|
|
15
|
-
const grpcMethods = [
|
|
16
|
-
"listSessions",
|
|
17
|
-
"revokeSession",
|
|
18
|
-
"revokeAllOtherSessions",
|
|
19
|
-
"getSession",
|
|
20
|
-
];
|
|
14
|
+
const grpcMethods = ["listSessions", "revokeSession", "revokeAllOtherSessions", "getSession"];
|
|
21
15
|
for (const method of grpcMethods) {
|
|
22
16
|
const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
23
17
|
(0, microservices_1.GrpcMethod)("SessionService", method)(constructor.prototype[method], method, descriptor);
|
|
@@ -70,7 +70,6 @@ export interface User {
|
|
|
70
70
|
createdAt: Timestamp | undefined;
|
|
71
71
|
updatedAt: Timestamp | undefined;
|
|
72
72
|
}
|
|
73
|
-
export declare const USERS_V1_PACKAGE_NAME = "users.v1";
|
|
74
73
|
export interface UsersServiceClient {
|
|
75
74
|
getMe(request: GetMeRequest): Observable<GetMeResponse>;
|
|
76
75
|
createUser(request: CreateUserRequest): Observable<CreateUserResponse>;
|
package/dist/generated/users.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
// protoc v6.33.2
|
|
6
6
|
// source: users.proto
|
|
7
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
-
exports.USERS_SERVICE_NAME = exports.
|
|
8
|
+
exports.USERS_SERVICE_NAME = exports.Gender = void 0;
|
|
9
9
|
exports.UsersServiceControllerMethods = UsersServiceControllerMethods;
|
|
10
10
|
/* eslint-disable */
|
|
11
11
|
const microservices_1 = require("@nestjs/microservices");
|
|
@@ -17,15 +17,9 @@ var Gender;
|
|
|
17
17
|
Gender[Gender["OTHER"] = 3] = "OTHER";
|
|
18
18
|
Gender[Gender["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
|
|
19
19
|
})(Gender || (exports.Gender = Gender = {}));
|
|
20
|
-
exports.USERS_V1_PACKAGE_NAME = "users.v1";
|
|
21
20
|
function UsersServiceControllerMethods() {
|
|
22
21
|
return function (constructor) {
|
|
23
|
-
const grpcMethods = [
|
|
24
|
-
"getMe",
|
|
25
|
-
"createUser",
|
|
26
|
-
"patchUser",
|
|
27
|
-
"getUsersByIdsLite",
|
|
28
|
-
];
|
|
22
|
+
const grpcMethods = ["getMe", "createUser", "patchUser", "getUsersByIdsLite"];
|
|
29
23
|
for (const method of grpcMethods) {
|
|
30
24
|
const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
31
25
|
(0, microservices_1.GrpcMethod)("UsersService", method)(constructor.prototype[method], method, descriptor);
|
package/gen/ts/account.ts
CHANGED
|
@@ -8,8 +8,6 @@
|
|
|
8
8
|
import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices";
|
|
9
9
|
import { Observable } from "rxjs";
|
|
10
10
|
|
|
11
|
-
export const protobufPackage = "account.v1";
|
|
12
|
-
|
|
13
11
|
export enum Role {
|
|
14
12
|
GUEST = 0,
|
|
15
13
|
USER = 1,
|
|
@@ -73,8 +71,6 @@ export interface ConfirmPhoneChangeResponse {
|
|
|
73
71
|
ok: boolean;
|
|
74
72
|
}
|
|
75
73
|
|
|
76
|
-
export const ACCOUNT_V1_PACKAGE_NAME = "account.v1";
|
|
77
|
-
|
|
78
74
|
export interface AccountServiceClient {
|
|
79
75
|
getAccount(request: GetAccountRequest): Observable<GetAccountResponse>;
|
|
80
76
|
|
package/gen/ts/auth.ts
CHANGED
|
@@ -9,8 +9,6 @@ import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices";
|
|
|
9
9
|
import { Observable } from "rxjs";
|
|
10
10
|
import { Empty } from "./google/protobuf/empty";
|
|
11
11
|
|
|
12
|
-
export const protobufPackage = "auth.v1";
|
|
13
|
-
|
|
14
12
|
export interface SendOtpRequest {
|
|
15
13
|
identifier: string;
|
|
16
14
|
type: string;
|
|
@@ -87,8 +85,6 @@ export interface DeviceInfo {
|
|
|
87
85
|
type: string;
|
|
88
86
|
}
|
|
89
87
|
|
|
90
|
-
export const AUTH_V1_PACKAGE_NAME = "auth.v1";
|
|
91
|
-
|
|
92
88
|
export interface AuthServiceClient {
|
|
93
89
|
sendOtp(request: SendOtpRequest): Observable<SendOtpResponse>;
|
|
94
90
|
|
|
@@ -6,8 +6,6 @@
|
|
|
6
6
|
|
|
7
7
|
/* eslint-disable */
|
|
8
8
|
|
|
9
|
-
export const protobufPackage = "google.protobuf";
|
|
10
|
-
|
|
11
9
|
/**
|
|
12
10
|
* A generic empty message that you can re-use to avoid defining duplicated
|
|
13
11
|
* empty messages in your APIs. A typical example is to use it as the request
|
|
@@ -19,5 +17,3 @@ export const protobufPackage = "google.protobuf";
|
|
|
19
17
|
*/
|
|
20
18
|
export interface Empty {
|
|
21
19
|
}
|
|
22
|
-
|
|
23
|
-
export const GOOGLE_PROTOBUF_PACKAGE_NAME = "google.protobuf";
|
|
@@ -6,8 +6,6 @@
|
|
|
6
6
|
|
|
7
7
|
/* eslint-disable */
|
|
8
8
|
|
|
9
|
-
export const protobufPackage = "google.protobuf";
|
|
10
|
-
|
|
11
9
|
/**
|
|
12
10
|
* A Timestamp represents a point in time independent of any time zone or local
|
|
13
11
|
* calendar, encoded as a count of seconds and fractions of seconds at
|
|
@@ -115,5 +113,3 @@ export interface Timestamp {
|
|
|
115
113
|
*/
|
|
116
114
|
nanos: number;
|
|
117
115
|
}
|
|
118
|
-
|
|
119
|
-
export const GOOGLE_PROTOBUF_PACKAGE_NAME = "google.protobuf";
|
package/gen/ts/media.ts
CHANGED
|
@@ -8,8 +8,6 @@
|
|
|
8
8
|
import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices";
|
|
9
9
|
import { Observable } from "rxjs";
|
|
10
10
|
|
|
11
|
-
export const protobufPackage = "media.v1";
|
|
12
|
-
|
|
13
11
|
export interface UploadRequest {
|
|
14
12
|
fileName: string;
|
|
15
13
|
folder: string;
|
|
@@ -126,8 +124,6 @@ export interface CompleteMultipartUploadResponse {
|
|
|
126
124
|
url: string;
|
|
127
125
|
}
|
|
128
126
|
|
|
129
|
-
export const MEDIA_V1_PACKAGE_NAME = "media.v1";
|
|
130
|
-
|
|
131
127
|
export interface MediaServiceClient {
|
|
132
128
|
/** Существующие методы */
|
|
133
129
|
|
package/gen/ts/posts.ts
CHANGED
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices";
|
|
9
9
|
import { Observable } from "rxjs";
|
|
10
10
|
import { Timestamp } from "./google/protobuf/timestamp";
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
import { CompletedPart, PresignedPartUrl } from "./media";
|
|
12
|
+
import { UserLite } from "./users";
|
|
13
13
|
|
|
14
14
|
export enum PostStatus {
|
|
15
15
|
POST_STATUS_UNSPECIFIED = 0,
|
|
@@ -84,13 +84,6 @@ export interface MediaUploadInfo {
|
|
|
84
84
|
partUrls: PresignedPartUrl[];
|
|
85
85
|
}
|
|
86
86
|
|
|
87
|
-
export interface PresignedPartUrl {
|
|
88
|
-
partNumber: number;
|
|
89
|
-
url: string;
|
|
90
|
-
/** "PUT" */
|
|
91
|
-
method: string;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
87
|
/** === Финализация поста === */
|
|
95
88
|
export interface FinalizePostRequest {
|
|
96
89
|
postId: string;
|
|
@@ -112,11 +105,6 @@ export interface MediaFinalizeInfo {
|
|
|
112
105
|
parts: CompletedPart[];
|
|
113
106
|
}
|
|
114
107
|
|
|
115
|
-
export interface CompletedPart {
|
|
116
|
-
partNumber: number;
|
|
117
|
-
etag: string;
|
|
118
|
-
}
|
|
119
|
-
|
|
120
108
|
export interface FinalizePostResponse {
|
|
121
109
|
post: Post | undefined;
|
|
122
110
|
}
|
|
@@ -124,8 +112,6 @@ export interface FinalizePostResponse {
|
|
|
124
112
|
/** === Получение поста === */
|
|
125
113
|
export interface GetPostRequest {
|
|
126
114
|
postId: string;
|
|
127
|
-
/** Для проверки лайка текущего пользователя */
|
|
128
|
-
userId?: string | undefined;
|
|
129
115
|
}
|
|
130
116
|
|
|
131
117
|
export interface GetPostResponse {
|
|
@@ -157,8 +143,6 @@ export interface DeletePostResponse {
|
|
|
157
143
|
|
|
158
144
|
/** === Лента постов === */
|
|
159
145
|
export interface GetFeedRequest {
|
|
160
|
-
/** Для фильтрации и проверки лайков */
|
|
161
|
-
userId: string;
|
|
162
146
|
page: number;
|
|
163
147
|
/** Максимум 50 */
|
|
164
148
|
limit: number;
|
|
@@ -176,8 +160,6 @@ export interface GetFeedResponse {
|
|
|
176
160
|
export interface GetUserPostsRequest {
|
|
177
161
|
/** ID пользователя, чьи посты запрашиваем */
|
|
178
162
|
userId: string;
|
|
179
|
-
/** Для проверки лайков */
|
|
180
|
-
currentUserId: string;
|
|
181
163
|
page: number;
|
|
182
164
|
limit: number;
|
|
183
165
|
cursor?: string | undefined;
|
|
@@ -262,8 +244,6 @@ export interface Post {
|
|
|
262
244
|
/** Статистика */
|
|
263
245
|
likesCount: number;
|
|
264
246
|
viewsCount: number;
|
|
265
|
-
/** Для текущего пользователя */
|
|
266
|
-
isLiked: boolean;
|
|
267
247
|
createdAt: Timestamp | undefined;
|
|
268
248
|
updatedAt: Timestamp | undefined;
|
|
269
249
|
}
|
|
@@ -278,14 +258,6 @@ export interface PostMedia {
|
|
|
278
258
|
order: number;
|
|
279
259
|
}
|
|
280
260
|
|
|
281
|
-
export interface UserLite {
|
|
282
|
-
id: string;
|
|
283
|
-
name?: string | undefined;
|
|
284
|
-
avatar?: string | undefined;
|
|
285
|
-
}
|
|
286
|
-
|
|
287
|
-
export const POSTS_V1_PACKAGE_NAME = "posts.v1";
|
|
288
|
-
|
|
289
261
|
export interface PostsServiceClient {
|
|
290
262
|
/** Инициализация и финализация поста */
|
|
291
263
|
|
package/gen/ts/session.ts
CHANGED
|
@@ -9,8 +9,6 @@ import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices";
|
|
|
9
9
|
import { Observable } from "rxjs";
|
|
10
10
|
import { Timestamp } from "./google/protobuf/timestamp";
|
|
11
11
|
|
|
12
|
-
export const protobufPackage = "session.v1";
|
|
13
|
-
|
|
14
12
|
export interface ListSessionsRequest {
|
|
15
13
|
userId: string;
|
|
16
14
|
sessionToken: string;
|
|
@@ -59,8 +57,6 @@ export interface Session {
|
|
|
59
57
|
ip: string;
|
|
60
58
|
}
|
|
61
59
|
|
|
62
|
-
export const SESSION_V1_PACKAGE_NAME = "session.v1";
|
|
63
|
-
|
|
64
60
|
export interface SessionServiceClient {
|
|
65
61
|
listSessions(request: ListSessionsRequest): Observable<ListSessionsResponse>;
|
|
66
62
|
|
package/gen/ts/users.ts
CHANGED
|
@@ -9,8 +9,6 @@ import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices";
|
|
|
9
9
|
import { Observable } from "rxjs";
|
|
10
10
|
import { Timestamp } from "./google/protobuf/timestamp";
|
|
11
11
|
|
|
12
|
-
export const protobufPackage = "users.v1";
|
|
13
|
-
|
|
14
12
|
export enum Gender {
|
|
15
13
|
UNSPECIFIED = 0,
|
|
16
14
|
MALE = 1,
|
|
@@ -96,8 +94,6 @@ export interface User {
|
|
|
96
94
|
updatedAt: Timestamp | undefined;
|
|
97
95
|
}
|
|
98
96
|
|
|
99
|
-
export const USERS_V1_PACKAGE_NAME = "users.v1";
|
|
100
|
-
|
|
101
97
|
export interface UsersServiceClient {
|
|
102
98
|
getMe(request: GetMeRequest): Observable<GetMeResponse>;
|
|
103
99
|
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@barupost/contracts",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.2",
|
|
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
8
|
"build": "tsc -p tsconfig.build.json",
|
|
9
|
-
"generate": "protoc -I ./proto ./proto/*.proto --ts_proto_out=./gen/ts --ts_proto_opt=nestJs=true,esModuleInterop=true,package=omit"
|
|
9
|
+
"generate": "protoc -I ./proto ./proto/*.proto --ts_proto_out=./gen/ts --ts_proto_opt=nestJs=true,esModuleInterop=true,package=omit,exportCommonSymbols=false"
|
|
10
10
|
},
|
|
11
11
|
"files": [
|
|
12
12
|
"dist",
|
package/proto/posts.proto
CHANGED
|
@@ -3,6 +3,8 @@ syntax = "proto3";
|
|
|
3
3
|
package posts.v1;
|
|
4
4
|
|
|
5
5
|
import "google/protobuf/timestamp.proto";
|
|
6
|
+
import "users.proto";
|
|
7
|
+
import "media.proto";
|
|
6
8
|
|
|
7
9
|
service PostsService {
|
|
8
10
|
// Инициализация и финализация поста
|
|
@@ -73,13 +75,7 @@ message MediaUploadInfo {
|
|
|
73
75
|
// Для multipart загрузки
|
|
74
76
|
optional string upload_id = 8;
|
|
75
77
|
optional string key = 9; // S3 key
|
|
76
|
-
repeated PresignedPartUrl part_urls = 10;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
message PresignedPartUrl {
|
|
80
|
-
int32 part_number = 1;
|
|
81
|
-
string url = 2;
|
|
82
|
-
string method = 3; // "PUT"
|
|
78
|
+
repeated media.v1.PresignedPartUrl part_urls = 10;
|
|
83
79
|
}
|
|
84
80
|
|
|
85
81
|
// === Финализация поста ===
|
|
@@ -93,12 +89,7 @@ message MediaFinalizeInfo {
|
|
|
93
89
|
string media_id = 1;
|
|
94
90
|
string media_key = 2; // S3 key после загрузки
|
|
95
91
|
optional string upload_id = 3; // Для multipart upload
|
|
96
|
-
repeated CompletedPart parts = 4; // Для multipart upload
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
message CompletedPart {
|
|
100
|
-
int32 part_number = 1;
|
|
101
|
-
string etag = 2;
|
|
92
|
+
repeated media.v1.CompletedPart parts = 4; // Для multipart upload
|
|
102
93
|
}
|
|
103
94
|
|
|
104
95
|
message FinalizePostResponse {
|
|
@@ -108,7 +99,6 @@ message FinalizePostResponse {
|
|
|
108
99
|
// === Получение поста ===
|
|
109
100
|
message GetPostRequest {
|
|
110
101
|
string post_id = 1;
|
|
111
|
-
optional string user_id = 2; // Для проверки лайка текущего пользователя
|
|
112
102
|
}
|
|
113
103
|
|
|
114
104
|
message GetPostResponse {
|
|
@@ -138,10 +128,9 @@ message DeletePostResponse {
|
|
|
138
128
|
|
|
139
129
|
// === Лента постов ===
|
|
140
130
|
message GetFeedRequest {
|
|
141
|
-
|
|
142
|
-
int32
|
|
143
|
-
|
|
144
|
-
optional string cursor = 4; // Для пагинации
|
|
131
|
+
int32 page = 1;
|
|
132
|
+
int32 limit = 2; // Максимум 50
|
|
133
|
+
optional string cursor = 3; // Для пагинации
|
|
145
134
|
}
|
|
146
135
|
|
|
147
136
|
message GetFeedResponse {
|
|
@@ -153,10 +142,9 @@ message GetFeedResponse {
|
|
|
153
142
|
// === Посты пользователя ===
|
|
154
143
|
message GetUserPostsRequest {
|
|
155
144
|
string user_id = 1; // ID пользователя, чьи посты запрашиваем
|
|
156
|
-
|
|
157
|
-
int32
|
|
158
|
-
|
|
159
|
-
optional string cursor = 5;
|
|
145
|
+
int32 page = 2;
|
|
146
|
+
int32 limit = 3;
|
|
147
|
+
optional string cursor = 4;
|
|
160
148
|
}
|
|
161
149
|
|
|
162
150
|
message GetUserPostsResponse {
|
|
@@ -193,7 +181,7 @@ message GetPostLikesRequest {
|
|
|
193
181
|
}
|
|
194
182
|
|
|
195
183
|
message GetPostLikesResponse {
|
|
196
|
-
repeated UserLite users = 1; // Из users-service
|
|
184
|
+
repeated users.v1.UserLite users = 1; // Из users-service
|
|
197
185
|
int64 total_count = 2;
|
|
198
186
|
}
|
|
199
187
|
|
|
@@ -237,10 +225,9 @@ message Post {
|
|
|
237
225
|
// Статистика
|
|
238
226
|
int64 likes_count = 6;
|
|
239
227
|
int64 views_count = 7;
|
|
240
|
-
bool is_liked = 8; // Для текущего пользователя
|
|
241
228
|
|
|
242
|
-
google.protobuf.Timestamp created_at =
|
|
243
|
-
google.protobuf.Timestamp updated_at =
|
|
229
|
+
google.protobuf.Timestamp created_at = 8;
|
|
230
|
+
google.protobuf.Timestamp updated_at = 9;
|
|
244
231
|
}
|
|
245
232
|
|
|
246
233
|
message PostMedia {
|
|
@@ -261,10 +248,4 @@ enum MediaType {
|
|
|
261
248
|
MEDIA_TYPE_UNSPECIFIED = 0;
|
|
262
249
|
PHOTO = 1;
|
|
263
250
|
VIDEO = 2;
|
|
264
|
-
}
|
|
265
|
-
|
|
266
|
-
message UserLite {
|
|
267
|
-
string id = 1;
|
|
268
|
-
optional string name = 2;
|
|
269
|
-
optional string avatar = 3;
|
|
270
|
-
}
|
|
251
|
+
}
|