@mondart/nestjs-common-module-core 3.2.6 → 3.2.8

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/README.md CHANGED
@@ -79,7 +79,11 @@ directly:
79
79
  ```ts
80
80
  import { ErrorResponse } from '@mondart/nestjs-common-module-core';
81
81
 
82
- new ErrorResponse({ name: 'NotFoundException', message: 'Not found', status: 404 });
82
+ new ErrorResponse({
83
+ name: 'NotFoundException',
84
+ message: 'Not found',
85
+ status: 404,
86
+ });
83
87
  ```
84
88
 
85
89
  Common request DTOs — `IdDto`, `IdsDto` (comma-separated `ids` query param),
@@ -208,6 +212,29 @@ for `{0}`-style `SharedMessages` interpolation, `EnvValidator` for validating
208
212
  `RxjsCatchErrorHelper` / `RxjsCustomTimeoutHelper` RxJS operators for mapping
209
213
  errors/timeouts on outbound calls to Nest exceptions.
210
214
 
215
+ ### Graceful HTTP shutdown
216
+
217
+ Use `GracefulShutdownHelper.enable()` instead of `app.enableShutdownHooks()`
218
+ in an HTTP service bootstrap:
219
+
220
+ ```ts
221
+ import { GracefulShutdownHelper } from '@mondart/nestjs-common-module-core';
222
+
223
+ const app = await NestFactory.create(AppModule);
224
+ GracefulShutdownHelper.enable(app);
225
+ await app.listen(appPort);
226
+ ```
227
+
228
+ On `SIGTERM` or `SIGINT`, the helper rejects new requests with `503` and a
229
+ `Connection: close` header, closes idle keep-alive connections, waits up to
230
+ 110 seconds for active responses, and then calls `app.close()` so Nest module,
231
+ Kafka, queue, and database shutdown hooks run. Configure the container stop
232
+ grace period above that deadline (the Swarm deployment uses two minutes).
233
+ Do not register Nest's default shutdown signal handlers alongside this helper.
234
+ During `app.close()`, the helper suppresses only ioredis's known
235
+ `Connection is closed.` rejection caused by an already-closing Bull connection;
236
+ any other unhandled shutdown rejection is logged and produces a failed exit.
237
+
211
238
  ## Kafka-related exports
212
239
 
213
240
  `BaseKafkaEventDto`, `KafkaRequestDto`, `KafkaSuccessResponse`,
@@ -3,4 +3,5 @@ export * from './is-id.decorator';
3
3
  export * from './is-not-empty-string.decorator';
4
4
  export * from './is-one-of-property.decorator';
5
5
  export * from './depend-on-property.decorator';
6
+ export * from './sanitize-html.decorator';
6
7
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/decorators/validations/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,mBAAmB,CAAC;AAClC,cAAc,iCAAiC,CAAC;AAChD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,gCAAgC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/decorators/validations/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,mBAAmB,CAAC;AAClC,cAAc,iCAAiC,CAAC;AAChD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,2BAA2B,CAAC"}
@@ -19,4 +19,5 @@ __exportStar(require("./is-id.decorator"), exports);
19
19
  __exportStar(require("./is-not-empty-string.decorator"), exports);
20
20
  __exportStar(require("./is-one-of-property.decorator"), exports);
21
21
  __exportStar(require("./depend-on-property.decorator"), exports);
