@merkaly/nest 0.2.6 → 0.2.7

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
@@ -40,6 +40,7 @@ import {
40
40
  env, loadEnv, // config
41
41
  LoggerModule, LoggerService, // logger
42
42
  requestLogger, requestOrigin, requestContext, noteRequest, bodyParsers, bodyParserReason, // uma linha por request
43
+ noIndex, // X-Robots-Tag noindex + /robots.txt bloqueando buscadores
43
44
  AbstractExceptionFilter, ExceptionsFilter, rememberError, // filtros (motivo do erro para o log)
44
45
  RabbitModule, EventsPublisher, EventsConsumer, EventRejectedException, // eventos
45
46
  rabbitConsumerOptions, assertConsumerTopology, OnMerkalyEvent,
@@ -1,3 +1,4 @@
1
1
  export * from './body-parsers';
2
+ export * from './no-index';
2
3
  export * from './request-logger';
3
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/http/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/http/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAC"}
@@ -15,5 +15,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./body-parsers"), exports);
18
+ __exportStar(require("./no-index"), exports);
18
19
  __exportStar(require("./request-logger"), exports);
19
20
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/http/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,iDAA+B;AAC/B,mDAAiC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/http/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,iDAA+B;AAC/B,6CAA2B;AAC3B,mDAAiC"}
@@ -0,0 +1,3 @@
1
+ import type { NextFunction, Request, Response } from 'express';
2
+ export declare function noIndex(): (request: Request, response: Response, next: NextFunction) => void;
3
+ //# sourceMappingURL=no-index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"no-index.d.ts","sourceRoot":"","sources":["../../src/http/no-index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAK/D,wBAAgB,OAAO,KACb,SAAS,OAAO,EAAE,UAAU,QAAQ,EAAE,MAAM,YAAY,UAWjE"}
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.noIndex = noIndex;
4
+ const ROBOTS = 'User-agent: *\nDisallow: /\n';
5
+ function noIndex() {
6
+ return (request, response, next) => {
7
+ response.setHeader('X-Robots-Tag', 'noindex, nofollow');
8
+ if (request.method === 'GET' && request.path === '/robots.txt') {
9
+ response.type('text/plain').send(ROBOTS);
10
+ return;
11
+ }
12
+ next();
13
+ };
14
+ }
15
+ //# sourceMappingURL=no-index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"no-index.js","sourceRoot":"","sources":["../../src/http/no-index.ts"],"names":[],"mappings":";;AAKA,0BAYC;AAfD,MAAM,MAAM,GAAG,8BAA8B,CAAC;AAG9C,SAAgB,OAAO;IACrB,OAAO,CAAC,OAAgB,EAAE,QAAkB,EAAE,IAAkB,EAAE,EAAE;QAClE,QAAQ,CAAC,SAAS,CAAC,cAAc,EAAE,mBAAmB,CAAC,CAAC;QAExD,IAAI,OAAO,CAAC,MAAM,KAAK,KAAK,IAAI,OAAO,CAAC,IAAI,KAAK,aAAa,EAAE,CAAC;YAC/D,QAAQ,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;YAEzC,OAAO;QACT,CAAC;QAED,IAAI,EAAE,CAAC;IACT,CAAC,CAAC;AACJ,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@merkaly/nest",
3
- "version": "0.2.6",
3
+ "version": "0.2.7",
4
4
  "description": "Shared NestJS runtime and tooling for Merkaly backend apps: pinned versions plus RabbitMQ events, logger, filters, config and signatures",
5
5
  "repository": {
6
6
  "type": "git",