@mamindom/contracts 1.0.50 → 1.0.52
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/gen/calculation.d.ts +55 -0
- package/dist/gen/calculation.js +28 -0
- package/dist/gen/common_post.d.ts +18 -0
- package/dist/gen/common_post.js +11 -0
- package/dist/gen/coupon.d.ts +96 -0
- package/dist/gen/coupon.js +37 -0
- package/dist/gen/post.d.ts +304 -0
- package/dist/gen/post.js +55 -0
- package/dist/gen/post_category.d.ts +104 -0
- package/dist/gen/post_category.js +43 -0
- package/dist/gen/post_comment.d.ts +54 -0
- package/dist/gen/post_comment.js +36 -0
- package/dist/gen/post_tag.d.ts +68 -0
- package/dist/gen/post_tag.js +28 -0
- package/dist/gen/post_version.d.ts +73 -0
- package/dist/gen/post_version.js +28 -0
- package/dist/gen/promotion.d.ts +284 -0
- package/dist/gen/promotion.js +91 -0
- package/dist/proto/calculation.proto +66 -0
- package/dist/proto/common_post.proto +23 -0
- package/dist/proto/common_promo.proto +6 -7
- package/dist/proto/coupon.proto +121 -0
- package/dist/proto/post.proto +193 -0
- package/dist/proto/post_category.proto +84 -0
- package/dist/proto/post_comment.proto +66 -0
- package/dist/proto/post_tag.proto +57 -0
- package/dist/proto/post_version.proto +61 -0
- package/dist/proto/promotion.proto +257 -0
- package/dist/src/proto/paths.d.ts +8 -1
- package/dist/src/proto/paths.js +8 -1
- package/gen/calculation.ts +94 -0
- package/gen/common_post.ts +31 -0
- package/gen/coupon.ts +169 -0
- package/gen/post.ts +346 -0
- package/gen/post_category.ts +157 -0
- package/gen/post_comment.ts +99 -0
- package/gen/post_tag.ts +113 -0
- package/gen/post_version.ts +112 -0
- package/gen/promotion.ts +353 -0
- package/package.json +1 -1
- package/proto/calculation.proto +66 -0
- package/proto/common_post.proto +23 -0
- package/proto/common_promo.proto +6 -7
- package/proto/coupon.proto +121 -0
- package/proto/post.proto +193 -0
- package/proto/post_category.proto +84 -0
- package/proto/post_comment.proto +66 -0
- package/proto/post_tag.proto +57 -0
- package/proto/post_version.proto +61 -0
- package/proto/promotion.proto +257 -0
- package/dist/gen/promo.d.ts +0 -293
- package/dist/gen/promo.js +0 -73
- package/dist/proto/promo.proto +0 -238
- package/gen/promo.ts +0 -390
- package/proto/promo.proto +0 -238
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
2
|
+
// versions:
|
|
3
|
+
// protoc-gen-ts_proto v2.11.4
|
|
4
|
+
// protoc v3.21.12
|
|
5
|
+
// source: post_category.proto
|
|
6
|
+
|
|
7
|
+
/* eslint-disable */
|
|
8
|
+
import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices";
|
|
9
|
+
import { Observable } from "rxjs";
|
|
10
|
+
import { DeleteResponse, PaginationMeta, PaginationRequest } from "./common_post";
|
|
11
|
+
|
|
12
|
+
export const protobufPackage = "content.v1";
|
|
13
|
+
|
|
14
|
+
export enum PostCategoryType {
|
|
15
|
+
POST_CATEGORY_TYPE_UNSPECIFIED = 0,
|
|
16
|
+
POST_CATEGORY_TYPE_ARTICLE = 1,
|
|
17
|
+
POST_CATEGORY_TYPE_NEWS = 2,
|
|
18
|
+
POST_CATEGORY_TYPE_PAGE = 3,
|
|
19
|
+
POST_CATEGORY_TYPE_ALL = 4,
|
|
20
|
+
UNRECOGNIZED = -1,
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export interface PostCategoryResponse {
|
|
24
|
+
id: string;
|
|
25
|
+
slug: string;
|
|
26
|
+
name: { [key: string]: string };
|
|
27
|
+
description: { [key: string]: string };
|
|
28
|
+
sortOrder: number;
|
|
29
|
+
postType: PostCategoryType;
|
|
30
|
+
createdAt: string;
|
|
31
|
+
updatedAt: string;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export interface PostCategoryResponse_NameEntry {
|
|
35
|
+
key: string;
|
|
36
|
+
value: string;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export interface PostCategoryResponse_DescriptionEntry {
|
|
40
|
+
key: string;
|
|
41
|
+
value: string;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export interface GetPostCategoriesRequest {
|
|
45
|
+
pagination: PaginationRequest | undefined;
|
|
46
|
+
postType?: PostCategoryType | undefined;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export interface GetPostCategoriesResponse {
|
|
50
|
+
items: PostCategoryResponse[];
|
|
51
|
+
meta: PaginationMeta | undefined;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export interface GetPostCategoryRequest {
|
|
55
|
+
id: string;
|
|
56
|
+
slug?: string | undefined;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export interface CreatePostCategoryRequest {
|
|
60
|
+
slug: string;
|
|
61
|
+
name: { [key: string]: string };
|
|
62
|
+
description: { [key: string]: string };
|
|
63
|
+
sortOrder: number;
|
|
64
|
+
postType: PostCategoryType;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export interface CreatePostCategoryRequest_NameEntry {
|
|
68
|
+
key: string;
|
|
69
|
+
value: string;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export interface CreatePostCategoryRequest_DescriptionEntry {
|
|
73
|
+
key: string;
|
|
74
|
+
value: string;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export interface UpdatePostCategoryRequest {
|
|
78
|
+
id: string;
|
|
79
|
+
slug?: string | undefined;
|
|
80
|
+
name: { [key: string]: string };
|
|
81
|
+
description: { [key: string]: string };
|
|
82
|
+
sortOrder?: number | undefined;
|
|
83
|
+
postType?: PostCategoryType | undefined;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export interface UpdatePostCategoryRequest_NameEntry {
|
|
87
|
+
key: string;
|
|
88
|
+
value: string;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
export interface UpdatePostCategoryRequest_DescriptionEntry {
|
|
92
|
+
key: string;
|
|
93
|
+
value: string;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export interface DeletePostCategoryRequest {
|
|
97
|
+
id: string;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
export const CONTENT_V1_PACKAGE_NAME = "content.v1";
|
|
101
|
+
|
|
102
|
+
export interface PostCategoryServiceClient {
|
|
103
|
+
getPostCategories(request: GetPostCategoriesRequest): Observable<GetPostCategoriesResponse>;
|
|
104
|
+
|
|
105
|
+
getPostCategory(request: GetPostCategoryRequest): Observable<PostCategoryResponse>;
|
|
106
|
+
|
|
107
|
+
createPostCategory(request: CreatePostCategoryRequest): Observable<PostCategoryResponse>;
|
|
108
|
+
|
|
109
|
+
updatePostCategory(request: UpdatePostCategoryRequest): Observable<PostCategoryResponse>;
|
|
110
|
+
|
|
111
|
+
deletePostCategory(request: DeletePostCategoryRequest): Observable<DeleteResponse>;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
export interface PostCategoryServiceController {
|
|
115
|
+
getPostCategories(
|
|
116
|
+
request: GetPostCategoriesRequest,
|
|
117
|
+
): Promise<GetPostCategoriesResponse> | Observable<GetPostCategoriesResponse> | GetPostCategoriesResponse;
|
|
118
|
+
|
|
119
|
+
getPostCategory(
|
|
120
|
+
request: GetPostCategoryRequest,
|
|
121
|
+
): Promise<PostCategoryResponse> | Observable<PostCategoryResponse> | PostCategoryResponse;
|
|
122
|
+
|
|
123
|
+
createPostCategory(
|
|
124
|
+
request: CreatePostCategoryRequest,
|
|
125
|
+
): Promise<PostCategoryResponse> | Observable<PostCategoryResponse> | PostCategoryResponse;
|
|
126
|
+
|
|
127
|
+
updatePostCategory(
|
|
128
|
+
request: UpdatePostCategoryRequest,
|
|
129
|
+
): Promise<PostCategoryResponse> | Observable<PostCategoryResponse> | PostCategoryResponse;
|
|
130
|
+
|
|
131
|
+
deletePostCategory(
|
|
132
|
+
request: DeletePostCategoryRequest,
|
|
133
|
+
): Promise<DeleteResponse> | Observable<DeleteResponse> | DeleteResponse;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
export function PostCategoryServiceControllerMethods() {
|
|
137
|
+
return function (constructor: Function) {
|
|
138
|
+
const grpcMethods: string[] = [
|
|
139
|
+
"getPostCategories",
|
|
140
|
+
"getPostCategory",
|
|
141
|
+
"createPostCategory",
|
|
142
|
+
"updatePostCategory",
|
|
143
|
+
"deletePostCategory",
|
|
144
|
+
];
|
|
145
|
+
for (const method of grpcMethods) {
|
|
146
|
+
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
147
|
+
GrpcMethod("PostCategoryService", method)(constructor.prototype[method], method, descriptor);
|
|
148
|
+
}
|
|
149
|
+
const grpcStreamMethods: string[] = [];
|
|
150
|
+
for (const method of grpcStreamMethods) {
|
|
151
|
+
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
152
|
+
GrpcStreamMethod("PostCategoryService", method)(constructor.prototype[method], method, descriptor);
|
|
153
|
+
}
|
|
154
|
+
};
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
export const POST_CATEGORY_SERVICE_NAME = "PostCategoryService";
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
2
|
+
// versions:
|
|
3
|
+
// protoc-gen-ts_proto v2.11.4
|
|
4
|
+
// protoc v3.21.12
|
|
5
|
+
// source: post_comment.proto
|
|
6
|
+
|
|
7
|
+
/* eslint-disable */
|
|
8
|
+
import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices";
|
|
9
|
+
import { Observable } from "rxjs";
|
|
10
|
+
import { DeleteResponse, PaginationMeta, PaginationRequest } from "./common_post";
|
|
11
|
+
|
|
12
|
+
export const protobufPackage = "content.v1";
|
|
13
|
+
|
|
14
|
+
export enum CommentStatus {
|
|
15
|
+
COMMENT_STATUS_UNSPECIFIED = 0,
|
|
16
|
+
COMMENT_STATUS_PENDING = 1,
|
|
17
|
+
COMMENT_STATUS_APPROVED = 2,
|
|
18
|
+
COMMENT_STATUS_REJECTED = 3,
|
|
19
|
+
UNRECOGNIZED = -1,
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export interface CommentResponse {
|
|
23
|
+
id: string;
|
|
24
|
+
postId: string;
|
|
25
|
+
authorName: string;
|
|
26
|
+
authorEmail: string;
|
|
27
|
+
body: string;
|
|
28
|
+
status: CommentStatus;
|
|
29
|
+
createdAt: string;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export interface GetCommentsRequest {
|
|
33
|
+
pagination: PaginationRequest | undefined;
|
|
34
|
+
postId?: string | undefined;
|
|
35
|
+
status?: CommentStatus | undefined;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export interface GetCommentsResponse {
|
|
39
|
+
items: CommentResponse[];
|
|
40
|
+
meta: PaginationMeta | undefined;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export interface CreateCommentRequest {
|
|
44
|
+
postId: string;
|
|
45
|
+
authorName: string;
|
|
46
|
+
authorEmail: string;
|
|
47
|
+
body: string;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export interface CommentIdRequest {
|
|
51
|
+
id: string;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export const CONTENT_V1_PACKAGE_NAME = "content.v1";
|
|
55
|
+
|
|
56
|
+
export interface PostCommentServiceClient {
|
|
57
|
+
getComments(request: GetCommentsRequest): Observable<GetCommentsResponse>;
|
|
58
|
+
|
|
59
|
+
createComment(request: CreateCommentRequest): Observable<CommentResponse>;
|
|
60
|
+
|
|
61
|
+
approveComment(request: CommentIdRequest): Observable<CommentResponse>;
|
|
62
|
+
|
|
63
|
+
rejectComment(request: CommentIdRequest): Observable<CommentResponse>;
|
|
64
|
+
|
|
65
|
+
deleteComment(request: CommentIdRequest): Observable<DeleteResponse>;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export interface PostCommentServiceController {
|
|
69
|
+
getComments(
|
|
70
|
+
request: GetCommentsRequest,
|
|
71
|
+
): Promise<GetCommentsResponse> | Observable<GetCommentsResponse> | GetCommentsResponse;
|
|
72
|
+
|
|
73
|
+
createComment(
|
|
74
|
+
request: CreateCommentRequest,
|
|
75
|
+
): Promise<CommentResponse> | Observable<CommentResponse> | CommentResponse;
|
|
76
|
+
|
|
77
|
+
approveComment(request: CommentIdRequest): Promise<CommentResponse> | Observable<CommentResponse> | CommentResponse;
|
|
78
|
+
|
|
79
|
+
rejectComment(request: CommentIdRequest): Promise<CommentResponse> | Observable<CommentResponse> | CommentResponse;
|
|
80
|
+
|
|
81
|
+
deleteComment(request: CommentIdRequest): Promise<DeleteResponse> | Observable<DeleteResponse> | DeleteResponse;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export function PostCommentServiceControllerMethods() {
|
|
85
|
+
return function (constructor: Function) {
|
|
86
|
+
const grpcMethods: string[] = ["getComments", "createComment", "approveComment", "rejectComment", "deleteComment"];
|
|
87
|
+
for (const method of grpcMethods) {
|
|
88
|
+
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
89
|
+
GrpcMethod("PostCommentService", method)(constructor.prototype[method], method, descriptor);
|
|
90
|
+
}
|
|
91
|
+
const grpcStreamMethods: string[] = [];
|
|
92
|
+
for (const method of grpcStreamMethods) {
|
|
93
|
+
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
94
|
+
GrpcStreamMethod("PostCommentService", method)(constructor.prototype[method], method, descriptor);
|
|
95
|
+
}
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
export const POST_COMMENT_SERVICE_NAME = "PostCommentService";
|
package/gen/post_tag.ts
ADDED
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
2
|
+
// versions:
|
|
3
|
+
// protoc-gen-ts_proto v2.11.4
|
|
4
|
+
// protoc v3.21.12
|
|
5
|
+
// source: post_tag.proto
|
|
6
|
+
|
|
7
|
+
/* eslint-disable */
|
|
8
|
+
import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices";
|
|
9
|
+
import { Observable } from "rxjs";
|
|
10
|
+
import { DeleteResponse, PaginationMeta, PaginationRequest } from "./common_post";
|
|
11
|
+
|
|
12
|
+
export const protobufPackage = "content.v1";
|
|
13
|
+
|
|
14
|
+
export interface PostTagResponse {
|
|
15
|
+
id: string;
|
|
16
|
+
slug: string;
|
|
17
|
+
name: { [key: string]: string };
|
|
18
|
+
createdAt: string;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export interface PostTagResponse_NameEntry {
|
|
22
|
+
key: string;
|
|
23
|
+
value: string;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export interface GetPostTagsRequest {
|
|
27
|
+
pagination: PaginationRequest | undefined;
|
|
28
|
+
search?: string | undefined;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export interface GetPostTagsResponse {
|
|
32
|
+
items: PostTagResponse[];
|
|
33
|
+
meta: PaginationMeta | undefined;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export interface GetPostTagRequest {
|
|
37
|
+
id: string;
|
|
38
|
+
slug?: string | undefined;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export interface CreatePostTagRequest {
|
|
42
|
+
slug: string;
|
|
43
|
+
name: { [key: string]: string };
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export interface CreatePostTagRequest_NameEntry {
|
|
47
|
+
key: string;
|
|
48
|
+
value: string;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export interface UpdatePostTagRequest {
|
|
52
|
+
id: string;
|
|
53
|
+
slug?: string | undefined;
|
|
54
|
+
name: { [key: string]: string };
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export interface UpdatePostTagRequest_NameEntry {
|
|
58
|
+
key: string;
|
|
59
|
+
value: string;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export interface DeletePostTagRequest {
|
|
63
|
+
id: string;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export const CONTENT_V1_PACKAGE_NAME = "content.v1";
|
|
67
|
+
|
|
68
|
+
export interface PostTagServiceClient {
|
|
69
|
+
getPostTags(request: GetPostTagsRequest): Observable<GetPostTagsResponse>;
|
|
70
|
+
|
|
71
|
+
getPostTag(request: GetPostTagRequest): Observable<PostTagResponse>;
|
|
72
|
+
|
|
73
|
+
createPostTag(request: CreatePostTagRequest): Observable<PostTagResponse>;
|
|
74
|
+
|
|
75
|
+
updatePostTag(request: UpdatePostTagRequest): Observable<PostTagResponse>;
|
|
76
|
+
|
|
77
|
+
deletePostTag(request: DeletePostTagRequest): Observable<DeleteResponse>;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export interface PostTagServiceController {
|
|
81
|
+
getPostTags(
|
|
82
|
+
request: GetPostTagsRequest,
|
|
83
|
+
): Promise<GetPostTagsResponse> | Observable<GetPostTagsResponse> | GetPostTagsResponse;
|
|
84
|
+
|
|
85
|
+
getPostTag(request: GetPostTagRequest): Promise<PostTagResponse> | Observable<PostTagResponse> | PostTagResponse;
|
|
86
|
+
|
|
87
|
+
createPostTag(
|
|
88
|
+
request: CreatePostTagRequest,
|
|
89
|
+
): Promise<PostTagResponse> | Observable<PostTagResponse> | PostTagResponse;
|
|
90
|
+
|
|
91
|
+
updatePostTag(
|
|
92
|
+
request: UpdatePostTagRequest,
|
|
93
|
+
): Promise<PostTagResponse> | Observable<PostTagResponse> | PostTagResponse;
|
|
94
|
+
|
|
95
|
+
deletePostTag(request: DeletePostTagRequest): Promise<DeleteResponse> | Observable<DeleteResponse> | DeleteResponse;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
export function PostTagServiceControllerMethods() {
|
|
99
|
+
return function (constructor: Function) {
|
|
100
|
+
const grpcMethods: string[] = ["getPostTags", "getPostTag", "createPostTag", "updatePostTag", "deletePostTag"];
|
|
101
|
+
for (const method of grpcMethods) {
|
|
102
|
+
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
103
|
+
GrpcMethod("PostTagService", method)(constructor.prototype[method], method, descriptor);
|
|
104
|
+
}
|
|
105
|
+
const grpcStreamMethods: string[] = [];
|
|
106
|
+
for (const method of grpcStreamMethods) {
|
|
107
|
+
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
108
|
+
GrpcStreamMethod("PostTagService", method)(constructor.prototype[method], method, descriptor);
|
|
109
|
+
}
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
export const POST_TAG_SERVICE_NAME = "PostTagService";
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
2
|
+
// versions:
|
|
3
|
+
// protoc-gen-ts_proto v2.11.4
|
|
4
|
+
// protoc v3.21.12
|
|
5
|
+
// source: post_version.proto
|
|
6
|
+
|
|
7
|
+
/* eslint-disable */
|
|
8
|
+
import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices";
|
|
9
|
+
import { Observable } from "rxjs";
|
|
10
|
+
import { PaginationMeta, PaginationRequest, SuccessResponse } from "./common_post";
|
|
11
|
+
|
|
12
|
+
export const protobufPackage = "content.v1";
|
|
13
|
+
|
|
14
|
+
export interface PostVersionResponse {
|
|
15
|
+
id: string;
|
|
16
|
+
postId: string;
|
|
17
|
+
title: { [key: string]: string };
|
|
18
|
+
excerpt: { [key: string]: string };
|
|
19
|
+
content: { [key: string]: string };
|
|
20
|
+
version: number;
|
|
21
|
+
savedById: string;
|
|
22
|
+
createdAt: string;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export interface PostVersionResponse_TitleEntry {
|
|
26
|
+
key: string;
|
|
27
|
+
value: string;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export interface PostVersionResponse_ExcerptEntry {
|
|
31
|
+
key: string;
|
|
32
|
+
value: string;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export interface PostVersionResponse_ContentEntry {
|
|
36
|
+
key: string;
|
|
37
|
+
value: string;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export interface PostVersionListItem {
|
|
41
|
+
id: string;
|
|
42
|
+
postId: string;
|
|
43
|
+
version: number;
|
|
44
|
+
savedById: string;
|
|
45
|
+
createdAt: string;
|
|
46
|
+
title: { [key: string]: string };
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export interface PostVersionListItem_TitleEntry {
|
|
50
|
+
key: string;
|
|
51
|
+
value: string;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export interface GetPostVersionsRequest {
|
|
55
|
+
postId: string;
|
|
56
|
+
pagination: PaginationRequest | undefined;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export interface GetPostVersionsResponse {
|
|
60
|
+
items: PostVersionListItem[];
|
|
61
|
+
meta: PaginationMeta | undefined;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export interface GetPostVersionRequest {
|
|
65
|
+
id: string;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export interface RestorePostVersionRequest {
|
|
69
|
+
versionId: string;
|
|
70
|
+
restoredById: string;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export const CONTENT_V1_PACKAGE_NAME = "content.v1";
|
|
74
|
+
|
|
75
|
+
export interface PostVersionServiceClient {
|
|
76
|
+
getPostVersions(request: GetPostVersionsRequest): Observable<GetPostVersionsResponse>;
|
|
77
|
+
|
|
78
|
+
getPostVersion(request: GetPostVersionRequest): Observable<PostVersionResponse>;
|
|
79
|
+
|
|
80
|
+
restorePostVersion(request: RestorePostVersionRequest): Observable<SuccessResponse>;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export interface PostVersionServiceController {
|
|
84
|
+
getPostVersions(
|
|
85
|
+
request: GetPostVersionsRequest,
|
|
86
|
+
): Promise<GetPostVersionsResponse> | Observable<GetPostVersionsResponse> | GetPostVersionsResponse;
|
|
87
|
+
|
|
88
|
+
getPostVersion(
|
|
89
|
+
request: GetPostVersionRequest,
|
|
90
|
+
): Promise<PostVersionResponse> | Observable<PostVersionResponse> | PostVersionResponse;
|
|
91
|
+
|
|
92
|
+
restorePostVersion(
|
|
93
|
+
request: RestorePostVersionRequest,
|
|
94
|
+
): Promise<SuccessResponse> | Observable<SuccessResponse> | SuccessResponse;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
export function PostVersionServiceControllerMethods() {
|
|
98
|
+
return function (constructor: Function) {
|
|
99
|
+
const grpcMethods: string[] = ["getPostVersions", "getPostVersion", "restorePostVersion"];
|
|
100
|
+
for (const method of grpcMethods) {
|
|
101
|
+
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
102
|
+
GrpcMethod("PostVersionService", method)(constructor.prototype[method], method, descriptor);
|
|
103
|
+
}
|
|
104
|
+
const grpcStreamMethods: string[] = [];
|
|
105
|
+
for (const method of grpcStreamMethods) {
|
|
106
|
+
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
107
|
+
GrpcStreamMethod("PostVersionService", method)(constructor.prototype[method], method, descriptor);
|
|
108
|
+
}
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
export const POST_VERSION_SERVICE_NAME = "PostVersionService";
|