dl-commons 0.1.9 → 0.1.11

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.
Files changed (85) hide show
  1. package/dist/dead-messages/classify-error.d.ts +8 -0
  2. package/dist/dead-messages/classify-error.js +41 -0
  3. package/dist/dead-messages/classify-error.js.map +1 -0
  4. package/dist/dead-messages/dead-letter-retry.error.d.ts +3 -0
  5. package/dist/dead-messages/dead-letter-retry.error.js +11 -0
  6. package/dist/dead-messages/dead-letter-retry.error.js.map +1 -0
  7. package/dist/dead-messages/dead-message.schema.d.ts +282 -0
  8. package/dist/dead-messages/dead-message.schema.js +130 -0
  9. package/dist/dead-messages/dead-message.schema.js.map +1 -0
  10. package/dist/dead-messages/dead-messages.const.d.ts +8 -0
  11. package/dist/dead-messages/dead-messages.const.js +12 -0
  12. package/dist/dead-messages/dead-messages.const.js.map +1 -0
  13. package/dist/dead-messages/dead-messages.controller.d.ts +17 -0
  14. package/dist/dead-messages/dead-messages.controller.js +97 -0
  15. package/dist/dead-messages/dead-messages.controller.js.map +1 -0
  16. package/dist/dead-messages/dead-messages.dto.d.ts +14 -0
  17. package/dist/dead-messages/dead-messages.dto.js +54 -0
  18. package/dist/dead-messages/dead-messages.dto.js.map +1 -0
  19. package/dist/dead-messages/dead-messages.module.d.ts +2 -0
  20. package/dist/dead-messages/dead-messages.module.js +28 -0
  21. package/dist/dead-messages/dead-messages.module.js.map +1 -0
  22. package/dist/dead-messages/dead-messages.service.d.ts +94 -0
  23. package/dist/dead-messages/dead-messages.service.js +281 -0
  24. package/dist/dead-messages/dead-messages.service.js.map +1 -0
  25. package/dist/dead-messages/kafka-consumer-runner.d.ts +47 -0
  26. package/dist/dead-messages/kafka-consumer-runner.js +258 -0
  27. package/dist/dead-messages/kafka-consumer-runner.js.map +1 -0
  28. package/dist/dead-messages/kafka-logging.d.ts +9 -0
  29. package/dist/dead-messages/kafka-logging.js +29 -0
  30. package/dist/dead-messages/kafka-logging.js.map +1 -0
  31. package/dist/dead-messages/unprocessable-message.error.d.ts +9 -0
  32. package/dist/dead-messages/unprocessable-message.error.js +37 -0
  33. package/dist/dead-messages/unprocessable-message.error.js.map +1 -0
  34. package/dist/filters/base-exception.filter.d.ts +1 -0
  35. package/dist/filters/base-exception.filter.js +38 -15
  36. package/dist/filters/base-exception.filter.js.map +1 -1
  37. package/dist/index.d.ts +13 -1
  38. package/dist/index.js +45 -1
  39. package/dist/index.js.map +1 -1
  40. package/dist/models/dtos/wrappers/rest-wrapper.class.d.ts +9 -0
  41. package/dist/models/dtos/wrappers/rest-wrapper.class.js +13 -7
  42. package/dist/models/dtos/wrappers/rest-wrapper.class.js.map +1 -1
  43. package/dist/models/schemas/base.schema.d.ts +5 -1
  44. package/dist/models/schemas/embedded/archive.schema.d.ts +5 -1
  45. package/dist/models/schemas/embedded/attachment.schema.d.ts +5 -1
  46. package/dist/models/schemas/embedded/author.schema.d.ts +5 -1
  47. package/dist/models/schemas/embedded/contact.schema.d.ts +5 -1
  48. package/dist/models/schemas/embedded/crop-area.schema.d.ts +5 -1
  49. package/dist/models/schemas/embedded/date-time-range.schema.d.ts +5 -1
  50. package/dist/models/schemas/embedded/dictionary-embedded.schema.d.ts +5 -1
  51. package/dist/models/schemas/embedded/group-session.schema.d.ts +5 -1
  52. package/dist/models/schemas/embedded/i18n.embedded.d.ts +5 -1
  53. package/dist/models/schemas/embedded/location.schema.d.ts +5 -1
  54. package/dist/models/schemas/embedded/person.schema.d.ts +5 -1
  55. package/dist/models/schemas/embedded/physical-address.schema.d.ts +5 -1
  56. package/dist/models/schemas/embedded/picture.schema.d.ts +5 -1
  57. package/dist/models/schemas/embedded/record.embedded.d.ts +5 -1
  58. package/dist/models/schemas/embedded/residence.schema.d.ts +5 -1
  59. package/dist/models/schemas/embedded/s3.schema.d.ts +40 -8
  60. package/dist/models/schemas/embedded/session-user.schema.d.ts +5 -1
  61. package/dist/models/schemas/embedded/student-embedded.schema.d.ts +5 -1
  62. package/dist/models/schemas/embedded/teacher.schema.d.ts +5 -1
  63. package/dist/models/schemas/embedded/time.schema.d.ts +5 -1
  64. package/dist/models/schemas/embedded/virtual-address.schema.d.ts +5 -1
  65. package/dist/models/schemas/identifable.schema.d.ts +5 -1
  66. package/dist/models/schemas/parent.schema.d.ts +5 -1
  67. package/dist/models/schemas/session.schema.d.ts +5 -1
  68. package/dist/services/dictionaries.service.js +3 -3
  69. package/dist/services/dictionaries.service.js.map +1 -1
  70. package/dist/services/groups.service.js +2 -2
  71. package/dist/services/groups.service.js.map +1 -1
  72. package/dist/services/iam.service.js +6 -6
  73. package/dist/services/iam.service.js.map +1 -1
  74. package/dist/services/otp.service.js +4 -4
  75. package/dist/services/otp.service.js.map +1 -1
  76. package/dist/services/sessions.service.js +3 -3
  77. package/dist/services/sessions.service.js.map +1 -1
  78. package/dist/services/smtp.service.js +26 -17
  79. package/dist/services/smtp.service.js.map +1 -1
  80. package/dist/services/students.service.js +1 -1
  81. package/dist/services/students.service.js.map +1 -1
  82. package/dist/utils/error-safety.d.ts +16 -0
  83. package/dist/utils/error-safety.js +124 -0
  84. package/dist/utils/error-safety.js.map +1 -0
  85. package/package.json +38 -3
