tiryaq-shared 1.0.0 → 1.1.1
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/error-codes.d.ts +286 -0
- package/dist/error-codes.d.ts.map +1 -0
- package/dist/error-codes.js +235 -0
- package/dist/error-codes.js.map +1 -0
- package/dist/filters/global-exception.filter.d.ts +23 -0
- package/dist/filters/global-exception.filter.d.ts.map +1 -0
- package/dist/filters/global-exception.filter.js +157 -0
- package/dist/filters/global-exception.filter.js.map +1 -0
- package/dist/filters/microservice-exception.filter.d.ts +11 -0
- package/dist/filters/microservice-exception.filter.d.ts.map +1 -0
- package/dist/filters/microservice-exception.filter.js +106 -0
- package/dist/filters/microservice-exception.filter.js.map +1 -0
- package/dist/filters/validation-exception.filter.d.ts +9 -0
- package/dist/filters/validation-exception.filter.d.ts.map +1 -0
- package/dist/filters/validation-exception.filter.js +97 -0
- package/dist/filters/validation-exception.filter.js.map +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -1
- package/dist/interfaces.d.ts +101 -4
- package/dist/interfaces.d.ts.map +1 -1
- package/dist/interfaces.js +32 -0
- package/dist/interfaces.js.map +1 -1
- package/dist/message-patterns.d.ts +11 -0
- package/dist/message-patterns.d.ts.map +1 -1
- package/dist/message-patterns.js +14 -0
- package/dist/message-patterns.js.map +1 -1
- package/dist/response-utils.d.ts +52 -0
- package/dist/response-utils.d.ts.map +1 -0
- package/dist/response-utils.js +114 -0
- package/dist/response-utils.js.map +1 -0
- package/package.json +10 -1
|
@@ -0,0 +1,286 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Standardized Error Codes for all services
|
|
3
|
+
* Format: SERVICE_DOMAIN_ERROR
|
|
4
|
+
*/
|
|
5
|
+
export declare const COMMON_ERROR_CODES: {
|
|
6
|
+
readonly INTERNAL_SERVER_ERROR: "CMN_001";
|
|
7
|
+
readonly VALIDATION_ERROR: "CMN_002";
|
|
8
|
+
readonly INVALID_REQUEST: "CMN_003";
|
|
9
|
+
readonly RESOURCE_NOT_FOUND: "CMN_004";
|
|
10
|
+
readonly UNAUTHORIZED: "CMN_005";
|
|
11
|
+
readonly FORBIDDEN: "CMN_006";
|
|
12
|
+
readonly RATE_LIMIT_EXCEEDED: "CMN_007";
|
|
13
|
+
readonly DATABASE_CONNECTION_ERROR: "CMN_101";
|
|
14
|
+
readonly DATABASE_QUERY_ERROR: "CMN_102";
|
|
15
|
+
readonly DUPLICATE_ENTRY: "CMN_103";
|
|
16
|
+
readonly KAFKA_CONNECTION_ERROR: "CMN_201";
|
|
17
|
+
readonly REDIS_CONNECTION_ERROR: "CMN_202";
|
|
18
|
+
readonly EMAIL_SERVICE_ERROR: "CMN_203";
|
|
19
|
+
readonly SMS_SERVICE_ERROR: "CMN_204";
|
|
20
|
+
};
|
|
21
|
+
export declare const AUTH_ERROR_CODES: {
|
|
22
|
+
readonly INVALID_CREDENTIALS: "AUTH_001";
|
|
23
|
+
readonly USER_NOT_FOUND: "AUTH_002";
|
|
24
|
+
readonly EMAIL_ALREADY_EXISTS: "AUTH_003";
|
|
25
|
+
readonly WEAK_PASSWORD: "AUTH_004";
|
|
26
|
+
readonly ACCOUNT_LOCKED: "AUTH_005";
|
|
27
|
+
readonly EMAIL_NOT_VERIFIED: "AUTH_006";
|
|
28
|
+
readonly INVALID_TOKEN: "AUTH_101";
|
|
29
|
+
readonly TOKEN_EXPIRED: "AUTH_102";
|
|
30
|
+
readonly TOKEN_BLACKLISTED: "AUTH_103";
|
|
31
|
+
readonly REFRESH_TOKEN_INVALID: "AUTH_104";
|
|
32
|
+
readonly PROFILE_UPDATE_FAILED: "AUTH_201";
|
|
33
|
+
readonly ADDRESS_NOT_FOUND: "AUTH_202";
|
|
34
|
+
readonly ADDRESS_LIMIT_EXCEEDED: "AUTH_203";
|
|
35
|
+
readonly MOBILE_NUMBER_ALREADY_EXISTS: "AUTH_301";
|
|
36
|
+
readonly INVALID_MOBILE_NUMBER: "AUTH_302";
|
|
37
|
+
readonly OTP_SEND_FAILED: "AUTH_303";
|
|
38
|
+
readonly INVALID_OTP: "AUTH_304";
|
|
39
|
+
readonly OTP_EXPIRED: "AUTH_305";
|
|
40
|
+
readonly OTP_MAX_ATTEMPTS_EXCEEDED: "AUTH_306";
|
|
41
|
+
readonly MPIN_ALREADY_SET: "AUTH_307";
|
|
42
|
+
readonly INVALID_MPIN_FORMAT: "AUTH_308";
|
|
43
|
+
readonly MPIN_CREATION_FAILED: "AUTH_309";
|
|
44
|
+
readonly REGISTRATION_INCOMPLETE: "AUTH_310";
|
|
45
|
+
readonly REGISTRATION_ALREADY_COMPLETE: "AUTH_311";
|
|
46
|
+
readonly INVALID_REGION: "AUTH_312";
|
|
47
|
+
readonly SESSION_NOT_FOUND: "AUTH_401";
|
|
48
|
+
readonly SESSION_EXPIRED: "AUTH_402";
|
|
49
|
+
readonly SESSION_CREATION_FAILED: "AUTH_403";
|
|
50
|
+
readonly INVALID_SESSION_TOKEN: "AUTH_404";
|
|
51
|
+
readonly MULTIPLE_SESSIONS_DETECTED: "AUTH_405";
|
|
52
|
+
readonly DEVICE_NOT_AUTHORIZED: "AUTH_406";
|
|
53
|
+
};
|
|
54
|
+
export declare const PHARMACY_ERROR_CODES: {
|
|
55
|
+
readonly PHARMACY_NOT_FOUND: "PHARM_001";
|
|
56
|
+
readonly PHARMACY_CLOSED: "PHARM_002";
|
|
57
|
+
readonly MEDICINE_NOT_FOUND: "PHARM_003";
|
|
58
|
+
readonly MEDICINE_OUT_OF_STOCK: "PHARM_004";
|
|
59
|
+
readonly PRESCRIPTION_REQUIRED: "PHARM_005";
|
|
60
|
+
readonly ORDER_NOT_FOUND: "PHARM_101";
|
|
61
|
+
readonly ORDER_ALREADY_CANCELLED: "PHARM_102";
|
|
62
|
+
readonly ORDER_CANNOT_BE_MODIFIED: "PHARM_103";
|
|
63
|
+
readonly INVALID_ORDER_STATUS: "PHARM_104";
|
|
64
|
+
readonly INSUFFICIENT_STOCK: "PHARM_105";
|
|
65
|
+
readonly INVALID_PRESCRIPTION: "PHARM_201";
|
|
66
|
+
readonly PRESCRIPTION_EXPIRED: "PHARM_202";
|
|
67
|
+
readonly PRESCRIPTION_UPLOAD_FAILED: "PHARM_203";
|
|
68
|
+
};
|
|
69
|
+
export declare const CONSULTATION_ERROR_CODES: {
|
|
70
|
+
readonly DOCTOR_NOT_FOUND: "CONS_001";
|
|
71
|
+
readonly DOCTOR_UNAVAILABLE: "CONS_002";
|
|
72
|
+
readonly INVALID_SPECIALTY: "CONS_003";
|
|
73
|
+
readonly APPOINTMENT_NOT_FOUND: "CONS_101";
|
|
74
|
+
readonly APPOINTMENT_ALREADY_BOOKED: "CONS_102";
|
|
75
|
+
readonly APPOINTMENT_CANCELLED: "CONS_103";
|
|
76
|
+
readonly INVALID_TIME_SLOT: "CONS_104";
|
|
77
|
+
readonly APPOINTMENT_IN_PAST: "CONS_105";
|
|
78
|
+
readonly BOOKING_WINDOW_CLOSED: "CONS_106";
|
|
79
|
+
readonly CONSULTATION_NOT_STARTED: "CONS_201";
|
|
80
|
+
readonly CONSULTATION_ENDED: "CONS_202";
|
|
81
|
+
readonly PRESCRIPTION_GENERATION_FAILED: "CONS_203";
|
|
82
|
+
};
|
|
83
|
+
export declare const PAYMENT_ERROR_CODES: {
|
|
84
|
+
readonly INSUFFICIENT_BALANCE: "PAY_001";
|
|
85
|
+
readonly WALLET_NOT_FOUND: "PAY_002";
|
|
86
|
+
readonly WALLET_LOCKED: "PAY_003";
|
|
87
|
+
readonly MINIMUM_BALANCE_ERROR: "PAY_004";
|
|
88
|
+
readonly PAYMENT_FAILED: "PAY_101";
|
|
89
|
+
readonly PAYMENT_GATEWAY_ERROR: "PAY_102";
|
|
90
|
+
readonly INVALID_PAYMENT_METHOD: "PAY_103";
|
|
91
|
+
readonly PAYMENT_ALREADY_PROCESSED: "PAY_104";
|
|
92
|
+
readonly REFUND_FAILED: "PAY_105";
|
|
93
|
+
readonly CARD_NOT_FOUND: "PAY_201";
|
|
94
|
+
readonly CARD_EXPIRED: "PAY_202";
|
|
95
|
+
readonly CARD_DECLINED: "PAY_203";
|
|
96
|
+
readonly INVALID_CARD_DETAILS: "PAY_204";
|
|
97
|
+
};
|
|
98
|
+
export declare const LAB_ERROR_CODES: {
|
|
99
|
+
readonly LAB_NOT_FOUND: "LAB_001";
|
|
100
|
+
readonly LAB_CLOSED: "LAB_002";
|
|
101
|
+
readonly TEST_NOT_AVAILABLE: "LAB_003";
|
|
102
|
+
readonly LAB_APPOINTMENT_NOT_FOUND: "LAB_101";
|
|
103
|
+
readonly TIME_SLOT_UNAVAILABLE: "LAB_102";
|
|
104
|
+
readonly APPOINTMENT_BOOKING_FAILED: "LAB_103";
|
|
105
|
+
readonly REPORT_NOT_FOUND: "LAB_201";
|
|
106
|
+
readonly REPORT_UPLOAD_FAILED: "LAB_202";
|
|
107
|
+
readonly REPORT_GENERATION_FAILED: "LAB_203";
|
|
108
|
+
};
|
|
109
|
+
export declare const NOTIFICATION_ERROR_CODES: {
|
|
110
|
+
readonly NOTIFICATION_NOT_FOUND: "NOTIF_001";
|
|
111
|
+
readonly NOTIFICATION_SEND_FAILED: "NOTIF_002";
|
|
112
|
+
readonly INVALID_NOTIFICATION_TYPE: "NOTIF_003";
|
|
113
|
+
readonly SETTINGS_UPDATE_FAILED: "NOTIF_101";
|
|
114
|
+
readonly INVALID_SETTINGS: "NOTIF_102";
|
|
115
|
+
};
|
|
116
|
+
export declare const SEARCH_ERROR_CODES: {
|
|
117
|
+
readonly SEARCH_FAILED: "SEARCH_001";
|
|
118
|
+
readonly INVALID_SEARCH_QUERY: "SEARCH_002";
|
|
119
|
+
readonly ELASTICSEARCH_ERROR: "SEARCH_003";
|
|
120
|
+
readonly INDEX_NOT_FOUND: "SEARCH_004";
|
|
121
|
+
};
|
|
122
|
+
export declare const TELEMEDICINE_ERROR_CODES: {
|
|
123
|
+
readonly SESSION_NOT_FOUND: "TELE_001";
|
|
124
|
+
readonly SESSION_EXPIRED: "TELE_002";
|
|
125
|
+
readonly SESSION_CREATION_FAILED: "TELE_003";
|
|
126
|
+
readonly INVALID_SESSION_TOKEN: "TELE_004";
|
|
127
|
+
readonly VIDEO_CONNECTION_FAILED: "TELE_101";
|
|
128
|
+
readonly CHAT_SEND_FAILED: "TELE_102";
|
|
129
|
+
readonly RECORDING_FAILED: "TELE_103";
|
|
130
|
+
readonly DOCUMENT_UPLOAD_FAILED: "TELE_201";
|
|
131
|
+
readonly DOCUMENT_NOT_FOUND: "TELE_202";
|
|
132
|
+
};
|
|
133
|
+
export declare const SETTINGS_ERROR_CODES: {
|
|
134
|
+
readonly USER_SETTINGS_NOT_FOUND: "SET_001";
|
|
135
|
+
readonly SETTINGS_UPDATE_FAILED: "SET_002";
|
|
136
|
+
readonly INVALID_PREFERENCE: "SET_003";
|
|
137
|
+
readonly PRIVACY_SETTINGS_ERROR: "SET_101";
|
|
138
|
+
readonly DATA_EXPORT_FAILED: "SET_102";
|
|
139
|
+
};
|
|
140
|
+
export declare const SUCCESS_CODES: {
|
|
141
|
+
readonly OPERATION_SUCCESSFUL: "SUC_001";
|
|
142
|
+
readonly CREATED_SUCCESSFULLY: "SUC_002";
|
|
143
|
+
readonly UPDATED_SUCCESSFULLY: "SUC_003";
|
|
144
|
+
readonly DELETED_SUCCESSFULLY: "SUC_004";
|
|
145
|
+
readonly RETRIEVED_SUCCESSFULLY: "SUC_005";
|
|
146
|
+
readonly USER_REGISTERED: "AUTH_SUC_001";
|
|
147
|
+
readonly USER_LOGGED_IN: "AUTH_SUC_002";
|
|
148
|
+
readonly USER_LOGGED_OUT: "AUTH_SUC_003";
|
|
149
|
+
readonly TOKEN_REFRESHED: "AUTH_SUC_004";
|
|
150
|
+
readonly PROFILE_UPDATED: "AUTH_SUC_005";
|
|
151
|
+
readonly OTP_SENT_SUCCESSFULLY: "AUTH_SUC_006";
|
|
152
|
+
readonly OTP_VERIFIED_SUCCESSFULLY: "AUTH_SUC_007";
|
|
153
|
+
readonly MPIN_CREATED_SUCCESSFULLY: "AUTH_SUC_008";
|
|
154
|
+
readonly PATIENT_REGISTRATION_COMPLETED: "AUTH_SUC_009";
|
|
155
|
+
readonly PATIENT_LOGIN_SUCCESSFUL: "AUTH_SUC_010";
|
|
156
|
+
readonly SESSION_CREATED_SUCCESSFULLY: "AUTH_SUC_011";
|
|
157
|
+
readonly ORDER_PLACED: "PHARM_SUC_001";
|
|
158
|
+
readonly ORDER_UPDATED: "PHARM_SUC_002";
|
|
159
|
+
readonly ORDER_CANCELLED: "PHARM_SUC_003";
|
|
160
|
+
readonly PRESCRIPTION_UPLOADED: "PHARM_SUC_004";
|
|
161
|
+
readonly APPOINTMENT_BOOKED: "CONS_SUC_001";
|
|
162
|
+
readonly APPOINTMENT_COMPLETED: "CONS_SUC_002";
|
|
163
|
+
readonly PRESCRIPTION_GENERATED: "CONS_SUC_003";
|
|
164
|
+
readonly PAYMENT_PROCESSED: "PAY_SUC_001";
|
|
165
|
+
readonly REFUND_PROCESSED: "PAY_SUC_002";
|
|
166
|
+
readonly WALLET_RECHARGED: "PAY_SUC_003";
|
|
167
|
+
readonly LAB_APPOINTMENT_BOOKED: "LAB_SUC_001";
|
|
168
|
+
readonly REPORT_UPLOADED: "LAB_SUC_002";
|
|
169
|
+
readonly NOTIFICATION_SENT: "NOTIF_SUC_001";
|
|
170
|
+
readonly SETTINGS_UPDATED: "NOTIF_SUC_002";
|
|
171
|
+
};
|
|
172
|
+
export declare const ERROR_CODES: {
|
|
173
|
+
readonly USER_SETTINGS_NOT_FOUND: "SET_001";
|
|
174
|
+
readonly SETTINGS_UPDATE_FAILED: "SET_002";
|
|
175
|
+
readonly INVALID_PREFERENCE: "SET_003";
|
|
176
|
+
readonly PRIVACY_SETTINGS_ERROR: "SET_101";
|
|
177
|
+
readonly DATA_EXPORT_FAILED: "SET_102";
|
|
178
|
+
readonly SESSION_NOT_FOUND: "TELE_001";
|
|
179
|
+
readonly SESSION_EXPIRED: "TELE_002";
|
|
180
|
+
readonly SESSION_CREATION_FAILED: "TELE_003";
|
|
181
|
+
readonly INVALID_SESSION_TOKEN: "TELE_004";
|
|
182
|
+
readonly VIDEO_CONNECTION_FAILED: "TELE_101";
|
|
183
|
+
readonly CHAT_SEND_FAILED: "TELE_102";
|
|
184
|
+
readonly RECORDING_FAILED: "TELE_103";
|
|
185
|
+
readonly DOCUMENT_UPLOAD_FAILED: "TELE_201";
|
|
186
|
+
readonly DOCUMENT_NOT_FOUND: "TELE_202";
|
|
187
|
+
readonly SEARCH_FAILED: "SEARCH_001";
|
|
188
|
+
readonly INVALID_SEARCH_QUERY: "SEARCH_002";
|
|
189
|
+
readonly ELASTICSEARCH_ERROR: "SEARCH_003";
|
|
190
|
+
readonly INDEX_NOT_FOUND: "SEARCH_004";
|
|
191
|
+
readonly NOTIFICATION_NOT_FOUND: "NOTIF_001";
|
|
192
|
+
readonly NOTIFICATION_SEND_FAILED: "NOTIF_002";
|
|
193
|
+
readonly INVALID_NOTIFICATION_TYPE: "NOTIF_003";
|
|
194
|
+
readonly INVALID_SETTINGS: "NOTIF_102";
|
|
195
|
+
readonly LAB_NOT_FOUND: "LAB_001";
|
|
196
|
+
readonly LAB_CLOSED: "LAB_002";
|
|
197
|
+
readonly TEST_NOT_AVAILABLE: "LAB_003";
|
|
198
|
+
readonly LAB_APPOINTMENT_NOT_FOUND: "LAB_101";
|
|
199
|
+
readonly TIME_SLOT_UNAVAILABLE: "LAB_102";
|
|
200
|
+
readonly APPOINTMENT_BOOKING_FAILED: "LAB_103";
|
|
201
|
+
readonly REPORT_NOT_FOUND: "LAB_201";
|
|
202
|
+
readonly REPORT_UPLOAD_FAILED: "LAB_202";
|
|
203
|
+
readonly REPORT_GENERATION_FAILED: "LAB_203";
|
|
204
|
+
readonly INSUFFICIENT_BALANCE: "PAY_001";
|
|
205
|
+
readonly WALLET_NOT_FOUND: "PAY_002";
|
|
206
|
+
readonly WALLET_LOCKED: "PAY_003";
|
|
207
|
+
readonly MINIMUM_BALANCE_ERROR: "PAY_004";
|
|
208
|
+
readonly PAYMENT_FAILED: "PAY_101";
|
|
209
|
+
readonly PAYMENT_GATEWAY_ERROR: "PAY_102";
|
|
210
|
+
readonly INVALID_PAYMENT_METHOD: "PAY_103";
|
|
211
|
+
readonly PAYMENT_ALREADY_PROCESSED: "PAY_104";
|
|
212
|
+
readonly REFUND_FAILED: "PAY_105";
|
|
213
|
+
readonly CARD_NOT_FOUND: "PAY_201";
|
|
214
|
+
readonly CARD_EXPIRED: "PAY_202";
|
|
215
|
+
readonly CARD_DECLINED: "PAY_203";
|
|
216
|
+
readonly INVALID_CARD_DETAILS: "PAY_204";
|
|
217
|
+
readonly DOCTOR_NOT_FOUND: "CONS_001";
|
|
218
|
+
readonly DOCTOR_UNAVAILABLE: "CONS_002";
|
|
219
|
+
readonly INVALID_SPECIALTY: "CONS_003";
|
|
220
|
+
readonly APPOINTMENT_NOT_FOUND: "CONS_101";
|
|
221
|
+
readonly APPOINTMENT_ALREADY_BOOKED: "CONS_102";
|
|
222
|
+
readonly APPOINTMENT_CANCELLED: "CONS_103";
|
|
223
|
+
readonly INVALID_TIME_SLOT: "CONS_104";
|
|
224
|
+
readonly APPOINTMENT_IN_PAST: "CONS_105";
|
|
225
|
+
readonly BOOKING_WINDOW_CLOSED: "CONS_106";
|
|
226
|
+
readonly CONSULTATION_NOT_STARTED: "CONS_201";
|
|
227
|
+
readonly CONSULTATION_ENDED: "CONS_202";
|
|
228
|
+
readonly PRESCRIPTION_GENERATION_FAILED: "CONS_203";
|
|
229
|
+
readonly PHARMACY_NOT_FOUND: "PHARM_001";
|
|
230
|
+
readonly PHARMACY_CLOSED: "PHARM_002";
|
|
231
|
+
readonly MEDICINE_NOT_FOUND: "PHARM_003";
|
|
232
|
+
readonly MEDICINE_OUT_OF_STOCK: "PHARM_004";
|
|
233
|
+
readonly PRESCRIPTION_REQUIRED: "PHARM_005";
|
|
234
|
+
readonly ORDER_NOT_FOUND: "PHARM_101";
|
|
235
|
+
readonly ORDER_ALREADY_CANCELLED: "PHARM_102";
|
|
236
|
+
readonly ORDER_CANNOT_BE_MODIFIED: "PHARM_103";
|
|
237
|
+
readonly INVALID_ORDER_STATUS: "PHARM_104";
|
|
238
|
+
readonly INSUFFICIENT_STOCK: "PHARM_105";
|
|
239
|
+
readonly INVALID_PRESCRIPTION: "PHARM_201";
|
|
240
|
+
readonly PRESCRIPTION_EXPIRED: "PHARM_202";
|
|
241
|
+
readonly PRESCRIPTION_UPLOAD_FAILED: "PHARM_203";
|
|
242
|
+
readonly INVALID_CREDENTIALS: "AUTH_001";
|
|
243
|
+
readonly USER_NOT_FOUND: "AUTH_002";
|
|
244
|
+
readonly EMAIL_ALREADY_EXISTS: "AUTH_003";
|
|
245
|
+
readonly WEAK_PASSWORD: "AUTH_004";
|
|
246
|
+
readonly ACCOUNT_LOCKED: "AUTH_005";
|
|
247
|
+
readonly EMAIL_NOT_VERIFIED: "AUTH_006";
|
|
248
|
+
readonly INVALID_TOKEN: "AUTH_101";
|
|
249
|
+
readonly TOKEN_EXPIRED: "AUTH_102";
|
|
250
|
+
readonly TOKEN_BLACKLISTED: "AUTH_103";
|
|
251
|
+
readonly REFRESH_TOKEN_INVALID: "AUTH_104";
|
|
252
|
+
readonly PROFILE_UPDATE_FAILED: "AUTH_201";
|
|
253
|
+
readonly ADDRESS_NOT_FOUND: "AUTH_202";
|
|
254
|
+
readonly ADDRESS_LIMIT_EXCEEDED: "AUTH_203";
|
|
255
|
+
readonly MOBILE_NUMBER_ALREADY_EXISTS: "AUTH_301";
|
|
256
|
+
readonly INVALID_MOBILE_NUMBER: "AUTH_302";
|
|
257
|
+
readonly OTP_SEND_FAILED: "AUTH_303";
|
|
258
|
+
readonly INVALID_OTP: "AUTH_304";
|
|
259
|
+
readonly OTP_EXPIRED: "AUTH_305";
|
|
260
|
+
readonly OTP_MAX_ATTEMPTS_EXCEEDED: "AUTH_306";
|
|
261
|
+
readonly MPIN_ALREADY_SET: "AUTH_307";
|
|
262
|
+
readonly INVALID_MPIN_FORMAT: "AUTH_308";
|
|
263
|
+
readonly MPIN_CREATION_FAILED: "AUTH_309";
|
|
264
|
+
readonly REGISTRATION_INCOMPLETE: "AUTH_310";
|
|
265
|
+
readonly REGISTRATION_ALREADY_COMPLETE: "AUTH_311";
|
|
266
|
+
readonly INVALID_REGION: "AUTH_312";
|
|
267
|
+
readonly MULTIPLE_SESSIONS_DETECTED: "AUTH_405";
|
|
268
|
+
readonly DEVICE_NOT_AUTHORIZED: "AUTH_406";
|
|
269
|
+
readonly INTERNAL_SERVER_ERROR: "CMN_001";
|
|
270
|
+
readonly VALIDATION_ERROR: "CMN_002";
|
|
271
|
+
readonly INVALID_REQUEST: "CMN_003";
|
|
272
|
+
readonly RESOURCE_NOT_FOUND: "CMN_004";
|
|
273
|
+
readonly UNAUTHORIZED: "CMN_005";
|
|
274
|
+
readonly FORBIDDEN: "CMN_006";
|
|
275
|
+
readonly RATE_LIMIT_EXCEEDED: "CMN_007";
|
|
276
|
+
readonly DATABASE_CONNECTION_ERROR: "CMN_101";
|
|
277
|
+
readonly DATABASE_QUERY_ERROR: "CMN_102";
|
|
278
|
+
readonly DUPLICATE_ENTRY: "CMN_103";
|
|
279
|
+
readonly KAFKA_CONNECTION_ERROR: "CMN_201";
|
|
280
|
+
readonly REDIS_CONNECTION_ERROR: "CMN_202";
|
|
281
|
+
readonly EMAIL_SERVICE_ERROR: "CMN_203";
|
|
282
|
+
readonly SMS_SERVICE_ERROR: "CMN_204";
|
|
283
|
+
};
|
|
284
|
+
export type ErrorCode = typeof ERROR_CODES[keyof typeof ERROR_CODES];
|
|
285
|
+
export type SuccessCode = typeof SUCCESS_CODES[keyof typeof SUCCESS_CODES];
|
|
286
|
+
//# sourceMappingURL=error-codes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error-codes.d.ts","sourceRoot":"","sources":["../src/error-codes.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;CAoBrB,CAAC;AAGX,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyCnB,CAAC;AAGX,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;CAmBvB,CAAC;AAGX,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;CAkB3B,CAAC;AAGX,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;CAmBtB,CAAC;AAGX,eAAO,MAAM,eAAe;;;;;;;;;;CAelB,CAAC;AAGX,eAAO,MAAM,wBAAwB;;;;;;CAS3B,CAAC;AAGX,eAAO,MAAM,kBAAkB;;;;;CAMrB,CAAC;AAGX,eAAO,MAAM,wBAAwB;;;;;;;;;;CAe3B,CAAC;AAGX,eAAO,MAAM,oBAAoB;;;;;;CASvB,CAAC;AAGX,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8ChB,CAAC;AAGX,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAWd,CAAC;AAEX,MAAM,MAAM,SAAS,GAAG,OAAO,WAAW,CAAC,MAAM,OAAO,WAAW,CAAC,CAAC;AACrE,MAAM,MAAM,WAAW,GAAG,OAAO,aAAa,CAAC,MAAM,OAAO,aAAa,CAAC,CAAC"}
|
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Standardized Error Codes for all services
|
|
4
|
+
* Format: SERVICE_DOMAIN_ERROR
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.ERROR_CODES = exports.SUCCESS_CODES = exports.SETTINGS_ERROR_CODES = exports.TELEMEDICINE_ERROR_CODES = exports.SEARCH_ERROR_CODES = exports.NOTIFICATION_ERROR_CODES = exports.LAB_ERROR_CODES = exports.PAYMENT_ERROR_CODES = exports.CONSULTATION_ERROR_CODES = exports.PHARMACY_ERROR_CODES = exports.AUTH_ERROR_CODES = exports.COMMON_ERROR_CODES = void 0;
|
|
8
|
+
// Common Error Codes (1000-1999)
|
|
9
|
+
exports.COMMON_ERROR_CODES = {
|
|
10
|
+
// General errors
|
|
11
|
+
INTERNAL_SERVER_ERROR: 'CMN_001',
|
|
12
|
+
VALIDATION_ERROR: 'CMN_002',
|
|
13
|
+
INVALID_REQUEST: 'CMN_003',
|
|
14
|
+
RESOURCE_NOT_FOUND: 'CMN_004',
|
|
15
|
+
UNAUTHORIZED: 'CMN_005',
|
|
16
|
+
FORBIDDEN: 'CMN_006',
|
|
17
|
+
RATE_LIMIT_EXCEEDED: 'CMN_007',
|
|
18
|
+
// Database errors
|
|
19
|
+
DATABASE_CONNECTION_ERROR: 'CMN_101',
|
|
20
|
+
DATABASE_QUERY_ERROR: 'CMN_102',
|
|
21
|
+
DUPLICATE_ENTRY: 'CMN_103',
|
|
22
|
+
// External service errors
|
|
23
|
+
KAFKA_CONNECTION_ERROR: 'CMN_201',
|
|
24
|
+
REDIS_CONNECTION_ERROR: 'CMN_202',
|
|
25
|
+
EMAIL_SERVICE_ERROR: 'CMN_203',
|
|
26
|
+
SMS_SERVICE_ERROR: 'CMN_204',
|
|
27
|
+
};
|
|
28
|
+
// Auth Service Error Codes (2000-2999)
|
|
29
|
+
exports.AUTH_ERROR_CODES = {
|
|
30
|
+
// Authentication errors
|
|
31
|
+
INVALID_CREDENTIALS: 'AUTH_001',
|
|
32
|
+
USER_NOT_FOUND: 'AUTH_002',
|
|
33
|
+
EMAIL_ALREADY_EXISTS: 'AUTH_003',
|
|
34
|
+
WEAK_PASSWORD: 'AUTH_004',
|
|
35
|
+
ACCOUNT_LOCKED: 'AUTH_005',
|
|
36
|
+
EMAIL_NOT_VERIFIED: 'AUTH_006',
|
|
37
|
+
// Token errors
|
|
38
|
+
INVALID_TOKEN: 'AUTH_101',
|
|
39
|
+
TOKEN_EXPIRED: 'AUTH_102',
|
|
40
|
+
TOKEN_BLACKLISTED: 'AUTH_103',
|
|
41
|
+
REFRESH_TOKEN_INVALID: 'AUTH_104',
|
|
42
|
+
// Profile errors
|
|
43
|
+
PROFILE_UPDATE_FAILED: 'AUTH_201',
|
|
44
|
+
ADDRESS_NOT_FOUND: 'AUTH_202',
|
|
45
|
+
ADDRESS_LIMIT_EXCEEDED: 'AUTH_203',
|
|
46
|
+
// Patient Registration & OTP errors
|
|
47
|
+
MOBILE_NUMBER_ALREADY_EXISTS: 'AUTH_301',
|
|
48
|
+
INVALID_MOBILE_NUMBER: 'AUTH_302',
|
|
49
|
+
OTP_SEND_FAILED: 'AUTH_303',
|
|
50
|
+
INVALID_OTP: 'AUTH_304',
|
|
51
|
+
OTP_EXPIRED: 'AUTH_305',
|
|
52
|
+
OTP_MAX_ATTEMPTS_EXCEEDED: 'AUTH_306',
|
|
53
|
+
MPIN_ALREADY_SET: 'AUTH_307',
|
|
54
|
+
INVALID_MPIN_FORMAT: 'AUTH_308',
|
|
55
|
+
MPIN_CREATION_FAILED: 'AUTH_309',
|
|
56
|
+
REGISTRATION_INCOMPLETE: 'AUTH_310',
|
|
57
|
+
REGISTRATION_ALREADY_COMPLETE: 'AUTH_311',
|
|
58
|
+
INVALID_REGION: 'AUTH_312',
|
|
59
|
+
// Session errors
|
|
60
|
+
SESSION_NOT_FOUND: 'AUTH_401',
|
|
61
|
+
SESSION_EXPIRED: 'AUTH_402',
|
|
62
|
+
SESSION_CREATION_FAILED: 'AUTH_403',
|
|
63
|
+
INVALID_SESSION_TOKEN: 'AUTH_404',
|
|
64
|
+
MULTIPLE_SESSIONS_DETECTED: 'AUTH_405',
|
|
65
|
+
DEVICE_NOT_AUTHORIZED: 'AUTH_406',
|
|
66
|
+
};
|
|
67
|
+
// Pharmacy Service Error Codes (3000-3999)
|
|
68
|
+
exports.PHARMACY_ERROR_CODES = {
|
|
69
|
+
// Pharmacy errors
|
|
70
|
+
PHARMACY_NOT_FOUND: 'PHARM_001',
|
|
71
|
+
PHARMACY_CLOSED: 'PHARM_002',
|
|
72
|
+
MEDICINE_NOT_FOUND: 'PHARM_003',
|
|
73
|
+
MEDICINE_OUT_OF_STOCK: 'PHARM_004',
|
|
74
|
+
PRESCRIPTION_REQUIRED: 'PHARM_005',
|
|
75
|
+
// Order errors
|
|
76
|
+
ORDER_NOT_FOUND: 'PHARM_101',
|
|
77
|
+
ORDER_ALREADY_CANCELLED: 'PHARM_102',
|
|
78
|
+
ORDER_CANNOT_BE_MODIFIED: 'PHARM_103',
|
|
79
|
+
INVALID_ORDER_STATUS: 'PHARM_104',
|
|
80
|
+
INSUFFICIENT_STOCK: 'PHARM_105',
|
|
81
|
+
// Prescription errors
|
|
82
|
+
INVALID_PRESCRIPTION: 'PHARM_201',
|
|
83
|
+
PRESCRIPTION_EXPIRED: 'PHARM_202',
|
|
84
|
+
PRESCRIPTION_UPLOAD_FAILED: 'PHARM_203',
|
|
85
|
+
};
|
|
86
|
+
// Consultation Service Error Codes (4000-4999)
|
|
87
|
+
exports.CONSULTATION_ERROR_CODES = {
|
|
88
|
+
// Doctor errors
|
|
89
|
+
DOCTOR_NOT_FOUND: 'CONS_001',
|
|
90
|
+
DOCTOR_UNAVAILABLE: 'CONS_002',
|
|
91
|
+
INVALID_SPECIALTY: 'CONS_003',
|
|
92
|
+
// Appointment errors
|
|
93
|
+
APPOINTMENT_NOT_FOUND: 'CONS_101',
|
|
94
|
+
APPOINTMENT_ALREADY_BOOKED: 'CONS_102',
|
|
95
|
+
APPOINTMENT_CANCELLED: 'CONS_103',
|
|
96
|
+
INVALID_TIME_SLOT: 'CONS_104',
|
|
97
|
+
APPOINTMENT_IN_PAST: 'CONS_105',
|
|
98
|
+
BOOKING_WINDOW_CLOSED: 'CONS_106',
|
|
99
|
+
// Consultation errors
|
|
100
|
+
CONSULTATION_NOT_STARTED: 'CONS_201',
|
|
101
|
+
CONSULTATION_ENDED: 'CONS_202',
|
|
102
|
+
PRESCRIPTION_GENERATION_FAILED: 'CONS_203',
|
|
103
|
+
};
|
|
104
|
+
// Payment Service Error Codes (5000-5999)
|
|
105
|
+
exports.PAYMENT_ERROR_CODES = {
|
|
106
|
+
// Wallet errors
|
|
107
|
+
INSUFFICIENT_BALANCE: 'PAY_001',
|
|
108
|
+
WALLET_NOT_FOUND: 'PAY_002',
|
|
109
|
+
WALLET_LOCKED: 'PAY_003',
|
|
110
|
+
MINIMUM_BALANCE_ERROR: 'PAY_004',
|
|
111
|
+
// Payment errors
|
|
112
|
+
PAYMENT_FAILED: 'PAY_101',
|
|
113
|
+
PAYMENT_GATEWAY_ERROR: 'PAY_102',
|
|
114
|
+
INVALID_PAYMENT_METHOD: 'PAY_103',
|
|
115
|
+
PAYMENT_ALREADY_PROCESSED: 'PAY_104',
|
|
116
|
+
REFUND_FAILED: 'PAY_105',
|
|
117
|
+
// Card errors
|
|
118
|
+
CARD_NOT_FOUND: 'PAY_201',
|
|
119
|
+
CARD_EXPIRED: 'PAY_202',
|
|
120
|
+
CARD_DECLINED: 'PAY_203',
|
|
121
|
+
INVALID_CARD_DETAILS: 'PAY_204',
|
|
122
|
+
};
|
|
123
|
+
// Lab Service Error Codes (6000-6999)
|
|
124
|
+
exports.LAB_ERROR_CODES = {
|
|
125
|
+
// Lab errors
|
|
126
|
+
LAB_NOT_FOUND: 'LAB_001',
|
|
127
|
+
LAB_CLOSED: 'LAB_002',
|
|
128
|
+
TEST_NOT_AVAILABLE: 'LAB_003',
|
|
129
|
+
// Appointment errors
|
|
130
|
+
LAB_APPOINTMENT_NOT_FOUND: 'LAB_101',
|
|
131
|
+
TIME_SLOT_UNAVAILABLE: 'LAB_102',
|
|
132
|
+
APPOINTMENT_BOOKING_FAILED: 'LAB_103',
|
|
133
|
+
// Report errors
|
|
134
|
+
REPORT_NOT_FOUND: 'LAB_201',
|
|
135
|
+
REPORT_UPLOAD_FAILED: 'LAB_202',
|
|
136
|
+
REPORT_GENERATION_FAILED: 'LAB_203',
|
|
137
|
+
};
|
|
138
|
+
// Notification Service Error Codes (7000-7999)
|
|
139
|
+
exports.NOTIFICATION_ERROR_CODES = {
|
|
140
|
+
// Notification errors
|
|
141
|
+
NOTIFICATION_NOT_FOUND: 'NOTIF_001',
|
|
142
|
+
NOTIFICATION_SEND_FAILED: 'NOTIF_002',
|
|
143
|
+
INVALID_NOTIFICATION_TYPE: 'NOTIF_003',
|
|
144
|
+
// Settings errors
|
|
145
|
+
SETTINGS_UPDATE_FAILED: 'NOTIF_101',
|
|
146
|
+
INVALID_SETTINGS: 'NOTIF_102',
|
|
147
|
+
};
|
|
148
|
+
// Search Service Error Codes (8000-8999)
|
|
149
|
+
exports.SEARCH_ERROR_CODES = {
|
|
150
|
+
// Search errors
|
|
151
|
+
SEARCH_FAILED: 'SEARCH_001',
|
|
152
|
+
INVALID_SEARCH_QUERY: 'SEARCH_002',
|
|
153
|
+
ELASTICSEARCH_ERROR: 'SEARCH_003',
|
|
154
|
+
INDEX_NOT_FOUND: 'SEARCH_004',
|
|
155
|
+
};
|
|
156
|
+
// Telemedicine Service Error Codes (9000-9999)
|
|
157
|
+
exports.TELEMEDICINE_ERROR_CODES = {
|
|
158
|
+
// Session errors
|
|
159
|
+
SESSION_NOT_FOUND: 'TELE_001',
|
|
160
|
+
SESSION_EXPIRED: 'TELE_002',
|
|
161
|
+
SESSION_CREATION_FAILED: 'TELE_003',
|
|
162
|
+
INVALID_SESSION_TOKEN: 'TELE_004',
|
|
163
|
+
// Video/Chat errors
|
|
164
|
+
VIDEO_CONNECTION_FAILED: 'TELE_101',
|
|
165
|
+
CHAT_SEND_FAILED: 'TELE_102',
|
|
166
|
+
RECORDING_FAILED: 'TELE_103',
|
|
167
|
+
// Document errors
|
|
168
|
+
DOCUMENT_UPLOAD_FAILED: 'TELE_201',
|
|
169
|
+
DOCUMENT_NOT_FOUND: 'TELE_202',
|
|
170
|
+
};
|
|
171
|
+
// Settings Service Error Codes (10000-10999)
|
|
172
|
+
exports.SETTINGS_ERROR_CODES = {
|
|
173
|
+
// User settings errors
|
|
174
|
+
USER_SETTINGS_NOT_FOUND: 'SET_001',
|
|
175
|
+
SETTINGS_UPDATE_FAILED: 'SET_002',
|
|
176
|
+
INVALID_PREFERENCE: 'SET_003',
|
|
177
|
+
// Privacy errors
|
|
178
|
+
PRIVACY_SETTINGS_ERROR: 'SET_101',
|
|
179
|
+
DATA_EXPORT_FAILED: 'SET_102',
|
|
180
|
+
};
|
|
181
|
+
// Success Codes for each service
|
|
182
|
+
exports.SUCCESS_CODES = {
|
|
183
|
+
// Common success codes
|
|
184
|
+
OPERATION_SUCCESSFUL: 'SUC_001',
|
|
185
|
+
CREATED_SUCCESSFULLY: 'SUC_002',
|
|
186
|
+
UPDATED_SUCCESSFULLY: 'SUC_003',
|
|
187
|
+
DELETED_SUCCESSFULLY: 'SUC_004',
|
|
188
|
+
RETRIEVED_SUCCESSFULLY: 'SUC_005',
|
|
189
|
+
// Auth specific
|
|
190
|
+
USER_REGISTERED: 'AUTH_SUC_001',
|
|
191
|
+
USER_LOGGED_IN: 'AUTH_SUC_002',
|
|
192
|
+
USER_LOGGED_OUT: 'AUTH_SUC_003',
|
|
193
|
+
TOKEN_REFRESHED: 'AUTH_SUC_004',
|
|
194
|
+
PROFILE_UPDATED: 'AUTH_SUC_005',
|
|
195
|
+
// Patient registration specific
|
|
196
|
+
OTP_SENT_SUCCESSFULLY: 'AUTH_SUC_006',
|
|
197
|
+
OTP_VERIFIED_SUCCESSFULLY: 'AUTH_SUC_007',
|
|
198
|
+
MPIN_CREATED_SUCCESSFULLY: 'AUTH_SUC_008',
|
|
199
|
+
PATIENT_REGISTRATION_COMPLETED: 'AUTH_SUC_009',
|
|
200
|
+
PATIENT_LOGIN_SUCCESSFUL: 'AUTH_SUC_010',
|
|
201
|
+
SESSION_CREATED_SUCCESSFULLY: 'AUTH_SUC_011',
|
|
202
|
+
// Pharmacy specific
|
|
203
|
+
ORDER_PLACED: 'PHARM_SUC_001',
|
|
204
|
+
ORDER_UPDATED: 'PHARM_SUC_002',
|
|
205
|
+
ORDER_CANCELLED: 'PHARM_SUC_003',
|
|
206
|
+
PRESCRIPTION_UPLOADED: 'PHARM_SUC_004',
|
|
207
|
+
// Consultation specific
|
|
208
|
+
APPOINTMENT_BOOKED: 'CONS_SUC_001',
|
|
209
|
+
APPOINTMENT_COMPLETED: 'CONS_SUC_002',
|
|
210
|
+
PRESCRIPTION_GENERATED: 'CONS_SUC_003',
|
|
211
|
+
// Payment specific
|
|
212
|
+
PAYMENT_PROCESSED: 'PAY_SUC_001',
|
|
213
|
+
REFUND_PROCESSED: 'PAY_SUC_002',
|
|
214
|
+
WALLET_RECHARGED: 'PAY_SUC_003',
|
|
215
|
+
// Lab specific
|
|
216
|
+
LAB_APPOINTMENT_BOOKED: 'LAB_SUC_001',
|
|
217
|
+
REPORT_UPLOADED: 'LAB_SUC_002',
|
|
218
|
+
// Notification specific
|
|
219
|
+
NOTIFICATION_SENT: 'NOTIF_SUC_001',
|
|
220
|
+
SETTINGS_UPDATED: 'NOTIF_SUC_002',
|
|
221
|
+
};
|
|
222
|
+
// All error codes combined for easy import
|
|
223
|
+
exports.ERROR_CODES = {
|
|
224
|
+
...exports.COMMON_ERROR_CODES,
|
|
225
|
+
...exports.AUTH_ERROR_CODES,
|
|
226
|
+
...exports.PHARMACY_ERROR_CODES,
|
|
227
|
+
...exports.CONSULTATION_ERROR_CODES,
|
|
228
|
+
...exports.PAYMENT_ERROR_CODES,
|
|
229
|
+
...exports.LAB_ERROR_CODES,
|
|
230
|
+
...exports.NOTIFICATION_ERROR_CODES,
|
|
231
|
+
...exports.SEARCH_ERROR_CODES,
|
|
232
|
+
...exports.TELEMEDICINE_ERROR_CODES,
|
|
233
|
+
...exports.SETTINGS_ERROR_CODES,
|
|
234
|
+
};
|
|
235
|
+
//# sourceMappingURL=error-codes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
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IAE9B,wBAAwB;IACxB,iBAAiB,EAAE,eAAe;IAClC,gBAAgB,EAAE,eAAe;CACzB,CAAC;AAEX,2CAA2C;AAC9B,QAAA,WAAW,GAAG;IACzB,GAAG,0BAAkB;IACrB,GAAG,wBAAgB;IACnB,GAAG,4BAAoB;IACvB,GAAG,gCAAwB;IAC3B,GAAG,2BAAmB;IACtB,GAAG,uBAAe;IAClB,GAAG,gCAAwB;IAC3B,GAAG,0BAAkB;IACrB,GAAG,gCAAwB;IAC3B,GAAG,4BAAoB;CACf,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ExceptionFilter, ArgumentsHost, HttpStatus } from '@nestjs/common';
|
|
2
|
+
import { ErrorCode } from '../error-codes';
|
|
3
|
+
/**
|
|
4
|
+
* Custom exception class for business logic errors
|
|
5
|
+
*/
|
|
6
|
+
export declare class BusinessException extends Error {
|
|
7
|
+
errorCode: ErrorCode;
|
|
8
|
+
statusCode: HttpStatus;
|
|
9
|
+
constructor(message: string, errorCode: ErrorCode, statusCode?: HttpStatus);
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Global exception filter that standardizes all error responses
|
|
13
|
+
* Implements DRY principle by centralizing error handling
|
|
14
|
+
*/
|
|
15
|
+
export declare class GlobalExceptionFilter implements ExceptionFilter {
|
|
16
|
+
private readonly logger;
|
|
17
|
+
catch(exception: unknown, host: ArgumentsHost): void;
|
|
18
|
+
/**
|
|
19
|
+
* Map HTTP status codes to appropriate error codes
|
|
20
|
+
*/
|
|
21
|
+
private mapHttpStatusToErrorCode;
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=global-exception.filter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"global-exception.filter.d.ts","sourceRoot":"","sources":["../../src/filters/global-exception.filter.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EAEf,aAAa,EAEb,UAAU,EAEX,MAAM,gBAAgB,CAAC;AAGxB,OAAO,EAAe,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAExD;;GAEG;AACH,qBAAa,iBAAkB,SAAQ,KAAK;IAGjC,SAAS,EAAE,SAAS;IACpB,UAAU,EAAE,UAAU;gBAF7B,OAAO,EAAE,MAAM,EACR,SAAS,EAAE,SAAS,EACpB,UAAU,GAAE,UAAmC;CAKzD;AAED;;;GAGG;AACH,qBACa,qBAAsB,YAAW,eAAe;IAC3D,OAAO,CAAC,QAAQ,CAAC,MAAM,CAA0C;IAEjE,KAAK,CAAC,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,aAAa;IA4D7C;;OAEG;IACH,OAAO,CAAC,wBAAwB;CAoBjC"}
|