@mamindom/contracts 1.0.124 → 1.0.126
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/events/auth/otp-requested.interface.d.ts +6 -2
- package/dist/events/index.d.ts +1 -0
- package/dist/events/index.js +1 -0
- package/dist/events/orders/order-cancelled.interface.d.ts +7 -0
- package/dist/events/orders/order-status-changed.interface.d.ts +9 -0
- package/dist/events/stock/index.d.ts +5 -0
- package/dist/events/stock/index.js +21 -0
- package/dist/events/stock/stock-confirm-requested.interface.d.ts +4 -0
- package/dist/events/stock/stock-confirm-requested.interface.js +2 -0
- package/dist/events/stock/stock-release-requested.interface.d.ts +9 -0
- package/dist/events/stock/stock-release-requested.interface.js +2 -0
- package/dist/events/stock/stock-reserve-failed.interface.d.ts +9 -0
- package/dist/events/stock/stock-reserve-failed.interface.js +2 -0
- package/dist/events/stock/stock-reserve-requested.interface.d.ts +10 -0
- package/dist/events/stock/stock-reserve-requested.interface.js +2 -0
- package/dist/events/stock/stock-reserved.interface.d.ts +11 -0
- package/dist/events/stock/stock-reserved.interface.js +2 -0
- package/dist/gen/audit.d.ts +65 -0
- package/dist/gen/audit.js +28 -0
- package/dist/gen/bonus_settings.d.ts +35 -0
- package/dist/gen/bonus_settings.js +28 -0
- package/dist/gen/delivery_settings.d.ts +33 -0
- package/dist/gen/delivery_settings.js +28 -0
- package/dist/gen/manager.d.ts +102 -0
- package/dist/gen/manager.js +39 -0
- package/dist/gen/notification.d.ts +279 -0
- package/dist/gen/notification.js +119 -0
- package/dist/gen/product.d.ts +16 -0
- package/dist/gen/rbac.d.ts +111 -0
- package/dist/gen/rbac.js +37 -0
- package/dist/proto/audit.proto +59 -0
- package/dist/proto/bonus_settings.proto +35 -0
- package/dist/proto/delivery_settings.proto +35 -0
- package/dist/proto/manager.proto +88 -0
- package/dist/proto/notification.proto +317 -0
- package/dist/proto/product.proto +26 -9
- package/dist/proto/rbac.proto +109 -0
- package/dist/src/proto/paths.d.ts +6 -0
- package/dist/src/proto/paths.js +7 -1
- package/events/auth/otp-requested.interface.ts +10 -2
- package/events/index.ts +1 -0
- package/events/orders/order-cancelled.interface.ts +9 -0
- package/events/orders/order-status-changed.interface.ts +14 -0
- package/events/stock/index.ts +5 -0
- package/events/stock/stock-confirm-requested.interface.ts +6 -0
- package/events/stock/stock-release-requested.interface.ts +11 -0
- package/events/stock/stock-reserve-failed.interface.ts +8 -0
- package/events/stock/stock-reserve-requested.interface.ts +16 -0
- package/events/stock/stock-reserved.interface.ts +13 -0
- package/gen/audit.ts +109 -0
- package/gen/bonus_settings.ts +71 -0
- package/gen/delivery_settings.ts +69 -0
- package/gen/manager.ts +192 -0
- package/gen/notification.ts +427 -0
- package/gen/product.ts +31 -5
- package/gen/rbac.ts +192 -0
- package/package.json +1 -1
- package/proto/audit.proto +59 -0
- package/proto/bonus_settings.proto +35 -0
- package/proto/delivery_settings.proto +35 -0
- package/proto/manager.proto +88 -0
- package/proto/notification.proto +317 -0
- package/proto/product.proto +26 -9
- package/proto/rbac.proto +109 -0
|
@@ -0,0 +1,279 @@
|
|
|
1
|
+
import { Observable } from "rxjs";
|
|
2
|
+
export declare const protobufPackage = "notification.v1";
|
|
3
|
+
export declare enum NotificationChannel {
|
|
4
|
+
NOTIFICATION_CHANNEL_UNSPECIFIED = 0,
|
|
5
|
+
EMAIL = 1,
|
|
6
|
+
SMS = 2,
|
|
7
|
+
TELEGRAM = 3,
|
|
8
|
+
UNRECOGNIZED = -1
|
|
9
|
+
}
|
|
10
|
+
export declare enum NotificationLocale {
|
|
11
|
+
NOTIFICATION_LOCALE_UNSPECIFIED = 0,
|
|
12
|
+
UK = 1,
|
|
13
|
+
RU = 2,
|
|
14
|
+
UNRECOGNIZED = -1
|
|
15
|
+
}
|
|
16
|
+
export declare enum NotificationCategory {
|
|
17
|
+
NOTIFICATION_CATEGORY_UNSPECIFIED = 0,
|
|
18
|
+
TRANSACTIONAL = 1,
|
|
19
|
+
ACCOUNT = 2,
|
|
20
|
+
MARKETING = 3,
|
|
21
|
+
ADMIN = 4,
|
|
22
|
+
OTP = 5,
|
|
23
|
+
UNRECOGNIZED = -1
|
|
24
|
+
}
|
|
25
|
+
export declare enum NotificationStatus {
|
|
26
|
+
NOTIFICATION_STATUS_UNSPECIFIED = 0,
|
|
27
|
+
PENDING = 1,
|
|
28
|
+
SENT = 2,
|
|
29
|
+
FAILED = 3,
|
|
30
|
+
SIMULATED = 4,
|
|
31
|
+
SUPPRESSED = 5,
|
|
32
|
+
UNRECOGNIZED = -1
|
|
33
|
+
}
|
|
34
|
+
export declare enum TelegramTopic {
|
|
35
|
+
TELEGRAM_TOPIC_UNSPECIFIED = 0,
|
|
36
|
+
ORDERS = 1,
|
|
37
|
+
ORDERS_ALERTS = 2,
|
|
38
|
+
PAYMENTS = 3,
|
|
39
|
+
WAREHOUSE = 4,
|
|
40
|
+
REVIEWS = 5,
|
|
41
|
+
CALLBACK = 6,
|
|
42
|
+
REPORTS = 7,
|
|
43
|
+
ALERTS = 8,
|
|
44
|
+
GENERAL = 9,
|
|
45
|
+
UNRECOGNIZED = -1
|
|
46
|
+
}
|
|
47
|
+
export interface NotificationTemplate {
|
|
48
|
+
id: string;
|
|
49
|
+
key: string;
|
|
50
|
+
channel: NotificationChannel;
|
|
51
|
+
locale: NotificationLocale;
|
|
52
|
+
category: NotificationCategory;
|
|
53
|
+
title: string;
|
|
54
|
+
subject: string;
|
|
55
|
+
/**
|
|
56
|
+
* JSON-stringified Tiptap content (передаємо як string щоб не
|
|
57
|
+
* використовувати proto google.protobuf.Struct).
|
|
58
|
+
*/
|
|
59
|
+
contentJson: string;
|
|
60
|
+
bodyHtml: string;
|
|
61
|
+
bodyText: string;
|
|
62
|
+
/** JSON array of variable names (для autocomplete). */
|
|
63
|
+
variablesJson: string;
|
|
64
|
+
isActive: boolean;
|
|
65
|
+
version: number;
|
|
66
|
+
createdAt: number;
|
|
67
|
+
updatedAt: number;
|
|
68
|
+
}
|
|
69
|
+
export interface TemplateResponse {
|
|
70
|
+
ok: boolean;
|
|
71
|
+
template: NotificationTemplate | undefined;
|
|
72
|
+
errorMessage: string;
|
|
73
|
+
}
|
|
74
|
+
export interface ListTemplatesRequest {
|
|
75
|
+
channel?: NotificationChannel | undefined;
|
|
76
|
+
locale?: NotificationLocale | undefined;
|
|
77
|
+
category?: NotificationCategory | undefined;
|
|
78
|
+
search?: string | undefined;
|
|
79
|
+
}
|
|
80
|
+
export interface ListTemplatesResponse {
|
|
81
|
+
items: NotificationTemplate[];
|
|
82
|
+
}
|
|
83
|
+
export interface GetTemplateRequest {
|
|
84
|
+
id: string;
|
|
85
|
+
}
|
|
86
|
+
export interface UpsertTemplateRequest {
|
|
87
|
+
key: string;
|
|
88
|
+
channel: NotificationChannel;
|
|
89
|
+
locale: NotificationLocale;
|
|
90
|
+
category: NotificationCategory;
|
|
91
|
+
title: string;
|
|
92
|
+
subject: string;
|
|
93
|
+
contentJson: string;
|
|
94
|
+
bodyHtml: string;
|
|
95
|
+
bodyText: string;
|
|
96
|
+
variablesJson: string;
|
|
97
|
+
isActive: boolean;
|
|
98
|
+
}
|
|
99
|
+
export interface UpdateTemplateRequest {
|
|
100
|
+
id: string;
|
|
101
|
+
title?: string | undefined;
|
|
102
|
+
subject?: string | undefined;
|
|
103
|
+
contentJson?: string | undefined;
|
|
104
|
+
bodyHtml: string;
|
|
105
|
+
bodyText: string;
|
|
106
|
+
variablesJson?: string | undefined;
|
|
107
|
+
isActive?: boolean | undefined;
|
|
108
|
+
/** Admin id для audit (хто змінив). */
|
|
109
|
+
actorId?: string | undefined;
|
|
110
|
+
}
|
|
111
|
+
export interface ToggleTemplateRequest {
|
|
112
|
+
id: string;
|
|
113
|
+
isActive: boolean;
|
|
114
|
+
}
|
|
115
|
+
export interface NotificationTemplateVersion {
|
|
116
|
+
id: string;
|
|
117
|
+
version: number;
|
|
118
|
+
title: string;
|
|
119
|
+
subject: string;
|
|
120
|
+
contentJson: string;
|
|
121
|
+
bodyHtml: string;
|
|
122
|
+
bodyText: string;
|
|
123
|
+
variablesJson: string;
|
|
124
|
+
createdById?: string | undefined;
|
|
125
|
+
createdAt: number;
|
|
126
|
+
}
|
|
127
|
+
export interface ListVersionsRequest {
|
|
128
|
+
templateId: string;
|
|
129
|
+
}
|
|
130
|
+
export interface ListVersionsResponse {
|
|
131
|
+
items: NotificationTemplateVersion[];
|
|
132
|
+
}
|
|
133
|
+
export interface RestoreVersionRequest {
|
|
134
|
+
templateId: string;
|
|
135
|
+
version: number;
|
|
136
|
+
actorId?: string | undefined;
|
|
137
|
+
}
|
|
138
|
+
export interface RenderPreviewRequest {
|
|
139
|
+
bodyHtml: string;
|
|
140
|
+
/** JSON-stringified variables { "order.number": "MD-2026-0001", ... } */
|
|
141
|
+
variablesJson: string;
|
|
142
|
+
subject?: string | undefined;
|
|
143
|
+
}
|
|
144
|
+
export interface RenderPreviewResponse {
|
|
145
|
+
html: string;
|
|
146
|
+
subject: string;
|
|
147
|
+
}
|
|
148
|
+
export interface SendTestRequest {
|
|
149
|
+
templateId: string;
|
|
150
|
+
/** email або phone (залежно від channel). */
|
|
151
|
+
recipient: string;
|
|
152
|
+
/** JSON-stringified test variables. */
|
|
153
|
+
variablesJson: string;
|
|
154
|
+
}
|
|
155
|
+
export interface SendTestResponse {
|
|
156
|
+
ok: boolean;
|
|
157
|
+
errorMessage: string;
|
|
158
|
+
}
|
|
159
|
+
export interface NotificationLog {
|
|
160
|
+
id: string;
|
|
161
|
+
templateKey: string;
|
|
162
|
+
channel: NotificationChannel;
|
|
163
|
+
locale: NotificationLocale;
|
|
164
|
+
recipient: string;
|
|
165
|
+
orderId?: string | undefined;
|
|
166
|
+
userId?: string | undefined;
|
|
167
|
+
status: NotificationStatus;
|
|
168
|
+
providerMessageId?: string | undefined;
|
|
169
|
+
providerName?: string | undefined;
|
|
170
|
+
error?: string | undefined;
|
|
171
|
+
sentAt?: number | undefined;
|
|
172
|
+
createdAt: number;
|
|
173
|
+
}
|
|
174
|
+
export interface ListLogsRequest {
|
|
175
|
+
channel?: NotificationChannel | undefined;
|
|
176
|
+
status?: NotificationStatus | undefined;
|
|
177
|
+
templateKey?: string | undefined;
|
|
178
|
+
orderId?: string | undefined;
|
|
179
|
+
userId?: string | undefined;
|
|
180
|
+
recipient?: string | undefined;
|
|
181
|
+
dateFrom?: number | undefined;
|
|
182
|
+
dateTo?: number | undefined;
|
|
183
|
+
page: number;
|
|
184
|
+
limit: number;
|
|
185
|
+
}
|
|
186
|
+
export interface ListLogsResponse {
|
|
187
|
+
items: NotificationLog[];
|
|
188
|
+
total: number;
|
|
189
|
+
page: number;
|
|
190
|
+
limit: number;
|
|
191
|
+
}
|
|
192
|
+
export interface TelegramChat {
|
|
193
|
+
id: string;
|
|
194
|
+
chatId: string;
|
|
195
|
+
topic: TelegramTopic;
|
|
196
|
+
label: string;
|
|
197
|
+
tag?: string | undefined;
|
|
198
|
+
isActive: boolean;
|
|
199
|
+
createdAt: number;
|
|
200
|
+
updatedAt: number;
|
|
201
|
+
}
|
|
202
|
+
export interface TelegramChatResponse {
|
|
203
|
+
ok: boolean;
|
|
204
|
+
chat: TelegramChat | undefined;
|
|
205
|
+
errorMessage: string;
|
|
206
|
+
}
|
|
207
|
+
export interface ListChatsRequest {
|
|
208
|
+
}
|
|
209
|
+
export interface ListChatsResponse {
|
|
210
|
+
items: TelegramChat[];
|
|
211
|
+
}
|
|
212
|
+
export interface UpsertChatRequest {
|
|
213
|
+
chatId: string;
|
|
214
|
+
topic: TelegramTopic;
|
|
215
|
+
label: string;
|
|
216
|
+
tag?: string | undefined;
|
|
217
|
+
isActive: boolean;
|
|
218
|
+
}
|
|
219
|
+
export interface DeleteChatRequest {
|
|
220
|
+
id: string;
|
|
221
|
+
}
|
|
222
|
+
export interface DeleteChatResponse {
|
|
223
|
+
ok: boolean;
|
|
224
|
+
errorMessage: string;
|
|
225
|
+
}
|
|
226
|
+
export interface TestSendTelegramRequest {
|
|
227
|
+
chatId: string;
|
|
228
|
+
}
|
|
229
|
+
export interface TestSendTelegramResponse {
|
|
230
|
+
ok: boolean;
|
|
231
|
+
errorMessage: string;
|
|
232
|
+
}
|
|
233
|
+
export declare const NOTIFICATION_V1_PACKAGE_NAME = "notification.v1";
|
|
234
|
+
export interface NotificationTemplateServiceClient {
|
|
235
|
+
listTemplates(request: ListTemplatesRequest): Observable<ListTemplatesResponse>;
|
|
236
|
+
getTemplate(request: GetTemplateRequest): Observable<TemplateResponse>;
|
|
237
|
+
upsertTemplate(request: UpsertTemplateRequest): Observable<TemplateResponse>;
|
|
238
|
+
updateTemplate(request: UpdateTemplateRequest): Observable<TemplateResponse>;
|
|
239
|
+
toggleTemplate(request: ToggleTemplateRequest): Observable<TemplateResponse>;
|
|
240
|
+
listVersions(request: ListVersionsRequest): Observable<ListVersionsResponse>;
|
|
241
|
+
restoreVersion(request: RestoreVersionRequest): Observable<TemplateResponse>;
|
|
242
|
+
renderPreview(request: RenderPreviewRequest): Observable<RenderPreviewResponse>;
|
|
243
|
+
sendTest(request: SendTestRequest): Observable<SendTestResponse>;
|
|
244
|
+
}
|
|
245
|
+
export interface NotificationTemplateServiceController {
|
|
246
|
+
listTemplates(request: ListTemplatesRequest): Promise<ListTemplatesResponse> | Observable<ListTemplatesResponse> | ListTemplatesResponse;
|
|
247
|
+
getTemplate(request: GetTemplateRequest): Promise<TemplateResponse> | Observable<TemplateResponse> | TemplateResponse;
|
|
248
|
+
upsertTemplate(request: UpsertTemplateRequest): Promise<TemplateResponse> | Observable<TemplateResponse> | TemplateResponse;
|
|
249
|
+
updateTemplate(request: UpdateTemplateRequest): Promise<TemplateResponse> | Observable<TemplateResponse> | TemplateResponse;
|
|
250
|
+
toggleTemplate(request: ToggleTemplateRequest): Promise<TemplateResponse> | Observable<TemplateResponse> | TemplateResponse;
|
|
251
|
+
listVersions(request: ListVersionsRequest): Promise<ListVersionsResponse> | Observable<ListVersionsResponse> | ListVersionsResponse;
|
|
252
|
+
restoreVersion(request: RestoreVersionRequest): Promise<TemplateResponse> | Observable<TemplateResponse> | TemplateResponse;
|
|
253
|
+
renderPreview(request: RenderPreviewRequest): Promise<RenderPreviewResponse> | Observable<RenderPreviewResponse> | RenderPreviewResponse;
|
|
254
|
+
sendTest(request: SendTestRequest): Promise<SendTestResponse> | Observable<SendTestResponse> | SendTestResponse;
|
|
255
|
+
}
|
|
256
|
+
export declare function NotificationTemplateServiceControllerMethods(): (constructor: Function) => void;
|
|
257
|
+
export declare const NOTIFICATION_TEMPLATE_SERVICE_NAME = "NotificationTemplateService";
|
|
258
|
+
export interface NotificationLogsServiceClient {
|
|
259
|
+
listLogs(request: ListLogsRequest): Observable<ListLogsResponse>;
|
|
260
|
+
}
|
|
261
|
+
export interface NotificationLogsServiceController {
|
|
262
|
+
listLogs(request: ListLogsRequest): Promise<ListLogsResponse> | Observable<ListLogsResponse> | ListLogsResponse;
|
|
263
|
+
}
|
|
264
|
+
export declare function NotificationLogsServiceControllerMethods(): (constructor: Function) => void;
|
|
265
|
+
export declare const NOTIFICATION_LOGS_SERVICE_NAME = "NotificationLogsService";
|
|
266
|
+
export interface TelegramChatsServiceClient {
|
|
267
|
+
listChats(request: ListChatsRequest): Observable<ListChatsResponse>;
|
|
268
|
+
upsertChat(request: UpsertChatRequest): Observable<TelegramChatResponse>;
|
|
269
|
+
deleteChat(request: DeleteChatRequest): Observable<DeleteChatResponse>;
|
|
270
|
+
testSendTelegram(request: TestSendTelegramRequest): Observable<TestSendTelegramResponse>;
|
|
271
|
+
}
|
|
272
|
+
export interface TelegramChatsServiceController {
|
|
273
|
+
listChats(request: ListChatsRequest): Promise<ListChatsResponse> | Observable<ListChatsResponse> | ListChatsResponse;
|
|
274
|
+
upsertChat(request: UpsertChatRequest): Promise<TelegramChatResponse> | Observable<TelegramChatResponse> | TelegramChatResponse;
|
|
275
|
+
deleteChat(request: DeleteChatRequest): Promise<DeleteChatResponse> | Observable<DeleteChatResponse> | DeleteChatResponse;
|
|
276
|
+
testSendTelegram(request: TestSendTelegramRequest): Promise<TestSendTelegramResponse> | Observable<TestSendTelegramResponse> | TestSendTelegramResponse;
|
|
277
|
+
}
|
|
278
|
+
export declare function TelegramChatsServiceControllerMethods(): (constructor: Function) => void;
|
|
279
|
+
export declare const TELEGRAM_CHATS_SERVICE_NAME = "TelegramChatsService";
|
|
@@ -0,0 +1,119 @@
|
|
|
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: notification.proto
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.TELEGRAM_CHATS_SERVICE_NAME = exports.NOTIFICATION_LOGS_SERVICE_NAME = exports.NOTIFICATION_TEMPLATE_SERVICE_NAME = exports.NOTIFICATION_V1_PACKAGE_NAME = exports.TelegramTopic = exports.NotificationStatus = exports.NotificationCategory = exports.NotificationLocale = exports.NotificationChannel = exports.protobufPackage = void 0;
|
|
9
|
+
exports.NotificationTemplateServiceControllerMethods = NotificationTemplateServiceControllerMethods;
|
|
10
|
+
exports.NotificationLogsServiceControllerMethods = NotificationLogsServiceControllerMethods;
|
|
11
|
+
exports.TelegramChatsServiceControllerMethods = TelegramChatsServiceControllerMethods;
|
|
12
|
+
/* eslint-disable */
|
|
13
|
+
const microservices_1 = require("@nestjs/microservices");
|
|
14
|
+
exports.protobufPackage = "notification.v1";
|
|
15
|
+
var NotificationChannel;
|
|
16
|
+
(function (NotificationChannel) {
|
|
17
|
+
NotificationChannel[NotificationChannel["NOTIFICATION_CHANNEL_UNSPECIFIED"] = 0] = "NOTIFICATION_CHANNEL_UNSPECIFIED";
|
|
18
|
+
NotificationChannel[NotificationChannel["EMAIL"] = 1] = "EMAIL";
|
|
19
|
+
NotificationChannel[NotificationChannel["SMS"] = 2] = "SMS";
|
|
20
|
+
NotificationChannel[NotificationChannel["TELEGRAM"] = 3] = "TELEGRAM";
|
|
21
|
+
NotificationChannel[NotificationChannel["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
|
|
22
|
+
})(NotificationChannel || (exports.NotificationChannel = NotificationChannel = {}));
|
|
23
|
+
var NotificationLocale;
|
|
24
|
+
(function (NotificationLocale) {
|
|
25
|
+
NotificationLocale[NotificationLocale["NOTIFICATION_LOCALE_UNSPECIFIED"] = 0] = "NOTIFICATION_LOCALE_UNSPECIFIED";
|
|
26
|
+
NotificationLocale[NotificationLocale["UK"] = 1] = "UK";
|
|
27
|
+
NotificationLocale[NotificationLocale["RU"] = 2] = "RU";
|
|
28
|
+
NotificationLocale[NotificationLocale["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
|
|
29
|
+
})(NotificationLocale || (exports.NotificationLocale = NotificationLocale = {}));
|
|
30
|
+
var NotificationCategory;
|
|
31
|
+
(function (NotificationCategory) {
|
|
32
|
+
NotificationCategory[NotificationCategory["NOTIFICATION_CATEGORY_UNSPECIFIED"] = 0] = "NOTIFICATION_CATEGORY_UNSPECIFIED";
|
|
33
|
+
NotificationCategory[NotificationCategory["TRANSACTIONAL"] = 1] = "TRANSACTIONAL";
|
|
34
|
+
NotificationCategory[NotificationCategory["ACCOUNT"] = 2] = "ACCOUNT";
|
|
35
|
+
NotificationCategory[NotificationCategory["MARKETING"] = 3] = "MARKETING";
|
|
36
|
+
NotificationCategory[NotificationCategory["ADMIN"] = 4] = "ADMIN";
|
|
37
|
+
NotificationCategory[NotificationCategory["OTP"] = 5] = "OTP";
|
|
38
|
+
NotificationCategory[NotificationCategory["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
|
|
39
|
+
})(NotificationCategory || (exports.NotificationCategory = NotificationCategory = {}));
|
|
40
|
+
var NotificationStatus;
|
|
41
|
+
(function (NotificationStatus) {
|
|
42
|
+
NotificationStatus[NotificationStatus["NOTIFICATION_STATUS_UNSPECIFIED"] = 0] = "NOTIFICATION_STATUS_UNSPECIFIED";
|
|
43
|
+
NotificationStatus[NotificationStatus["PENDING"] = 1] = "PENDING";
|
|
44
|
+
NotificationStatus[NotificationStatus["SENT"] = 2] = "SENT";
|
|
45
|
+
NotificationStatus[NotificationStatus["FAILED"] = 3] = "FAILED";
|
|
46
|
+
NotificationStatus[NotificationStatus["SIMULATED"] = 4] = "SIMULATED";
|
|
47
|
+
NotificationStatus[NotificationStatus["SUPPRESSED"] = 5] = "SUPPRESSED";
|
|
48
|
+
NotificationStatus[NotificationStatus["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
|
|
49
|
+
})(NotificationStatus || (exports.NotificationStatus = NotificationStatus = {}));
|
|
50
|
+
var TelegramTopic;
|
|
51
|
+
(function (TelegramTopic) {
|
|
52
|
+
TelegramTopic[TelegramTopic["TELEGRAM_TOPIC_UNSPECIFIED"] = 0] = "TELEGRAM_TOPIC_UNSPECIFIED";
|
|
53
|
+
TelegramTopic[TelegramTopic["ORDERS"] = 1] = "ORDERS";
|
|
54
|
+
TelegramTopic[TelegramTopic["ORDERS_ALERTS"] = 2] = "ORDERS_ALERTS";
|
|
55
|
+
TelegramTopic[TelegramTopic["PAYMENTS"] = 3] = "PAYMENTS";
|
|
56
|
+
TelegramTopic[TelegramTopic["WAREHOUSE"] = 4] = "WAREHOUSE";
|
|
57
|
+
TelegramTopic[TelegramTopic["REVIEWS"] = 5] = "REVIEWS";
|
|
58
|
+
TelegramTopic[TelegramTopic["CALLBACK"] = 6] = "CALLBACK";
|
|
59
|
+
TelegramTopic[TelegramTopic["REPORTS"] = 7] = "REPORTS";
|
|
60
|
+
TelegramTopic[TelegramTopic["ALERTS"] = 8] = "ALERTS";
|
|
61
|
+
TelegramTopic[TelegramTopic["GENERAL"] = 9] = "GENERAL";
|
|
62
|
+
TelegramTopic[TelegramTopic["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
|
|
63
|
+
})(TelegramTopic || (exports.TelegramTopic = TelegramTopic = {}));
|
|
64
|
+
exports.NOTIFICATION_V1_PACKAGE_NAME = "notification.v1";
|
|
65
|
+
function NotificationTemplateServiceControllerMethods() {
|
|
66
|
+
return function (constructor) {
|
|
67
|
+
const grpcMethods = [
|
|
68
|
+
"listTemplates",
|
|
69
|
+
"getTemplate",
|
|
70
|
+
"upsertTemplate",
|
|
71
|
+
"updateTemplate",
|
|
72
|
+
"toggleTemplate",
|
|
73
|
+
"listVersions",
|
|
74
|
+
"restoreVersion",
|
|
75
|
+
"renderPreview",
|
|
76
|
+
"sendTest",
|
|
77
|
+
];
|
|
78
|
+
for (const method of grpcMethods) {
|
|
79
|
+
const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
80
|
+
(0, microservices_1.GrpcMethod)("NotificationTemplateService", method)(constructor.prototype[method], method, descriptor);
|
|
81
|
+
}
|
|
82
|
+
const grpcStreamMethods = [];
|
|
83
|
+
for (const method of grpcStreamMethods) {
|
|
84
|
+
const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
85
|
+
(0, microservices_1.GrpcStreamMethod)("NotificationTemplateService", method)(constructor.prototype[method], method, descriptor);
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
exports.NOTIFICATION_TEMPLATE_SERVICE_NAME = "NotificationTemplateService";
|
|
90
|
+
function NotificationLogsServiceControllerMethods() {
|
|
91
|
+
return function (constructor) {
|
|
92
|
+
const grpcMethods = ["listLogs"];
|
|
93
|
+
for (const method of grpcMethods) {
|
|
94
|
+
const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
95
|
+
(0, microservices_1.GrpcMethod)("NotificationLogsService", method)(constructor.prototype[method], method, descriptor);
|
|
96
|
+
}
|
|
97
|
+
const grpcStreamMethods = [];
|
|
98
|
+
for (const method of grpcStreamMethods) {
|
|
99
|
+
const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
100
|
+
(0, microservices_1.GrpcStreamMethod)("NotificationLogsService", method)(constructor.prototype[method], method, descriptor);
|
|
101
|
+
}
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
exports.NOTIFICATION_LOGS_SERVICE_NAME = "NotificationLogsService";
|
|
105
|
+
function TelegramChatsServiceControllerMethods() {
|
|
106
|
+
return function (constructor) {
|
|
107
|
+
const grpcMethods = ["listChats", "upsertChat", "deleteChat", "testSendTelegram"];
|
|
108
|
+
for (const method of grpcMethods) {
|
|
109
|
+
const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
110
|
+
(0, microservices_1.GrpcMethod)("TelegramChatsService", method)(constructor.prototype[method], method, descriptor);
|
|
111
|
+
}
|
|
112
|
+
const grpcStreamMethods = [];
|
|
113
|
+
for (const method of grpcStreamMethods) {
|
|
114
|
+
const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
115
|
+
(0, microservices_1.GrpcStreamMethod)("TelegramChatsService", method)(constructor.prototype[method], method, descriptor);
|
|
116
|
+
}
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
exports.TELEGRAM_CHATS_SERVICE_NAME = "TelegramChatsService";
|
package/dist/gen/product.d.ts
CHANGED
|
@@ -101,6 +101,8 @@ export interface ProductListItemResponse {
|
|
|
101
101
|
reviewCount: number;
|
|
102
102
|
stickers: ProductStickerResponse[];
|
|
103
103
|
activePromo?: ProductPromoInfo | undefined;
|
|
104
|
+
/** Вага у кг для розрахунку доставки (0 → fallback на defaultItemWeightKg). */
|
|
105
|
+
weightKg: number;
|
|
104
106
|
}
|
|
105
107
|
export interface ProductListItemResponse_NameEntry {
|
|
106
108
|
key: string;
|
|
@@ -164,6 +166,8 @@ export interface ProductDetailResponse {
|
|
|
164
166
|
manualRating?: number | undefined;
|
|
165
167
|
activePromo?: ProductPromoInfo | undefined;
|
|
166
168
|
colors: ProductColorResponse[];
|
|
169
|
+
/** Вага товару у кг для розрахунку доставки (variant може override'ити). */
|
|
170
|
+
weightKg: number;
|
|
167
171
|
}
|
|
168
172
|
export interface ProductDetailResponse_NameEntry {
|
|
169
173
|
key: string;
|
|
@@ -373,6 +377,7 @@ export interface CreateProductRequest {
|
|
|
373
377
|
[key: string]: string;
|
|
374
378
|
};
|
|
375
379
|
colorHex?: string | undefined;
|
|
380
|
+
weightKg?: number | undefined;
|
|
376
381
|
}
|
|
377
382
|
export interface CreateProductRequest_NameEntry {
|
|
378
383
|
key: string;
|
|
@@ -436,6 +441,7 @@ export interface UpdateProductRequest {
|
|
|
436
441
|
};
|
|
437
442
|
colorHex?: string | undefined;
|
|
438
443
|
manualRating?: number | undefined;
|
|
444
|
+
weightKg?: number | undefined;
|
|
439
445
|
}
|
|
440
446
|
export interface UpdateProductRequest_NameEntry {
|
|
441
447
|
key: string;
|
|
@@ -673,6 +679,8 @@ export interface ProductVariantDetailResponse {
|
|
|
673
679
|
attributes: ProductAttributeResponse[];
|
|
674
680
|
overrides: VariantOverrides | undefined;
|
|
675
681
|
colorId?: string | undefined;
|
|
682
|
+
/** Override-вага варіанту у кг; 0 означає "успадкувати від продукту". */
|
|
683
|
+
weightKg: number;
|
|
676
684
|
}
|
|
677
685
|
export interface ProductVariantDetailResponse_OptionsEntry {
|
|
678
686
|
key: string;
|
|
@@ -710,6 +718,7 @@ export interface VariantOverrides {
|
|
|
710
718
|
hasOwnAttributes: boolean;
|
|
711
719
|
hasOwnVideo: boolean;
|
|
712
720
|
hasOwnOldPrice: boolean;
|
|
721
|
+
hasOwnWeight: boolean;
|
|
713
722
|
}
|
|
714
723
|
export interface CreateProductVariantRequest {
|
|
715
724
|
productId: string;
|
|
@@ -743,6 +752,8 @@ export interface CreateProductVariantRequest {
|
|
|
743
752
|
images: ProductImagePayload[];
|
|
744
753
|
attributeValueIds: string[];
|
|
745
754
|
colorId?: string | undefined;
|
|
755
|
+
/** Override-вага варіанту у кг (null/unset → успадкувати від продукту). */
|
|
756
|
+
weightKg?: number | undefined;
|
|
746
757
|
}
|
|
747
758
|
export interface CreateProductVariantRequest_OptionsEntry {
|
|
748
759
|
key: string;
|
|
@@ -800,6 +811,8 @@ export interface UpdateProductVariantRequest {
|
|
|
800
811
|
images: ProductImagePayload[];
|
|
801
812
|
attributeValueIds: string[];
|
|
802
813
|
colorId?: string | undefined;
|
|
814
|
+
/** Override-вага варіанту у кг (null/unset → успадкувати від продукту). */
|
|
815
|
+
weightKg?: number | undefined;
|
|
803
816
|
clearPrice: boolean;
|
|
804
817
|
clearOldPrice: boolean;
|
|
805
818
|
clearName: boolean;
|
|
@@ -812,6 +825,7 @@ export interface UpdateProductVariantRequest {
|
|
|
812
825
|
clearAttributes: boolean;
|
|
813
826
|
clearVideo: boolean;
|
|
814
827
|
clearColor: boolean;
|
|
828
|
+
clearWeight: boolean;
|
|
815
829
|
}
|
|
816
830
|
export interface UpdateProductVariantRequest_OptionsEntry {
|
|
817
831
|
key: string;
|
|
@@ -882,6 +896,8 @@ export interface VariantLookupResult {
|
|
|
882
896
|
nameUk: string;
|
|
883
897
|
mainImage: string;
|
|
884
898
|
colorId?: string | undefined;
|
|
899
|
+
/** Вага у кг (variant.weight_kg ?? product.weight_kg ?? 0). */
|
|
900
|
+
weightKg: number;
|
|
885
901
|
}
|
|
886
902
|
export interface BulkLookupVariantsRequest {
|
|
887
903
|
variantIds: string[];
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { Observable } from "rxjs";
|
|
2
|
+
export declare const protobufPackage = "rbac.v1";
|
|
3
|
+
export interface RbacPermission {
|
|
4
|
+
id: string;
|
|
5
|
+
key: string;
|
|
6
|
+
groupKey: string;
|
|
7
|
+
label: string;
|
|
8
|
+
description: string;
|
|
9
|
+
}
|
|
10
|
+
export interface RbacRole {
|
|
11
|
+
id: string;
|
|
12
|
+
slug: string;
|
|
13
|
+
name: string;
|
|
14
|
+
description: string;
|
|
15
|
+
color: string;
|
|
16
|
+
isSystem: boolean;
|
|
17
|
+
isProtected: boolean;
|
|
18
|
+
usersCount: number;
|
|
19
|
+
permissionKeys: string[];
|
|
20
|
+
createdAt: string;
|
|
21
|
+
updatedAt: string;
|
|
22
|
+
}
|
|
23
|
+
export interface ListPermissionsRequest {
|
|
24
|
+
}
|
|
25
|
+
export interface ListPermissionsResponse {
|
|
26
|
+
items: RbacPermission[];
|
|
27
|
+
}
|
|
28
|
+
export interface ListRolesRequest {
|
|
29
|
+
search?: string | undefined;
|
|
30
|
+
}
|
|
31
|
+
export interface ListRolesResponse {
|
|
32
|
+
items: RbacRole[];
|
|
33
|
+
}
|
|
34
|
+
export interface GetRoleRequest {
|
|
35
|
+
id: string;
|
|
36
|
+
}
|
|
37
|
+
export interface CreateRoleRequest {
|
|
38
|
+
slug: string;
|
|
39
|
+
name: string;
|
|
40
|
+
description: string;
|
|
41
|
+
color: string;
|
|
42
|
+
permissionKeys: string[];
|
|
43
|
+
}
|
|
44
|
+
export interface UpdateRoleRequest {
|
|
45
|
+
id: string;
|
|
46
|
+
name?: string | undefined;
|
|
47
|
+
description?: string | undefined;
|
|
48
|
+
color?: string | undefined;
|
|
49
|
+
/** Якщо передано — повна заміна; якщо не передано — без змін. */
|
|
50
|
+
permissionKeys: string[];
|
|
51
|
+
replacePermissions: boolean;
|
|
52
|
+
}
|
|
53
|
+
export interface DeleteRoleRequest {
|
|
54
|
+
id: string;
|
|
55
|
+
}
|
|
56
|
+
export interface DeleteRoleResponse {
|
|
57
|
+
ok: boolean;
|
|
58
|
+
}
|
|
59
|
+
export interface AssignAccountRoleRequest {
|
|
60
|
+
accountId: string;
|
|
61
|
+
/**
|
|
62
|
+
* Якщо custom_role_id порожній — користувач відвʼязується від кастомної ролі,
|
|
63
|
+
* і дозволи беруться з системної.
|
|
64
|
+
*/
|
|
65
|
+
customRoleId?: string | undefined;
|
|
66
|
+
}
|
|
67
|
+
export interface AssignAccountRoleResponse {
|
|
68
|
+
ok: boolean;
|
|
69
|
+
}
|
|
70
|
+
export interface GetAccountPermissionsRequest {
|
|
71
|
+
accountId: string;
|
|
72
|
+
}
|
|
73
|
+
export interface GetAccountPermissionsResponse {
|
|
74
|
+
/**
|
|
75
|
+
* Effective permissions з урахуванням system role + custom role override.
|
|
76
|
+
* Може містити "*" — повний доступ (ADMIN).
|
|
77
|
+
*/
|
|
78
|
+
permissionKeys: string[];
|
|
79
|
+
/** Слаг ефективної ролі (для UI/labels). */
|
|
80
|
+
roleSlug: string;
|
|
81
|
+
roleName: string;
|
|
82
|
+
}
|
|
83
|
+
export declare const RBAC_V1_PACKAGE_NAME = "rbac.v1";
|
|
84
|
+
export interface RbacServiceClient {
|
|
85
|
+
/** Permissions catalog (read-only, seeded). */
|
|
86
|
+
listPermissions(request: ListPermissionsRequest): Observable<ListPermissionsResponse>;
|
|
87
|
+
/** Roles CRUD. */
|
|
88
|
+
listRoles(request: ListRolesRequest): Observable<ListRolesResponse>;
|
|
89
|
+
getRole(request: GetRoleRequest): Observable<RbacRole>;
|
|
90
|
+
createRole(request: CreateRoleRequest): Observable<RbacRole>;
|
|
91
|
+
updateRole(request: UpdateRoleRequest): Observable<RbacRole>;
|
|
92
|
+
deleteRole(request: DeleteRoleRequest): Observable<DeleteRoleResponse>;
|
|
93
|
+
/** Account ↔ role bindings. */
|
|
94
|
+
assignAccountRole(request: AssignAccountRoleRequest): Observable<AssignAccountRoleResponse>;
|
|
95
|
+
getAccountPermissions(request: GetAccountPermissionsRequest): Observable<GetAccountPermissionsResponse>;
|
|
96
|
+
}
|
|
97
|
+
export interface RbacServiceController {
|
|
98
|
+
/** Permissions catalog (read-only, seeded). */
|
|
99
|
+
listPermissions(request: ListPermissionsRequest): Promise<ListPermissionsResponse> | Observable<ListPermissionsResponse> | ListPermissionsResponse;
|
|
100
|
+
/** Roles CRUD. */
|
|
101
|
+
listRoles(request: ListRolesRequest): Promise<ListRolesResponse> | Observable<ListRolesResponse> | ListRolesResponse;
|
|
102
|
+
getRole(request: GetRoleRequest): Promise<RbacRole> | Observable<RbacRole> | RbacRole;
|
|
103
|
+
createRole(request: CreateRoleRequest): Promise<RbacRole> | Observable<RbacRole> | RbacRole;
|
|
104
|
+
updateRole(request: UpdateRoleRequest): Promise<RbacRole> | Observable<RbacRole> | RbacRole;
|
|
105
|
+
deleteRole(request: DeleteRoleRequest): Promise<DeleteRoleResponse> | Observable<DeleteRoleResponse> | DeleteRoleResponse;
|
|
106
|
+
/** Account ↔ role bindings. */
|
|
107
|
+
assignAccountRole(request: AssignAccountRoleRequest): Promise<AssignAccountRoleResponse> | Observable<AssignAccountRoleResponse> | AssignAccountRoleResponse;
|
|
108
|
+
getAccountPermissions(request: GetAccountPermissionsRequest): Promise<GetAccountPermissionsResponse> | Observable<GetAccountPermissionsResponse> | GetAccountPermissionsResponse;
|
|
109
|
+
}
|
|
110
|
+
export declare function RbacServiceControllerMethods(): (constructor: Function) => void;
|
|
111
|
+
export declare const RBAC_SERVICE_NAME = "RbacService";
|
package/dist/gen/rbac.js
ADDED
|
@@ -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: rbac.proto
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.RBAC_SERVICE_NAME = exports.RBAC_V1_PACKAGE_NAME = exports.protobufPackage = void 0;
|
|
9
|
+
exports.RbacServiceControllerMethods = RbacServiceControllerMethods;
|
|
10
|
+
/* eslint-disable */
|
|
11
|
+
const microservices_1 = require("@nestjs/microservices");
|
|
12
|
+
exports.protobufPackage = "rbac.v1";
|
|
13
|
+
exports.RBAC_V1_PACKAGE_NAME = "rbac.v1";
|
|
14
|
+
function RbacServiceControllerMethods() {
|
|
15
|
+
return function (constructor) {
|
|
16
|
+
const grpcMethods = [
|
|
17
|
+
"listPermissions",
|
|
18
|
+
"listRoles",
|
|
19
|
+
"getRole",
|
|
20
|
+
"createRole",
|
|
21
|
+
"updateRole",
|
|
22
|
+
"deleteRole",
|
|
23
|
+
"assignAccountRole",
|
|
24
|
+
"getAccountPermissions",
|
|
25
|
+
];
|
|
26
|
+
for (const method of grpcMethods) {
|
|
27
|
+
const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
28
|
+
(0, microservices_1.GrpcMethod)("RbacService", 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)("RbacService", method)(constructor.prototype[method], method, descriptor);
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
exports.RBAC_SERVICE_NAME = "RbacService";
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package audit.v1;
|
|
4
|
+
|
|
5
|
+
service AuditService {
|
|
6
|
+
rpc LogAction(LogActionRequest) returns (LogActionResponse);
|
|
7
|
+
rpc ListAudit(ListAuditRequest) returns (ListAuditResponse);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
message LogActionRequest {
|
|
11
|
+
optional string actor_id = 1;
|
|
12
|
+
optional string actor_name = 2;
|
|
13
|
+
optional string actor_email = 3;
|
|
14
|
+
string action = 4; // e.g. "order.cancelled", "product.price_changed"
|
|
15
|
+
string target_type = 5; // e.g. "order", "product", "role"
|
|
16
|
+
optional string target_id = 6;
|
|
17
|
+
optional string summary = 7; // human-readable summary
|
|
18
|
+
optional string before_json = 8; // serialized JSON snapshot (small!)
|
|
19
|
+
optional string after_json = 9;
|
|
20
|
+
optional string ip = 10;
|
|
21
|
+
optional string user_agent = 11;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
message LogActionResponse {
|
|
25
|
+
bool ok = 1;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
message ListAuditRequest {
|
|
29
|
+
optional int32 page = 1;
|
|
30
|
+
optional int32 limit = 2;
|
|
31
|
+
optional string actor_id = 3;
|
|
32
|
+
optional string target_type = 4;
|
|
33
|
+
optional string target_id = 5;
|
|
34
|
+
optional string action = 6;
|
|
35
|
+
optional string action_group = 7; // "orders" matches order.* etc
|
|
36
|
+
optional string from = 8; // ISO date
|
|
37
|
+
optional string to = 9;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
message AuditEntry {
|
|
41
|
+
string id = 1;
|
|
42
|
+
string actor_id = 2;
|
|
43
|
+
string actor_name = 3;
|
|
44
|
+
string actor_email = 4;
|
|
45
|
+
string action = 5;
|
|
46
|
+
string target_type = 6;
|
|
47
|
+
string target_id = 7;
|
|
48
|
+
string summary = 8;
|
|
49
|
+
string before_json = 9;
|
|
50
|
+
string after_json = 10;
|
|
51
|
+
string ip = 11;
|
|
52
|
+
string user_agent = 12;
|
|
53
|
+
string created_at = 13;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
message ListAuditResponse {
|
|
57
|
+
repeated AuditEntry items = 1;
|
|
58
|
+
int32 total = 2;
|
|
59
|
+
}
|