22
+ __exportStar(require("./sanitize-html.decorator"), exports);
22
23
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/decorators/validations/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4CAA0B;AAC1B,oDAAkC;AAClC,kEAAgD;AAChD,iEAA+C;AAC/C,iEAA+C"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/decorators/validations/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4CAA0B;AAC1B,oDAAkC;AAClC,kEAAgD;AAChD,iEAA+C;AAC/C,iEAA+C;AAC/C,4DAA0C"}
@@ -0,0 +1,3 @@
1
+ import type { IOptions } from 'sanitize-html';
2
+ export declare function SanitizeHtml(options?: IOptions): PropertyDecorator;
3
+ //# sourceMappingURL=sanitize-html.decorator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sanitize-html.decorator.d.ts","sourceRoot":"","sources":["../../../src/decorators/validations/sanitize-html.decorator.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAG9C,wBAAgB,YAAY,CAAC,OAAO,CAAC,EAAE,QAAQ,GAAG,iBAAiB,CAIlE"}
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SanitizeHtml = SanitizeHtml;
4
+ const class_transformer_1 = require("class-transformer");
5
+ const helpers_1 = require("../../helpers");
6
+ function SanitizeHtml(options) {
7
+ return (0, class_transformer_1.Transform)(({ value }) => (0, helpers_1.sanitizeHtml)(value, options), {
8
+ toClassOnly: true,
9
+ });
10
+ }
11
+ //# sourceMappingURL=sanitize-html.decorator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sanitize-html.decorator.js","sourceRoot":"","sources":["../../../src/decorators/validations/sanitize-html.decorator.ts"],"names":[],"mappings":";;AAIA,oCAIC;AARD,yDAA8C;AAE9C,2CAA6C;AAE7C,SAAgB,YAAY,CAAC,OAAkB;IAC7C,OAAO,IAAA,6BAAS,EAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,IAAA,sBAAY,EAAC,KAAK,EAAE,OAAO,CAAC,EAAE;QAC5D,WAAW,EAAE,IAAI;KAClB,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,30 @@
1
+ import { INestApplication, Logger } from '@nestjs/common';
2
+ export interface GracefulShutdownOptions {
3
+ timeoutMs?: number;
4
+ signals?: NodeJS.Signals[];
5
+ logger?: Pick<Logger, 'log' | 'warn' | 'error'>;
6
+ autoDiscoverParticipants?: boolean;
7
+ participants?: GracefulShutdownParticipant[];
8
+ }
9
+ export interface GracefulShutdownParticipant {
10
+ readonly name: string;
11
+ stopAccepting(): void | Promise<void>;
12
+ waitForIdle?(): void | Promise<void>;
13
+ }
14
+ export interface GracefulShutdownController {
15
+ readonly isDraining: () => boolean;
16
+ readonly activeRequests: () => number;
17
+ readonly activeHandlers: () => number;
18
+ shutdown(signal?: NodeJS.Signals): Promise<void>;
19
+ }
20
+ export declare class GracefulShutdownHelper {
21
+ private static isExpectedRedisShutdownError;
22
+ static enable(app: INestApplication, options?: GracefulShutdownOptions): GracefulShutdownController;
23
+ private static discoverParticipants;
24
+ private static getProviderInstances;
25
+ private static isClosable;
26
+ private static isSchedulerRegistry;
27
+ private static uniqueParticipants;
28
+ private static waitUntil;
29
+ }
30
+ //# sourceMappingURL=graceful-shutdown.helper.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"graceful-shutdown.helper.d.ts","sourceRoot":"","sources":["../../src/helpers/graceful-shutdown.helper.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,gBAAgB,EAChB,MAAM,EAGP,MAAM,gBAAgB,CAAC;AAYxB,MAAM,WAAW,uBAAuB;IACtC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC,OAAO,EAAE,CAAC;IAC3B,MAAM,CAAC,EAAE,IAAI,CAAC,MAAM,EAAE,KAAK,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC;IAChD,wBAAwB,CAAC,EAAE,OAAO,CAAC;IACnC,YAAY,CAAC,EAAE,2BAA2B,EAAE,CAAC;CAC9C;AAED,MAAM,WAAW,2BAA2B;IAC1C,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,aAAa,IAAI,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACtC,WAAW,CAAC,IAAI,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACtC;AAED,MAAM,WAAW,0BAA0B;IACzC,QAAQ,CAAC,UAAU,EAAE,MAAM,OAAO,CAAC;IACnC,QAAQ,CAAC,cAAc,EAAE,MAAM,MAAM,CAAC;IACtC,QAAQ,CAAC,cAAc,EAAE,MAAM,MAAM,CAAC;IACtC,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAClD;AAgED,qBAAa,sBAAsB;IACjC,OAAO,CAAC,MAAM,CAAC,4BAA4B;IAS3C,MAAM,CAAC,MAAM,CACX,GAAG,EAAE,gBAAgB,EACrB,OAAO,GAAE,uBAA4B,GACpC,0BAA0B;IA8J7B,OAAO,CAAC,MAAM,CAAC,oBAAoB;IAkFnC,OAAO,CAAC,MAAM,CAAC,oBAAoB;IAenC,OAAO,CAAC,MAAM,CAAC,UAAU;IAQzB,OAAO,CAAC,MAAM,CAAC,mBAAmB;IAclC,OAAO,CAAC,MAAM,CAAC,kBAAkB;mBAWZ,SAAS;CAO/B"}
@@ -0,0 +1,258 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GracefulShutdownHelper = void 0;
4
+ const common_1 = require("@nestjs/common");
5
+ const core_1 = require("@nestjs/core");
6
+ const rxjs_1 = require("rxjs");
7
+ const DEFAULT_TIMEOUT_MS = 110_000;
8
+ const PARTICIPANT_POLL_INTERVAL_MS = 50;
9
+ class TransportActivityInterceptor {
10
+ constructor(isDraining) {
11
+ this.isDraining = isDraining;
12
+ this.active = 0;
13
+ }
14
+ intercept(context, next) {
15
+ if (context.getType() === 'http')
16
+ return next.handle();
17
+ if (this.isDraining()) {
18
+ return (0, rxjs_1.throwError)(() => new common_1.ServiceUnavailableException('Service is shutting down'));
19
+ }
20
+ this.active += 1;
21
+ return next.handle().pipe((0, rxjs_1.finalize)(() => {
22
+ this.active = Math.max(0, this.active - 1);
23
+ }));
24
+ }
25
+ count() {
26
+ return this.active;
27
+ }
28
+ }
29
+ class GracefulShutdownHelper {
30
+ static isExpectedRedisShutdownError(reason) {
31
+ if (!(reason instanceof Error))
32
+ return false;
33
+ return (reason.message === 'Connection is closed.' &&
34
+ (reason.stack?.includes('/ioredis/') ?? false));
35
+ }
36
+ static enable(app, options = {}) {
37
+ const server = app.getHttpServer();
38
+ const timeoutMs = options.timeoutMs ?? DEFAULT_TIMEOUT_MS;
39
+ const signals = options.signals ?? ['SIGTERM', 'SIGINT'];
40
+ const logger = options.logger ?? new common_1.Logger('GracefulShutdown');
41
+ let draining = false;
42
+ let activeRequests = 0;
43
+ let shutdownPromise;
44
+ const transportActivity = new TransportActivityInterceptor(() => draining);
45
+ app.useGlobalInterceptors(transportActivity);
46
+ app.use((_request, response, next) => {
47
+ if (draining) {
48
+ response.statusCode = 503;
49
+ response.setHeader('Connection', 'close');
50
+ response.setHeader('Content-Type', 'application/json');
51
+ response.end(JSON.stringify({
52
+ statusCode: 503,
53
+ message: 'Service is shutting down',
54
+ }));
55
+ return;
56
+ }
57
+ activeRequests += 1;
58
+ let completed = false;
59
+ const complete = () => {
60
+ if (completed)
61
+ return;
62
+ completed = true;
63
+ activeRequests = Math.max(0, activeRequests - 1);
64
+ };
65
+ response.once('finish', complete);
66
+ response.once('close', complete);
67
+ next();
68
+ });
69
+ const shutdown = async (signal) => {
70
+ if (shutdownPromise)
71
+ return shutdownPromise;
72
+ shutdownPromise = (async () => {
73
+ draining = true;
74
+ logger.log(`${signal ?? 'Shutdown'} received; draining ${activeRequests} active request(s)`);
75
+ const participants = [
76
+ ...(options.autoDiscoverParticipants === false
77
+ ? []
78
+ : GracefulShutdownHelper.discoverParticipants(app, logger)),
79
+ ...(options.participants ?? []),
80
+ ];
81
+ const uniqueParticipants = GracefulShutdownHelper.uniqueParticipants(participants);
82
+ let closeServer = () => undefined;
83
+ const serverClosed = new Promise((resolve, reject) => {
84
+ closeServer = (error) => {
85
+ if (error)
86
+ reject(error);
87
+ else
88
+ resolve();
89
+ };
90
+ });
91
+ server.close(closeServer);
92
+ server.closeIdleConnections?.();
93
+ let timeout;
94
+ try {
95
+ const participantsDrained = Promise.all(uniqueParticipants.map(async (participant) => {
96
+ logger.log(`Stopping ${participant.name} intake`);
97
+ await participant.stopAccepting();
98
+ await participant.waitForIdle?.();
99
+ })).then(() => undefined);
100
+ await Promise.race([
101
+ Promise.all([
102
+ serverClosed,
103
+ GracefulShutdownHelper.waitUntil(() => transportActivity.count() === 0),
104
+ participantsDrained,
105
+ ]).then(() => undefined),
106
+ new Promise((resolve) => {
107
+ timeout = setTimeout(() => {
108
+ logger.warn(`Graceful shutdown timed out with ${activeRequests} active HTTP request(s) and ${transportActivity.count()} active transport handler(s)`);
109
+ server.closeAllConnections?.();
110
+ resolve();
111
+ }, timeoutMs);
112
+ timeout.unref();
113
+ }),
114
+ ]);
115
+ let unexpectedShutdownRejection = false;
116
+ const handleShutdownRejection = (reason) => {
117
+ if (GracefulShutdownHelper.isExpectedRedisShutdownError(reason)) {
118
+ logger.warn('Ignored an expected ioredis connection-closed rejection during shutdown');
119
+ return;
120
+ }
121
+ unexpectedShutdownRejection = true;
122
+ process.exitCode = 1;
123
+ logger.error('Unhandled rejection occurred during graceful shutdown', reason instanceof Error ? reason.stack : String(reason));
124
+ };
125
+ process.on('unhandledRejection', handleShutdownRejection);
126
+ try {
127
+ await app.close();
128
+ }
129
+ finally {
130
+ process.off('unhandledRejection', handleShutdownRejection);
131
+ }
132
+ if (unexpectedShutdownRejection) {
133
+ throw new Error('Graceful shutdown encountered an unexpected asynchronous error');
134
+ }
135
+ logger.log('Graceful shutdown completed');
136
+ }
137
+ catch (error) {
138
+ process.exitCode = 1;
139
+ logger.error('Graceful shutdown failed', error instanceof Error ? error.stack : String(error));
140
+ throw error;
141
+ }
142
+ finally {
143
+ if (timeout)
144
+ clearTimeout(timeout);
145
+ }
146
+ })();
147
+ return shutdownPromise;
148
+ };
149
+ for (const signal of signals) {
150
+ process.once(signal, () => {
151
+ void shutdown(signal).catch(() => undefined);
152
+ });
153
+ }
154
+ return {
155
+ isDraining: () => draining,
156
+ activeRequests: () => activeRequests,
157
+ activeHandlers: () => transportActivity.count(),
158
+ shutdown,
159
+ };
160
+ }
161
+ static discoverParticipants(app, logger) {
162
+ const providers = GracefulShutdownHelper.getProviderInstances(app);
163
+ const participants = [];
164
+ const microserviceServers = app
165
+ .getMicroservices()
166
+ .map((microservice) => microservice.serverInstance)
167
+ .filter((server) => GracefulShutdownHelper.isClosable(server));
168
+ if (microserviceServers.length > 0) {
169
+ participants.push({
170
+ name: 'Kafka/microservice',
171
+ stopAccepting: () => Promise.all(microserviceServers.map((server) => server.close())).then(() => undefined),
172
+ });
173
+ }
174
+ const queueResources = new Set();
175
+ for (const [token, instance] of providers) {
176
+ if (typeof token === 'string' &&
177
+ token.startsWith('BullQueue_') &&
178
+ GracefulShutdownHelper.isClosable(instance)) {
179
+ queueResources.add(instance);
180
+ }
181
+ const worker = instance?.worker;
182
+ if (GracefulShutdownHelper.isClosable(worker))
183
+ queueResources.add(worker);
184
+ }
185
+ if (queueResources.size > 0) {
186
+ participants.push({
187
+ name: 'Bull/BullMQ',
188
+ stopAccepting: () => Promise.all([...queueResources].map((resource) => resource.close(false))).then(() => undefined),
189
+ });
190
+ }
191
+ const scheduler = providers
192
+ .map(([, instance]) => instance)
193
+ .find(GracefulShutdownHelper.isSchedulerRegistry);
194
+ if (scheduler) {
195
+ const cronJobs = [...scheduler.getCronJobs().values()];
196
+ participants.push({
197
+ name: 'scheduler',
198
+ stopAccepting: () => {
199
+ for (const cronJob of cronJobs)
200
+ cronJob.stop();
201
+ for (const interval of scheduler.getIntervals()) {
202
+ scheduler.deleteInterval(interval);
203
+ }
204
+ for (const timeoutName of scheduler.getTimeouts()) {
205
+ scheduler.deleteTimeout(timeoutName);
206
+ }
207
+ },
208
+ waitForIdle: () => GracefulShutdownHelper.waitUntil(() => cronJobs.every((cronJob) => !cronJob.isCallbackRunning)),
209
+ });
210
+ }
211
+ logger.log(participants.length === 0
212
+ ? 'No background shutdown participants discovered'
213
+ : `Discovered shutdown participants: ${participants
214
+ .map((participant) => participant.name)
215
+ .join(', ')}`);
216
+ return participants;
217
+ }
218
+ static getProviderInstances(app) {
219
+ try {
220
+ const modules = app.get(core_1.ModulesContainer, { strict: false });
221
+ return [...modules.values()].flatMap((moduleRef) => [...moduleRef.providers.entries()].map(([token, wrapper]) => [token, wrapper.instance]));
222
+ }
223
+ catch {
224
+ return [];
225
+ }
226
+ }
227
+ static isClosable(value) {
228
+ return (typeof value === 'object' &&
229
+ value !== null &&
230
+ typeof value.close === 'function');
231
+ }
232
+ static isSchedulerRegistry(value) {
233
+ if (typeof value !== 'object' || value === null)
234
+ return false;
235
+ const registry = value;
236
+ return (typeof registry.getCronJobs === 'function' &&
237
+ typeof registry.getIntervals === 'function' &&
238
+ typeof registry.getTimeouts === 'function' &&
239
+ typeof registry.deleteInterval === 'function' &&
240
+ typeof registry.deleteTimeout === 'function');
241
+ }
242
+ static uniqueParticipants(participants) {
243
+ const names = new Set();
244
+ return participants.filter((participant) => {
245
+ if (names.has(participant.name))
246
+ return false;
247
+ names.add(participant.name);
248
+ return true;
249
+ });
250
+ }
251
+ static async waitUntil(predicate) {
252
+ while (!predicate()) {
253
+ await new Promise((resolve) => setTimeout(resolve, PARTICIPANT_POLL_INTERVAL_MS));
254
+ }
255
+ }
256
+ }
257
+ exports.GracefulShutdownHelper = GracefulShutdownHelper;
258
+ //# sourceMappingURL=graceful-shutdown.helper.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"graceful-shutdown.helper.js","sourceRoot":"","sources":["../../src/helpers/graceful-shutdown.helper.ts"],"names":[],"mappings":";;;AAAA,2CAOwB;AACxB,uCAAgD;AAEhD,+BAAwD;AA8BxD,MAAM,kBAAkB,GAAG,OAAO,CAAC;AACnC,MAAM,4BAA4B,GAAG,EAAE,CAAC;AA2BxC,MAAM,4BAA4B;IAGhC,YAA6B,UAAyB;QAAzB,eAAU,GAAV,UAAU,CAAe;QAF9C,WAAM,GAAG,CAAC,CAAC;IAEsC,CAAC;IAE1D,SAAS,CAAC,O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AU;YAC3C,OAAO,QAAQ,CAAC,WAAW,KAAK,UAAU;YAC1C,OAAO,QAAQ,CAAC,cAAc,KAAK,UAAU;YAC7C,OAAO,QAAQ,CAAC,aAAa,KAAK,UAAU,CAC7C,CAAC;IACJ,CAAC;IAEO,MAAM,CAAC,kBAAkB,CAC/B,YAA2C;QAE3C,MAAM,KAAK,GAAG,IAAI,GAAG,EAAU,CAAC;QAChC,OAAO,YAAY,CAAC,MAAM,CAAC,CAAC,WAAW,EAAE,EAAE;YACzC,IAAI,KAAK,CAAC,GAAG,CAAC,WAAW,CAAC,IAAI,CAAC;gBAAE,OAAO,KAAK,CAAC;YAC9C,KAAK,CAAC,GAAG,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;YAC5B,OAAO,IAAI,CAAC;QACd,CAAC,CAAC,CAAC;IACL,CAAC;IAEO,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,SAAwB;QACrD,OAAO,CAAC,SAAS,EAAE,EAAE,CAAC;YACpB,MAAM,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,EAAE,CAClC,UAAU,CAAC,OAAO,EAAE,4BAA4B,CAAC,CAClD,CAAC;QACJ,CAAC;IACH,CAAC;CACF;AApTD,wDAoTC"}
@@ -0,0 +1,3 @@
1
+ import sanitizeHtmlLib from 'sanitize-html';
2
+ export declare function sanitizeHtml(value: unknown, options?: sanitizeHtmlLib.IOptions): unknown;
3
+ //# sourceMappingURL=html-sanitizer.helper.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"html-sanitizer.helper.d.ts","sourceRoot":"","sources":["../../src/helpers/html-sanitizer.helper.ts"],"names":[],"mappings":"AAAA,OAAO,eAAe,MAAM,eAAe,CAAC;AAE5C,wBAAgB,YAAY,CAC1B,KAAK,EAAE,OAAO,EACd,OAAO,CAAC,EAAE,eAAe,CAAC,QAAQ,GACjC,OAAO,CAsBT"}
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.sanitizeHtml = sanitizeHtml;
7
+ const sanitize_html_1 = __importDefault(require("sanitize-html"));
8
+ function sanitizeHtml(value, options) {
9
+ if (typeof value !== 'string')
10
+ return value;
11
+ return (0, sanitize_html_1.default)(value, {
12
+ allowedTags: ['p', 'br', 'strong', 'em', 'u', 's', 'ul', 'ol', 'li', 'a'],
13
+ allowedAttributes: {
14
+ a: ['href', 'title', 'target', 'rel'],
15
+ },
16
+ allowedSchemes: ['http', 'https', 'mailto'],
17
+ allowProtocolRelative: false,
18
+ enforceHtmlBoundary: true,
19
+ transformTags: {
20
+ a: (_tagName, attribs) => ({
21
+ tagName: 'a',
22
+ attribs: {
23
+ ...attribs,
24
+ rel: 'noopener noreferrer nofollow',
25
+ },
26
+ }),
27
+ },
28
+ ...options,
29
+ }).trim();
30
+ }
31
+ //# sourceMappingURL=html-sanitizer.helper.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"html-sanitizer.helper.js","sourceRoot":"","sources":["../../src/helpers/html-sanitizer.helper.ts"],"names":[],"mappings":";;;;;AAEA,oCAyBC;AA3BD,kEAA4C;AAE5C,SAAgB,YAAY,CAC1B,KAAc,EACd,OAAkC;IAElC,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAC;IAE5C,OAAO,IAAA,uBAAe,EAAC,KAAK,EAAE;QAC5B,WAAW,EAAE,CAAC,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,CAAC;QACzE,iBAAiB,EAAE;YACjB,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,KAAK,CAAC;SACtC;QACD,cAAc,EAAE,CAAC,MAAM,EAAE,OAAO,EAAE,QAAQ,CAAC;QAC3C,qBAAqB,EAAE,KAAK;QAC5B,mBAAmB,EAAE,IAAI;QACzB,aAAa,EAAE;YACb,CAAC,EAAE,CAAC,QAAQ,EAAE,OAAO,EAAE,EAAE,CAAC,CAAC;gBACzB,OAAO,EAAE,GAAG;gBACZ,OAAO,EAAE;oBACP,GAAG,OAAO;oBACV,GAAG,EAAE,8BAA8B;iBACpC;aACF,CAAC;SACH;QACD,GAAG,OAAO;KACX,CAAC,CAAC,IAAI,EAAE,CAAC;AACZ,CAAC"}
@@ -3,6 +3,7 @@ export * from './cli-command.helper';
3
3
  export * from './convert-string-case.helper';
