@barupost/contracts 0.0.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/events/account/email-changed.interface.d.ts +4 -0
- package/dist/events/account/email-changed.interface.js +2 -0
- package/dist/events/account/index.d.ts +2 -0
- package/dist/events/account/index.js +18 -0
- package/dist/events/account/phone-changed.interface.d.ts +4 -0
- package/dist/events/account/phone-changed.interface.js +2 -0
- package/dist/events/auth/index.d.ts +1 -0
- package/dist/events/auth/index.js +17 -0
- package/dist/events/auth/otp-requested.interface.d.ts +5 -0
- package/dist/events/auth/otp-requested.interface.js +2 -0
- package/dist/events/index.d.ts +2 -0
- package/dist/events/index.js +18 -0
- package/dist/generated/account.d.ts +70 -0
- package/dist/generated/account.js +45 -0
- package/dist/generated/auth.d.ts +83 -0
- package/dist/generated/auth.js +34 -0
- package/dist/generated/google/protobuf/empty.d.ts +13 -0
- package/dist/generated/google/protobuf/empty.js +11 -0
- package/dist/generated/google/protobuf/timestamp.d.ts +109 -0
- package/dist/generated/google/protobuf/timestamp.js +11 -0
- package/dist/generated/index.d.ts +6 -0
- package/dist/generated/index.js +22 -0
- package/dist/generated/media.d.ts +124 -0
- package/dist/generated/media.js +35 -0
- package/dist/generated/posts.d.ts +259 -0
- package/dist/generated/posts.js +57 -0
- package/dist/generated/session.d.ts +56 -0
- package/dist/generated/session.js +32 -0
- package/dist/generated/users.d.ts +87 -0
- package/dist/generated/users.js +40 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +19 -0
- package/dist/proto/index.d.ts +1 -0
- package/dist/proto/index.js +17 -0
- package/dist/proto/paths.d.ts +8 -0
- package/dist/proto/paths.js +12 -0
- package/gen/go/.gitkeep +0 -0
- package/gen/go/media/media.pb.go +1545 -0
- package/gen/go/media/media_grpc.pb.go +342 -0
- package/gen/ts/.gitkeep +0 -0
- package/gen/ts/account.ts +133 -0
- package/gen/ts/auth.ts +135 -0
- package/gen/ts/google/protobuf/empty.ts +23 -0
- package/gen/ts/google/protobuf/struct.ts +197 -0
- package/gen/ts/google/protobuf/timestamp.ts +119 -0
- package/gen/ts/media.ts +205 -0
- package/gen/ts/posts.ts +417 -0
- package/gen/ts/session.ts +110 -0
- package/gen/ts/users.ts +140 -0
- package/package.json +28 -0
- package/proto/account.proto +75 -0
- package/proto/auth.proto +91 -0
- package/proto/media.proto +120 -0
- package/proto/posts.proto +270 -0
- package/proto/session.proto +61 -0
- package/proto/users.proto +105 -0
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
3
|
+
// versions:
|
|
4
|
+
// protoc-gen-ts_proto v2.11.2
|
|
5
|
+
// protoc v6.33.2
|
|
6
|
+
// source: media.proto
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.MEDIA_SERVICE_NAME = exports.MEDIA_V1_PACKAGE_NAME = void 0;
|
|
9
|
+
exports.MediaServiceControllerMethods = MediaServiceControllerMethods;
|
|
10
|
+
/* eslint-disable */
|
|
11
|
+
const microservices_1 = require("@nestjs/microservices");
|
|
12
|
+
exports.MEDIA_V1_PACKAGE_NAME = "media.v1";
|
|
13
|
+
function MediaServiceControllerMethods() {
|
|
14
|
+
return function (constructor) {
|
|
15
|
+
const grpcMethods = [
|
|
16
|
+
"upload",
|
|
17
|
+
"get",
|
|
18
|
+
"delete",
|
|
19
|
+
"getPresignedUrls",
|
|
20
|
+
"createMultipartUpload",
|
|
21
|
+
"getPresignedPartUrls",
|
|
22
|
+
"completeMultipartUpload",
|
|
23
|
+
];
|
|
24
|
+
for (const method of grpcMethods) {
|
|
25
|
+
const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
26
|
+
(0, microservices_1.GrpcMethod)("MediaService", method)(constructor.prototype[method], method, descriptor);
|
|
27
|
+
}
|
|
28
|
+
const grpcStreamMethods = [];
|
|
29
|
+
for (const method of grpcStreamMethods) {
|
|
30
|
+
const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
31
|
+
(0, microservices_1.GrpcStreamMethod)("MediaService", method)(constructor.prototype[method], method, descriptor);
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
exports.MEDIA_SERVICE_NAME = "MediaService";
|
|
@@ -0,0 +1,259 @@
|
|
|
1
|
+
import { Observable } from "rxjs";
|
|
2
|
+
import { Timestamp } from "./google/protobuf/timestamp";
|
|
3
|
+
import { CompletedPart, PresignedPartUrl } from "./media";
|
|
4
|
+
import { UserLite } from "./users";
|
|
5
|
+
export declare enum PostStatus {
|
|
6
|
+
POST_STATUS_UNSPECIFIED = 0,
|
|
7
|
+
DRAFT = 1,
|
|
8
|
+
PUBLISHED = 2,
|
|
9
|
+
DELETED = 3,
|
|
10
|
+
UNRECOGNIZED = -1
|
|
11
|
+
}
|
|
12
|
+
export declare enum MediaType {
|
|
13
|
+
MEDIA_TYPE_UNSPECIFIED = 0,
|
|
14
|
+
PHOTO = 1,
|
|
15
|
+
VIDEO = 2,
|
|
16
|
+
UNRECOGNIZED = -1
|
|
17
|
+
}
|
|
18
|
+
/** === Инициализация поста === */
|
|
19
|
+
export interface CreatePostInitRequest {
|
|
20
|
+
authorId: string;
|
|
21
|
+
caption?: string | undefined;
|
|
22
|
+
/** Метаданные файлов (до 10 элементов) */
|
|
23
|
+
files: FileInfo[];
|
|
24
|
+
}
|
|
25
|
+
export interface FileInfo {
|
|
26
|
+
name: string;
|
|
27
|
+
/** Размер в байтах */
|
|
28
|
+
size: number;
|
|
29
|
+
/** MIME type (image/jpeg, video/mp4, etc.) */
|
|
30
|
+
type: string;
|
|
31
|
+
}
|
|
32
|
+
export interface CreatePostInitResponse {
|
|
33
|
+
postId: string;
|
|
34
|
+
status: PostStatus;
|
|
35
|
+
}
|
|
36
|
+
/** === Получение presigned Urls для загрузки медиа === */
|
|
37
|
+
export interface GetPostUploadUrlsRequest {
|
|
38
|
+
postId: string;
|
|
39
|
+
/** Для проверки прав */
|
|
40
|
+
authorId: string;
|
|
41
|
+
}
|
|
42
|
+
export interface GetPostUploadUrlsResponse {
|
|
43
|
+
postId: string;
|
|
44
|
+
uploadInfo: MediaUploadInfo[];
|
|
45
|
+
}
|
|
46
|
+
export interface MediaUploadInfo {
|
|
47
|
+
mediaId: string;
|
|
48
|
+
type: MediaType;
|
|
49
|
+
order: number;
|
|
50
|
+
/** Для простого PUT загрузки */
|
|
51
|
+
presignedUrl?: string | undefined;
|
|
52
|
+
/** "PUT" */
|
|
53
|
+
method?: string | undefined;
|
|
54
|
+
sizeLimit?: number | undefined;
|
|
55
|
+
contentType?: string | undefined;
|
|
56
|
+
/** Для multipart загрузки */
|
|
57
|
+
uploadId?: string | undefined;
|
|
58
|
+
/** S3 key */
|
|
59
|
+
key?: string | undefined;
|
|
60
|
+
partUrls: PresignedPartUrl[];
|
|
61
|
+
}
|
|
62
|
+
/** === Финализация поста === */
|
|
63
|
+
export interface FinalizePostRequest {
|
|
64
|
+
postId: string;
|
|
65
|
+
/** Для проверки прав */
|
|
66
|
+
authorId: string;
|
|
67
|
+
/** Информация о загруженных файлах */
|
|
68
|
+
media: MediaFinalizeInfo[];
|
|
69
|
+
}
|
|
70
|
+
export interface MediaFinalizeInfo {
|
|
71
|
+
mediaId: string;
|
|
72
|
+
/** S3 key после загрузки */
|
|
73
|
+
mediaKey: string;
|
|
74
|
+
/** Для multipart upload */
|
|
75
|
+
uploadId?: string | undefined;
|
|
76
|
+
/** Для multipart upload */
|
|
77
|
+
parts: CompletedPart[];
|
|
78
|
+
}
|
|
79
|
+
export interface FinalizePostResponse {
|
|
80
|
+
post: Post | undefined;
|
|
81
|
+
}
|
|
82
|
+
/** === Получение поста === */
|
|
83
|
+
export interface GetPostRequest {
|
|
84
|
+
postId: string;
|
|
85
|
+
/** Для проверки лайка текущего пользователя */
|
|
86
|
+
userId?: string | undefined;
|
|
87
|
+
}
|
|
88
|
+
export interface GetPostResponse {
|
|
89
|
+
post: Post | undefined;
|
|
90
|
+
}
|
|
91
|
+
/** === Обновление поста === */
|
|
92
|
+
export interface UpdatePostRequest {
|
|
93
|
+
postId: string;
|
|
94
|
+
/** Для проверки прав */
|
|
95
|
+
authorId: string;
|
|
96
|
+
caption?: string | undefined;
|
|
97
|
+
}
|
|
98
|
+
export interface UpdatePostResponse {
|
|
99
|
+
post: Post | undefined;
|
|
100
|
+
}
|
|
101
|
+
/** === Удаление поста === */
|
|
102
|
+
export interface DeletePostRequest {
|
|
103
|
+
postId: string;
|
|
104
|
+
/** Для проверки прав */
|
|
105
|
+
authorId: string;
|
|
106
|
+
}
|
|
107
|
+
export interface DeletePostResponse {
|
|
108
|
+
ok: boolean;
|
|
109
|
+
}
|
|
110
|
+
/** === Лента постов === */
|
|
111
|
+
export interface GetFeedRequest {
|
|
112
|
+
/** Для фильтрации и проверки лайков */
|
|
113
|
+
userId: string;
|
|
114
|
+
page: number;
|
|
115
|
+
/** Максимум 50 */
|
|
116
|
+
limit: number;
|
|
117
|
+
/** Для пагинации */
|
|
118
|
+
cursor?: string | undefined;
|
|
119
|
+
}
|
|
120
|
+
export interface GetFeedResponse {
|
|
121
|
+
posts: Post[];
|
|
122
|
+
nextCursor?: string | undefined;
|
|
123
|
+
hasMore: boolean;
|
|
124
|
+
}
|
|
125
|
+
/** === Посты пользователя === */
|
|
126
|
+
export interface GetUserPostsRequest {
|
|
127
|
+
/** ID пользователя, чьи посты запрашиваем */
|
|
128
|
+
userId: string;
|
|
129
|
+
/** Для проверки лайков */
|
|
130
|
+
currentUserId: string;
|
|
131
|
+
page: number;
|
|
132
|
+
limit: number;
|
|
133
|
+
cursor?: string | undefined;
|
|
134
|
+
}
|
|
135
|
+
export interface GetUserPostsResponse {
|
|
136
|
+
posts: Post[];
|
|
137
|
+
nextCursor?: string | undefined;
|
|
138
|
+
hasMore: boolean;
|
|
139
|
+
}
|
|
140
|
+
/** === Лайки === */
|
|
141
|
+
export interface LikePostRequest {
|
|
142
|
+
postId: string;
|
|
143
|
+
userId: string;
|
|
144
|
+
}
|
|
145
|
+
export interface LikePostResponse {
|
|
146
|
+
ok: boolean;
|
|
147
|
+
likesCount: number;
|
|
148
|
+
}
|
|
149
|
+
export interface UnlikePostRequest {
|
|
150
|
+
postId: string;
|
|
151
|
+
userId: string;
|
|
152
|
+
}
|
|
153
|
+
export interface UnlikePostResponse {
|
|
154
|
+
ok: boolean;
|
|
155
|
+
likesCount: number;
|
|
156
|
+
}
|
|
157
|
+
export interface GetPostLikesRequest {
|
|
158
|
+
postId: string;
|
|
159
|
+
page: number;
|
|
160
|
+
limit: number;
|
|
161
|
+
}
|
|
162
|
+
export interface GetPostLikesResponse {
|
|
163
|
+
/** Из users-service */
|
|
164
|
+
users: UserLite[];
|
|
165
|
+
totalCount: number;
|
|
166
|
+
}
|
|
167
|
+
export interface CheckLikeRequest {
|
|
168
|
+
postId: string;
|
|
169
|
+
userId: string;
|
|
170
|
+
}
|
|
171
|
+
export interface CheckLikeResponse {
|
|
172
|
+
isLiked: boolean;
|
|
173
|
+
}
|
|
174
|
+
/** === Просмотры === */
|
|
175
|
+
export interface TrackViewRequest {
|
|
176
|
+
postId: string;
|
|
177
|
+
/** Может быть пустым для анонимных просмотров */
|
|
178
|
+
userId: string;
|
|
179
|
+
ip?: string | undefined;
|
|
180
|
+
}
|
|
181
|
+
export interface TrackViewResponse {
|
|
182
|
+
ok: boolean;
|
|
183
|
+
viewsCount: number;
|
|
184
|
+
}
|
|
185
|
+
export interface GetPostViewsRequest {
|
|
186
|
+
postId: string;
|
|
187
|
+
}
|
|
188
|
+
export interface GetPostViewsResponse {
|
|
189
|
+
viewsCount: number;
|
|
190
|
+
}
|
|
191
|
+
/** === Модель поста === */
|
|
192
|
+
export interface Post {
|
|
193
|
+
id: string;
|
|
194
|
+
authorId: string;
|
|
195
|
+
caption?: string | undefined;
|
|
196
|
+
media: PostMedia[];
|
|
197
|
+
status: PostStatus;
|
|
198
|
+
/** Статистика */
|
|
199
|
+
likesCount: number;
|
|
200
|
+
viewsCount: number;
|
|
201
|
+
/** Для текущего пользователя */
|
|
202
|
+
isLiked: boolean;
|
|
203
|
+
createdAt: Timestamp | undefined;
|
|
204
|
+
updatedAt: Timestamp | undefined;
|
|
205
|
+
}
|
|
206
|
+
export interface PostMedia {
|
|
207
|
+
id: string;
|
|
208
|
+
/** Ключ из S3 */
|
|
209
|
+
mediaKey: string;
|
|
210
|
+
/** PHOTO или VIDEO */
|
|
211
|
+
type: MediaType;
|
|
212
|
+
/** Порядок отображения */
|
|
213
|
+
order: number;
|
|
214
|
+
}
|
|
215
|
+
export declare const POSTS_V1_PACKAGE_NAME = "posts.v1";
|
|
216
|
+
export interface PostsServiceClient {
|
|
217
|
+
/** Инициализация и финализация поста */
|
|
218
|
+
createPostInit(request: CreatePostInitRequest): Observable<CreatePostInitResponse>;
|
|
219
|
+
getPostUploadUrls(request: GetPostUploadUrlsRequest): Observable<GetPostUploadUrlsResponse>;
|
|
220
|
+
finalizePost(request: FinalizePostRequest): Observable<FinalizePostResponse>;
|
|
221
|
+
/** CRUD постов */
|
|
222
|
+
getPost(request: GetPostRequest): Observable<GetPostResponse>;
|
|
223
|
+
updatePost(request: UpdatePostRequest): Observable<UpdatePostResponse>;
|
|
224
|
+
deletePost(request: DeletePostRequest): Observable<DeletePostResponse>;
|
|
225
|
+
/** Лента постов */
|
|
226
|
+
getFeed(request: GetFeedRequest): Observable<GetFeedResponse>;
|
|
227
|
+
getUserPosts(request: GetUserPostsRequest): Observable<GetUserPostsResponse>;
|
|
228
|
+
/** Лайки */
|
|
229
|
+
likePost(request: LikePostRequest): Observable<LikePostResponse>;
|
|
230
|
+
unlikePost(request: UnlikePostRequest): Observable<UnlikePostResponse>;
|
|
231
|
+
getPostLikes(request: GetPostLikesRequest): Observable<GetPostLikesResponse>;
|
|
232
|
+
checkLike(request: CheckLikeRequest): Observable<CheckLikeResponse>;
|
|
233
|
+
/** Просмотры */
|
|
234
|
+
trackView(request: TrackViewRequest): Observable<TrackViewResponse>;
|
|
235
|
+
getPostViews(request: GetPostViewsRequest): Observable<GetPostViewsResponse>;
|
|
236
|
+
}
|
|
237
|
+
export interface PostsServiceController {
|
|
238
|
+
/** Инициализация и финализация поста */
|
|
239
|
+
createPostInit(request: CreatePostInitRequest): Promise<CreatePostInitResponse> | Observable<CreatePostInitResponse> | CreatePostInitResponse;
|
|
240
|
+
getPostUploadUrls(request: GetPostUploadUrlsRequest): Promise<GetPostUploadUrlsResponse> | Observable<GetPostUploadUrlsResponse> | GetPostUploadUrlsResponse;
|
|
241
|
+
finalizePost(request: FinalizePostRequest): Promise<FinalizePostResponse> | Observable<FinalizePostResponse> | FinalizePostResponse;
|
|
242
|
+
/** CRUD постов */
|
|
243
|
+
getPost(request: GetPostRequest): Promise<GetPostResponse> | Observable<GetPostResponse> | GetPostResponse;
|
|
244
|
+
updatePost(request: UpdatePostRequest): Promise<UpdatePostResponse> | Observable<UpdatePostResponse> | UpdatePostResponse;
|
|
245
|
+
deletePost(request: DeletePostRequest): Promise<DeletePostResponse> | Observable<DeletePostResponse> | DeletePostResponse;
|
|
246
|
+
/** Лента постов */
|
|
247
|
+
getFeed(request: GetFeedRequest): Promise<GetFeedResponse> | Observable<GetFeedResponse> | GetFeedResponse;
|
|
248
|
+
getUserPosts(request: GetUserPostsRequest): Promise<GetUserPostsResponse> | Observable<GetUserPostsResponse> | GetUserPostsResponse;
|
|
249
|
+
/** Лайки */
|
|
250
|
+
likePost(request: LikePostRequest): Promise<LikePostResponse> | Observable<LikePostResponse> | LikePostResponse;
|
|
251
|
+
unlikePost(request: UnlikePostRequest): Promise<UnlikePostResponse> | Observable<UnlikePostResponse> | UnlikePostResponse;
|
|
252
|
+
getPostLikes(request: GetPostLikesRequest): Promise<GetPostLikesResponse> | Observable<GetPostLikesResponse> | GetPostLikesResponse;
|
|
253
|
+
checkLike(request: CheckLikeRequest): Promise<CheckLikeResponse> | Observable<CheckLikeResponse> | CheckLikeResponse;
|
|
254
|
+
/** Просмотры */
|
|
255
|
+
trackView(request: TrackViewRequest): Promise<TrackViewResponse> | Observable<TrackViewResponse> | TrackViewResponse;
|
|
256
|
+
getPostViews(request: GetPostViewsRequest): Promise<GetPostViewsResponse> | Observable<GetPostViewsResponse> | GetPostViewsResponse;
|
|
257
|
+
}
|
|
258
|
+
export declare function PostsServiceControllerMethods(): (constructor: Function) => void;
|
|
259
|
+
export declare const POSTS_SERVICE_NAME = "PostsService";
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
3
|
+
// versions:
|
|
4
|
+
// protoc-gen-ts_proto v2.11.2
|
|
5
|
+
// protoc v6.33.2
|
|
6
|
+
// source: posts.proto
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.POSTS_SERVICE_NAME = exports.POSTS_V1_PACKAGE_NAME = exports.MediaType = exports.PostStatus = void 0;
|
|
9
|
+
exports.PostsServiceControllerMethods = PostsServiceControllerMethods;
|
|
10
|
+
/* eslint-disable */
|
|
11
|
+
const microservices_1 = require("@nestjs/microservices");
|
|
12
|
+
var PostStatus;
|
|
13
|
+
(function (PostStatus) {
|
|
14
|
+
PostStatus[PostStatus["POST_STATUS_UNSPECIFIED"] = 0] = "POST_STATUS_UNSPECIFIED";
|
|
15
|
+
PostStatus[PostStatus["DRAFT"] = 1] = "DRAFT";
|
|
16
|
+
PostStatus[PostStatus["PUBLISHED"] = 2] = "PUBLISHED";
|
|
17
|
+
PostStatus[PostStatus["DELETED"] = 3] = "DELETED";
|
|
18
|
+
PostStatus[PostStatus["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
|
|
19
|
+
})(PostStatus || (exports.PostStatus = PostStatus = {}));
|
|
20
|
+
var MediaType;
|
|
21
|
+
(function (MediaType) {
|
|
22
|
+
MediaType[MediaType["MEDIA_TYPE_UNSPECIFIED"] = 0] = "MEDIA_TYPE_UNSPECIFIED";
|
|
23
|
+
MediaType[MediaType["PHOTO"] = 1] = "PHOTO";
|
|
24
|
+
MediaType[MediaType["VIDEO"] = 2] = "VIDEO";
|
|
25
|
+
MediaType[MediaType["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
|
|
26
|
+
})(MediaType || (exports.MediaType = MediaType = {}));
|
|
27
|
+
exports.POSTS_V1_PACKAGE_NAME = "posts.v1";
|
|
28
|
+
function PostsServiceControllerMethods() {
|
|
29
|
+
return function (constructor) {
|
|
30
|
+
const grpcMethods = [
|
|
31
|
+
"createPostInit",
|
|
32
|
+
"getPostUploadUrls",
|
|
33
|
+
"finalizePost",
|
|
34
|
+
"getPost",
|
|
35
|
+
"updatePost",
|
|
36
|
+
"deletePost",
|
|
37
|
+
"getFeed",
|
|
38
|
+
"getUserPosts",
|
|
39
|
+
"likePost",
|
|
40
|
+
"unlikePost",
|
|
41
|
+
"getPostLikes",
|
|
42
|
+
"checkLike",
|
|
43
|
+
"trackView",
|
|
44
|
+
"getPostViews",
|
|
45
|
+
];
|
|
46
|
+
for (const method of grpcMethods) {
|
|
47
|
+
const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
48
|
+
(0, microservices_1.GrpcMethod)("PostsService", method)(constructor.prototype[method], method, descriptor);
|
|
49
|
+
}
|
|
50
|
+
const grpcStreamMethods = [];
|
|
51
|
+
for (const method of grpcStreamMethods) {
|
|
52
|
+
const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
53
|
+
(0, microservices_1.GrpcStreamMethod)("PostsService", method)(constructor.prototype[method], method, descriptor);
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
exports.POSTS_SERVICE_NAME = "PostsService";
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { Observable } from "rxjs";
|
|
2
|
+
import { Timestamp } from "./google/protobuf/timestamp";
|
|
3
|
+
export interface ListSessionsRequest {
|
|
4
|
+
userId: string;
|
|
5
|
+
sessionToken: string;
|
|
6
|
+
}
|
|
7
|
+
export interface ListSessionsResponse {
|
|
8
|
+
sessions: Session[];
|
|
9
|
+
}
|
|
10
|
+
export interface GetSessionRequest {
|
|
11
|
+
id?: string | undefined;
|
|
12
|
+
userId: string;
|
|
13
|
+
sessionToken?: string | undefined;
|
|
14
|
+
}
|
|
15
|
+
export interface GetSessionResponse {
|
|
16
|
+
session: Session | undefined;
|
|
17
|
+
}
|
|
18
|
+
export interface RevokeSessionRequest {
|
|
19
|
+
id: string;
|
|
20
|
+
userId: string;
|
|
21
|
+
sessionToken?: string | undefined;
|
|
22
|
+
}
|
|
23
|
+
export interface RevokeSessionResponse {
|
|
24
|
+
ok: boolean;
|
|
25
|
+
}
|
|
26
|
+
export interface RevokeAllOtherSessionsRequest {
|
|
27
|
+
userId: string;
|
|
28
|
+
sessionToken?: string | undefined;
|
|
29
|
+
}
|
|
30
|
+
export interface RevokeAllOtherSessionsResponse {
|
|
31
|
+
ok: boolean;
|
|
32
|
+
}
|
|
33
|
+
export interface Session {
|
|
34
|
+
id: string;
|
|
35
|
+
createdAt: Timestamp | undefined;
|
|
36
|
+
country: string;
|
|
37
|
+
city: string;
|
|
38
|
+
browser: string;
|
|
39
|
+
os: string;
|
|
40
|
+
ip: string;
|
|
41
|
+
}
|
|
42
|
+
export declare const SESSION_V1_PACKAGE_NAME = "session.v1";
|
|
43
|
+
export interface SessionServiceClient {
|
|
44
|
+
listSessions(request: ListSessionsRequest): Observable<ListSessionsResponse>;
|
|
45
|
+
revokeSession(request: RevokeSessionRequest): Observable<RevokeSessionResponse>;
|
|
46
|
+
revokeAllOtherSessions(request: RevokeAllOtherSessionsRequest): Observable<RevokeAllOtherSessionsResponse>;
|
|
47
|
+
getSession(request: GetSessionRequest): Observable<GetSessionResponse>;
|
|
48
|
+
}
|
|
49
|
+
export interface SessionServiceController {
|
|
50
|
+
listSessions(request: ListSessionsRequest): Promise<ListSessionsResponse> | Observable<ListSessionsResponse> | ListSessionsResponse;
|
|
51
|
+
revokeSession(request: RevokeSessionRequest): Promise<RevokeSessionResponse> | Observable<RevokeSessionResponse> | RevokeSessionResponse;
|
|
52
|
+
revokeAllOtherSessions(request: RevokeAllOtherSessionsRequest): Promise<RevokeAllOtherSessionsResponse> | Observable<RevokeAllOtherSessionsResponse> | RevokeAllOtherSessionsResponse;
|
|
53
|
+
getSession(request: GetSessionRequest): Promise<GetSessionResponse> | Observable<GetSessionResponse> | GetSessionResponse;
|
|
54
|
+
}
|
|
55
|
+
export declare function SessionServiceControllerMethods(): (constructor: Function) => void;
|
|
56
|
+
export declare const SESSION_SERVICE_NAME = "SessionService";
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
3
|
+
// versions:
|
|
4
|
+
// protoc-gen-ts_proto v2.11.2
|
|
5
|
+
// protoc v6.33.2
|
|
6
|
+
// source: session.proto
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.SESSION_SERVICE_NAME = exports.SESSION_V1_PACKAGE_NAME = void 0;
|
|
9
|
+
exports.SessionServiceControllerMethods = SessionServiceControllerMethods;
|
|
10
|
+
/* eslint-disable */
|
|
11
|
+
const microservices_1 = require("@nestjs/microservices");
|
|
12
|
+
exports.SESSION_V1_PACKAGE_NAME = "session.v1";
|
|
13
|
+
function SessionServiceControllerMethods() {
|
|
14
|
+
return function (constructor) {
|
|
15
|
+
const grpcMethods = [
|
|
16
|
+
"listSessions",
|
|
17
|
+
"revokeSession",
|
|
18
|
+
"revokeAllOtherSessions",
|
|
19
|
+
"getSession",
|
|
20
|
+
];
|
|
21
|
+
for (const method of grpcMethods) {
|
|
22
|
+
const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
23
|
+
(0, microservices_1.GrpcMethod)("SessionService", method)(constructor.prototype[method], method, descriptor);
|
|
24
|
+
}
|
|
25
|
+
const grpcStreamMethods = [];
|
|
26
|
+
for (const method of grpcStreamMethods) {
|
|
27
|
+
const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
28
|
+
(0, microservices_1.GrpcStreamMethod)("SessionService", method)(constructor.prototype[method], method, descriptor);
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
exports.SESSION_SERVICE_NAME = "SessionService";
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { Observable } from "rxjs";
|
|
2
|
+
import { Timestamp } from "./google/protobuf/timestamp";
|
|
3
|
+
export declare enum Gender {
|
|
4
|
+
UNSPECIFIED = 0,
|
|
5
|
+
MALE = 1,
|
|
6
|
+
FEMALE = 2,
|
|
7
|
+
OTHER = 3,
|
|
8
|
+
UNRECOGNIZED = -1
|
|
9
|
+
}
|
|
10
|
+
export interface GetMeRequest {
|
|
11
|
+
id: string;
|
|
12
|
+
}
|
|
13
|
+
export interface GetMeResponse {
|
|
14
|
+
user: User | undefined;
|
|
15
|
+
}
|
|
16
|
+
export interface CreateUserRequest {
|
|
17
|
+
id: string;
|
|
18
|
+
name?: string | undefined;
|
|
19
|
+
avatar?: string | undefined;
|
|
20
|
+
}
|
|
21
|
+
export interface CreateUserResponse {
|
|
22
|
+
ok: boolean;
|
|
23
|
+
}
|
|
24
|
+
export interface PatchUserRequest {
|
|
25
|
+
userId: string;
|
|
26
|
+
/** Базовые поля */
|
|
27
|
+
name?: string | undefined;
|
|
28
|
+
avatar?: string | undefined;
|
|
29
|
+
/** Новые поля профиля */
|
|
30
|
+
bio?: string | undefined;
|
|
31
|
+
birthDate?: Timestamp | undefined;
|
|
32
|
+
gender?: Gender | undefined;
|
|
33
|
+
/** Контакты (дополнительные) */
|
|
34
|
+
website?: string | undefined;
|
|
35
|
+
vkUrl?: string | undefined;
|
|
36
|
+
telegramUsername?: string | undefined;
|
|
37
|
+
}
|
|
38
|
+
export interface PatchUserResponse {
|
|
39
|
+
ok: boolean;
|
|
40
|
+
}
|
|
41
|
+
export interface GetUsersByIdsLiteRequest {
|
|
42
|
+
ids: string[];
|
|
43
|
+
}
|
|
44
|
+
export interface GetUsersByIdsLiteResponse {
|
|
45
|
+
users: UserLite[];
|
|
46
|
+
}
|
|
47
|
+
export interface UserLite {
|
|
48
|
+
id: string;
|
|
49
|
+
name?: string | undefined;
|
|
50
|
+
avatar?: string | undefined;
|
|
51
|
+
}
|
|
52
|
+
export interface User {
|
|
53
|
+
id: string;
|
|
54
|
+
name?: string | undefined;
|
|
55
|
+
phone?: string | undefined;
|
|
56
|
+
email?: string | undefined;
|
|
57
|
+
avatar?: string | undefined;
|
|
58
|
+
bio?: string | undefined;
|
|
59
|
+
birthDate?: Timestamp | undefined;
|
|
60
|
+
gender?: Gender | undefined;
|
|
61
|
+
website?: string | undefined;
|
|
62
|
+
vkUrl?: string | undefined;
|
|
63
|
+
telegramUsername?: string | undefined;
|
|
64
|
+
isPremium?: boolean | undefined;
|
|
65
|
+
isBanned?: boolean | undefined;
|
|
66
|
+
banReason?: string | undefined;
|
|
67
|
+
bannedUntil?: Timestamp | undefined;
|
|
68
|
+
lastActiveAt?: Timestamp | undefined;
|
|
69
|
+
registrationSource?: string | undefined;
|
|
70
|
+
createdAt: Timestamp | undefined;
|
|
71
|
+
updatedAt: Timestamp | undefined;
|
|
72
|
+
}
|
|
73
|
+
export declare const USERS_V1_PACKAGE_NAME = "users.v1";
|
|
74
|
+
export interface UsersServiceClient {
|
|
75
|
+
getMe(request: GetMeRequest): Observable<GetMeResponse>;
|
|
76
|
+
createUser(request: CreateUserRequest): Observable<CreateUserResponse>;
|
|
77
|
+
patchUser(request: PatchUserRequest): Observable<PatchUserResponse>;
|
|
78
|
+
getUsersByIdsLite(request: GetUsersByIdsLiteRequest): Observable<GetUsersByIdsLiteResponse>;
|
|
79
|
+
}
|
|
80
|
+
export interface UsersServiceController {
|
|
81
|
+
getMe(request: GetMeRequest): Promise<GetMeResponse> | Observable<GetMeResponse> | GetMeResponse;
|
|
82
|
+
createUser(request: CreateUserRequest): Promise<CreateUserResponse> | Observable<CreateUserResponse> | CreateUserResponse;
|
|
83
|
+
patchUser(request: PatchUserRequest): Promise<PatchUserResponse> | Observable<PatchUserResponse> | PatchUserResponse;
|
|
84
|
+
getUsersByIdsLite(request: GetUsersByIdsLiteRequest): Promise<GetUsersByIdsLiteResponse> | Observable<GetUsersByIdsLiteResponse> | GetUsersByIdsLiteResponse;
|
|
85
|
+
}
|
|
86
|
+
export declare function UsersServiceControllerMethods(): (constructor: Function) => void;
|
|
87
|
+
export declare const USERS_SERVICE_NAME = "UsersService";
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
3
|
+
// versions:
|
|
4
|
+
// protoc-gen-ts_proto v2.11.2
|
|
5
|
+
// protoc v6.33.2
|
|
6
|
+
// source: users.proto
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.USERS_SERVICE_NAME = exports.USERS_V1_PACKAGE_NAME = exports.Gender = void 0;
|
|
9
|
+
exports.UsersServiceControllerMethods = UsersServiceControllerMethods;
|
|
10
|
+
/* eslint-disable */
|
|
11
|
+
const microservices_1 = require("@nestjs/microservices");
|
|
12
|
+
var Gender;
|
|
13
|
+
(function (Gender) {
|
|
14
|
+
Gender[Gender["UNSPECIFIED"] = 0] = "UNSPECIFIED";
|
|
15
|
+
Gender[Gender["MALE"] = 1] = "MALE";
|
|
16
|
+
Gender[Gender["FEMALE"] = 2] = "FEMALE";
|
|
17
|
+
Gender[Gender["OTHER"] = 3] = "OTHER";
|
|
18
|
+
Gender[Gender["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
|
|
19
|
+
})(Gender || (exports.Gender = Gender = {}));
|
|
20
|
+
exports.USERS_V1_PACKAGE_NAME = "users.v1";
|
|
21
|
+
function UsersServiceControllerMethods() {
|
|
22
|
+
return function (constructor) {
|
|
23
|
+
const grpcMethods = [
|
|
24
|
+
"getMe",
|
|
25
|
+
"createUser",
|
|
26
|
+
"patchUser",
|
|
27
|
+
"getUsersByIdsLite",
|
|
28
|
+
];
|
|
29
|
+
for (const method of grpcMethods) {
|
|
30
|
+
const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
31
|
+
(0, microservices_1.GrpcMethod)("UsersService", method)(constructor.prototype[method], method, descriptor);
|
|
32
|
+
}
|
|
33
|
+
const grpcStreamMethods = [];
|
|
34
|
+
for (const method of grpcStreamMethods) {
|
|
35
|
+
const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
36
|
+
(0, microservices_1.GrpcStreamMethod)("UsersService", method)(constructor.prototype[method], method, descriptor);
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
exports.USERS_SERVICE_NAME = "UsersService";
|
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
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("./events"), exports);
|
|
18
|
+
__exportStar(require("./generated"), exports);
|
|
19
|
+
__exportStar(require("./proto"), exports);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './paths';
|
|
@@ -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("./paths"), exports);
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PROTO_PATHS = void 0;
|
|
4
|
+
const path_1 = require("path");
|
|
5
|
+
exports.PROTO_PATHS = {
|
|
6
|
+
AUTH: (0, path_1.join)(__dirname, "../../proto/auth.proto"),
|
|
7
|
+
ACCOUNT: (0, path_1.join)(__dirname, "../../proto/account.proto"),
|
|
8
|
+
USERS: (0, path_1.join)(__dirname, "../../proto/users.proto"),
|
|
9
|
+
MEDIA: (0, path_1.join)(__dirname, "../../proto/media.proto"),
|
|
10
|
+
POSTS: (0, path_1.join)(__dirname, "../../proto/posts.proto"),
|
|
11
|
+
SESSION: (0, path_1.join)(__dirname, "../../proto/session.proto"),
|
|
12
|
+
};
|
package/gen/go/.gitkeep
ADDED
|
File without changes
|