@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
package/gen/manager.ts
ADDED
|
@@ -0,0 +1,192 @@
|
|
|
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: manager.proto
|
|
6
|
+
|
|
7
|
+
/* eslint-disable */
|
|
8
|
+
import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices";
|
|
9
|
+
import { Observable } from "rxjs";
|
|
10
|
+
|
|
11
|
+
export const protobufPackage = "manager.v1";
|
|
12
|
+
|
|
13
|
+
export interface Vacation {
|
|
14
|
+
id: string;
|
|
15
|
+
startsAt: string;
|
|
16
|
+
endsAt: string;
|
|
17
|
+
reason: string;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export interface ManagerProfileDto {
|
|
21
|
+
id: string;
|
|
22
|
+
accountId: string;
|
|
23
|
+
displayName: string;
|
|
24
|
+
email: string;
|
|
25
|
+
isActive: boolean;
|
|
26
|
+
queueOrder: number;
|
|
27
|
+
assignedCount: number;
|
|
28
|
+
terminatedAt: string;
|
|
29
|
+
reassignmentStrategy: string;
|
|
30
|
+
vacations: Vacation[];
|
|
31
|
+
createdAt: string;
|
|
32
|
+
updatedAt: string;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export interface ListManagersRequest {
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export interface ListManagersResponse {
|
|
39
|
+
items: ManagerProfileDto[];
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export interface GetManagerRequest {
|
|
43
|
+
id: string;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export interface CreateManagerRequest {
|
|
47
|
+
accountId: string;
|
|
48
|
+
displayName?: string | undefined;
|
|
49
|
+
email?:
|
|
50
|
+
| string
|
|
51
|
+
| undefined;
|
|
52
|
+
/** URGENT_ONLY | ALL */
|
|
53
|
+
reassignmentStrategy?: string | undefined;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export interface UpdateManagerRequest {
|
|
57
|
+
id: string;
|
|
58
|
+
displayName?: string | undefined;
|
|
59
|
+
email?: string | undefined;
|
|
60
|
+
reassignmentStrategy?: string | undefined;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export interface SetManagerActiveRequest {
|
|
64
|
+
id: string;
|
|
65
|
+
isActive: boolean;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export interface TerminateManagerRequest {
|
|
69
|
+
id: string;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export interface ReorderManagersRequest {
|
|
73
|
+
orderedIds: string[];
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export interface AddVacationRequest {
|
|
77
|
+
managerId: string;
|
|
78
|
+
/** ISO date */
|
|
79
|
+
startsAt: string;
|
|
80
|
+
endsAt: string;
|
|
81
|
+
reason?: string | undefined;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export interface AddVacationResponse {
|
|
85
|
+
id: string;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export interface DeleteVacationRequest {
|
|
89
|
+
id: string;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
export interface ReassignUnassignedRequest {
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
export interface ReassignUnassignedResponse {
|
|
96
|
+
ok: boolean;
|
|
97
|
+
reassignedCount: number;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
export interface BoolResult {
|
|
101
|
+
ok: boolean;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
export const MANAGER_V1_PACKAGE_NAME = "manager.v1";
|
|
105
|
+
|
|
106
|
+
export interface ManagerServiceClient {
|
|
107
|
+
listManagers(request: ListManagersRequest): Observable<ListManagersResponse>;
|
|
108
|
+
|
|
109
|
+
getManager(request: GetManagerRequest): Observable<ManagerProfileDto>;
|
|
110
|
+
|
|
111
|
+
createManager(request: CreateManagerRequest): Observable<ManagerProfileDto>;
|
|
112
|
+
|
|
113
|
+
updateManager(request: UpdateManagerRequest): Observable<ManagerProfileDto>;
|
|
114
|
+
|
|
115
|
+
setManagerActive(request: SetManagerActiveRequest): Observable<ManagerProfileDto>;
|
|
116
|
+
|
|
117
|
+
terminateManager(request: TerminateManagerRequest): Observable<ManagerProfileDto>;
|
|
118
|
+
|
|
119
|
+
reorderManagers(request: ReorderManagersRequest): Observable<BoolResult>;
|
|
120
|
+
|
|
121
|
+
addVacation(request: AddVacationRequest): Observable<AddVacationResponse>;
|
|
122
|
+
|
|
123
|
+
deleteVacation(request: DeleteVacationRequest): Observable<BoolResult>;
|
|
124
|
+
|
|
125
|
+
reassignUnassigned(request: ReassignUnassignedRequest): Observable<ReassignUnassignedResponse>;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
export interface ManagerServiceController {
|
|
129
|
+
listManagers(
|
|
130
|
+
request: ListManagersRequest,
|
|
131
|
+
): Promise<ListManagersResponse> | Observable<ListManagersResponse> | ListManagersResponse;
|
|
132
|
+
|
|
133
|
+
getManager(
|
|
134
|
+
request: GetManagerRequest,
|
|
135
|
+
): Promise<ManagerProfileDto> | Observable<ManagerProfileDto> | ManagerProfileDto;
|
|
136
|
+
|
|
137
|
+
createManager(
|
|
138
|
+
request: CreateManagerRequest,
|
|
139
|
+
): Promise<ManagerProfileDto> | Observable<ManagerProfileDto> | ManagerProfileDto;
|
|
140
|
+
|
|
141
|
+
updateManager(
|
|
142
|
+
request: UpdateManagerRequest,
|
|
143
|
+
): Promise<ManagerProfileDto> | Observable<ManagerProfileDto> | ManagerProfileDto;
|
|
144
|
+
|
|
145
|
+
setManagerActive(
|
|
146
|
+
request: SetManagerActiveRequest,
|
|
147
|
+
): Promise<ManagerProfileDto> | Observable<ManagerProfileDto> | ManagerProfileDto;
|
|
148
|
+
|
|
149
|
+
terminateManager(
|
|
150
|
+
request: TerminateManagerRequest,
|
|
151
|
+
): Promise<ManagerProfileDto> | Observable<ManagerProfileDto> | ManagerProfileDto;
|
|
152
|
+
|
|
153
|
+
reorderManagers(request: ReorderManagersRequest): Promise<BoolResult> | Observable<BoolResult> | BoolResult;
|
|
154
|
+
|
|
155
|
+
addVacation(
|
|
156
|
+
request: AddVacationRequest,
|
|
157
|
+
): Promise<AddVacationResponse> | Observable<AddVacationResponse> | AddVacationResponse;
|
|
158
|
+
|
|
159
|
+
deleteVacation(request: DeleteVacationRequest): Promise<BoolResult> | Observable<BoolResult> | BoolResult;
|
|
160
|
+
|
|
161
|
+
reassignUnassigned(
|
|
162
|
+
request: ReassignUnassignedRequest,
|
|
163
|
+
): Promise<ReassignUnassignedResponse> | Observable<ReassignUnassignedResponse> | ReassignUnassignedResponse;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
export function ManagerServiceControllerMethods() {
|
|
167
|
+
return function (constructor: Function) {
|
|
168
|
+
const grpcMethods: string[] = [
|
|
169
|
+
"listManagers",
|
|
170
|
+
"getManager",
|
|
171
|
+
"createManager",
|
|
172
|
+
"updateManager",
|
|
173
|
+
"setManagerActive",
|
|
174
|
+
"terminateManager",
|
|
175
|
+
"reorderManagers",
|
|
176
|
+
"addVacation",
|
|
177
|
+
"deleteVacation",
|
|
178
|
+
"reassignUnassigned",
|
|
179
|
+
];
|
|
180
|
+
for (const method of grpcMethods) {
|
|
181
|
+
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
182
|
+
GrpcMethod("ManagerService", method)(constructor.prototype[method], method, descriptor);
|
|
183
|
+
}
|
|
184
|
+
const grpcStreamMethods: string[] = [];
|
|
185
|
+
for (const method of grpcStreamMethods) {
|
|
186
|
+
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
187
|
+
GrpcStreamMethod("ManagerService", method)(constructor.prototype[method], method, descriptor);
|
|
188
|
+
}
|
|
189
|
+
};
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
export const MANAGER_SERVICE_NAME = "ManagerService";
|
|
@@ -0,0 +1,427 @@
|
|
|
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: notification.proto
|
|
6
|
+
|
|
7
|
+
/* eslint-disable */
|
|
8
|
+
import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices";
|
|
9
|
+
import { Observable } from "rxjs";
|
|
10
|
+
|
|
11
|
+
export const protobufPackage = "notification.v1";
|
|
12
|
+
|
|
13
|
+
export enum NotificationChannel {
|
|
14
|
+
NOTIFICATION_CHANNEL_UNSPECIFIED = 0,
|
|
15
|
+
EMAIL = 1,
|
|
16
|
+
SMS = 2,
|
|
17
|
+
TELEGRAM = 3,
|
|
18
|
+
UNRECOGNIZED = -1,
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export enum NotificationLocale {
|
|
22
|
+
NOTIFICATION_LOCALE_UNSPECIFIED = 0,
|
|
23
|
+
UK = 1,
|
|
24
|
+
RU = 2,
|
|
25
|
+
UNRECOGNIZED = -1,
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export enum NotificationCategory {
|
|
29
|
+
NOTIFICATION_CATEGORY_UNSPECIFIED = 0,
|
|
30
|
+
TRANSACTIONAL = 1,
|
|
31
|
+
ACCOUNT = 2,
|
|
32
|
+
MARKETING = 3,
|
|
33
|
+
ADMIN = 4,
|
|
34
|
+
OTP = 5,
|
|
35
|
+
UNRECOGNIZED = -1,
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export enum NotificationStatus {
|
|
39
|
+
NOTIFICATION_STATUS_UNSPECIFIED = 0,
|
|
40
|
+
PENDING = 1,
|
|
41
|
+
SENT = 2,
|
|
42
|
+
FAILED = 3,
|
|
43
|
+
SIMULATED = 4,
|
|
44
|
+
SUPPRESSED = 5,
|
|
45
|
+
UNRECOGNIZED = -1,
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export enum TelegramTopic {
|
|
49
|
+
TELEGRAM_TOPIC_UNSPECIFIED = 0,
|
|
50
|
+
ORDERS = 1,
|
|
51
|
+
ORDERS_ALERTS = 2,
|
|
52
|
+
PAYMENTS = 3,
|
|
53
|
+
WAREHOUSE = 4,
|
|
54
|
+
REVIEWS = 5,
|
|
55
|
+
CALLBACK = 6,
|
|
56
|
+
REPORTS = 7,
|
|
57
|
+
ALERTS = 8,
|
|
58
|
+
GENERAL = 9,
|
|
59
|
+
UNRECOGNIZED = -1,
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export interface NotificationTemplate {
|
|
63
|
+
id: string;
|
|
64
|
+
key: string;
|
|
65
|
+
channel: NotificationChannel;
|
|
66
|
+
locale: NotificationLocale;
|
|
67
|
+
category: NotificationCategory;
|
|
68
|
+
title: string;
|
|
69
|
+
subject: string;
|
|
70
|
+
/**
|
|
71
|
+
* JSON-stringified Tiptap content (передаємо як string щоб не
|
|
72
|
+
* використовувати proto google.protobuf.Struct).
|
|
73
|
+
*/
|
|
74
|
+
contentJson: string;
|
|
75
|
+
bodyHtml: string;
|
|
76
|
+
bodyText: string;
|
|
77
|
+
/** JSON array of variable names (для autocomplete). */
|
|
78
|
+
variablesJson: string;
|
|
79
|
+
isActive: boolean;
|
|
80
|
+
version: number;
|
|
81
|
+
createdAt: number;
|
|
82
|
+
updatedAt: number;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export interface TemplateResponse {
|
|
86
|
+
ok: boolean;
|
|
87
|
+
template: NotificationTemplate | undefined;
|
|
88
|
+
errorMessage: string;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
export interface ListTemplatesRequest {
|
|
92
|
+
channel?: NotificationChannel | undefined;
|
|
93
|
+
locale?: NotificationLocale | undefined;
|
|
94
|
+
category?: NotificationCategory | undefined;
|
|
95
|
+
search?: string | undefined;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
export interface ListTemplatesResponse {
|
|
99
|
+
items: NotificationTemplate[];
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
export interface GetTemplateRequest {
|
|
103
|
+
id: string;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
export interface UpsertTemplateRequest {
|
|
107
|
+
key: string;
|
|
108
|
+
channel: NotificationChannel;
|
|
109
|
+
locale: NotificationLocale;
|
|
110
|
+
category: NotificationCategory;
|
|
111
|
+
title: string;
|
|
112
|
+
subject: string;
|
|
113
|
+
contentJson: string;
|
|
114
|
+
bodyHtml: string;
|
|
115
|
+
bodyText: string;
|
|
116
|
+
variablesJson: string;
|
|
117
|
+
isActive: boolean;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
export interface UpdateTemplateRequest {
|
|
121
|
+
id: string;
|
|
122
|
+
title?: string | undefined;
|
|
123
|
+
subject?: string | undefined;
|
|
124
|
+
contentJson?: string | undefined;
|
|
125
|
+
bodyHtml: string;
|
|
126
|
+
bodyText: string;
|
|
127
|
+
variablesJson?: string | undefined;
|
|
128
|
+
isActive?:
|
|
129
|
+
| boolean
|
|
130
|
+
| undefined;
|
|
131
|
+
/** Admin id для audit (хто змінив). */
|
|
132
|
+
actorId?: string | undefined;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
export interface ToggleTemplateRequest {
|
|
136
|
+
id: string;
|
|
137
|
+
isActive: boolean;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
export interface NotificationTemplateVersion {
|
|
141
|
+
id: string;
|
|
142
|
+
version: number;
|
|
143
|
+
title: string;
|
|
144
|
+
subject: string;
|
|
145
|
+
contentJson: string;
|
|
146
|
+
bodyHtml: string;
|
|
147
|
+
bodyText: string;
|
|
148
|
+
variablesJson: string;
|
|
149
|
+
createdById?: string | undefined;
|
|
150
|
+
createdAt: number;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
export interface ListVersionsRequest {
|
|
154
|
+
templateId: string;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
export interface ListVersionsResponse {
|
|
158
|
+
items: NotificationTemplateVersion[];
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
export interface RestoreVersionRequest {
|
|
162
|
+
templateId: string;
|
|
163
|
+
version: number;
|
|
164
|
+
actorId?: string | undefined;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
export interface RenderPreviewRequest {
|
|
168
|
+
bodyHtml: string;
|
|
169
|
+
/** JSON-stringified variables { "order.number": "MD-2026-0001", ... } */
|
|
170
|
+
variablesJson: string;
|
|
171
|
+
subject?: string | undefined;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
export interface RenderPreviewResponse {
|
|
175
|
+
html: string;
|
|
176
|
+
subject: string;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
export interface SendTestRequest {
|
|
180
|
+
templateId: string;
|
|
181
|
+
/** email або phone (залежно від channel). */
|
|
182
|
+
recipient: string;
|
|
183
|
+
/** JSON-stringified test variables. */
|
|
184
|
+
variablesJson: string;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
export interface SendTestResponse {
|
|
188
|
+
ok: boolean;
|
|
189
|
+
errorMessage: string;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
export interface NotificationLog {
|
|
193
|
+
id: string;
|
|
194
|
+
templateKey: string;
|
|
195
|
+
channel: NotificationChannel;
|
|
196
|
+
locale: NotificationLocale;
|
|
197
|
+
recipient: string;
|
|
198
|
+
orderId?: string | undefined;
|
|
199
|
+
userId?: string | undefined;
|
|
200
|
+
status: NotificationStatus;
|
|
201
|
+
providerMessageId?: string | undefined;
|
|
202
|
+
providerName?: string | undefined;
|
|
203
|
+
error?: string | undefined;
|
|
204
|
+
sentAt?: number | undefined;
|
|
205
|
+
createdAt: number;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
export interface ListLogsRequest {
|
|
209
|
+
channel?: NotificationChannel | undefined;
|
|
210
|
+
status?: NotificationStatus | undefined;
|
|
211
|
+
templateKey?: string | undefined;
|
|
212
|
+
orderId?: string | undefined;
|
|
213
|
+
userId?: string | undefined;
|
|
214
|
+
recipient?: string | undefined;
|
|
215
|
+
dateFrom?: number | undefined;
|
|
216
|
+
dateTo?: number | undefined;
|
|
217
|
+
page: number;
|
|
218
|
+
limit: number;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
export interface ListLogsResponse {
|
|
222
|
+
items: NotificationLog[];
|
|
223
|
+
total: number;
|
|
224
|
+
page: number;
|
|
225
|
+
limit: number;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
export interface TelegramChat {
|
|
229
|
+
id: string;
|
|
230
|
+
chatId: string;
|
|
231
|
+
topic: TelegramTopic;
|
|
232
|
+
label: string;
|
|
233
|
+
tag?: string | undefined;
|
|
234
|
+
isActive: boolean;
|
|
235
|
+
createdAt: number;
|
|
236
|
+
updatedAt: number;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
export interface TelegramChatResponse {
|
|
240
|
+
ok: boolean;
|
|
241
|
+
chat: TelegramChat | undefined;
|
|
242
|
+
errorMessage: string;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
export interface ListChatsRequest {
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
export interface ListChatsResponse {
|
|
249
|
+
items: TelegramChat[];
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
export interface UpsertChatRequest {
|
|
253
|
+
chatId: string;
|
|
254
|
+
topic: TelegramTopic;
|
|
255
|
+
label: string;
|
|
256
|
+
tag?: string | undefined;
|
|
257
|
+
isActive: boolean;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
export interface DeleteChatRequest {
|
|
261
|
+
id: string;
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
export interface DeleteChatResponse {
|
|
265
|
+
ok: boolean;
|
|
266
|
+
errorMessage: string;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
export interface TestSendTelegramRequest {
|
|
270
|
+
chatId: string;
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
export interface TestSendTelegramResponse {
|
|
274
|
+
ok: boolean;
|
|
275
|
+
errorMessage: string;
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
export const NOTIFICATION_V1_PACKAGE_NAME = "notification.v1";
|
|
279
|
+
|
|
280
|
+
export interface NotificationTemplateServiceClient {
|
|
281
|
+
listTemplates(request: ListTemplatesRequest): Observable<ListTemplatesResponse>;
|
|
282
|
+
|
|
283
|
+
getTemplate(request: GetTemplateRequest): Observable<TemplateResponse>;
|
|
284
|
+
|
|
285
|
+
upsertTemplate(request: UpsertTemplateRequest): Observable<TemplateResponse>;
|
|
286
|
+
|
|
287
|
+
updateTemplate(request: UpdateTemplateRequest): Observable<TemplateResponse>;
|
|
288
|
+
|
|
289
|
+
toggleTemplate(request: ToggleTemplateRequest): Observable<TemplateResponse>;
|
|
290
|
+
|
|
291
|
+
listVersions(request: ListVersionsRequest): Observable<ListVersionsResponse>;
|
|
292
|
+
|
|
293
|
+
restoreVersion(request: RestoreVersionRequest): Observable<TemplateResponse>;
|
|
294
|
+
|
|
295
|
+
renderPreview(request: RenderPreviewRequest): Observable<RenderPreviewResponse>;
|
|
296
|
+
|
|
297
|
+
sendTest(request: SendTestRequest): Observable<SendTestResponse>;
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
export interface NotificationTemplateServiceController {
|
|
301
|
+
listTemplates(
|
|
302
|
+
request: ListTemplatesRequest,
|
|
303
|
+
): Promise<ListTemplatesResponse> | Observable<ListTemplatesResponse> | ListTemplatesResponse;
|
|
304
|
+
|
|
305
|
+
getTemplate(request: GetTemplateRequest): Promise<TemplateResponse> | Observable<TemplateResponse> | TemplateResponse;
|
|
306
|
+
|
|
307
|
+
upsertTemplate(
|
|
308
|
+
request: UpsertTemplateRequest,
|
|
309
|
+
): Promise<TemplateResponse> | Observable<TemplateResponse> | TemplateResponse;
|
|
310
|
+
|
|
311
|
+
updateTemplate(
|
|
312
|
+
request: UpdateTemplateRequest,
|
|
313
|
+
): Promise<TemplateResponse> | Observable<TemplateResponse> | TemplateResponse;
|
|
314
|
+
|
|
315
|
+
toggleTemplate(
|
|
316
|
+
request: ToggleTemplateRequest,
|
|
317
|
+
): Promise<TemplateResponse> | Observable<TemplateResponse> | TemplateResponse;
|
|
318
|
+
|
|
319
|
+
listVersions(
|
|
320
|
+
request: ListVersionsRequest,
|
|
321
|
+
): Promise<ListVersionsResponse> | Observable<ListVersionsResponse> | ListVersionsResponse;
|
|
322
|
+
|
|
323
|
+
restoreVersion(
|
|
324
|
+
request: RestoreVersionRequest,
|
|
325
|
+
): Promise<TemplateResponse> | Observable<TemplateResponse> | TemplateResponse;
|
|
326
|
+
|
|
327
|
+
renderPreview(
|
|
328
|
+
request: RenderPreviewRequest,
|
|
329
|
+
): Promise<RenderPreviewResponse> | Observable<RenderPreviewResponse> | RenderPreviewResponse;
|
|
330
|
+
|
|
331
|
+
sendTest(request: SendTestRequest): Promise<SendTestResponse> | Observable<SendTestResponse> | SendTestResponse;
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
export function NotificationTemplateServiceControllerMethods() {
|
|
335
|
+
return function (constructor: Function) {
|
|
336
|
+
const grpcMethods: string[] = [
|
|
337
|
+
"listTemplates",
|
|
338
|
+
"getTemplate",
|
|
339
|
+
"upsertTemplate",
|
|
340
|
+
"updateTemplate",
|
|
341
|
+
"toggleTemplate",
|
|
342
|
+
"listVersions",
|
|
343
|
+
"restoreVersion",
|
|
344
|
+
"renderPreview",
|
|
345
|
+
"sendTest",
|
|
346
|
+
];
|
|
347
|
+
for (const method of grpcMethods) {
|
|
348
|
+
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
349
|
+
GrpcMethod("NotificationTemplateService", method)(constructor.prototype[method], method, descriptor);
|
|
350
|
+
}
|
|
351
|
+
const grpcStreamMethods: string[] = [];
|
|
352
|
+
for (const method of grpcStreamMethods) {
|
|
353
|
+
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
354
|
+
GrpcStreamMethod("NotificationTemplateService", method)(constructor.prototype[method], method, descriptor);
|
|
355
|
+
}
|
|
356
|
+
};
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
export const NOTIFICATION_TEMPLATE_SERVICE_NAME = "NotificationTemplateService";
|
|
360
|
+
|
|
361
|
+
export interface NotificationLogsServiceClient {
|
|
362
|
+
listLogs(request: ListLogsRequest): Observable<ListLogsResponse>;
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
export interface NotificationLogsServiceController {
|
|
366
|
+
listLogs(request: ListLogsRequest): Promise<ListLogsResponse> | Observable<ListLogsResponse> | ListLogsResponse;
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
export function NotificationLogsServiceControllerMethods() {
|
|
370
|
+
return function (constructor: Function) {
|
|
371
|
+
const grpcMethods: string[] = ["listLogs"];
|
|
372
|
+
for (const method of grpcMethods) {
|
|
373
|
+
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
374
|
+
GrpcMethod("NotificationLogsService", method)(constructor.prototype[method], method, descriptor);
|
|
375
|
+
}
|
|
376
|
+
const grpcStreamMethods: string[] = [];
|
|
377
|
+
for (const method of grpcStreamMethods) {
|
|
378
|
+
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
379
|
+
GrpcStreamMethod("NotificationLogsService", method)(constructor.prototype[method], method, descriptor);
|
|
380
|
+
}
|
|
381
|
+
};
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
export const NOTIFICATION_LOGS_SERVICE_NAME = "NotificationLogsService";
|
|
385
|
+
|
|
386
|
+
export interface TelegramChatsServiceClient {
|
|
387
|
+
listChats(request: ListChatsRequest): Observable<ListChatsResponse>;
|
|
388
|
+
|
|
389
|
+
upsertChat(request: UpsertChatRequest): Observable<TelegramChatResponse>;
|
|
390
|
+
|
|
391
|
+
deleteChat(request: DeleteChatRequest): Observable<DeleteChatResponse>;
|
|
392
|
+
|
|
393
|
+
testSendTelegram(request: TestSendTelegramRequest): Observable<TestSendTelegramResponse>;
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
export interface TelegramChatsServiceController {
|
|
397
|
+
listChats(request: ListChatsRequest): Promise<ListChatsResponse> | Observable<ListChatsResponse> | ListChatsResponse;
|
|
398
|
+
|
|
399
|
+
upsertChat(
|
|
400
|
+
request: UpsertChatRequest,
|
|
401
|
+
): Promise<TelegramChatResponse> | Observable<TelegramChatResponse> | TelegramChatResponse;
|
|
402
|
+
|
|
403
|
+
deleteChat(
|
|
404
|
+
request: DeleteChatRequest,
|
|
405
|
+
): Promise<DeleteChatResponse> | Observable<DeleteChatResponse> | DeleteChatResponse;
|
|
406
|
+
|
|
407
|
+
testSendTelegram(
|
|
408
|
+
request: TestSendTelegramRequest,
|
|
409
|
+
): Promise<TestSendTelegramResponse> | Observable<TestSendTelegramResponse> | TestSendTelegramResponse;
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
export function TelegramChatsServiceControllerMethods() {
|
|
413
|
+
return function (constructor: Function) {
|
|
414
|
+
const grpcMethods: string[] = ["listChats", "upsertChat", "deleteChat", "testSendTelegram"];
|
|
415
|
+
for (const method of grpcMethods) {
|
|
416
|
+
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
417
|
+
GrpcMethod("TelegramChatsService", method)(constructor.prototype[method], method, descriptor);
|
|
418
|
+
}
|
|
419
|
+
const grpcStreamMethods: string[] = [];
|
|
420
|
+
for (const method of grpcStreamMethods) {
|
|
421
|
+
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
422
|
+
GrpcStreamMethod("TelegramChatsService", method)(constructor.prototype[method], method, descriptor);
|
|
423
|
+
}
|
|
424
|
+
};
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
export const TELEGRAM_CHATS_SERVICE_NAME = "TelegramChatsService";
|
package/gen/product.ts
CHANGED
|
@@ -121,7 +121,11 @@ export interface ProductListItemResponse {
|
|
|
121
121
|
rating: number;
|
|
122
122
|
reviewCount: number;
|
|
123
123
|
stickers: ProductStickerResponse[];
|
|
124
|
-
activePromo?:
|
|
124
|
+
activePromo?:
|
|
125
|
+
| ProductPromoInfo
|
|
126
|
+
| undefined;
|
|
127
|
+
/** Вага у кг для розрахунку доставки (0 → fallback на defaultItemWeightKg). */
|
|
128
|
+
weightKg: number;
|
|
125
129
|
}
|
|
126
130
|
|
|
127
131
|
export interface ProductListItemResponse_NameEntry {
|
|
@@ -169,6 +173,8 @@ export interface ProductDetailResponse {
|
|
|
169
173
|
manualRating?: number | undefined;
|
|
170
174
|
activePromo?: ProductPromoInfo | undefined;
|
|
171
175
|
colors: ProductColorResponse[];
|
|
176
|
+
/** Вага товару у кг для розрахунку доставки (variant може override'ити). */
|
|
177
|
+
weightKg: number;
|
|
172
178
|
}
|
|
173
179
|
|
|
174
180
|
export interface ProductDetailResponse_NameEntry {
|
|
@@ -379,6 +385,7 @@ export interface CreateProductRequest {
|
|
|
379
385
|
groupId?: string | undefined;
|
|
380
386
|
colorLabel: { [key: string]: string };
|
|
381
387
|
colorHex?: string | undefined;
|
|
388
|
+
weightKg?: number | undefined;
|
|
382
389
|
}
|
|
383
390
|
|
|
384
391
|
export interface CreateProductRequest_NameEntry {
|
|
@@ -437,6 +444,7 @@ export interface UpdateProductRequest {
|
|
|
437
444
|
colorLabel: { [key: string]: string };
|
|
438
445
|
colorHex?: string | undefined;
|
|
439
446
|
manualRating?: number | undefined;
|
|
447
|
+
weightKg?: number | undefined;
|
|
440
448
|
}
|
|
441
449
|
|
|
442
450
|
export interface UpdateProductRequest_NameEntry {
|
|
@@ -688,7 +696,11 @@ export interface ProductVariantDetailResponse {
|
|
|
688
696
|
images: ProductImageResponse[];
|
|
689
697
|
attributes: ProductAttributeResponse[];
|
|
690
698
|
overrides: VariantOverrides | undefined;
|
|
691
|
-
colorId?:
|
|
699
|
+
colorId?:
|
|
700
|
+
| string
|
|
701
|
+
| undefined;
|
|
702
|
+
/** Override-вага варіанту у кг; 0 означає "успадкувати від продукту". */
|
|
703
|
+
weightKg: number;
|
|
692
704
|
}
|
|
693
705
|
|
|
694
706
|
export interface ProductVariantDetailResponse_OptionsEntry {
|
|
@@ -733,6 +745,7 @@ export interface VariantOverrides {
|
|
|
733
745
|
hasOwnAttributes: boolean;
|
|
734
746
|
hasOwnVideo: boolean;
|
|
735
747
|
hasOwnOldPrice: boolean;
|
|
748
|
+
hasOwnWeight: boolean;
|
|
736
749
|
}
|
|
737
750
|
|
|
738
751
|
export interface CreateProductVariantRequest {
|
|
@@ -754,7 +767,11 @@ export interface CreateProductVariantRequest {
|
|
|
754
767
|
videoUrl?: string | undefined;
|
|
755
768
|
images: ProductImagePayload[];
|
|
756
769
|
attributeValueIds: string[];
|
|
757
|
-
colorId?:
|
|
770
|
+
colorId?:
|
|
771
|
+
| string
|
|
772
|
+
| undefined;
|
|
773
|
+
/** Override-вага варіанту у кг (null/unset → успадкувати від продукту). */
|
|
774
|
+
weightKg?: number | undefined;
|
|
758
775
|
}
|
|
759
776
|
|
|
760
777
|
export interface CreateProductVariantRequest_OptionsEntry {
|
|
@@ -806,7 +823,11 @@ export interface UpdateProductVariantRequest {
|
|
|
806
823
|
videoUrl?: string | undefined;
|
|
807
824
|
images: ProductImagePayload[];
|
|
808
825
|
attributeValueIds: string[];
|
|
809
|
-
colorId?:
|
|
826
|
+
colorId?:
|
|
827
|
+
| string
|
|
828
|
+
| undefined;
|
|
829
|
+
/** Override-вага варіанту у кг (null/unset → успадкувати від продукту). */
|
|
830
|
+
weightKg?: number | undefined;
|
|
810
831
|
clearPrice: boolean;
|
|
811
832
|
clearOldPrice: boolean;
|
|
812
833
|
clearName: boolean;
|
|
@@ -819,6 +840,7 @@ export interface UpdateProductVariantRequest {
|
|
|
819
840
|
clearAttributes: boolean;
|
|
820
841
|
clearVideo: boolean;
|
|
821
842
|
clearColor: boolean;
|
|
843
|
+
clearWeight: boolean;
|
|
822
844
|
}
|
|
823
845
|
|
|
824
846
|
export interface UpdateProductVariantRequest_OptionsEntry {
|
|
@@ -902,7 +924,11 @@ export interface VariantLookupResult {
|
|
|
902
924
|
/** Локалізована назва (uk → ru → перше) для зручності клієнта. */
|
|
903
925
|
nameUk: string;
|
|
904
926
|
mainImage: string;
|
|
905
|
-
colorId?:
|
|
927
|
+
colorId?:
|
|
928
|
+
| string
|
|
929
|
+
| undefined;
|
|
930
|
+
/** Вага у кг (variant.weight_kg ?? product.weight_kg ?? 0). */
|
|
931
|
+
weightKg: number;
|
|
906
932
|
}
|
|
907
933
|
|
|
908
934
|
export interface BulkLookupVariantsRequest {
|