4
4
  export * from './generate-hash.helper';
5
5
  export * from './get-env.helper';
6
+ export * from './graceful-shutdown.helper';
6
7
  export * from './hmac.helper';
7
8
  export * from './i18n-message.helper';
8
9
  export * from './message-formatter.helper';
@@ -14,4 +15,5 @@ export * from './rxjs-catch-error.helper';
14
15
  export * from './rxjs-timeout-custom-callback.helper';
15
16
  export * from './success-response-translation.helper';
16
17
  export * from './yup.helper';
18
+ export * from './html-sanitizer.helper';
17
19
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/helpers/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,sBAAsB,CAAC;AACrC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,wBAAwB,CAAC;AACvC,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,uBAAuB,CAAC;AACtC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,iBAAiB,CAAC;AAChC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC;AACnC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,uCAAuC,CAAC;AACtD,cAAc,uCAAuC,CAAC;AACtD,cAAc,cAAc,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/helpers/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,sBAAsB,CAAC;AACrC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,wBAAwB,CAAC;AACvC,cAAc,kBAAkB,CAAC;AACjC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,eAAe,CAAC;AAC9B,cAAc,uBAAuB,CAAC;AACtC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,iBAAiB,CAAC;AAChC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC;AACnC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,uCAAuC,CAAC;AACtD,cAAc,uCAAuC,CAAC;AACtD,cAAc,cAAc,CAAC;AAC7B,cAAc,yBAAyB,CAAC"}
@@ -19,6 +19,7 @@ __exportStar(require("./cli-command.helper"), exports);
19
19
  __exportStar(require("./convert-string-case.helper"), exports);
