@mamindom/contracts 1.0.51 → 1.0.53

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.
@@ -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";
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@mamindom/contracts",
3
3
  "description": "proto",
4
- "version": "1.0.51",
4
+ "version": "1.0.53",
5
5
  "main": "./dist/src/index.js",
6
6
  "types": "./dist/src/index.d.ts",
7
7
  "exports": {
@@ -0,0 +1,23 @@
1
+ syntax = "proto3";
2
+
3
+ package content.v1;
4
+
5
+ message SuccessResponse {
6
+ bool success = 1;
7
+ }
8
+
9
+ message DeleteResponse {
10
+ bool success = 1;
11
+ }
12
+
13
+ message PaginationRequest {
14
+ int32 page = 1;
15
+ int32 limit = 2;
16
+ }
17
+
18
+ message PaginationMeta {
19
+ int32 total_items = 1;
20
+ int32 total_pages = 2;
21
+ int32 current_page = 3;
22
+ int32 per_page = 4;
23
+ }
@@ -0,0 +1,193 @@
1
+ syntax = "proto3";
2
+
3
+ package content.v1;
4
+
5
+ import "common_post.proto";
6
+
7
+
8
+ service PostService {
9
+
10
+ rpc GetPosts (GetPostsRequest) returns (GetPostsResponse);
11
+ rpc GetPost (GetPostRequest) returns (PostResponse);
12
+ rpc CreatePost (CreatePostRequest) returns (PostResponse);
13
+ rpc UpdatePost (UpdatePostRequest) returns (PostResponse);
14
+ rpc DeletePost (DeletePostRequest) returns (DeleteResponse);
15
+
16
+
17
+ rpc PublishPost (PostIdRequest) returns (PostResponse);
18
+ rpc SchedulePost (SchedulePostRequest) returns (PostResponse);
19
+ rpc ArchivePost (PostIdRequest) returns (PostResponse);
20
+
21
+
22
+ rpc IncrementViews (PostIdRequest) returns (SuccessResponse);
23
+ }
24
+
25
+
26
+ enum PostType {
27
+ POST_TYPE_UNSPECIFIED = 0;
28
+ POST_TYPE_ARTICLE = 1;
29
+ POST_TYPE_NEWS = 2;
30
+ POST_TYPE_PAGE = 3;
31
+ }
32
+
33
+ enum PostStatus {
34
+ POST_STATUS_UNSPECIFIED = 0;
35
+ POST_STATUS_DRAFT = 1;
36
+ POST_STATUS_SCHEDULED = 2;
37
+ POST_STATUS_PUBLISHED = 3;
38
+ POST_STATUS_ARCHIVED = 4;
39
+ }
40
+
41
+ message PostResponse {
42
+ string id = 1;
43
+ string slug = 2;
44
+ PostType type = 3;
45
+ PostStatus status = 4;
46
+
47
+ map<string, string> title = 5;
48
+ map<string, string> excerpt = 6;
49
+ map<string, string> content = 7;
50
+
51
+ optional string cover_image = 8;
52
+ optional string cover_image_id = 9;
53
+
54
+ optional string published_at = 10;
55
+ int32 read_time = 11;
56
+ int32 views_count = 12;
57
+ int32 comments_count = 13;
58
+
59
+ map<string, string> seo_title = 14;
60
+ map<string, string> seo_description = 15;
61
+ map<string, string> seo_keywords = 16;
62
+ map<string, string> seo_h1 = 17;
63
+
64
+ string created_by_id = 18;
65
+ string created_at = 19;
66
+ string updated_at = 20;
67
+
68
+ repeated PostCategoryItem categories = 21;
69
+ repeated PostTagItem tags = 22;
70
+ }
71
+
72
+
73
+ message PostCategoryItem {
74
+ string id = 1;
75
+ string slug = 2;
76
+ map<string, string> name = 3;
77
+ }
78
+
79
+ message PostTagItem {
80
+ string id = 1;
81
+ string slug = 2;
82
+ map<string, string> name = 3;
83
+ }
84
+
85
+
86
+ message PostListItem {
87
+ string id = 1;
88
+ string slug = 2;
89
+ PostType type = 3;
90
+ PostStatus status = 4;
91
+
92
+ map<string, string> title = 5;
93
+ map<string, string> excerpt = 6;
94
+
95
+ optional string cover_image = 7;
96
+ optional string published_at = 8;
97
+ int32 read_time = 9;
98
+ int32 views_count = 10;
99
+ int32 comments_count = 11;
100
+
101
+ repeated PostCategoryItem categories = 12;
102
+ repeated PostTagItem tags = 13;
103
+ }
104
+
105
+
106
+ message GetPostsRequest {
107
+ PaginationRequest pagination = 1;
108
+
109
+ optional PostType type = 2;
110
+ optional PostStatus status = 3;
111
+ optional string search = 4;
112
+ optional string category_id = 5;
113
+ optional string tag_id = 6;
114
+ optional string date_from = 7;
115
+ optional string date_to = 8;
116
+ optional string sort_by = 9;
117
+ }
118
+
119
+ message GetPostsResponse {
120
+ repeated PostListItem items = 1;
121
+ PaginationMeta meta = 2;
122
+ }
123
+
124
+
125
+ message GetPostRequest {
126
+ string id = 1;
127
+ optional string slug = 2;
128
+ }
129
+
130
+
131
+ message CreatePostRequest {
132
+ PostType type = 1;
133
+
134
+ optional string slug = 2;
135
+
136
+ map<string, string> title = 3;
137
+ map<string, string> excerpt = 4;
138
+ map<string, string> content = 5;
139
+
140
+ optional string cover_image = 6;
141
+ optional string cover_image_id = 7;
142
+
143
+ map<string, string> seo_title = 8;
144
+ map<string, string> seo_description = 9;
145
+ map<string, string> seo_keywords = 10;
146
+ map<string, string> seo_h1 = 11;
147
+
148
+ repeated string category_ids = 12;
149
+ repeated string tag_ids = 13;
150
+
151
+ string created_by_id = 14;
152
+ }
153
+
154
+
155
+ message UpdatePostRequest {
156
+ string id = 1;
157
+
158
+ optional string slug = 2;
159
+
160
+ map<string, string> title = 3;
161
+ map<string, string> excerpt = 4;
162
+ map<string, string> content = 5;
163
+
164
+ optional string cover_image = 6;
165
+ optional string cover_image_id = 7;
166
+
167
+ map<string, string> seo_title = 8;
168
+ map<string, string> seo_description = 9;
169
+ map<string, string> seo_keywords = 10;
170
+ map<string, string> seo_h1 = 11;
171
+
172
+ repeated string category_ids = 12;
173
+ repeated string tag_ids = 13;
174
+
175
+ string updated_by_id = 14;
176
+ }
177
+
178
+
179
+ message DeletePostRequest {
180
+ string id = 1;
181
+ }
182
+
183
+
184
+ message PostIdRequest {
185
+ string id = 1;
186
+ }
187
+
188
+
189
+ message SchedulePostRequest {
190
+ string id = 1;
191
+ string publish_at = 2;
192
+ string updated_by_id = 3;
193
+ }
@@ -0,0 +1,84 @@
1
+ syntax = "proto3";
2
+
3
+ package content.v1;
4
+
5
+ import "common_post.proto";
6
+
7
+
8
+ service PostCategoryService {
9
+ rpc GetPostCategories (GetPostCategoriesRequest) returns (GetPostCategoriesResponse);
10
+ rpc GetPostCategory (GetPostCategoryRequest) returns (PostCategoryResponse);
11
+ rpc CreatePostCategory (CreatePostCategoryRequest) returns (PostCategoryResponse);
12
+ rpc UpdatePostCategory (UpdatePostCategoryRequest) returns (PostCategoryResponse);
13
+ rpc DeletePostCategory (DeletePostCategoryRequest) returns (DeleteResponse);
14
+ }
15
+
16
+
17
+ enum PostCategoryType {
18
+ POST_CATEGORY_TYPE_UNSPECIFIED = 0;
19
+ POST_CATEGORY_TYPE_ARTICLE = 1;
20
+ POST_CATEGORY_TYPE_NEWS = 2;
21
+ POST_CATEGORY_TYPE_PAGE = 3;
22
+ POST_CATEGORY_TYPE_ALL = 4;
23
+ }
24
+
25
+
26
+ message PostCategoryResponse {
27
+ string id = 1;
28
+ string slug = 2;
29
+
30
+ map<string, string> name = 3;
31
+ map<string, string> description = 4;
32
+
33
+ int32 sort_order = 5;
34
+ PostCategoryType post_type = 6;
35
+
36
+ string created_at = 7;
37
+ string updated_at = 8;
38
+ }
39
+
40
+
41
+ message GetPostCategoriesRequest {
42
+ PaginationRequest pagination = 1;
43
+ optional PostCategoryType post_type = 2;
44
+ }
45
+
46
+ message GetPostCategoriesResponse {
47
+ repeated PostCategoryResponse items = 1;
48
+ PaginationMeta meta = 2;
49
+ }
50
+
51
+
52
+ message GetPostCategoryRequest {
53
+ string id = 1;
54
+ optional string slug = 2;
55
+ }
56
+
57
+
58
+ message CreatePostCategoryRequest {
59
+ string slug = 1;
60
+
61
+ map<string, string> name = 2;
62
+ map<string, string> description = 3;
63
+
64
+ int32 sort_order = 4;
65
+ PostCategoryType post_type = 5;
66
+ }
67
+
68
+
69
+ message UpdatePostCategoryRequest {
70
+ string id = 1;
71
+
72
+ optional string slug = 2;
73
+
74
+ map<string, string> name = 3;
75
+ map<string, string> description = 4;
76
+
77
+ optional int32 sort_order = 5;
78
+ optional PostCategoryType post_type = 6;
79
+ }
80
+
81
+
82
+ message DeletePostCategoryRequest {
83
+ string id = 1;
84
+ }
@@ -0,0 +1,66 @@
1
+ syntax = "proto3";
2
+
3
+ package content.v1;
4
+
5
+ import "common_post.proto";
6
+
7
+
8
+ service PostCommentService {
9
+
10
+ rpc GetComments (GetCommentsRequest) returns (GetCommentsResponse);
11
+
12
+ rpc CreateComment (CreateCommentRequest) returns (CommentResponse);
13
+
14
+ rpc ApproveComment (CommentIdRequest) returns (CommentResponse);
15
+ rpc RejectComment (CommentIdRequest) returns (CommentResponse);
16
+ rpc DeleteComment (CommentIdRequest) returns (DeleteResponse);
17
+ }
18
+
19
+
20
+ enum CommentStatus {
21
+ COMMENT_STATUS_UNSPECIFIED = 0;
22
+ COMMENT_STATUS_PENDING = 1;
23
+ COMMENT_STATUS_APPROVED = 2;
24
+ COMMENT_STATUS_REJECTED = 3;
25
+ }
26
+
27
+
28
+ message CommentResponse {
29
+ string id = 1;
30
+ string post_id = 2;
31
+
32
+ string author_name = 3;
33
+ string author_email = 4;
34
+ string body = 5;
35
+
36
+ CommentStatus status = 6;
37
+
38
+ string created_at = 7;
39
+ }
40
+
41
+
42
+ message GetCommentsRequest {
43
+ PaginationRequest pagination = 1;
44
+
45
+ optional string post_id = 2;
46
+ optional CommentStatus status = 3;
47
+ }
48
+
49
+ message GetCommentsResponse {
50
+ repeated CommentResponse items = 1;
51
+ PaginationMeta meta = 2;
52
+ }
53
+
54
+
55
+ message CreateCommentRequest {
56
+ string post_id = 1;
57
+
58
+ string author_name = 2;
59
+ string author_email = 3;
60
+ string body = 4;
61
+ }
62
+
63
+
64
+ message CommentIdRequest {
65
+ string id = 1;
66
+ }
@@ -0,0 +1,57 @@
1
+ syntax = "proto3";
2
+
3
+ package content.v1;
4
+
5
+ import "common_post.proto";
6
+
7
+
8
+ service PostTagService {
9
+ rpc GetPostTags (GetPostTagsRequest) returns (GetPostTagsResponse);
10
+ rpc GetPostTag (GetPostTagRequest) returns (PostTagResponse);
11
+ rpc CreatePostTag (CreatePostTagRequest) returns (PostTagResponse);
12
+ rpc UpdatePostTag (UpdatePostTagRequest) returns (PostTagResponse);
13
+ rpc DeletePostTag (DeletePostTagRequest) returns (DeleteResponse);
14
+ }
15
+
16
+
17
+ message PostTagResponse {
18
+ string id = 1;
19
+ string slug = 2;
20
+ map<string, string> name = 3;
21
+ string created_at = 4;
22
+ }
23
+
24
+
25
+ message GetPostTagsRequest {
26
+ PaginationRequest pagination = 1;
27
+ optional string search = 2;
28
+ }
29
+
30
+ message GetPostTagsResponse {
31
+ repeated PostTagResponse items = 1;
32
+ PaginationMeta meta = 2;
33
+ }
34
+
35
+
36
+ message GetPostTagRequest {
37
+ string id = 1;
38
+ optional string slug = 2;
39
+ }
40
+
41
+
42
+ message CreatePostTagRequest {
43
+ string slug = 1;
44
+ map<string, string> name = 2;
45
+ }
46
+
47
+
48
+ message UpdatePostTagRequest {
49
+ string id = 1;
50
+ optional string slug = 2;
51
+ map<string, string> name = 3;
52
+ }
53
+
54
+
55
+ message DeletePostTagRequest {
56
+ string id = 1;
57
+ }