@rafikidota/iroh 0.31.0 → 0.33.0

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
@@ -24,19 +24,22 @@ npx nest g -c @rafikidota/iroh init
24
24
 
25
25
  ```ts
26
26
  import { Module } from '@nestjs/common';
27
+ import { NestModule } from '@nestjs/common';
28
+ import { MiddlewareConsumer } from '@nestjs/common';
29
+ import { StartTimeMiddleware } from '@rafikidota/iroh';
27
30
  import { CommonModule } from './common/common.module';
28
31
  import { CoreModule } from './modules/core.module';
29
32
 
30
33
  @Module({
31
- imports: [
32
- //... some other imports
33
- CommonModule,
34
- CoreModule,
35
- ],
34
+ imports: [CommonModule, CoreModule],
36
35
  controllers: [],
37
36
  providers: [],
38
37
  })
39
- export class AppModule {}
38
+ export class AppModule implements NestModule {
39
+ configure(consumer: MiddlewareConsumer) {
40
+ consumer.apply(StartTimeMiddleware).forRoutes('/*path');
41
+ }
42
+ }
40
43
  ```
41
44
 
42
45
  ## 3. Generate CRUD Module
@@ -6,5 +6,6 @@ export * from './filters';
6
6
  export * from './interceptors';
7
7
  export * from './interfaces';
8
8
  export * from './loggers';
9
+ export * from './middlewares';
9
10
  export * from './parsers';
10
11
  export * from './pipes';
@@ -22,6 +22,7 @@ __exportStar(require("./filters"), exports);
22
22
  __exportStar(require("./interceptors"), exports);
23
23
  __exportStar(require("./interfaces"), exports);
24
24
  __exportStar(require("./loggers"), exports);
25
+ __exportStar(require("./middlewares"), exports);
25
26
  __exportStar(require("./parsers"), exports);
26
27
  __exportStar(require("./pipes"), exports);
27
28
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/common/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,6CAA2B;AAC3B,+CAA6B;AAC7B,wCAAsB;AACtB,2CAAyB;AACzB,4CAA0B;AAC1B,iDAA+B;AAC/B,+CAA6B;AAC7B,4CAA0B;AAC1B,4CAA0B;AAC1B,0CAAwB"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/common/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,6CAA2B;AAC3B,+CAA6B;AAC7B,wCAAsB;AACtB,2CAAyB;AACzB,4CAA0B;AAC1B,iDAA+B;AAC/B,+CAA6B;AAC7B,4CAA0B;AAC1B,gDAA8B;AAC9B,4CAA0B;AAC1B,0CAAwB"}
@@ -0,0 +1 @@
1
+ export * from './start-time.middleware';
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./start-time.middleware"), exports);
18
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/common/middlewares/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0DAAwC"}
@@ -0,0 +1,7 @@
1
+ import { NestMiddleware } from '@nestjs/common';
2
+ import { Request } from 'express';
3
+ import { Response } from 'express';
4
+ import { NextFunction } from 'express';
5
+ export declare class StartTimeMiddleware implements NestMiddleware {
6
+ use(req: Request, res: Response, next: NextFunction): void;
7
+ }
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.StartTimeMiddleware = void 0;
10
+ const common_1 = require("@nestjs/common");
11
+ let StartTimeMiddleware = class StartTimeMiddleware {
12
+ use(req, res, next) {
13
+ const startTime = Date.now();
14
+ Object.assign(req, { startTime });
15
+ next();
16
+ }
17
+ };
18
+ exports.StartTimeMiddleware = StartTimeMiddleware;
19
+ exports.StartTimeMiddleware = StartTimeMiddleware = __decorate([
20
+ (0, common_1.Injectable)()
21
+ ], StartTimeMiddleware);
22
+ //# sourceMappingURL=start-time.middleware.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"start-time.middleware.js","sourceRoot":"","sources":["../../../src/common/middlewares/start-time.middleware.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAA4C;AAOrC,IAAM,mBAAmB,GAAzB,MAAM,mBAAmB;IAC9B,GAAG,CAAC,GAAY,EAAE,GAAa,EAAE,IAAkB;QACjD,MAAM,SAAS,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;QAC7B,MAAM,CAAC,MAAM,CAAC,GAAG,EAAE,EAAE,SAAS,EAAE,CAAC,CAAC;QAClC,IAAI,EAAE,CAAC;IACT,CAAC;CACF,CAAA;AANY,kDAAmB;8BAAnB,mBAAmB;IAD/B,IAAA,mBAAU,GAAE;GACA,mBAAmB,CAM/B"}
@@ -2,9 +2,10 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.QueryParser = void 0;
4
4
  const common_1 = require("@nestjs/common");
