@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
package/proto/faq.proto
ADDED
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package content.v1;
|
|
4
|
+
|
|
5
|
+
import "common_post.proto";
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
service FaqService {
|
|
9
|
+
// Storefront
|
|
10
|
+
rpc GetFaqStorefront (GetFaqStorefrontRequest) returns (GetFaqStorefrontResponse);
|
|
11
|
+
rpc SearchFaq (SearchFaqRequest) returns (SearchFaqResponse);
|
|
12
|
+
|
|
13
|
+
// Admin — categories
|
|
14
|
+
rpc GetFaqCategories (GetFaqCategoriesRequest) returns (GetFaqCategoriesResponse);
|
|
15
|
+
rpc GetFaqCategory (FaqCategoryIdRequest) returns (FaqCategoryResponse);
|
|
16
|
+
rpc CreateFaqCategory (CreateFaqCategoryRequest) returns (FaqCategoryResponse);
|
|
17
|
+
rpc UpdateFaqCategory (UpdateFaqCategoryRequest) returns (FaqCategoryResponse);
|
|
18
|
+
rpc DeleteFaqCategory (FaqCategoryIdRequest) returns (DeleteResponse);
|
|
19
|
+
rpc ReorderFaqCategories (ReorderFaqRequest) returns (SuccessResponse);
|
|
20
|
+
|
|
21
|
+
// Admin — items
|
|
22
|
+
rpc GetFaqItems (GetFaqItemsRequest) returns (GetFaqItemsResponse);
|
|
23
|
+
rpc GetFaqItem (FaqItemIdRequest) returns (FaqItemResponse);
|
|
24
|
+
rpc CreateFaqItem (CreateFaqItemRequest) returns (FaqItemResponse);
|
|
25
|
+
rpc UpdateFaqItem (UpdateFaqItemRequest) returns (FaqItemResponse);
|
|
26
|
+
rpc DeleteFaqItem (FaqItemIdRequest) returns (DeleteResponse);
|
|
27
|
+
rpc ReorderFaqItems (ReorderFaqRequest) returns (SuccessResponse);
|
|
28
|
+
rpc BulkSetPopular (BulkSetPopularFaqRequest) returns (SuccessResponse);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
enum FaqStatus {
|
|
33
|
+
FAQ_STATUS_UNSPECIFIED = 0;
|
|
34
|
+
FAQ_STATUS_DRAFT = 1;
|
|
35
|
+
FAQ_STATUS_PUBLISHED = 2;
|
|
36
|
+
FAQ_STATUS_ARCHIVED = 3;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
message FaqCategoryResponse {
|
|
41
|
+
string id = 1;
|
|
42
|
+
string slug = 2;
|
|
43
|
+
|
|
44
|
+
map<string, string> title = 3;
|
|
45
|
+
|
|
46
|
+
optional string icon = 4;
|
|
47
|
+
|
|
48
|
+
int32 sort_order = 5;
|
|
49
|
+
FaqStatus status = 6;
|
|
50
|
+
|
|
51
|
+
int32 items_count = 7;
|
|
52
|
+
|
|
53
|
+
string created_at = 8;
|
|
54
|
+
string updated_at = 9;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
message FaqItemResponse {
|
|
59
|
+
string id = 1;
|
|
60
|
+
string category_id = 2;
|
|
61
|
+
|
|
62
|
+
map<string, string> question = 3;
|
|
63
|
+
map<string, string> answer = 4;
|
|
64
|
+
|
|
65
|
+
bool is_popular = 5;
|
|
66
|
+
int32 sort_order = 6;
|
|
67
|
+
FaqStatus status = 7;
|
|
68
|
+
|
|
69
|
+
string created_at = 8;
|
|
70
|
+
string updated_at = 9;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
message FaqCategoryWithItems {
|
|
75
|
+
FaqCategoryResponse category = 1;
|
|
76
|
+
repeated FaqItemResponse items = 2;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
// ── Storefront ──────────────────────────────────────────────────────────────
|
|
81
|
+
|
|
82
|
+
message GetFaqStorefrontRequest {
|
|
83
|
+
optional int32 popular_limit = 1;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
message GetFaqStorefrontResponse {
|
|
87
|
+
repeated FaqItemResponse popular = 1;
|
|
88
|
+
repeated FaqCategoryWithItems categories = 2;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
message SearchFaqRequest {
|
|
92
|
+
string query = 1;
|
|
93
|
+
optional int32 limit = 2;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
message SearchFaqResponse {
|
|
97
|
+
repeated FaqItemResponse items = 1;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
// ── Categories CRUD ─────────────────────────────────────────────────────────
|
|
102
|
+
|
|
103
|
+
message FaqCategoryIdRequest {
|
|
104
|
+
string id = 1;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
message GetFaqCategoriesRequest {
|
|
108
|
+
optional FaqStatus status = 1;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
message GetFaqCategoriesResponse {
|
|
112
|
+
repeated FaqCategoryResponse items = 1;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
message CreateFaqCategoryRequest {
|
|
116
|
+
string slug = 1;
|
|
117
|
+
map<string, string> title = 2;
|
|
118
|
+
optional string icon = 3;
|
|
119
|
+
int32 sort_order = 4;
|
|
120
|
+
FaqStatus status = 5;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
message UpdateFaqCategoryRequest {
|
|
124
|
+
string id = 1;
|
|
125
|
+
optional string slug = 2;
|
|
126
|
+
map<string, string> title = 3;
|
|
127
|
+
optional string icon = 4;
|
|
128
|
+
optional int32 sort_order = 5;
|
|
129
|
+
optional FaqStatus status = 6;
|
|
130
|
+
bool clear_icon = 7;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
// ── Items CRUD ──────────────────────────────────────────────────────────────
|
|
135
|
+
|
|
136
|
+
message FaqItemIdRequest {
|
|
137
|
+
string id = 1;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
message GetFaqItemsRequest {
|
|
141
|
+
optional string category_id = 1;
|
|
142
|
+
optional FaqStatus status = 2;
|
|
143
|
+
optional string search = 3;
|
|
144
|
+
PaginationRequest pagination = 4;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
message GetFaqItemsResponse {
|
|
148
|
+
repeated FaqItemResponse items = 1;
|
|
149
|
+
PaginationMeta meta = 2;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
message CreateFaqItemRequest {
|
|
153
|
+
string category_id = 1;
|
|
154
|
+
map<string, string> question = 2;
|
|
155
|
+
map<string, string> answer = 3;
|
|
156
|
+
bool is_popular = 4;
|
|
157
|
+
int32 sort_order = 5;
|
|
158
|
+
FaqStatus status = 6;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
message UpdateFaqItemRequest {
|
|
162
|
+
string id = 1;
|
|
163
|
+
optional string category_id = 2;
|
|
164
|
+
map<string, string> question = 3;
|
|
165
|
+
map<string, string> answer = 4;
|
|
166
|
+
optional bool is_popular = 5;
|
|
167
|
+
optional int32 sort_order = 6;
|
|
168
|
+
optional FaqStatus status = 7;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
|
|
172
|
+
// ── Reorder / Bulk ──────────────────────────────────────────────────────────
|
|
173
|
+
|
|
174
|
+
message FaqSortEntry {
|
|
175
|
+
string id = 1;
|
|
176
|
+
int32 sort_order = 2;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
message ReorderFaqRequest {
|
|
180
|
+
repeated FaqSortEntry items = 1;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
message BulkSetPopularFaqRequest {
|
|
184
|
+
repeated string ids = 1;
|
|
185
|
+
bool popular = 2;
|
|
186
|
+
}
|
package/proto/page.proto
ADDED
|
@@ -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
|
+
}
|