20
20
  __exportStar(require("./generate-hash.helper"), exports);
21
21
  __exportStar(require("./get-env.helper"), exports);
22
+ __exportStar(require("./graceful-shutdown.helper"), exports);
22
23
  __exportStar(require("./hmac.helper"), exports);
23
24
  __exportStar(require("./i18n-message.helper"), exports);
24
25
  __exportStar(require("./message-formatter.helper"), exports);
@@ -30,4 +31,5 @@ __exportStar(require("./rxjs-catch-error.helper"), exports);
30
31
  __exportStar(require("./rxjs-timeout-custom-callback.helper"), exports);
31
32
  __exportStar(require("./success-response-translation.helper"), exports);
32
33
  __exportStar(require("./yup.helper"), exports);
34
+ __exportStar(require("./html-sanitizer.helper"), exports);
33
35
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/helpers/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+CAA6B;AAC7B,uDAAqC;AACrC,+DAA6C;AAC7C,yDAAuC;AACvC,mDAAiC;AACjC,gDAA8B;AAC9B,wDAAsC;AACtC,6DAA2C;AAC3C,kDAAgC;AAChC,6DAA2C;AAC3C,iDAA+B;AAC/B,qDAAmC;AACnC,4DAA0C;AAC1C,wEAAsD;AACtD,wEAAsD;AACtD,+CAA6B"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/helpers/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+CAA6B;AAC7B,uDAAqC;AACrC,+DAA6C;AAC7C,yDAAuC;AACvC,mDAAiC;AACjC,6DAA2C;AAC3C,gDAA8B;AAC9B,wDAAsC;AACtC,6DAA2C;AAC3C,kDAAgC;AAChC,6DAA2C;AAC3C,iDAA+B;AAC/B,qDAAmC;AACnC,4DAA0C;AAC1C,wEAAsD;AACtD,wEAAsD;AACtD,+CAA6B;AAC7B,0DAAwC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mondart/nestjs-common-module-core",
3
- "version": "3.2.6",
3
+ "version": "3.2.8",
4
4
  "description": "Core utilities, DTOs, decorators, entities, filters, validators and helpers for NestJS.",