@@ -0,0 +1,258 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.KafkaConsumerRunner = void 0;
4
+ const classify_error_1 = require("./classify-error");
5
+ const dead_letter_retry_error_1 = require("./dead-letter-retry.error");
6
+ const dead_messages_const_1 = require("./dead-messages.const");
7
+ const dead_messages_service_1 = require("./dead-messages.service");
8
+ const where = (input) => { var _a; return `${input.group} ${input.topic}/${input.partition}@${(_a = input.message) === null || _a === void 0 ? void 0 : _a.offset}`; };
9
+ const nameOf = (error) => {
10
+ try {
11
+ return (0, classify_error_1.describeError)(error).name;
12
+ }
13
+ catch (_a) {
14
+ return 'unknown';
15
+ }
16
+ };
17
+ const nameAndKeyword = (error) => {
18
+ const { name, keyword } = (0, classify_error_1.describeError)(error);
19
+ return keyword ? `${name} ${keyword}` : name;
20
+ };
21
+ const keyOf = (identity) => JSON.stringify([identity.group, identity.topic, identity.partition, identity.offset, identity.timestamp]);
22
+ class KafkaConsumerRunner {
23
+ constructor(_options) {
24
+ var _a, _b;
25
+ this._options = _options;
26
+ this._consumer = null;
27
+ this._starting = null;
28
+ this._startSettled = false;
29
+ this._stopping = false;
30
+ this._fatal = false;
31
+ this._failed = new Set();
32
+ this._joins = 0;
33
+ this._settledJoin = new Map();
34
+ this._group = _options.groupId;
35
+ this._budgetMs = (_a = _options.retryBudgetMs) !== null && _a !== void 0 ? _a : dead_messages_const_1.DEAD_LETTER_RETRY_BUDGET_MS;
36
+ this._now = (_b = _options.now) !== null && _b !== void 0 ? _b : (() => new Date());
37
+ }
38
+ start() {
39
+ if (!this._starting) {
40
+ this._starting = this._start();
41
+ }
42
+ return this._starting;
43
+ }
44
+ async stop() {
45
+ this._stopping = true;
46
+ await this._starting;
47
+ if (!this._consumer) {
48
+ return;
49
+ }
50
+ this._unregister();
51
+ await this._disconnect();
52
+ }
53
+ async _start() {
54
+ try {
55
+ if (this._stopping) {
56
+ return;
57
+ }
58
+ const consumer = this._options.kafka.consumer({
59
+ groupId: this._group,
60
+ retry: { retries: 5, initialRetryTime: 300, maxRetryTime: 5000, factor: 0.2, multiplier: 2, restartOnFailure: async () => !this._stopping },
61
+ });
62
+ this._consumer = consumer;
63
+ this._listen(consumer);
64
+ await consumer.connect();
65
+ if (this._stopping) {
66
+ return;
67
+ }
68
+ for (const subscription of this._options.subscriptions) {
69
+ await consumer.subscribe(subscription);
70
+ if (this._stopping) {
71
+ return;
72
+ }
73
+ }
74
+ await consumer.run({ eachMessage: (payload) => this._eachMessage(payload), autoCommitThreshold: 1 });
75
+ if (this._stopping || this._fatal) {
76
+ return;
77
+ }
78
+ this._options.deadMessages.registerReplayer(this._group, (input) => this._options.dispatch(input));
79
+ }
80
+ catch (error) {
81
+ const line = `[kafka] ${this._group} failed to start: ${nameOf(error)}`;
82
+ if (this._stopping) {
83
+ await this._log('info', line);
84
+ return;
85
+ }
86
+ await this._log('error', line);
87
+ this._unregister();
88
+ this._fatalUnlessStopping();
89
+ }
90
+ finally {
91
+ this._startSettled = true;
92
+ }
93
+ }
94
+ _listen(consumer) {
95
+ consumer.on(consumer.events.CRASH, (event) => this._onCrash(event));
96
+ consumer.on(consumer.events.STOP, () => this._onStop());
97
+ consumer.on(consumer.events.GROUP_JOIN, (event) => this._onGroupJoin(event));
98
+ }
99
+ async _onCrash(event) {
100
+ var _a, _b;
101
+ try {
102
+ const restart = ((_a = event === null || event === void 0 ? void 0 : event.payload) === null || _a === void 0 ? void 0 : _a.restart) === true;
103
+ const line = `[kafka] ${this._group} crashed: ${nameOf((_b = event === null || event === void 0 ? void 0 : event.payload) === null || _b === void 0 ? void 0 : _b.error)}, restart=${restart}`;
104
+ if (this._stopping) {
105
+ await this._log('info', line);
106
+ return;
107
+ }
108
+ if (restart) {
109
+ await this._log('warn', line);
110
+ return;
111
+ }
112
+ await this._log('error', line);
113
+ this._unregister();
114
+ this._fatalUnlessStopping();
115
+ }
116
+ catch (_c) {
117
+ }
118
+ }
119
+ async _onStop() {
120
+ try {
121
+ await this._log('debug', `[kafka] ${this._group} stopped`);
122
+ }
123
+ catch (_a) {
124
+ }
125
+ }
126
+ async _onGroupJoin(event) {
127
+ var _a, _b, _c;
128
+ try {
129
+ this._joins += 1;
130
+ const assignment = (_b = (_a = event === null || event === void 0 ? void 0 : event.payload) === null || _a === void 0 ? void 0 : _a.memberAssignment) !== null && _b !== void 0 ? _b : {};
131
+ const partitions = Object.values(assignment).reduce((n, list) => n + (Array.isArray(list) ? list.length : 0), 0);
132
+ await this._log('info', `[kafka] ${this._group} joined: ${partitions} partitions`, { memberId: (_c = event === null || event === void 0 ? void 0 : event.payload) === null || _c === void 0 ? void 0 : _c.memberId });
133
+ if (this._stopping && this._startSettled) {
134
+ await this._disconnect();
135
+ }
136
+ }
137
+ catch (_d) {
138
+ }
139
+ }
140
+ async _eachMessage({ topic, partition, message }) {
141
+ const input = { group: this._group, topic, partition, message };
142
+ try {
143
+ await this._handle(input);
144
+ }
145
+ catch (e) {
146
+ if (e instanceof dead_letter_retry_error_1.DeadLetterRetryError) {
147
+ throw e;
148
+ }
149
+ await this._log('error', `[dead-letter] store failed, waiting ${where(input)} ${nameOf(e)}`);
150
+ throw this._retryError(input);
151
+ }
152
+ }
153
+ async _handle(input) {
154
+ var _a;
155
+ const partitionKey = `${input.partition}:${input.topic}`;
156
+ const join = this._joins;
157
+ const first = join > 0 && this._settledJoin.get(partitionKey) !== join;
158
+ try {
159
+ await this._options.dispatch({ topic: input.topic, partition: input.partition, message: input.message });
160
+ }
161
+ catch (error) {
162
+ return this._onFailure(input, error);
163
+ }
164
+ if (((_a = this._settledJoin.get(partitionKey)) !== null && _a !== void 0 ? _a : 0) < join) {
165
+ this._settledJoin.set(partitionKey, join);
166
+ }
167
+ const identity = (0, dead_messages_service_1.identityOf)(input);
168
+ const failedHere = this._failed.delete(keyOf(identity));
169
+ if (!failedHere && !first) {
170
+ return;
171
+ }
172
+ try {
173
+ await this._options.deadMessages.settleSuccess(identity, this._now());
174
+ }
175
+ catch (storeError) {
176
+ await this._log('warn', `[dead-letter] settle failed ${where(input)} ${nameOf(storeError)}`);
177
+ }
178
+ }
179
+ async _onFailure(input, error) {
180
+ const key = keyOf((0, dead_messages_service_1.identityOf)(input));
181
+ let outcome;
182
+ try {
183
+ outcome = await this._options.deadMessages.recordFailure(input, error, await this._kindOf(input, error), this._now(), this._budgetMs);
184
+ }
185
+ catch (storeError) {
186
+ await this._log('error', `[dead-letter] store failed, waiting ${where(input)} ${nameOf(storeError)}`);
187
+ throw this._retryError(input);
188
+ }
189
+ if (outcome.outcome === 'dead') {
190
+ this._failed.delete(key);
191
+ await this._log('error', `[dead-letter] ${where(input)} ${outcome.reason} ${nameAndKeyword(error)}`);
192
+ return;
193
+ }
194
+ if (outcome.outcome === 'already') {
195
+ this._failed.delete(key);
196
+ await this._log('warn', `[dead-letter] already ${outcome.status} ${where(input)}`);
197
+ return;
198
+ }
199
+ this._failed.add(key);
200
+ if (outcome.attempts === 1) {
201
+ await this._log('warn', `[dead-letter] retrying ${where(input)} ${nameAndKeyword(error)}`);
202
+ }
203
+ throw this._retryError(input);
204
+ }
205
+ async _kindOf(input, error) {
206
+ var _a, _b;
207
+ try {
208
+ const own = (_b = (_a = this._options).classify) === null || _b === void 0 ? void 0 : _b.call(_a, error);
209
+ if (own === 'permanent' || own === 'transient') {
210
+ return own;
211
+ }
212
+ }
213
+ catch (ruleError) {
214
+ await this._log('warn', `[dead-letter] classify failed ${where(input)} ${nameOf(ruleError)}`);
215
+ }
216
+ return (0, classify_error_1.classifyError)(error);
217
+ }
218
+ _retryError(input) {
219
+ var _a;
220
+ return new dead_letter_retry_error_1.DeadLetterRetryError(input.group, input.topic, input.partition, (_a = input.message) === null || _a === void 0 ? void 0 : _a.offset);
221
+ }
222
+ async _log(level, message, data) {
223
+ try {
224
+ const logger = this._options.logger;
225
+ await (data === undefined ? logger[level](message) : logger[level](message, data));
226
+ }
227
+ catch (_a) {
228
+ }
229
+ }
230
+ _unregister() {
231
+ try {
232
+ this._options.deadMessages.unregisterReplayer(this._group);
233
+ }
234
+ catch (_a) {
235
+ }
236
+ }
237
+ _fatalUnlessStopping() {
238
+ if (this._fatal || this._stopping) {
239
+ return;
240
+ }
241
+ this._fatal = true;
242
+ try {
243
+ this._options.onFatal();
244
+ }
245
+ catch (_a) {
246
+ }
247
+ }
248
+ async _disconnect() {
249
+ var _a;
250
+ try {
251
+ await ((_a = this._consumer) === null || _a === void 0 ? void 0 : _a.disconnect());
252
+ }
253
+ catch (_b) {
254
+ }
255
+ }
256
+ }
257
+ exports.KafkaConsumerRunner = KafkaConsumerRunner;
258
+ //# sourceMappingURL=kafka-consumer-runner.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"kafka-consumer-runner.js","sourceRoot":"","sources":["../../src/dead-messages/kafka-consumer-runner.ts"],"names":[],"mappings":";;;AA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,0CAAE,UAAU,EAAE,CAAA,CAAC;QACvC,CAAC;QAAC,WAAM,CAAC;QAET,CAAC;IACL,CAAC;CAEJ;AAzRD,kDAyRC"}
@@ -0,0 +1,9 @@
1
+ export declare function kafkaLogLevel(debug: string | undefined): number;
2
+ type KafkaLogEntry = {
3
+ namespace: string;
4
+ level: number;
5
+ label: string;
6
+ log: Record<string, any>;
7
+ };
8
+ export declare const kafkaLogCreator: (level: number) => (entry: KafkaLogEntry) => void;
9
+ export {};
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.kafkaLogCreator = void 0;
4
+ exports.kafkaLogLevel = kafkaLogLevel;
5
+ function kafkaLogLevel(debug) {
6
+ return debug === 'true' ? 5 : 1;
7
+ }
8
+ const kafkaLogCreator = () => {
9
+ return ({ namespace, label, log }) => {
10
+ const { message, groupId, topic, partition, error } = log;
11
+ const line = {
12
+ level: label,
13
+ namespace,
14
+ message: typeof message === 'string' ? message : message instanceof Error ? message.name : '',
15
+ };
16
+ if (groupId !== undefined)
17
+ line.groupId = groupId;
18
+ if (topic !== undefined)
19
+ line.topic = topic;
20
+ if (partition !== undefined)
21
+ line.partition = partition;
22
+ if (error !== null && typeof error === 'object' && typeof error.name === 'string') {
23
+ line.errorName = error.name;
24
+ }
25
+ (label === 'ERROR' ? console.error : console.log)(JSON.stringify(line));
26
+ };
27
+ };
28
+ exports.kafkaLogCreator = kafkaLogCreator;
29
+ //# sourceMappingURL=kafka-logging.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"kafka-logging.js","sourceRoot":"","sources":["../../src/dead-messages/kafka-logging.ts"],"names":[],"mappings":";;;AACA,sCAEC;AAFD,SAAgB,aAAa,CAAC,KAAyB;IACnD,OAAO,KAAK,KAAK,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACpC,CAAC;AAWM,MAAM,eAAe,GAAsD,GAAG,EAAE;IACnF,OAAO,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,GAAG,EAAE,EAAE,EAAE;QACjC,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,GAAG,GAAG,CAAC;QAC1D,MAAM,IAAI,GAA4B;YAClC,KAAK,EAAE,KAAK;YACZ,SAAS;YACT,OAAO,EAAE,OAAO,OAAO,KAAK,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,YAAY,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE;SAChG,CAAC;QACF,IAAI,OAAO,KAAK,SAAS;YAAE,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QAClD,IAAI,KAAK,KAAK,SAAS;YAAE,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QAC5C,IAAI,SAAS,KAAK,SAAS;YAAE,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QACxD,IAAI,KAAK,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,OAAO,KAAK,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;YAChF,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC,IAAI,CAAC;QAChC,CAAC;QACD,CAAC,KAAK,KAAK,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC;IAC5E,CAAC,CAAC;AACN,CAAC,CAAC;AAhBW,QAAA,eAAe,mBAgB1B"}
@@ -0,0 +1,9 @@
1
+ import type { IHeaders } from 'kafkajs';
2
+ export declare class UnprocessableMessageError extends Error {
3
+ constructor(message?: string);
4
+ }
5
+ export declare function parseJsonMessage(raw: string | null | undefined): unknown;
6
+ export declare const isObject: (v: unknown) => v is Record<string, any>;
7
+ export declare const isText: (v: unknown) => v is string;
8
+ export declare const isObjectId: (v: unknown) => v is string;
9
+ export declare function headerText(headers: IHeaders | undefined, name: string): string | undefined;
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isObjectId = exports.isText = exports.isObject = exports.UnprocessableMessageError = void 0;
4
+ exports.parseJsonMessage = parseJsonMessage;
5
+ exports.headerText = headerText;
6
+ class UnprocessableMessageError extends Error {
7
+ constructor(message) {
8
+ super(message);
9
+ this.name = 'UnprocessableMessageError';
10
+ }
11
+ }
12
+ exports.UnprocessableMessageError = UnprocessableMessageError;
13
+ function parseJsonMessage(raw) {
14
+ try {
15
+ if (typeof raw !== 'string') {
16
+ throw new Error();
17
+ }
18
+ return JSON.parse(raw);
19
+ }
20
+ catch (_a) {
21
+ throw new UnprocessableMessageError('the message is not JSON');
22
+ }
23
+ }
24
+ const isObject = (v) => typeof v === 'object' && v !== null && !Array.isArray(v);
25
+ exports.isObject = isObject;
26
+ const isText = (v) => typeof v === 'string' && v.trim().length > 0;
27
+ exports.isText = isText;
28
+ const isObjectId = (v) => typeof v === 'string' && /^[0-9a-fA-F]{24}$/.test(v);
29
+ exports.isObjectId = isObjectId;
30
+ function headerText(headers, name) {
31
+ const value = headers === null || headers === void 0 ? void 0 : headers[name];
32
+ if (Buffer.isBuffer(value) || typeof value === 'string') {
33
+ return value.toString();
34
+ }
35
+ return undefined;
36
+ }
37
+ //# sourceMappingURL=unprocessable-message.error.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"unprocessable-message.error.js","sourceRoot":"","sources":["../../src/dead-messages/unprocessable-message.error.ts"],"names":[],"mappings":";;;AAUA,4CASC;AAQD,gCAMC;AA9BD,MAAa,yBAA0B,SAAQ,KAAK;IAChD,YAAY,OAAgB;QACxB,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,2BAA2B,CAAC;IAC5C,CAAC;CACJ;AALD,8DAKC;AAED,SAAgB,gBAAgB,CAAC,GAA8B;IAC3D,IAAI,CAAC;QACD,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE,CAAC;YAC1B,MAAM,IAAI,KAAK,EAAE,CAAC;QACtB,CAAC;QACD,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAC3B,CAAC;IAAC,WAAM,CAAC;QACL,MAAM,IAAI,yBAAyB,CAAC,yBAAyB,CAAC,CAAC;IACnE,CAAC;AACL,CAAC;AAEM,MAAM,QAAQ,GAAG,CAAC,CAAU,EAA4B,EAAE,CAAC,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;AAA9G,QAAA,QAAQ,YAAsG;AAEpH,MAAM,MAAM,GAAG,CAAC,CAAU,EAAe,EAAE,CAAC,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC,CAAC;AAAnF,QAAA,MAAM,UAA6E;AAEzF,MAAM,UAAU,GAAG,CAAC,CAAU,EAAe,EAAE,CAAC,OAAO,CAAC,KAAK,QAAQ,IAAI,mBAAmB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAA/F,QAAA,UAAU,cAAqF;AAE5G,SAAgB,UAAU,CAAC,OAA6B,EAAE,IAAY;IAClE,MAAM,KAAK,GAAG,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAG,IAAI,CAAC,CAAC;IAC9B,IAAI,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QACtD,OAAO,KAAK,CAAC,QAAQ,EAAE,CAAC;IAC5B,CAAC;IACD,OAAO,SAAS,CAAC;AACrB,CAAC"}
@@ -5,4 +5,5 @@ export declare class BaseExceptionsFilter implements ExceptionFilter {
5
5
  constructor(_appLoggerService: AppLoggerService);
6
6
  catch(exception: any, host: ArgumentsHost): void;
7
7
  private filterException;
8
+ private _logLine;
8
9
  }