5
- const common_2 = require("@nestjs/common");
5
+ const timestamp_logger_1 = require("../loggers/providers/timestamp.logger");
6
6
  class QueryParser {
7
7
  static parse(query) {
8
+ this.logger.start();
8
9
  if (query.limit) {
9
10
  query.limit = Number(query.limit);
10
11
  }
@@ -27,7 +28,7 @@ class QueryParser {
27
28
  else {
28
29
  this.logger.error('Unknown error occurred while parsing options');
29
30
  }
30
- throw new common_2.BadRequestException('Invalid JSON in query param');
31
+ throw new common_1.BadRequestException('Invalid JSON in query param');
31
32
  }
32
33
  }
33
34
  }
@@ -36,5 +37,5 @@ class QueryParser {
36
37
  }
37
38
  }
38
39
  exports.QueryParser = QueryParser;
39
- QueryParser.logger = new common_1.Logger(QueryParser.name);
40
+ QueryParser.logger = new timestamp_logger_1.TimestampLogger(QueryParser.name);
40
41
  //# sourceMappingURL=query.parser.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"query.parser.js","sourceRoot":"","sources":["../../../src/common/parsers/query.parser.ts"],"names":[],"mappings":";;;AAAA,2CAAwC;AACxC,2CAAqD;AAGrD,MAAa,WAAW;IAEtB,MAAM,CAAC,KAAK,CAAC,KAAgB;QAC3B,IAAI,KAAK,CAAC,KAAK,EAAE,CAAC;YAChB,KAAK,CAAC,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QACpC,CAAC;QACD,IAAI,KAAK,CAAC,MAAM,EAAE,CAAC;YACjB,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QACtC,CAAC;QACD,IAAI,KAAK,CAAC,IAAI,EAAE,CAAC;YACf,KAAK,CAAC,IAAI,GAAG,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QAClC,CAAC;QACD,IAAI,KAAK,EAAE,OAAO,EAAE,CAAC;YACnB,IAAI,OAAO,KAAK,CAAC,OAAO,KAAK,QAAQ,EAAE,CAAC;gBACtC,IAAI,CAAC;oBACH,MAAM,aA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AG,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QAClC,CAAC;QACD,IAAI,KAAK,EAAE,OAAO,EAAE,CAAC;YACnB,IAAI,OAAO,KAAK,CAAC,OAAO,KAAK,QAAQ,EAAE,CAAC;gBACtC,IAAI,CAAC;oBACH,MAAM,aAAa,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;oBAChD,KAAK,GAAG,EAAE,GAAG,KAAK,EAAE,OAAO,EAAE,aAAa,EAAE,CAAC;gBAC/C,CAAC;gBAAC,OAAO,KAAc,EAAE,CAAC;oBACxB,IAAI,KAAK,YAAY,KAAK,EAAE,CAAC;wBAC3B,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;oBACnC,CAAC;yBAAM,CAAC;wBACN,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,8CAA8C,CAAC,CAAC;oBACpE,CAAC;oBACD,MAAM,IAAI,4BAAmB,CAAC,6BAA6B,CAAC,CAAC;gBAC/D,CAAC;YACH,CAAC;QACH,CAAC;QACD,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,2BAA2B,CAAC,CAAC;QAC7C,OAAO,EAAE,GAAG,KAAK,EAAE,CAAC;IACtB,CAAC;;AA9BH,kCA+BC;AA9ByB,kBAAM,GAAG,IAAI,kCAAe,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC"}
