@mamindom/contracts 1.0.118 → 1.0.119
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/faq.d.ts +213 -0
- package/dist/gen/faq.js +52 -0
- package/dist/gen/page.d.ts +191 -0
- package/dist/gen/page.js +44 -0
- package/dist/proto/faq.proto +186 -0
- package/dist/proto/page.proto +120 -0
- package/dist/src/proto/paths.d.ts +2 -0
- package/dist/src/proto/paths.js +3 -1
- package/gen/faq.ts +324 -0
- package/gen/page.ts +232 -0
- package/package.json +1 -1
- package/proto/faq.proto +186 -0
- package/proto/page.proto +120 -0
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package content.v1;
|
|
4
|
+
|
|
5
|
+
import "common_post.proto";
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
service PageService {
|
|
9
|
+
rpc GetPage (GetPageRequest) returns (PageResponse);
|
|
10
|
+
rpc GetPageById (PageIdRequest) returns (PageResponse);
|
|
11
|
+
rpc GetPages (GetPagesRequest) returns (GetPagesResponse);
|
|
12
|
+
rpc CreatePage (CreatePageRequest) returns (PageResponse);
|
|
13
|
+
rpc UpdatePage (UpdatePageRequest) returns (PageResponse);
|
|
14
|
+
rpc DeletePage (PageIdRequest) returns (DeleteResponse);
|
|
15
|
+
rpc PublishPage (PublishPageRequest) returns (PageResponse);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
enum PageStatus {
|
|
20
|
+
PAGE_STATUS_UNSPECIFIED = 0;
|
|
21
|
+
PAGE_STATUS_DRAFT = 1;
|
|
22
|
+
PAGE_STATUS_PUBLISHED = 2;
|
|
23
|
+
PAGE_STATUS_ARCHIVED = 3;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
message PageResponse {
|
|
28
|
+
string id = 1;
|
|
29
|
+
string slug = 2;
|
|
30
|
+
PageStatus status = 3;
|
|
31
|
+
|
|
32
|
+
map<string, string> title = 4;
|
|
33
|
+
|
|
34
|
+
// PageBlock[] serialized as JSON-string. ts-proto without oneofs
|
|
35
|
+
// turns discriminated unions into a soup of optional fields; keep
|
|
36
|
+
// the typed union on the gateway side via zod instead.
|
|
37
|
+
string blocks_json = 5;
|
|
38
|
+
|
|
39
|
+
optional string cover_image = 6;
|
|
40
|
+
optional string cover_image_id = 7;
|
|
41
|
+
|
|
42
|
+
map<string, string> seo_title = 8;
|
|
43
|
+
map<string, string> seo_description = 9;
|
|
44
|
+
map<string, string> seo_keywords = 10;
|
|
45
|
+
map<string, string> seo_h1 = 11;
|
|
46
|
+
|
|
47
|
+
optional string published_at = 12;
|
|
48
|
+
|
|
49
|
+
string created_by_id = 13;
|
|
50
|
+
string created_at = 14;
|
|
51
|
+
string updated_at = 15;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
message PageIdRequest {
|
|
56
|
+
string id = 1;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
message GetPageRequest {
|
|
60
|
+
string slug = 1;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
message GetPagesRequest {
|
|
64
|
+
optional PageStatus status = 1;
|
|
65
|
+
optional string search = 2;
|
|
66
|
+
PaginationRequest pagination = 3;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
message GetPagesResponse {
|
|
70
|
+
repeated PageResponse items = 1;
|
|
71
|
+
PaginationMeta meta = 2;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
message CreatePageRequest {
|
|
76
|
+
string slug = 1;
|
|
77
|
+
PageStatus status = 2;
|
|
78
|
+
|
|
79
|
+
map<string, string> title = 3;
|
|
80
|
+
string blocks_json = 4;
|
|
81
|
+
|
|
82
|
+
optional string cover_image = 5;
|
|
83
|
+
optional string cover_image_id = 6;
|
|
84
|
+
|
|
85
|
+
map<string, string> seo_title = 7;
|
|
86
|
+
map<string, string> seo_description = 8;
|
|
87
|
+
map<string, string> seo_keywords = 9;
|
|
88
|
+
map<string, string> seo_h1 = 10;
|
|
89
|
+
|
|
90
|
+
string created_by_id = 11;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
message UpdatePageRequest {
|
|
95
|
+
string id = 1;
|
|
96
|
+
|
|
97
|
+
optional string slug = 2;
|
|
98
|
+
optional PageStatus status = 3;
|
|
99
|
+
|
|
100
|
+
map<string, string> title = 4;
|
|
101
|
+
optional string blocks_json = 5;
|
|
102
|
+
|
|
103
|
+
optional string cover_image = 6;
|
|
104
|
+
optional string cover_image_id = 7;
|
|
105
|
+
bool clear_cover_image = 8;
|
|
106
|
+
|
|
107
|
+
map<string, string> seo_title = 9;
|
|
108
|
+
map<string, string> seo_description = 10;
|
|
109
|
+
map<string, string> seo_keywords = 11;
|
|
110
|
+
map<string, string> seo_h1 = 12;
|
|
111
|
+
|
|
112
|
+
string updated_by_id = 13;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
message PublishPageRequest {
|
|
117
|
+
string id = 1;
|
|
118
|
+
bool publish = 2;
|
|
119
|
+
string updated_by_id = 3;
|
|
120
|
+
}
|
package/dist/src/proto/paths.js
CHANGED
|
@@ -29,5 +29,7 @@ exports.PROTO_PATHS = {
|
|
|
29
29
|
POST_COMMENT: (0, node_path_1.join)(__dirname, '../../proto/post_comment.proto'),
|
|
30
30
|
POST_TAG: (0, node_path_1.join)(__dirname, '../../proto/post_tag.proto'),
|
|
31
31
|
POST_VERSION: (0, node_path_1.join)(__dirname, '../../proto/post_version.proto'),
|
|
32
|
-
BANNER: (0, node_path_1.join)(__dirname, '../../proto/banner.proto')
|
|
32
|
+
BANNER: (0, node_path_1.join)(__dirname, '../../proto/banner.proto'),
|
|
33
|
+
FAQ: (0, node_path_1.join)(__dirname, '../../proto/faq.proto'),
|
|
34
|
+
PAGE: (0, node_path_1.join)(__dirname, '../../proto/page.proto')
|
|
33
35
|
};
|
package/gen/faq.ts
ADDED
|
@@ -0,0 +1,324 @@
|
|
|
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: faq.proto
|
|
6
|
+
|
|
7
|
+
/* eslint-disable */
|
|
8
|
+
import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices";
|
|
9
|
+
import { Observable } from "rxjs";
|
|
10
|
+
import { DeleteResponse, PaginationMeta, PaginationRequest, SuccessResponse } from "./common_post";
|
|
11
|
+
|
|
12
|
+
export const protobufPackage = "content.v1";
|
|
13
|
+
|
|
14
|
+
export enum FaqStatus {
|
|
15
|
+
FAQ_STATUS_UNSPECIFIED = 0,
|
|
16
|
+
FAQ_STATUS_DRAFT = 1,
|
|
17
|
+
FAQ_STATUS_PUBLISHED = 2,
|
|
18
|
+
FAQ_STATUS_ARCHIVED = 3,
|
|
19
|
+
UNRECOGNIZED = -1,
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export interface FaqCategoryResponse {
|
|
23
|
+
id: string;
|
|
24
|
+
slug: string;
|
|
25
|
+
title: { [key: string]: string };
|
|
26
|
+
icon?: string | undefined;
|
|
27
|
+
sortOrder: number;
|
|
28
|
+
status: FaqStatus;
|
|
29
|
+
itemsCount: number;
|
|
30
|
+
createdAt: string;
|
|
31
|
+
updatedAt: string;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export interface FaqCategoryResponse_TitleEntry {
|
|
35
|
+
key: string;
|
|
36
|
+
value: string;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export interface FaqItemResponse {
|
|
40
|
+
id: string;
|
|
41
|
+
categoryId: string;
|
|
42
|
+
question: { [key: string]: string };
|
|
43
|
+
answer: { [key: string]: string };
|
|
44
|
+
isPopular: boolean;
|
|
45
|
+
sortOrder: number;
|
|
46
|
+
status: FaqStatus;
|
|
47
|
+
createdAt: string;
|
|
48
|
+
updatedAt: string;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export interface FaqItemResponse_QuestionEntry {
|
|
52
|
+
key: string;
|
|
53
|
+
value: string;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export interface FaqItemResponse_AnswerEntry {
|
|
57
|
+
key: string;
|
|
58
|
+
value: string;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export interface FaqCategoryWithItems {
|
|
62
|
+
category: FaqCategoryResponse | undefined;
|
|
63
|
+
items: FaqItemResponse[];
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export interface GetFaqStorefrontRequest {
|
|
67
|
+
popularLimit?: number | undefined;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export interface GetFaqStorefrontResponse {
|
|
71
|
+
popular: FaqItemResponse[];
|
|
72
|
+
categories: FaqCategoryWithItems[];
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export interface SearchFaqRequest {
|
|
76
|
+
query: string;
|
|
77
|
+
limit?: number | undefined;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export interface SearchFaqResponse {
|
|
81
|
+
items: FaqItemResponse[];
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export interface FaqCategoryIdRequest {
|
|
85
|
+
id: string;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export interface GetFaqCategoriesRequest {
|
|
89
|
+
status?: FaqStatus | undefined;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
export interface GetFaqCategoriesResponse {
|
|
93
|
+
items: FaqCategoryResponse[];
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export interface CreateFaqCategoryRequest {
|
|
97
|
+
slug: string;
|
|
98
|
+
title: { [key: string]: string };
|
|
99
|
+
icon?: string | undefined;
|
|
100
|
+
sortOrder: number;
|
|
101
|
+
status: FaqStatus;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
export interface CreateFaqCategoryRequest_TitleEntry {
|
|
105
|
+
key: string;
|
|
106
|
+
value: string;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
export interface UpdateFaqCategoryRequest {
|
|
110
|
+
id: string;
|
|
111
|
+
slug?: string | undefined;
|
|
112
|
+
title: { [key: string]: string };
|
|
113
|
+
icon?: string | undefined;
|
|
114
|
+
sortOrder?: number | undefined;
|
|
115
|
+
status?: FaqStatus | undefined;
|
|
116
|
+
clearIcon: boolean;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
export interface UpdateFaqCategoryRequest_TitleEntry {
|
|
120
|
+
key: string;
|
|
121
|
+
value: string;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
export interface FaqItemIdRequest {
|
|
125
|
+
id: string;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
export interface GetFaqItemsRequest {
|
|
129
|
+
categoryId?: string | undefined;
|
|
130
|
+
status?: FaqStatus | undefined;
|
|
131
|
+
search?: string | undefined;
|
|
132
|
+
pagination: PaginationRequest | undefined;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
export interface GetFaqItemsResponse {
|
|
136
|
+
items: FaqItemResponse[];
|
|
137
|
+
meta: PaginationMeta | undefined;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
export interface CreateFaqItemRequest {
|
|
141
|
+
categoryId: string;
|
|
142
|
+
question: { [key: string]: string };
|
|
143
|
+
answer: { [key: string]: string };
|
|
144
|
+
isPopular: boolean;
|
|
145
|
+
sortOrder: number;
|
|
146
|
+
status: FaqStatus;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
export interface CreateFaqItemRequest_QuestionEntry {
|
|
150
|
+
key: string;
|
|
151
|
+
value: string;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
export interface CreateFaqItemRequest_AnswerEntry {
|
|
155
|
+
key: string;
|
|
156
|
+
value: string;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
export interface UpdateFaqItemRequest {
|
|
160
|
+
id: string;
|
|
161
|
+
categoryId?: string | undefined;
|
|
162
|
+
question: { [key: string]: string };
|
|
163
|
+
answer: { [key: string]: string };
|
|
164
|
+
isPopular?: boolean | undefined;
|
|
165
|
+
sortOrder?: number | undefined;
|
|
166
|
+
status?: FaqStatus | undefined;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
export interface UpdateFaqItemRequest_QuestionEntry {
|
|
170
|
+
key: string;
|
|
171
|
+
value: string;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
export interface UpdateFaqItemRequest_AnswerEntry {
|
|
175
|
+
key: string;
|
|
176
|
+
value: string;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
export interface FaqSortEntry {
|
|
180
|
+
id: string;
|
|
181
|
+
sortOrder: number;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
export interface ReorderFaqRequest {
|
|
185
|
+
items: FaqSortEntry[];
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
export interface BulkSetPopularFaqRequest {
|
|
189
|
+
ids: string[];
|
|
190
|
+
popular: boolean;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
export const CONTENT_V1_PACKAGE_NAME = "content.v1";
|
|
194
|
+
|
|
195
|
+
export interface FaqServiceClient {
|
|
196
|
+
/** Storefront */
|
|
197
|
+
|
|
198
|
+
getFaqStorefront(request: GetFaqStorefrontRequest): Observable<GetFaqStorefrontResponse>;
|
|
199
|
+
|
|
200
|
+
searchFaq(request: SearchFaqRequest): Observable<SearchFaqResponse>;
|
|
201
|
+
|
|
202
|
+
/** Admin — categories */
|
|
203
|
+
|
|
204
|
+
getFaqCategories(request: GetFaqCategoriesRequest): Observable<GetFaqCategoriesResponse>;
|
|
205
|
+
|
|
206
|
+
getFaqCategory(request: FaqCategoryIdRequest): Observable<FaqCategoryResponse>;
|
|
207
|
+
|
|
208
|
+
createFaqCategory(request: CreateFaqCategoryRequest): Observable<FaqCategoryResponse>;
|
|
209
|
+
|
|
210
|
+
updateFaqCategory(request: UpdateFaqCategoryRequest): Observable<FaqCategoryResponse>;
|
|
211
|
+
|
|
212
|
+
deleteFaqCategory(request: FaqCategoryIdRequest): Observable<DeleteResponse>;
|
|
213
|
+
|
|
214
|
+
reorderFaqCategories(request: ReorderFaqRequest): Observable<SuccessResponse>;
|
|
215
|
+
|
|
216
|
+
/** Admin — items */
|
|
217
|
+
|
|
218
|
+
getFaqItems(request: GetFaqItemsRequest): Observable<GetFaqItemsResponse>;
|
|
219
|
+
|
|
220
|
+
getFaqItem(request: FaqItemIdRequest): Observable<FaqItemResponse>;
|
|
221
|
+
|
|
222
|
+
createFaqItem(request: CreateFaqItemRequest): Observable<FaqItemResponse>;
|
|
223
|
+
|
|
224
|
+
updateFaqItem(request: UpdateFaqItemRequest): Observable<FaqItemResponse>;
|
|
225
|
+
|
|
226
|
+
deleteFaqItem(request: FaqItemIdRequest): Observable<DeleteResponse>;
|
|
227
|
+
|
|
228
|
+
reorderFaqItems(request: ReorderFaqRequest): Observable<SuccessResponse>;
|
|
229
|
+
|
|
230
|
+
bulkSetPopular(request: BulkSetPopularFaqRequest): Observable<SuccessResponse>;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
export interface FaqServiceController {
|
|
234
|
+
/** Storefront */
|
|
235
|
+
|
|
236
|
+
getFaqStorefront(
|
|
237
|
+
request: GetFaqStorefrontRequest,
|
|
238
|
+
): Promise<GetFaqStorefrontResponse> | Observable<GetFaqStorefrontResponse> | GetFaqStorefrontResponse;
|
|
239
|
+
|
|
240
|
+
searchFaq(request: SearchFaqRequest): Promise<SearchFaqResponse> | Observable<SearchFaqResponse> | SearchFaqResponse;
|
|
241
|
+
|
|
242
|
+
/** Admin — categories */
|
|
243
|
+
|
|
244
|
+
getFaqCategories(
|
|
245
|
+
request: GetFaqCategoriesRequest,
|
|
246
|
+
): Promise<GetFaqCategoriesResponse> | Observable<GetFaqCategoriesResponse> | GetFaqCategoriesResponse;
|
|
247
|
+
|
|
248
|
+
getFaqCategory(
|
|
249
|
+
request: FaqCategoryIdRequest,
|
|
250
|
+
): Promise<FaqCategoryResponse> | Observable<FaqCategoryResponse> | FaqCategoryResponse;
|
|
251
|
+
|
|
252
|
+
createFaqCategory(
|
|
253
|
+
request: CreateFaqCategoryRequest,
|
|
254
|
+
): Promise<FaqCategoryResponse> | Observable<FaqCategoryResponse> | FaqCategoryResponse;
|
|
255
|
+
|
|
256
|
+
updateFaqCategory(
|
|
257
|
+
request: UpdateFaqCategoryRequest,
|
|
258
|
+
): Promise<FaqCategoryResponse> | Observable<FaqCategoryResponse> | FaqCategoryResponse;
|
|
259
|
+
|
|
260
|
+
deleteFaqCategory(
|
|
261
|
+
request: FaqCategoryIdRequest,
|
|
262
|
+
): Promise<DeleteResponse> | Observable<DeleteResponse> | DeleteResponse;
|
|
263
|
+
|
|
264
|
+
reorderFaqCategories(
|
|
265
|
+
request: ReorderFaqRequest,
|
|
266
|
+
): Promise<SuccessResponse> | Observable<SuccessResponse> | SuccessResponse;
|
|
267
|
+
|
|
268
|
+
/** Admin — items */
|
|
269
|
+
|
|
270
|
+
getFaqItems(
|
|
271
|
+
request: GetFaqItemsRequest,
|
|
272
|
+
): Promise<GetFaqItemsResponse> | Observable<GetFaqItemsResponse> | GetFaqItemsResponse;
|
|
273
|
+
|
|
274
|
+
getFaqItem(request: FaqItemIdRequest): Promise<FaqItemResponse> | Observable<FaqItemResponse> | FaqItemResponse;
|
|
275
|
+
|
|
276
|
+
createFaqItem(
|
|
277
|
+
request: CreateFaqItemRequest,
|
|
278
|
+
): Promise<FaqItemResponse> | Observable<FaqItemResponse> | FaqItemResponse;
|
|
279
|
+
|
|
280
|
+
updateFaqItem(
|
|
281
|
+
request: UpdateFaqItemRequest,
|
|
282
|
+
): Promise<FaqItemResponse> | Observable<FaqItemResponse> | FaqItemResponse;
|
|
283
|
+
|
|
284
|
+
deleteFaqItem(request: FaqItemIdRequest): Promise<DeleteResponse> | Observable<DeleteResponse> | DeleteResponse;
|
|
285
|
+
|
|
286
|
+
reorderFaqItems(request: ReorderFaqRequest): Promise<SuccessResponse> | Observable<SuccessResponse> | SuccessResponse;
|
|
287
|
+
|
|
288
|
+
bulkSetPopular(
|
|
289
|
+
request: BulkSetPopularFaqRequest,
|
|
290
|
+
): Promise<SuccessResponse> | Observable<SuccessResponse> | SuccessResponse;
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
export function FaqServiceControllerMethods() {
|
|
294
|
+
return function (constructor: Function) {
|
|
295
|
+
const grpcMethods: string[] = [
|
|
296
|
+
"getFaqStorefront",
|
|
297
|
+
"searchFaq",
|
|
298
|
+
"getFaqCategories",
|
|
299
|
+
"getFaqCategory",
|
|
300
|
+
"createFaqCategory",
|
|
301
|
+
"updateFaqCategory",
|
|
302
|
+
"deleteFaqCategory",
|
|
303
|
+
"reorderFaqCategories",
|
|
304
|
+
"getFaqItems",
|
|
305
|
+
"getFaqItem",
|
|
306
|
+
"createFaqItem",
|
|
307
|
+
"updateFaqItem",
|
|
308
|
+
"deleteFaqItem",
|
|
309
|
+
"reorderFaqItems",
|
|
310
|
+
"bulkSetPopular",
|
|
311
|
+
];
|
|
312
|
+
for (const method of grpcMethods) {
|
|
313
|
+
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
314
|
+
GrpcMethod("FaqService", method)(constructor.prototype[method], method, descriptor);
|
|
315
|
+
}
|
|
316
|
+
const grpcStreamMethods: string[] = [];
|
|
317
|
+
for (const method of grpcStreamMethods) {
|
|
318
|
+
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
319
|
+
GrpcStreamMethod("FaqService", method)(constructor.prototype[method], method, descriptor);
|
|
320
|
+
}
|
|
321
|
+
};
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
export const FAQ_SERVICE_NAME = "FaqService";
|
package/gen/page.ts
ADDED
|
@@ -0,0 +1,232 @@
|
|
|
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: page.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 PageStatus {
|
|
15
|
+
PAGE_STATUS_UNSPECIFIED = 0,
|
|
16
|
+
PAGE_STATUS_DRAFT = 1,
|
|
17
|
+
PAGE_STATUS_PUBLISHED = 2,
|
|
18
|
+
PAGE_STATUS_ARCHIVED = 3,
|
|
19
|
+
UNRECOGNIZED = -1,
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export interface PageResponse {
|
|
23
|
+
id: string;
|
|
24
|
+
slug: string;
|
|
25
|
+
status: PageStatus;
|
|
26
|
+
title: { [key: string]: string };
|
|
27
|
+
/**
|
|
28
|
+
* PageBlock[] serialized as JSON-string. ts-proto without oneofs
|
|
29
|
+
* turns discriminated unions into a soup of optional fields; keep
|
|
30
|
+
* the typed union on the gateway side via zod instead.
|
|
31
|
+
*/
|
|
32
|
+
blocksJson: string;
|
|
33
|
+
coverImage?: string | undefined;
|
|
34
|
+
coverImageId?: string | undefined;
|
|
35
|
+
seoTitle: { [key: string]: string };
|
|
36
|
+
seoDescription: { [key: string]: string };
|
|
37
|
+
seoKeywords: { [key: string]: string };
|
|
38
|
+
seoH1: { [key: string]: string };
|
|
39
|
+
publishedAt?: string | undefined;
|
|
40
|
+
createdById: string;
|
|
41
|
+
createdAt: string;
|
|
42
|
+
updatedAt: string;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export interface PageResponse_TitleEntry {
|
|
46
|
+
key: string;
|
|
47
|
+
value: string;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export interface PageResponse_SeoTitleEntry {
|
|
51
|
+
key: string;
|
|
52
|
+
value: string;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export interface PageResponse_SeoDescriptionEntry {
|
|
56
|
+
key: string;
|
|
57
|
+
value: string;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export interface PageResponse_SeoKeywordsEntry {
|
|
61
|
+
key: string;
|
|
62
|
+
value: string;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export interface PageResponse_SeoH1Entry {
|
|
66
|
+
key: string;
|
|
67
|
+
value: string;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export interface PageIdRequest {
|
|
71
|
+
id: string;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export interface GetPageRequest {
|
|
75
|
+
slug: string;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export interface GetPagesRequest {
|
|
79
|
+
status?: PageStatus | undefined;
|
|
80
|
+
search?: string | undefined;
|
|
81
|
+
pagination: PaginationRequest | undefined;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export interface GetPagesResponse {
|
|
85
|
+
items: PageResponse[];
|
|
86
|
+
meta: PaginationMeta | undefined;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export interface CreatePageRequest {
|
|
90
|
+
slug: string;
|
|
91
|
+
status: PageStatus;
|
|
92
|
+
title: { [key: string]: string };
|
|
93
|
+
blocksJson: string;
|
|
94
|
+
coverImage?: string | undefined;
|
|
95
|
+
coverImageId?: string | undefined;
|
|
96
|
+
seoTitle: { [key: string]: string };
|
|
97
|
+
seoDescription: { [key: string]: string };
|
|
98
|
+
seoKeywords: { [key: string]: string };
|
|
99
|
+
seoH1: { [key: string]: string };
|
|
100
|
+
createdById: string;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
export interface CreatePageRequest_TitleEntry {
|
|
104
|
+
key: string;
|
|
105
|
+
value: string;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
export interface CreatePageRequest_SeoTitleEntry {
|
|
109
|
+
key: string;
|
|
110
|
+
value: string;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
export interface CreatePageRequest_SeoDescriptionEntry {
|
|
114
|
+
key: string;
|
|
115
|
+
value: string;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
export interface CreatePageRequest_SeoKeywordsEntry {
|
|
119
|
+
key: string;
|
|
120
|
+
value: string;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
export interface CreatePageRequest_SeoH1Entry {
|
|
124
|
+
key: string;
|
|
125
|
+
value: string;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
export interface UpdatePageRequest {
|
|
129
|
+
id: string;
|
|
130
|
+
slug?: string | undefined;
|
|
131
|
+
status?: PageStatus | undefined;
|
|
132
|
+
title: { [key: string]: string };
|
|
133
|
+
blocksJson?: string | undefined;
|
|
134
|
+
coverImage?: string | undefined;
|
|
135
|
+
coverImageId?: string | undefined;
|
|
136
|
+
clearCoverImage: boolean;
|
|
137
|
+
seoTitle: { [key: string]: string };
|
|
138
|
+
seoDescription: { [key: string]: string };
|
|
139
|
+
seoKeywords: { [key: string]: string };
|
|
140
|
+
seoH1: { [key: string]: string };
|
|
141
|
+
updatedById: string;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
export interface UpdatePageRequest_TitleEntry {
|
|
145
|
+
key: string;
|
|
146
|
+
value: string;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
export interface UpdatePageRequest_SeoTitleEntry {
|
|
150
|
+
key: string;
|
|
151
|
+
value: string;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
export interface UpdatePageRequest_SeoDescriptionEntry {
|
|
155
|
+
key: string;
|
|
156
|
+
value: string;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
export interface UpdatePageRequest_SeoKeywordsEntry {
|
|
160
|
+
key: string;
|
|
161
|
+
value: string;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
export interface UpdatePageRequest_SeoH1Entry {
|
|
165
|
+
key: string;
|
|
166
|
+
value: string;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
export interface PublishPageRequest {
|
|
170
|
+
id: string;
|
|
171
|
+
publish: boolean;
|
|
172
|
+
updatedById: string;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
export const CONTENT_V1_PACKAGE_NAME = "content.v1";
|
|
176
|
+
|
|
177
|
+
export interface PageServiceClient {
|
|
178
|
+
getPage(request: GetPageRequest): Observable<PageResponse>;
|
|
179
|
+
|
|
180
|
+
getPageById(request: PageIdRequest): Observable<PageResponse>;
|
|
181
|
+
|
|
182
|
+
getPages(request: GetPagesRequest): Observable<GetPagesResponse>;
|
|
183
|
+
|
|
184
|
+
createPage(request: CreatePageRequest): Observable<PageResponse>;
|
|
185
|
+
|
|
186
|
+
updatePage(request: UpdatePageRequest): Observable<PageResponse>;
|
|
187
|
+
|
|
188
|
+
deletePage(request: PageIdRequest): Observable<DeleteResponse>;
|
|
189
|
+
|
|
190
|
+
publishPage(request: PublishPageRequest): Observable<PageResponse>;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
export interface PageServiceController {
|
|
194
|
+
getPage(request: GetPageRequest): Promise<PageResponse> | Observable<PageResponse> | PageResponse;
|
|
195
|
+
|
|
196
|
+
getPageById(request: PageIdRequest): Promise<PageResponse> | Observable<PageResponse> | PageResponse;
|
|
197
|
+
|
|
198
|
+
getPages(request: GetPagesRequest): Promise<GetPagesResponse> | Observable<GetPagesResponse> | GetPagesResponse;
|
|
199
|
+
|
|
200
|
+
createPage(request: CreatePageRequest): Promise<PageResponse> | Observable<PageResponse> | PageResponse;
|
|
201
|
+
|
|
202
|
+
updatePage(request: UpdatePageRequest): Promise<PageResponse> | Observable<PageResponse> | PageResponse;
|
|
203
|
+
|
|
204
|
+
deletePage(request: PageIdRequest): Promise<DeleteResponse> | Observable<DeleteResponse> | DeleteResponse;
|
|
205
|
+
|
|
206
|
+
publishPage(request: PublishPageRequest): Promise<PageResponse> | Observable<PageResponse> | PageResponse;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
export function PageServiceControllerMethods() {
|
|
210
|
+
return function (constructor: Function) {
|
|
211
|
+
const grpcMethods: string[] = [
|
|
212
|
+
"getPage",
|
|
213
|
+
"getPageById",
|
|
214
|
+
"getPages",
|
|
215
|
+
"createPage",
|
|
216
|
+
"updatePage",
|
|
217
|
+
"deletePage",
|
|
218
|
+
"publishPage",
|
|
219
|
+
];
|
|
220
|
+
for (const method of grpcMethods) {
|
|
221
|
+
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
222
|
+
GrpcMethod("PageService", method)(constructor.prototype[method], method, descriptor);
|
|
223
|
+
}
|
|
224
|
+
const grpcStreamMethods: string[] = [];
|
|
225
|
+
for (const method of grpcStreamMethods) {
|
|
226
|
+
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
227
|
+
GrpcStreamMethod("PageService", method)(constructor.prototype[method], method, descriptor);
|
|
228
|
+
}
|
|
229
|
+
};
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
export const PAGE_SERVICE_NAME = "PageService";
|