@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.
Files changed (55) hide show
  1. package/dist/gen/calculation.d.ts +55 -0
  2. package/dist/gen/calculation.js +28 -0
  3. package/dist/gen/common_post.d.ts +18 -0
  4. package/dist/gen/common_post.js +11 -0
  5. package/dist/gen/coupon.d.ts +96 -0
  6. package/dist/gen/coupon.js +37 -0
  7. package/dist/gen/post.d.ts +304 -0
  8. package/dist/gen/post.js +55 -0
  9. package/dist/gen/post_category.d.ts +104 -0
  10. package/dist/gen/post_category.js +43 -0
  11. package/dist/gen/post_comment.d.ts +54 -0
  12. package/dist/gen/post_comment.js +36 -0
  13. package/dist/gen/post_tag.d.ts +68 -0
  14. package/dist/gen/post_tag.js +28 -0
  15. package/dist/gen/post_version.d.ts +73 -0
  16. package/dist/gen/post_version.js +28 -0
  17. package/dist/gen/promotion.d.ts +284 -0
  18. package/dist/gen/promotion.js +91 -0
  19. package/dist/proto/calculation.proto +66 -0
  20. package/dist/proto/common_post.proto +23 -0
  21. package/dist/proto/common_promo.proto +6 -7
  22. package/dist/proto/coupon.proto +121 -0
  23. package/dist/proto/post.proto +193 -0
  24. package/dist/proto/post_category.proto +84 -0
  25. package/dist/proto/post_comment.proto +66 -0
  26. package/dist/proto/post_tag.proto +57 -0
  27. package/dist/proto/post_version.proto +61 -0
  28. package/dist/proto/promotion.proto +257 -0
  29. package/dist/src/proto/paths.d.ts +8 -1
  30. package/dist/src/proto/paths.js +8 -1
  31. package/gen/calculation.ts +94 -0
  32. package/gen/common_post.ts +31 -0
  33. package/gen/coupon.ts +169 -0
  34. package/gen/post.ts +346 -0
  35. package/gen/post_category.ts +157 -0
  36. package/gen/post_comment.ts +99 -0
  37. package/gen/post_tag.ts +113 -0
  38. package/gen/post_version.ts +112 -0
  39. package/gen/promotion.ts +353 -0
  40. package/package.json +1 -1
  41. package/proto/calculation.proto +66 -0
  42. package/proto/common_post.proto +23 -0
  43. package/proto/common_promo.proto +6 -7
  44. package/proto/coupon.proto +121 -0
  45. package/proto/post.proto +193 -0
  46. package/proto/post_category.proto +84 -0
  47. package/proto/post_comment.proto +66 -0
  48. package/proto/post_tag.proto +57 -0
  49. package/proto/post_version.proto +61 -0
  50. package/proto/promotion.proto +257 -0
  51. package/dist/gen/promo.d.ts +0 -293
  52. package/dist/gen/promo.js +0 -73
  53. package/dist/proto/promo.proto +0 -238
  54. package/gen/promo.ts +0 -390
  55. package/proto/promo.proto +0 -238