@@ -6,24 +6,23 @@ const mongoose_1 = require("mongoose");
6
6
  const class_validator_1 = require("class-validator");
7
7
  const custom_exception_1 = require("../exceptions/custom.exception");
8
8
  const rest_wrapper_class_1 = require("../models/dtos/wrappers/rest-wrapper.class");
9
+ const error_safety_1 = require("../utils/error-safety");
9
10
  class BaseExceptionsFilter {
10
11
  constructor(_appLoggerService) {
11
12
  this._appLoggerService = _appLoggerService;
12
13
  }
13
14
  catch(exception, host) {
14
- var _a;
15
15
  const context = host.switchToHttp();
16
16
  const response = context.getResponse();
17
- this._appLoggerService.info('BaseExceptionsFilter - name:', { name: (_a = exception === null || exception === void 0 ? void 0 : exception.constructor) === null || _a === void 0 ? void 0 : _a.name });
18
- this._appLoggerService.info('BaseExceptionsFilter - exception:', exception);
19
- let handledException = null;
20
- const { restErrors, statusCode } = this.filterException(exception);
21
- handledException = new custom_exception_1.HandledException(restErrors, statusCode);
17
+ const { restErrors, statusCode, message } = this.filterException(exception);
18
+ this._appLoggerService.info('BaseExceptionsFilter', this._logLine(exception, restErrors, statusCode, message));
19
+ const handledException = new custom_exception_1.HandledException(restErrors, statusCode);
22
20
  handledException.send(response);
23
21
  }
24
22
  filterException(exception) {
25
23
  const restErrors = [];
26
24
  let statusCode = null;
25
+ let message;
27
26
  try {
28
27
  if (exception instanceof custom_exception_1.HandledException) {
29
28
  restErrors.push(...exception.getErrors());
@@ -48,7 +47,7 @@ class BaseExceptionsFilter {
48
47
  statusCode = common_1.HttpStatus.UNAUTHORIZED;
49
48
  }
50
49
  else if (exception instanceof common_1.NotFoundException) {
51
- restErrors.push(new rest_wrapper_class_1.RESTError('method_not_found', exception.message));
50
+ restErrors.push(new rest_wrapper_class_1.RESTError('method_not_found', exception.message.split('?')[0]));
52
51
  statusCode = common_1.HttpStatus.METHOD_NOT_ALLOWED;
53
52
  }
54
53
  else if (exception instanceof common_1.ForbiddenException) {
@@ -120,31 +119,55 @@ class BaseExceptionsFilter {
120
119
  statusCode = common_1.HttpStatus.INTERNAL_SERVER_ERROR;
121
120
  }
122
121
  else if (exception instanceof TypeError) {
123
- restErrors.push(new rest_wrapper_class_1.RESTError('type_error', exception.message));
122
+ restErrors.push(new rest_wrapper_class_1.RESTError('type_error'));
124
123
  statusCode = common_1.HttpStatus.INTERNAL_SERVER_ERROR;
124
+ message = exception.message;
125
125
  }
126
126
  else if (exception instanceof mongoose_1.mongo.MongoError) {
127
- restErrors.push(new rest_wrapper_class_1.RESTError('mongo_error', exception.message));
127
+ restErrors.push(new rest_wrapper_class_1.RESTError('mongo_error'));
128
128
  statusCode = common_1.HttpStatus.INTERNAL_SERVER_ERROR;
129
+ message = exception.message;
129
130
  }
130
131
  else if (exception instanceof class_validator_1.ValidationError) {
131
- restErrors.push(new rest_wrapper_class_1.RESTError('validation_error', exception));
132
+ restErrors.push(new rest_wrapper_class_1.RESTError('validation_error'));
132
133
  statusCode = common_1.HttpStatus.INTERNAL_SERVER_ERROR;
133
134
  }
134
135
  else if (exception instanceof mongoose_1.mongo.MongoServerError) {
135
- restErrors.push(new rest_wrapper_class_1.RESTError('mongo_server_error', exception.message));
136
+ restErrors.push(new rest_wrapper_class_1.RESTError('mongo_server_error'));
136
137
  statusCode = common_1.HttpStatus.INTERNAL_SERVER_ERROR;
138
+ message = exception.message;
137
139
  }
138
140
  else {
139
- restErrors.push(new rest_wrapper_class_1.RESTError('unknown_error', exception.message));
141
+ const text = exception.isAxiosError === true ? undefined : exception.message;
142
+ restErrors.push(new rest_wrapper_class_1.RESTError('unknown_error'));
140
143
  statusCode = common_1.HttpStatus.INTERNAL_SERVER_ERROR;
144
+ message = typeof text === 'string' ? text : undefined;
141
145
  }
142
146
  }
143
- catch (ex) {
144
- restErrors.push(new rest_wrapper_class_1.RESTError('base_exception_filter_error', ex));
147
+ catch (_a) {
148
+ restErrors.push(new rest_wrapper_class_1.RESTError('base_exception_filter_error'));
145
149
  statusCode = common_1.HttpStatus.INTERNAL_SERVER_ERROR;
146
150
  }
147
- return { restErrors, statusCode };
151
+ return { restErrors, statusCode, message };
152
+ }
153
+ _logLine(exception, restErrors, statusCode, message) {
154
+ var _a;
155
+ const line = { status: statusCode, keywords: restErrors.map((error) => error === null || error === void 0 ? void 0 : error.keyword) };
156
+ try {
157
+ const name = (_a = exception === null || exception === void 0 ? void 0 : exception.constructor) === null || _a === void 0 ? void 0 : _a.name;
158
+ if (typeof name === 'string') {
159
+ line.name = name;
160
+ }
161
+ if ((exception instanceof rest_wrapper_class_1.RESTError && exception.failure) || (exception === null || exception === void 0 ? void 0 : exception.isAxiosError) === true) {
162
+ line.failure = (0, error_safety_1.describeFailure)(exception);
163
+ }
164
+ }
165
+ catch (_b) {
166
+ }
167
+ if (typeof message === 'string') {
168
+ line.message = message;
169
+ }
170
+ return line;
148
171
  }
149
172
  }
150
173
  exports.BaseExceptionsFilter = BaseExceptionsFilter;
@@ -1 +1 @@
1
- {"version":3,"file":"base-exception.filter.js","sourceRoot":"","sources":["../../src/filters/base-exception.filter.ts"],"names":[],"mappings":";;;AAAA,2CAwBwB;AACxB,uCAAiC;AACjC,qDAAkD;AAClD,qEAAkE;AAClE,mFAAuE;AAGvE,MAAa,oBAAoB;IAG7B,YAA6B,iBAAmC;QAAnC,sBAAiB,GAAjB,iBAAiB,CAAkB;IAChE,CAAC;IAED,KAAK,CAAC,SAAc,EAAE,IAAmB;;QACrC,MAAM,OAAO,GAAG,IAAI,CAAC,YAAY,EAAE,CAAC;QACpC,MAAM,QAAQ,GAAG,OAAO,CAAC,WAAW,EAAY,CAAC;QAKjD,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,8BAA8B,EAAE,EAAE,IAAI,EAAE,MAAA,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,WAAW,0CAAE,IAAI,EAAE,CAAC,CAAC;QACpG,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,mCAAmC,EAAE,SAAS,CAAC,CAAC;QAE5E,IAAI,gBAAgB,GAA2B,IAAI,CAAC;Q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AG,OAAO,CAAC;QAC3B,CAAC;QACD,OAAO,IAAI,CAAC;IAChB,CAAC;CACJ;AAlJD,oDAkJC"}
package/dist/index.d.ts CHANGED
@@ -91,4 +91,16 @@ import { GroupsService } from './services/groups.service';
91
91
  import { Logger } from './utils/logger.class';
92
92
  import { AppLoggerService } from './services/app-logger.service';
93
93
  import { sameId, escapeRegex } from './utils/helper.utils';
94
- export { Logger, PermissionsScannerService, SessionsService, DictionariesService, SMTPService, OTPService, StorageService, IAMService, StudentsService, GroupsService, AppLoggerService, RESTError, RESTPage, RESTPaging, RESTQueryParams, RESTRequestBody, RESTResponseBody, RESTResult, RESTSort, SortDirection, IMongoPage, AccessTokenGuard, PermissionGuard, AllowPermissions, APP__PORT, APP__DEBUG, APP__ACCESS_TOKEN, APP__MONGO__CS, DL_SESSIONS__MONGO__CS, MONGO__CS, REDIS__CS, KAFKA__BROKERS, RecordState, ContactType, UserVerificationLevel, UserType, WeekDay, GroupState, S3FileState, FileLogInitType, AttachmentType, VirtualAddressType, LocationType, I18nDTO, CropAreaDTO, IDParams, IIdentifable, IBase, IRecord, II18n, IDictionary, IPermission, IRole, IContact, IPerson, IResidence, ISessionUser, ISession, IUser, IOTP, IParent, IGroupEmbedded, IStudentEmbedded, ITeacher, IGroupSession, ITime, ISMTPAPIConfig, IS3, ILogInitiator, IS3File, IFileState, IFileRecord, IFileMeta, IFileLog, IUserMeta, ICropArea, IAttachment, IPicture, IAuthor, IFileEmbedded, IFileRequest, IPhysicalAddress, IDateTimeRange, IVirtualAddress, ILocation, IArchive, Identifable, IdentifableSchema, IdentifableDocument, Base, BaseSchema, BaseDocument, Record, RecordSchema, RecordDocument, I18n, I18nSchema, I18nDocument, Residence, ResidenceSchema, ResidenceDocument, Contact, ContactSchema, ContactDocument, Person, PersonSchema, PersonDocument, DictionaryEmbedded, DictionaryEmbeddedSchema, DictionaryEmbeddedDocument, SessionUser, SessionUserSchema, SessionUserDocument, Session, SessionSchema, SessionDocument, GroupSessionSchema, GroupSessionDocument, GroupSession, TeacherSchema, TeacherDocument, Teacher, StudentEmbeddedSchema, StudentEmbeddedDocument, StudentEmbedded, TimeSchema, TimeDocument, Time, S3, S3Schema, S3Document, LogInitiator, LogInitiatorSchema, LogInitiatorDocument, FileLog, FileLogSchema, FileLogDocument, FileMeta, FileMetaSchema, FileMetaDocument, FileState, FileStateSchema, FileStateDocument, FileRecord, FileRecordSchema, FileRecordDocument, S3File, S3FileSchema, S3FileDocument, FileEmbedded, FileEmbeddedSchema, FileEmbeddedDocument, CropArea, CropAreaSchema, CropAreaDocument, Attachment, AttachmentSchema, AttachmentDocument, Picture, PictureSchema, PictureDocument, Author, AuthorSchema, AuthorDocument, PhysicalAddress, PhysicalAddressSchema, PhysicalAddressDocument, DateTimeRange, DateTimeRangeSchema, DateTimeRangeDocument, VirtualAddress, VirtualAddressSchema, VirtualAddressDocument, Location, LocationSchema, LocationDocument, Archive, ArchiveSchema, ArchiveDocument, BaseExceptionsFilter, validationExceptionFactory, HandledException, IsMapOfStrings, transformers, sameId, escapeRegex, MongoIdPipe, MongoIdsPipe, DLCommonsModule, };
94
+ import { IFailureSummary, describeFailure, failedCall } from './utils/error-safety';
95
+ import { UnprocessableMessageError, parseJsonMessage, isObject, isText, isObjectId, headerText } from './dead-messages/unprocessable-message.error';
96
+ import { ErrorKind, IDescribedError, classifyError, describeError } from './dead-messages/classify-error';
97
+ import { DeadLetterRetryError } from './dead-messages/dead-letter-retry.error';
98
+ import { DEAD_LETTER_RETRY_BUDGET_MS, DEAD_MESSAGE_RETRYING_TTL_MS, DEAD_MESSAGE_RESOLVED_TTL_MS, DEAD_MESSAGE_REPLAY_CLAIM_MS, DEAD_MESSAGES_LIST_DEFAULT, DEAD_MESSAGES_LIST_MAX, DEAD_MESSAGE_ERROR_MESSAGE_MAX, KAFKA_ON_FATAL } from './dead-messages/dead-messages.const';
99
+ import { kafkaLogLevel, kafkaLogCreator } from './dead-messages/kafka-logging';
100
+ import { DeadMessage, DeadMessageDocument, DeadMessageSchema, DeadMessageStatus, DeadMessageReason } from './dead-messages/dead-message.schema';
101
+ import { DeadMessagesService, IKafkaInput, IDeadLetterInput, IDeadMessageIdentity, IRecordOutcome, DeadMessageReplayer, IEncodedBytes, IDeadMessageView, identityOf, kafkaInputOf } from './dead-messages/dead-messages.service';
102
+ import { DeadMessageActionData, DeadMessageActionRB, DeadMessagesQuery } from './dead-messages/dead-messages.dto';
103
+ import { DeadMessagesController } from './dead-messages/dead-messages.controller';
104
+ import { DeadMessagesModule } from './dead-messages/dead-messages.module';
105
+ import { IKafkaConsumerRunnerOptions, KafkaConsumerRunner } from './dead-messages/kafka-consumer-runner';
106
+ export { Logger, PermissionsScannerService, SessionsService, DictionariesService, SMTPService, OTPService, StorageService, IAMService, StudentsService, GroupsService, AppLoggerService, RESTError, RESTPage, RESTPaging, RESTQueryParams, RESTRequestBody, RESTResponseBody, RESTResult, RESTSort, SortDirection, IMongoPage, AccessTokenGuard, PermissionGuard, AllowPermissions, APP__PORT, APP__DEBUG, APP__ACCESS_TOKEN, APP__MONGO__CS, DL_SESSIONS__MONGO__CS, MONGO__CS, REDIS__CS, KAFKA__BROKERS, RecordState, ContactType, UserVerificationLevel, UserType, WeekDay, GroupState, S3FileState, FileLogInitType, AttachmentType, VirtualAddressType, LocationType, I18nDTO, CropAreaDTO, IDParams, IIdentifable, IBase, IRecord, II18n, IDictionary, IPermission, IRole, IContact, IPerson, IResidence, ISessionUser, ISession, IUser, IOTP, IParent, IGroupEmbedded, IStudentEmbedded, ITeacher, IGroupSession, ITime, ISMTPAPIConfig, IS3, ILogInitiator, IS3File, IFileState, IFileRecord, IFileMeta, IFileLog, IUserMeta, ICropArea, IAttachment, IPicture, IAuthor, IFileEmbedded, IFileRequest, IPhysicalAddress, IDateTimeRange, IVirtualAddress, ILocation, IArchive, Identifable, IdentifableSchema, IdentifableDocument, Base, BaseSchema, BaseDocument, Record, RecordSchema, RecordDocument, I18n, I18nSchema, I18nDocument, Residence, ResidenceSchema, ResidenceDocument, Contact, ContactSchema, ContactDocument, Person, PersonSchema, PersonDocument, DictionaryEmbedded, DictionaryEmbeddedSchema, DictionaryEmbeddedDocument, SessionUser, SessionUserSchema, SessionUserDocument, Session, SessionSchema, SessionDocument, GroupSessionSchema, GroupSessionDocument, GroupSession, TeacherSchema, TeacherDocument, Teacher, StudentEmbeddedSchema, StudentEmbeddedDocument, StudentEmbedded, TimeSchema, TimeDocument, Time, S3, S3Schema, S3Document, LogInitiator, LogInitiatorSchema, LogInitiatorDocument, FileLog, FileLogSchema, FileLogDocument, FileMeta, FileMetaSchema, FileMetaDocument, FileState, FileStateSchema, FileStateDocument, FileRecord, FileRecordSchema, FileRecordDocument, S3File, S3FileSchema, S3FileDocument, FileEmbedded, FileEmbeddedSchema, FileEmbeddedDocument, CropArea, CropAreaSchema, CropAreaDocument, Attachment, AttachmentSchema, AttachmentDocument, Picture, PictureSchema, PictureDocument, Author, AuthorSchema, AuthorDocument, PhysicalAddress, PhysicalAddressSchema, PhysicalAddressDocument, DateTimeRange, DateTimeRangeSchema, DateTimeRangeDocument, VirtualAddress, VirtualAddressSchema, VirtualAddressDocument, Location, LocationSchema, LocationDocument, Archive, ArchiveSchema, ArchiveDocument, BaseExceptionsFilter, validationExceptionFactory, HandledException, IsMapOfStrings, transformers, sameId, escapeRegex, describeFailure, failedCall, IFailureSummary, MongoIdPipe, MongoIdsPipe, DLCommonsModule, UnprocessableMessageError, parseJsonMessage, isObject, isText, isObjectId, headerText, ErrorKind, IDescribedError, classifyError, describeError, DeadLetterRetryError, DEAD_LETTER_RETRY_BUDGET_MS, DEAD_MESSAGE_RETRYING_TTL_MS, DEAD_MESSAGE_RESOLVED_TTL_MS, DEAD_MESSAGE_REPLAY_CLAIM_MS, DEAD_MESSAGES_LIST_DEFAULT, DEAD_MESSAGES_LIST_MAX, DEAD_MESSAGE_ERROR_MESSAGE_MAX, KAFKA_ON_FATAL, kafkaLogLevel, kafkaLogCreator, DeadMessageStatus, DeadMessageReason, DeadMessage, DeadMessageDocument, DeadMessageSchema, IKafkaInput, IDeadLetterInput, IDeadMessageIdentity, identityOf, IRecordOutcome, DeadMessageReplayer, kafkaInputOf, IEncodedBytes, IDeadMessageView, DeadMessagesService, DeadMessageActionData, DeadMessageActionRB, DeadMessagesQuery, DeadMessagesController, DeadMessagesModule, IKafkaConsumerRunnerOptions, KafkaConsumerRunner, };
package/dist/index.js CHANGED
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Record = exports.BaseSchema = exports.Base = exports.IdentifableSchema = exports.Identifable = exports.IDParams = exports.CropAreaDTO = exports.I18nDTO = exports.LocationType = exports.VirtualAddressType = exports.AttachmentType = exports.FileLogInitType = exports.S3FileState = exports.GroupState = exports.WeekDay = exports.UserType = exports.UserVerificationLevel = exports.ContactType = exports.RecordState = exports.KAFKA__BROKERS = exports.REDIS__CS = exports.MONGO__CS = exports.DL_SESSIONS__MONGO__CS = exports.APP__MONGO__CS = exports.APP__ACCESS_TOKEN = exports.APP__DEBUG = exports.APP__PORT = exports.AllowPermissions = exports.PermissionGuard = exports.AccessTokenGuard = exports.SortDirection = exports.RESTSort = exports.RESTResult = exports.RESTResponseBody = exports.RESTRequestBody = exports.RESTQueryParams = exports.RESTPaging = exports.RESTPage = exports.RESTError = exports.AppLoggerService = exports.GroupsService = exports.StudentsService = exports.IAMService = exports.StorageService = exports.OTPService = exports.SMTPService = exports.DictionariesService = exports.SessionsService = exports.PermissionsScannerService = exports.Logger = void 0;
4
4
  exports.DateTimeRange = exports.PhysicalAddressSchema = exports.PhysicalAddress = exports.AuthorSchema = exports.Author = exports.PictureSchema = exports.Picture = exports.AttachmentSchema = exports.Attachment = exports.CropAreaSchema = exports.CropArea = exports.FileEmbeddedSchema = exports.FileEmbedded = exports.S3FileSchema = exports.S3File = exports.FileRecordSchema = exports.FileRecord = exports.FileStateSchema = exports.FileState = exports.FileMetaSchema = exports.FileMeta = exports.FileLogSchema = exports.FileLog = exports.LogInitiatorSchema = exports.LogInitiator = exports.S3Schema = exports.S3 = exports.Time = exports.TimeSchema = exports.StudentEmbedded = exports.StudentEmbeddedSchema = exports.Teacher = exports.TeacherSchema = exports.GroupSession = exports.GroupSessionSchema = exports.SessionSchema = exports.Session = exports.SessionUserSchema = exports.SessionUser = exports.DictionaryEmbeddedSchema = exports.DictionaryEmbedded = exports.PersonSchema = exports.Person = exports.ContactSchema = exports.Contact = exports.ResidenceSchema = exports.Residence = exports.I18nSchema = exports.I18n = exports.RecordSchema = void 0;
5
- exports.DLCommonsModule = exports.MongoIdsPipe = exports.MongoIdPipe = exports.escapeRegex = exports.sameId = exports.transformers = exports.IsMapOfStrings = exports.HandledException = exports.validationExceptionFactory = exports.BaseExceptionsFilter = exports.ArchiveSchema = exports.Archive = exports.LocationSchema = exports.Location = exports.VirtualAddressSchema = exports.VirtualAddress = exports.DateTimeRangeSchema = void 0;
5
+ exports.KafkaConsumerRunner = exports.DeadMessagesModule = exports.DeadMessagesController = exports.DeadMessagesQuery = exports.DeadMessageActionRB = exports.DeadMessageActionData = exports.DeadMessagesService = exports.kafkaInputOf = exports.identityOf = exports.DeadMessageSchema = exports.DeadMessage = exports.kafkaLogCreator = exports.kafkaLogLevel = exports.KAFKA_ON_FATAL = exports.DEAD_MESSAGE_ERROR_MESSAGE_MAX = exports.DEAD_MESSAGES_LIST_MAX = exports.DEAD_MESSAGES_LIST_DEFAULT = exports.DEAD_MESSAGE_REPLAY_CLAIM_MS = exports.DEAD_MESSAGE_RESOLVED_TTL_MS = exports.DEAD_MESSAGE_RETRYING_TTL_MS = exports.DEAD_LETTER_RETRY_BUDGET_MS = exports.DeadLetterRetryError = exports.describeError = exports.classifyError = exports.headerText = exports.isObjectId = exports.isText = exports.isObject = exports.parseJsonMessage = exports.UnprocessableMessageError = exports.DLCommonsModule = exports.MongoIdsPipe = exports.MongoIdPipe = exports.failedCall = exports.describeFailure = exports.escapeRegex = exports.sameId = exports.transformers = exports.IsMapOfStrings = exports.HandledException = exports.validationExceptionFactory = exports.BaseExceptionsFilter = exports.ArchiveSchema = exports.Archive = exports.LocationSchema = exports.Location = exports.VirtualAddressSchema = exports.VirtualAddress = exports.DateTimeRangeSchema = void 0;
6
6
  const is_map_of_strings_decorator_1 = require("./decorators/is-map-of-strings.decorator");
7
7
  Object.defineProperty(exports, "IsMapOfStrings", { enumerable: true, get: function () { return is_map_of_strings_decorator_1.IsMapOfStrings; } });
8
8
  const dl_commons_module_1 = require("./dl-commons.module");
@@ -181,4 +181,48 @@ Object.defineProperty(exports, "AppLoggerService", { enumerable: true, get: func
181
181
  const helper_utils_1 = require("./utils/helper.utils");
182
182
  Object.defineProperty(exports, "sameId", { enumerable: true, get: function () { return helper_utils_1.sameId; } });
183
183
  Object.defineProperty(exports, "escapeRegex", { enumerable: true, get: function () { return helper_utils_1.escapeRegex; } });
184
+ const error_safety_1 = require("./utils/error-safety");
185
+ Object.defineProperty(exports, "describeFailure", { enumerable: true, get: function () { return error_safety_1.describeFailure; } });
186
+ Object.defineProperty(exports, "failedCall", { enumerable: true, get: function () { return error_safety_1.failedCall; } });
187
+ const unprocessable_message_error_1 = require("./dead-messages/unprocessable-message.error");
188
+ Object.defineProperty(exports, "UnprocessableMessageError", { enumerable: true, get: function () { return unprocessable_message_error_1.UnprocessableMessageError; } });
189
+ Object.defineProperty(exports, "parseJsonMessage", { enumerable: true, get: function () { return unprocessable_message_error_1.parseJsonMessage; } });
190
+ Object.defineProperty(exports, "isObject", { enumerable: true, get: function () { return unprocessable_message_error_1.isObject; } });
191
+ Object.defineProperty(exports, "isText", { enumerable: true, get: function () { return unprocessable_message_error_1.isText; } });
192
+ Object.defineProperty(exports, "isObjectId", { enumerable: true, get: function () { return unprocessable_message_error_1.isObjectId; } });
193
+ Object.defineProperty(exports, "headerText", { enumerable: true, get: function () { return unprocessable_message_error_1.headerText; } });
194
+ const classify_error_1 = require("./dead-messages/classify-error");
195
+ Object.defineProperty(exports, "classifyError", { enumerable: true, get: function () { return classify_error_1.classifyError; } });
196
+ Object.defineProperty(exports, "describeError", { enumerable: true, get: function () { return classify_error_1.describeError; } });
197
+ const dead_letter_retry_error_1 = require("./dead-messages/dead-letter-retry.error");
198
+ Object.defineProperty(exports, "DeadLetterRetryError", { enumerable: true, get: function () { return dead_letter_retry_error_1.DeadLetterRetryError; } });
199
+ const dead_messages_const_1 = require("./dead-messages/dead-messages.const");
200
+ Object.defineProperty(exports, "DEAD_LETTER_RETRY_BUDGET_MS", { enumerable: true, get: function () { return dead_messages_const_1.DEAD_LETTER_RETRY_BUDGET_MS; } });
201
+ Object.defineProperty(exports, "DEAD_MESSAGE_RETRYING_TTL_MS", { enumerable: true, get: function () { return dead_messages_const_1.DEAD_MESSAGE_RETRYING_TTL_MS; } });
202
+ Object.defineProperty(exports, "DEAD_MESSAGE_RESOLVED_TTL_MS", { enumerable: true, get: function () { return dead_messages_const_1.DEAD_MESSAGE_RESOLVED_TTL_MS; } });
203
+ Object.defineProperty(exports, "DEAD_MESSAGE_REPLAY_CLAIM_MS", { enumerable: true, get: function () { return dead_messages_const_1.DEAD_MESSAGE_REPLAY_CLAIM_MS; } });
204
+ Object.defineProperty(exports, "DEAD_MESSAGES_LIST_DEFAULT", { enumerable: true, get: function () { return dead_messages_const_1.DEAD_MESSAGES_LIST_DEFAULT; } });
205
+ Object.defineProperty(exports, "DEAD_MESSAGES_LIST_MAX", { enumerable: true, get: function () { return dead_messages_const_1.DEAD_MESSAGES_LIST_MAX; } });
206
+ Object.defineProperty(exports, "DEAD_MESSAGE_ERROR_MESSAGE_MAX", { enumerable: true, get: function () { return dead_messages_const_1.DEAD_MESSAGE_ERROR_MESSAGE_MAX; } });
207
+ Object.defineProperty(exports, "KAFKA_ON_FATAL", { enumerable: true, get: function () { return dead_messages_const_1.KAFKA_ON_FATAL; } });
208
+ const kafka_logging_1 = require("./dead-messages/kafka-logging");
209
+ Object.defineProperty(exports, "kafkaLogLevel", { enumerable: true, get: function () { return kafka_logging_1.kafkaLogLevel; } });
210
+ Object.defineProperty(exports, "kafkaLogCreator", { enumerable: true, get: function () { return kafka_logging_1.kafkaLogCreator; } });
211
+ const dead_message_schema_1 = require("./dead-messages/dead-message.schema");
212
+ Object.defineProperty(exports, "DeadMessage", { enumerable: true, get: function () { return dead_message_schema_1.DeadMessage; } });
213
+ Object.defineProperty(exports, "DeadMessageSchema", { enumerable: true, get: function () { return dead_message_schema_1.DeadMessageSchema; } });
214
+ const dead_messages_service_1 = require("./dead-messages/dead-messages.service");
215
+ Object.defineProperty(exports, "DeadMessagesService", { enumerable: true, get: function () { return dead_messages_service_1.DeadMessagesService; } });
216
+ Object.defineProperty(exports, "identityOf", { enumerable: true, get: function () { return dead_messages_service_1.identityOf; } });
217
+ Object.defineProperty(exports, "kafkaInputOf", { enumerable: true, get: function () { return dead_messages_service_1.kafkaInputOf; } });
218
+ const dead_messages_dto_1 = require("./dead-messages/dead-messages.dto");
219
+ Object.defineProperty(exports, "DeadMessageActionData", { enumerable: true, get: function () { return dead_messages_dto_1.DeadMessageActionData; } });
220
+ Object.defineProperty(exports, "DeadMessageActionRB", { enumerable: true, get: function () { return dead_messages_dto_1.DeadMessageActionRB; } });
221
+ Object.defineProperty(exports, "DeadMessagesQuery", { enumerable: true, get: function () { return dead_messages_dto_1.DeadMessagesQuery; } });
222
+ const dead_messages_controller_1 = require("./dead-messages/dead-messages.controller");
223
+ Object.defineProperty(exports, "DeadMessagesController", { enumerable: true, get: function () { return dead_messages_controller_1.DeadMessagesController; } });
224
+ const dead_messages_module_1 = require("./dead-messages/dead-messages.module");
225
+ Object.defineProperty(exports, "DeadMessagesModule", { enumerable: true, get: function () { return dead_messages_module_1.DeadMessagesModule; } });
226
+ const kafka_consumer_runner_1 = require("./dead-messages/kafka-consumer-runner");
227
+ Object.defineProperty(exports, "KafkaConsumerRunner", { enumerable: true, get: function () { return kafka_consumer_runner_1.KafkaConsumerRunner; } });
184
228
  //# sourceMappingURL=index.js.map