5
5
  "author": {
6
6
  "name": "Mondart"
@@ -17,25 +17,29 @@
17
17
  "build": "tsc -p tsconfig.json"
18
18
  },
19
19
  "dependencies": {
20
- "@nestjs/microservices": "^11.1.10",
21
- "@nestjs/throttler": "^6.5.0",
22
- "@sentry/nestjs": "^10.32.1",
23
- "moment-timezone": "^0.6.0",
24
20
  "@nestjs/common": "^11.1.10",
25
21
  "@nestjs/core": "^11.1.10",
22
+ "@nestjs/microservices": "^11.1.10",
26
23
  "@nestjs/swagger": "^11.0.3",
24
+ "@nestjs/throttler": "^6.5.0",
27
25
  "@nestjs/typeorm": "^11.0.0",
26
+ "@sentry/nestjs": "^10.32.1",
28
27
  "class-transformer": "^0.5.1",
29
28
  "class-validator": "^0.14.3",
29
+ "inquirer": "^13.2.2",
30
+ "moment-timezone": "^0.6.0",
30
31
  "nestjs-i18n": "10.6.1",
31
32
  "nestjs-paginate": "^12.8.3",
32
33
  "reflect-metadata": "^0.2.0",
33
- "inquirer": "^13.2.2",
34
- "yup": "^1.7.1",
35
34
  "rxjs": "^7.8.2",
36
- "typeorm": "^0.3.28"
35
+ "sanitize-html": "2.17.4",
36
+ "typeorm": "^0.3.28",
37
+ "yup": "^1.7.1"
37
38
  },
38
39
  "publishConfig": {
39
40
  "access": "public"
41
+ },
42
+ "devDependencies": {
43
+ "@types/sanitize-html": "^2.16.1"
40
44
  }
41
45
  }