@@ -0,0 +1,55 @@
1
+ import { Observable } from "rxjs";
2
+ import { SuccessResponse } from "./common_promo";
3
+ export declare const protobufPackage = "promo.v1";
4
+ export interface CartItem {
5
+ productId: string;
6
+ categoryId: string;
7
+ brandId: string;
8
+ quantity: number;
9
+ price: number;
10
+ }
11
+ export interface ValidateAndCalculateRequest {
12
+ userId: string;
13
+ items: CartItem[];
14
+ orderTotal: number;
15
+ couponCode?: string | undefined;
16
+ isFirstOrder: boolean;
17
+ orderCount: number;
18
+ }
19
+ export interface ValidateAndCalculateResponse {
20
+ isValid: boolean;
21
+ discountAmount: number;
22
+ finalTotal: number;
23
+ appliedPromotions: AppliedPromotion[];
24
+ appliedCoupon?: AppliedCoupon | undefined;
25
+ errorMessage?: string | undefined;
26
+ }
27
+ export interface AppliedPromotion {
28
+ promotionId: string;
29
+ promotionName: string;
30
+ discountAmount: number;
31
+ }
32
+ export interface AppliedCoupon {
33
+ couponId: string;
34
+ code: string;
35
+ promotionId: string;
36
+ discountAmount: number;
37
+ }
38
+ export interface ApplyPromotionRequest {
39
+ userId: string;
40
+ orderId: string;
41
+ discountAmount: number;
42
+ couponCode?: string | undefined;
43
+ promotionIds: string[];
44
+ }
45
+ export declare const PROMO_V1_PACKAGE_NAME = "promo.v1";
46
+ export interface PromoCalculationServiceClient {
47
+ validateAndCalculate(request: ValidateAndCalculateRequest): Observable<ValidateAndCalculateResponse>;
48
+ applyPromotion(request: ApplyPromotionRequest): Observable<SuccessResponse>;
49
+ }
50
+ export interface PromoCalculationServiceController {
51
+ validateAndCalculate(request: ValidateAndCalculateRequest): Promise<ValidateAndCalculateResponse> | Observable<ValidateAndCalculateResponse> | ValidateAndCalculateResponse;
52
+ applyPromotion(request: ApplyPromotionRequest): Promise<SuccessResponse> | Observable<SuccessResponse> | SuccessResponse;
53
+ }
54
+ export declare function PromoCalculationServiceControllerMethods(): (constructor: Function) => void;
55
+ export declare const PROMO_CALCULATION_SERVICE_NAME = "PromoCalculationService";
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
3
+ // versions:
4
+ // protoc-gen-ts_proto v2.11.4
5
+ // protoc v3.21.12
6
+ // source: calculation.proto
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.PROMO_CALCULATION_SERVICE_NAME = exports.PROMO_V1_PACKAGE_NAME = exports.protobufPackage = void 0;
9
+ exports.PromoCalculationServiceControllerMethods = PromoCalculationServiceControllerMethods;
10
+ /* eslint-disable */
11
+ const microservices_1 = require("@nestjs/microservices");
12
+ exports.protobufPackage = "promo.v1";
13
+ exports.PROMO_V1_PACKAGE_NAME = "promo.v1";
14
+ function PromoCalculationServiceControllerMethods() {
15
+ return function (constructor) {
16
+ const grpcMethods = ["validateAndCalculate", "applyPromotion"];
17
+ for (const method of grpcMethods) {
18
+ const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
19
+ (0, microservices_1.GrpcMethod)("PromoCalculationService", method)(constructor.prototype[method], method, descriptor);
20
+ }
21
+ const grpcStreamMethods = [];
22
+ for (const method of grpcStreamMethods) {
23
+ const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
24
+ (0, microservices_1.GrpcStreamMethod)("PromoCalculationService", method)(constructor.prototype[method], method, descriptor);
25
+ }
26
+ };
27
+ }
28
+ exports.PROMO_CALCULATION_SERVICE_NAME = "PromoCalculationService";
@@ -0,0 +1,18 @@
1
+ export declare const protobufPackage = "content.v1";
2
+ export interface SuccessResponse {
3
+ success: boolean;
4
+ }
5
+ export interface DeleteResponse {
6
+ success: boolean;
7
+ }
8
+ export interface PaginationRequest {
9
+ page: number;
10
+ limit: number;
11
+ }
12
+ export interface PaginationMeta {
13
+ totalItems: number;
14
+ totalPages: number;
15
+ currentPage: number;
16
+ perPage: number;
17
+ }
18
+ export declare const CONTENT_V1_PACKAGE_NAME = "content.v1";
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
3
+ // versions:
4
+ // protoc-gen-ts_proto v2.11.4
5
+ // protoc v3.21.12
6
+ // source: common_post.proto
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.CONTENT_V1_PACKAGE_NAME = exports.protobufPackage = void 0;
9
+ /* eslint-disable */
10
+ exports.protobufPackage = "content.v1";
11
+ exports.CONTENT_V1_PACKAGE_NAME = "content.v1";
@@ -0,0 +1,96 @@
1
+ import { Observable } from "rxjs";
2
+ import { PaginationMeta, PaginationRequest, SuccessResponse } from "./common_promo";
3
+ export declare const protobufPackage = "promo.v1";
4
+ export interface CouponResponse {
5
+ id: string;
6
+ promotionId: string;
7
+ code: string;
8
+ usageLimitTotal?: number | undefined;
9
+ usageLimitPerUser?: number | undefined;
10
+ usageCount: number;
11
+ isActive: boolean;
12
+ expiresAt?: string | undefined;
13
+ createdAt: string;
14
+ }
15
+ export interface GetCouponsRequest {
16
+ pagination: PaginationRequest | undefined;
17
+ promotionId?: string | undefined;
18
+ isActive?: boolean | undefined;
19
+ search?: string | undefined;
20
+ }
21
+ export interface GetCouponsResponse {
22
+ items: CouponResponse[];
23
+ meta: PaginationMeta | undefined;
24
+ }
25
+ export interface GetCouponRequest {
26
+ id: string;
27
+ code?: string | undefined;
28
+ }
29
+ export interface CreateCouponRequest {
30
+ promotionId: string;
31
+ code: string;
32
+ usageLimitTotal?: number | undefined;
33
+ usageLimitPerUser?: number | undefined;
34
+ expiresAt?: string | undefined;
35
+ isActive: boolean;
36
+ }
37
+ export interface UpdateCouponRequest {
38
+ id: string;
39
+ usageLimitTotal?: number | undefined;
40
+ usageLimitPerUser?: number | undefined;
41
+ expiresAt?: string | undefined;
42
+ isActive?: boolean | undefined;
43
+ }
44
+ export interface DeactivateCouponRequest {
45
+ id: string;
46
+ }
47
+ export interface GenerateCouponsRequest {
48
+ promotionId: string;
49
+ count: number;
50
+ prefix?: string | undefined;
51
+ randomLength?: number | undefined;
52
+ usageLimitPerUser?: number | undefined;
53
+ expiresAt?: string | undefined;
54
+ }
55
+ export interface GenerateCouponsResponse {
56
+ generated: number;
57
+ }
58
+ export interface ExportCouponsRequest {
59
+ promotionId: string;
60
+ activeOnly?: boolean | undefined;
61
+ }
62
+ export interface ExportCouponsResponse {
63
+ csvContent: string;
64
+ }
65
+ export interface ImportCouponsRequest {
66
+ promotionId: string;
67
+ csvContent: string;
68
+ }
69
+ export interface ImportCouponsResponse {
70
+ imported: number;
71
+ skipped: number;
72
+ errors: string[];
73
+ }
74
+ export declare const PROMO_V1_PACKAGE_NAME = "promo.v1";
75
+ export interface CouponServiceClient {
76
+ getCoupons(request: GetCouponsRequest): Observable<GetCouponsResponse>;
77
+ getCoupon(request: GetCouponRequest): Observable<CouponResponse>;
78
+ createCoupon(request: CreateCouponRequest): Observable<CouponResponse>;
79
+ updateCoupon(request: UpdateCouponRequest): Observable<CouponResponse>;
80
+ deactivateCoupon(request: DeactivateCouponRequest): Observable<SuccessResponse>;
81
+ generateCoupons(request: GenerateCouponsRequest): Observable<GenerateCouponsResponse>;
82
+ exportCoupons(request: ExportCouponsRequest): Observable<ExportCouponsResponse>;
83
+ importCoupons(request: ImportCouponsRequest): Observable<ImportCouponsResponse>;
84
+ }
85
+ export interface CouponServiceController {
86
+ getCoupons(request: GetCouponsRequest): Promise<GetCouponsResponse> | Observable<GetCouponsResponse> | GetCouponsResponse;
87
+ getCoupon(request: GetCouponRequest): Promise<CouponResponse> | Observable<CouponResponse> | CouponResponse;
88
+ createCoupon(request: CreateCouponRequest): Promise<CouponResponse> | Observable<CouponResponse> | CouponResponse;
89
+ updateCoupon(request: UpdateCouponRequest): Promise<CouponResponse> | Observable<CouponResponse> | CouponResponse;
90
+ deactivateCoupon(request: DeactivateCouponRequest): Promise<SuccessResponse> | Observable<SuccessResponse> | SuccessResponse;
91
+ generateCoupons(request: GenerateCouponsRequest): Promise<GenerateCouponsResponse> | Observable<GenerateCouponsResponse> | GenerateCouponsResponse;
92
+ exportCoupons(request: ExportCouponsRequest): Promise<ExportCouponsResponse> | Observable<ExportCouponsResponse> | ExportCouponsResponse;
93
+ importCoupons(request: ImportCouponsRequest): Promise<ImportCouponsResponse> | Observable<ImportCouponsResponse> | ImportCouponsResponse;
94
+ }
95
+ export declare function CouponServiceControllerMethods(): (constructor: Function) => void;
96
+ export declare const COUPON_SERVICE_NAME = "CouponService";
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
3
+ // versions:
4
+ // protoc-gen-ts_proto v2.11.4
5
+ // protoc v3.21.12
6
+ // source: coupon.proto
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.COUPON_SERVICE_NAME = exports.PROMO_V1_PACKAGE_NAME = exports.protobufPackage = void 0;
9
+ exports.CouponServiceControllerMethods = CouponServiceControllerMethods;
10
+ /* eslint-disable */
11
+ const microservices_1 = require("@nestjs/microservices");
12
+ exports.protobufPackage = "promo.v1";
13
+ exports.PROMO_V1_PACKAGE_NAME = "promo.v1";
14
+ function CouponServiceControllerMethods() {
15
+ return function (constructor) {
16
+ const grpcMethods = [
17
+ "getCoupons",
18
+ "getCoupon",
19
+ "createCoupon",
20
+ "updateCoupon",
21
+ "deactivateCoupon",
22
+ "generateCoupons",
23
+ "exportCoupons",
24
+ "importCoupons",
25
+ ];
26
+ for (const method of grpcMethods) {
27
+ const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
28
+ (0, microservices_1.GrpcMethod)("CouponService", method)(constructor.prototype[method], method, descriptor);
29
+ }
30
+ const grpcStreamMethods = [];
31
+ for (const method of grpcStreamMethods) {
32
+ const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
33
+ (0, microservices_1.GrpcStreamMethod)("CouponService", method)(constructor.prototype[method], method, descriptor);
34
+ }
35
+ };
36
+ }
37
+ exports.COUPON_SERVICE_NAME = "CouponService";
@@ -0,0 +1,304 @@
1
+ import { Observable } from "rxjs";
2
+ import { DeleteResponse, PaginationMeta, PaginationRequest, SuccessResponse } from "./common_post";
3
+ export declare const protobufPackage = "content.v1";
4
+ export declare enum PostType {
5
+ POST_TYPE_UNSPECIFIED = 0,
6
+ POST_TYPE_ARTICLE = 1,
7
+ POST_TYPE_NEWS = 2,
8
+ POST_TYPE_PAGE = 3,
9
+ UNRECOGNIZED = -1
10
+ }
11
+ export declare enum PostStatus {
12
+ POST_STATUS_UNSPECIFIED = 0,
13
+ POST_STATUS_DRAFT = 1,
14
+ POST_STATUS_SCHEDULED = 2,
15
+ POST_STATUS_PUBLISHED = 3,
16
+ POST_STATUS_ARCHIVED = 4,
17
+ UNRECOGNIZED = -1
18
+ }
19
+ export interface PostResponse {
20
+ id: string;
21
+ slug: string;
22
+ type: PostType;
23
+ status: PostStatus;
24
+ title: {
25
+ [key: string]: string;
26
+ };
27
+ excerpt: {
28
+ [key: string]: string;
29
+ };
30
+ content: {
31
+ [key: string]: string;
32
+ };
33
+ coverImage?: string | undefined;
34
+ coverImageId?: string | undefined;
35
+ publishedAt?: string | undefined;
36
+ readTime: number;
37
+ viewsCount: number;
38
+ commentsCount: number;
39
+ seoTitle: {
40
+ [key: string]: string;
41
+ };
42
+ seoDescription: {
43
+ [key: string]: string;
44
+ };
45
+ seoKeywords: {
46
+ [key: string]: string;
47
+ };
48
+ seoH1: {
49
+ [key: string]: string;
50
+ };
51
+ createdById: string;
52
+ createdAt: string;
53
+ updatedAt: string;
54
+ categories: PostCategoryItem[];
55
+ tags: PostTagItem[];
56
+ }
57
+ export interface PostResponse_TitleEntry {
58
+ key: string;
59
+ value: string;
60
+ }
61
+ export interface PostResponse_ExcerptEntry {
62
+ key: string;
63
+ value: string;
64
+ }
65
+ export interface PostResponse_ContentEntry {
66
+ key: string;
67
+ value: string;
68
+ }
69
+ export interface PostResponse_SeoTitleEntry {
70
+ key: string;
71
+ value: string;
72
+ }
73
+ export interface PostResponse_SeoDescriptionEntry {
74
+ key: string;
75
+ value: string;
76
+ }
77
+ export interface PostResponse_SeoKeywordsEntry {
78
+ key: string;
79
+ value: string;
80
+ }
81
+ export interface PostResponse_SeoH1Entry {
82
+ key: string;
83
+ value: string;
84
+ }
85
+ export interface PostCategoryItem {
86
+ id: string;
87
+ slug: string;
88
+ name: {
89
+ [key: string]: string;
90
+ };
91
+ }
92
+ export interface PostCategoryItem_NameEntry {
93
+ key: string;
94
+ value: string;
95
+ }
96
+ export interface PostTagItem {
97
+ id: string;
98
+ slug: string;
99
+ name: {
100
+ [key: string]: string;
101
+ };
102
+ }
103
+ export interface PostTagItem_NameEntry {
104
+ key: string;
105
+ value: string;
106
+ }
107
+ export interface PostListItem {
108
+ id: string;
109
+ slug: string;
110
+ type: PostType;
111
+ status: PostStatus;
112
+ title: {
113
+ [key: string]: string;
114
+ };
115
+ excerpt: {
116
+ [key: string]: string;
117
+ };
118
+ coverImage?: string | undefined;
119
+ publishedAt?: string | undefined;
120
+ readTime: number;
121
+ viewsCount: number;
122
+ commentsCount: number;
123
+ categories: PostCategoryItem[];
124
+ tags: PostTagItem[];
125
+ }
126
+ export interface PostListItem_TitleEntry {
127
+ key: string;
128
+ value: string;
129
+ }
130
+ export interface PostListItem_ExcerptEntry {
131
+ key: string;
132
+ value: string;
133
+ }
134
+ export interface GetPostsRequest {
135
+ pagination: PaginationRequest | undefined;
136
+ type?: PostType | undefined;
137
+ status?: PostStatus | undefined;
138
+ search?: string | undefined;
139
+ categoryId?: string | undefined;
140
+ tagId?: string | undefined;
141
+ dateFrom?: string | undefined;
142
+ dateTo?: string | undefined;
143
+ sortBy?: string | undefined;
144
+ }
145
+ export interface GetPostsResponse {
146
+ items: PostListItem[];
147
+ meta: PaginationMeta | undefined;
148
+ }
149
+ export interface GetPostRequest {
150
+ id: string;
151
+ slug?: string | undefined;
152
+ }
153
+ export interface CreatePostRequest {
154
+ type: PostType;
155
+ slug?: string | undefined;
156
+ title: {
157
+ [key: string]: string;
158
+ };
159
+ excerpt: {
160
+ [key: string]: string;
161
+ };
162
+ content: {
163
+ [key: string]: string;
164
+ };
165
+ coverImage?: string | undefined;
166
+ coverImageId?: string | undefined;
167
+ seoTitle: {
168
+ [key: string]: string;
169
+ };
170
+ seoDescription: {
171
+ [key: string]: string;
172
+ };
173
+ seoKeywords: {
174
+ [key: string]: string;
175
+ };
176
+ seoH1: {
177
+ [key: string]: string;
178
+ };
179
+ categoryIds: string[];
180
+ tagIds: string[];
181
+ createdById: string;
182
+ }
183
+ export interface CreatePostRequest_TitleEntry {
184
+ key: string;
185
+ value: string;
186
+ }
187
+ export interface CreatePostRequest_ExcerptEntry {
188
+ key: string;
189
+ value: string;
190
+ }
191
+ export interface CreatePostRequest_ContentEntry {
192
+ key: string;
193
+ value: string;
194
+ }
195
+ export interface CreatePostRequest_SeoTitleEntry {
196
+ key: string;
197
+ value: string;
198
+ }
199
+ export interface CreatePostRequest_SeoDescriptionEntry {
200
+ key: string;
201
+ value: string;
202
+ }
203
+ export interface CreatePostRequest_SeoKeywordsEntry {
204
+ key: string;
205
+ value: string;
206
+ }
207
+ export interface CreatePostRequest_SeoH1Entry {
208
+ key: string;
209
+ value: string;
210
+ }
211
+ export interface UpdatePostRequest {
212
+ id: string;
213
+ slug?: string | undefined;
214
+ title: {
215
+ [key: string]: string;
216
+ };
217
+ excerpt: {
218
+ [key: string]: string;
219
+ };
220
+ content: {
221
+ [key: string]: string;
222
+ };
223
+ coverImage?: string | undefined;
224
+ coverImageId?: string | undefined;
225
+ seoTitle: {
226
+ [key: string]: string;
227
+ };
228
+ seoDescription: {
229
+ [key: string]: string;
230
+ };
231
+ seoKeywords: {
232
+ [key: string]: string;
233
+ };
234
+ seoH1: {
235
+ [key: string]: string;
236
+ };
237
+ categoryIds: string[];
238
+ tagIds: string[];
239
+ updatedById: string;
240
+ }
241
+ export interface UpdatePostRequest_TitleEntry {
242
+ key: string;
243
+ value: string;
244
+ }
245
+ export interface UpdatePostRequest_ExcerptEntry {
246
+ key: string;
247
+ value: string;
248
+ }
249
+ export interface UpdatePostRequest_ContentEntry {
250
+ key: string;
251
+ value: string;
252
+ }
253
+ export interface UpdatePostRequest_SeoTitleEntry {
254
+ key: string;
255
+ value: string;
256
+ }
257
+ export interface UpdatePostRequest_SeoDescriptionEntry {
258
+ key: string;
259
+ value: string;
260
+ }
261
+ export interface UpdatePostRequest_SeoKeywordsEntry {
262
+ key: string;
263
+ value: string;
264
+ }
265
+ export interface UpdatePostRequest_SeoH1Entry {
266
+ key: string;
267
+ value: string;
268
+ }
269
+ export interface DeletePostRequest {
270
+ id: string;
271
+ }
272
+ export interface PostIdRequest {
273
+ id: string;
274
+ }
275
+ export interface SchedulePostRequest {
276
+ id: string;
277
+ publishAt: string;
278
+ updatedById: string;
279
+ }
280
+ export declare const CONTENT_V1_PACKAGE_NAME = "content.v1";
281
+ export interface PostServiceClient {
282
+ getPosts(request: GetPostsRequest): Observable<GetPostsResponse>;
283
+ getPost(request: GetPostRequest): Observable<PostResponse>;
284
+ createPost(request: CreatePostRequest): Observable<PostResponse>;
285
+ updatePost(request: UpdatePostRequest): Observable<PostResponse>;
286
+ deletePost(request: DeletePostRequest): Observable<DeleteResponse>;
287
+ publishPost(request: PostIdRequest): Observable<PostResponse>;
288
+ schedulePost(request: SchedulePostRequest): Observable<PostResponse>;
289
+ archivePost(request: PostIdRequest): Observable<PostResponse>;
290
+ incrementViews(request: PostIdRequest): Observable<SuccessResponse>;
291
+ }
292
+ export interface PostServiceController {
293
+ getPosts(request: GetPostsRequest): Promise<GetPostsResponse> | Observable<GetPostsResponse> | GetPostsResponse;
294
+ getPost(request: GetPostRequest): Promise<PostResponse> | Observable<PostResponse> | PostResponse;
295
+ createPost(request: CreatePostRequest): Promise<PostResponse> | Observable<PostResponse> | PostResponse;
296
+ updatePost(request: UpdatePostRequest): Promise<PostResponse> | Observable<PostResponse> | PostResponse;
297
+ deletePost(request: DeletePostRequest): Promise<DeleteResponse> | Observable<DeleteResponse> | DeleteResponse;
298
+ publishPost(request: PostIdRequest): Promise<PostResponse> | Observable<PostResponse> | PostResponse;
299
+ schedulePost(request: SchedulePostRequest): Promise<PostResponse> | Observable<PostResponse> | PostResponse;
300
+ archivePost(request: PostIdRequest): Promise<PostResponse> | Observable<PostResponse> | PostResponse;
301
+ incrementViews(request: PostIdRequest): Promise<SuccessResponse> | Observable<SuccessResponse> | SuccessResponse;
302
+ }
303
+ export declare function PostServiceControllerMethods(): (constructor: Function) => void;
304
+ export declare const POST_SERVICE_NAME = "PostService";
@@ -0,0 +1,55 @@
1
+ "use strict";
2
+ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
3
+ // versions:
4
+ // protoc-gen-ts_proto v2.11.4
5
+ // protoc v3.21.12
6
+ // source: post.proto
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.POST_SERVICE_NAME = exports.CONTENT_V1_PACKAGE_NAME = exports.PostStatus = exports.PostType = exports.protobufPackage = void 0;
9
+ exports.PostServiceControllerMethods = PostServiceControllerMethods;
10
+ /* eslint-disable */
11
+ const microservices_1 = require("@nestjs/microservices");
12
+ exports.protobufPackage = "content.v1";
13
+ var PostType;
14
+ (function (PostType) {
15
+ PostType[PostType["POST_TYPE_UNSPECIFIED"] = 0] = "POST_TYPE_UNSPECIFIED";
16
+ PostType[PostType["POST_TYPE_ARTICLE"] = 1] = "POST_TYPE_ARTICLE";
17
+ PostType[PostType["POST_TYPE_NEWS"] = 2] = "POST_TYPE_NEWS";
18
+ PostType[PostType["POST_TYPE_PAGE"] = 3] = "POST_TYPE_PAGE";
19
+ PostType[PostType["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
20
+ })(PostType || (exports.PostType = PostType = {}));
21
+ var PostStatus;
22
+ (function (PostStatus) {
23
+ PostStatus[PostStatus["POST_STATUS_UNSPECIFIED"] = 0] = "POST_STATUS_UNSPECIFIED";
24
+ PostStatus[PostStatus["POST_STATUS_DRAFT"] = 1] = "POST_STATUS_DRAFT";
25
+ PostStatus[PostStatus["POST_STATUS_SCHEDULED"] = 2] = "POST_STATUS_SCHEDULED";
26
+ PostStatus[PostStatus["POST_STATUS_PUBLISHED"] = 3] = "POST_STATUS_PUBLISHED";
27
+ PostStatus[PostStatus["POST_STATUS_ARCHIVED"] = 4] = "POST_STATUS_ARCHIVED";
28
+ PostStatus[PostStatus["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
29
+ })(PostStatus || (exports.PostStatus = PostStatus = {}));
30
+ exports.CONTENT_V1_PACKAGE_NAME = "content.v1";
31
+ function PostServiceControllerMethods() {
32
+ return function (constructor) {
33
+ const grpcMethods = [
34
+ "getPosts",
35
+ "getPost",
36
+ "createPost",
37
+ "updatePost",
38
+ "deletePost",
39
+ "publishPost",
40
+ "schedulePost",
41
+ "archivePost",
42
+ "incrementViews",
43
+ ];
44
+ for (const method of grpcMethods) {
45
+ const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
46
+ (0, microservices_1.GrpcMethod)("PostService", method)(constructor.prototype[method], method, descriptor);
47
+ }
48
+ const grpcStreamMethods = [];
49
+ for (const method of grpcStreamMethods) {
50
+ const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
51
+ (0, microservices_1.GrpcStreamMethod)("PostService", method)(constructor.prototype[method], method, descriptor);
52
+ }
53
+ };
54
+ }
55
+ exports.POST_SERVICE_NAME = "PostService";