@@ -1,2 +1,2 @@
1
- export declare const PublicKey = "public";
1
+ export declare const PublicKey = "Public";
2
2
  export declare const Public: () => import("@nestjs/common").CustomDecorator<string>;
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Public = exports.PublicKey = void 0;
4
4
  const common_1 = require("@nestjs/common");
5
- exports.PublicKey = 'public';
5
+ exports.PublicKey = 'Public';
6
6
  const Public = () => (0, common_1.SetMetadata)(exports.PublicKey, true);
7
7
  exports.Public = Public;
8
8
  //# sourceMappingURL=public.decorator.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rafikidota/iroh",
3
- "version": "0.31.0",
3
+ "version": "0.33.0",
4
4
  "description": "Sometimes, the best way to solve your own problems is to help someone else.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -30,14 +30,14 @@
30
30
  "@angular-devkit/core": "19.2.13",
31
31
  "@angular-devkit/schematics": "19.2.13",
32
32
  "@nestjs/axios": "4.0.0",
33
- "@nestjs/common": "11.1.1",
33
+ "@nestjs/common": "11.1.2",
34
34
  "@nestjs/config": "4.0.2",
35
- "@nestjs/core": "11.1.1",
35
+ "@nestjs/core": "11.1.2",
36
36
  "@nestjs/jwt": "11.0.0",
37
37
  "@nestjs/passport": "11.0.5",
38
38
  "@nestjs/swagger": "11.2.0",
39
39
  "@nestjs/typeorm": "11.0.0",
40
- "@rafikidota/serpens": "1.3.0",
40
+ "@rafikidota/serpens": "1.5.0",
41
41
  "@swc/core": "1.11.29",
42
42
  "@swc/helpers": "0.5.17",
43
43
  "axios": "1.9.0",
@@ -55,25 +55,25 @@
55
55
  },
56
56
  "devDependencies": {
57
57
  "@eslint/eslintrc": "3.3.1",
58
- "@eslint/js": "9.27.0",
58
+ "@eslint/js": "9.28.0",
59
59
  "@types/bcrypt": "5.0.2",
60
60
  "@types/express": "5.0.2",
61
- "@types/node": "22.15.21",
61
+ "@types/node": "22.15.29",
62
62
  "@types/passport-jwt": "4.0.1",
63
63
  "@types/uuid": "10.0.0",
64
- "@typescript-eslint/eslint-plugin": "8.32.1",
65
- "@typescript-eslint/parser": "8.32.1",
66
- "eslint": "9.27.0",
64
+ "@typescript-eslint/eslint-plugin": "8.33.0",
65
+ "@typescript-eslint/parser": "8.33.0",
66
+ "eslint": "9.28.0",
67
67
  "eslint-config-prettier": "10.1.5",
68
68
  "eslint-plugin-import": "2.31.0",
69
- "eslint-plugin-prettier": "5.4.0",
70
- "globals": "16.1.0",
69
+ "eslint-plugin-prettier": "5.4.1",
70
+ "globals": "16.2.0",
71
71
  "husky": "9.1.7",
72
- "lint-staged": "16.0.0",
72
+ "lint-staged": "16.1.0",
73
73
  "prettier": "3.5.3",
74
74
  "rimraf": "6.0.1",
75
75
  "typescript": "5.8.3",
76
- "typescript-eslint": "8.32.1"
76
+ "typescript-eslint": "8.33.0"
77
77
  },
78
78
  "peerDependencies": {},
79
79
  "schematics": "./collection.json",