@e22m4u/ts-rest-router 0.6.4 → 0.6.5

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.
@@ -68,9 +68,6 @@ __export(index_exports, {
68
68
  });
69
69
  module.exports = __toCommonJS(index_exports);
70
70
 
71
- // dist/esm/rest-router.js
72
- var import_js_trie_router3 = require("@e22m4u/js-trie-router");
73
-
74
71
  // dist/esm/debuggable-service.js
75
72
  var import_js_service = require("@e22m4u/js-service");
76
73
  var _DebuggableService = class _DebuggableService extends import_js_service.DebuggableService {
@@ -89,6 +86,9 @@ var _DebuggableService = class _DebuggableService extends import_js_service.Debu
89
86
  __name(_DebuggableService, "DebuggableService");
90
87
  var DebuggableService = _DebuggableService;
91
88
 
89
+ // dist/esm/rest-router.js
90
+ var import_js_trie_router3 = require("@e22m4u/js-trie-router");
91
+
92
92
  // dist/esm/controller-registry.js
93
93
  var import_js_format2 = require("@e22m4u/js-format");
94
94
  var import_js_trie_router2 = require("@e22m4u/js-trie-router");
@@ -1,7 +1,6 @@
1
1
  import { Constructor } from './types.js';
2
- import { HookType } from '@e22m4u/js-trie-router';
3
- import { RouterHook } from '@e22m4u/js-trie-router';
4
2
  import { DebuggableService } from './debuggable-service.js';
3
+ import { HookType, PostHandlerHook, PreHandlerHook } from '@e22m4u/js-trie-router';
5
4
  import { ControllerRootOptions } from './controller-registry.js';
6
5
  /**
7
6
  * Rest router.
@@ -24,5 +23,12 @@ export declare class RestRouter extends DebuggableService {
24
23
  * @param type
25
24
  * @param hook
26
25
  */
27
- addHook(type: HookType, hook: RouterHook): this;
26
+ addHook(type: typeof HookType.PRE_HANDLER, hook: PreHandlerHook): this;
27
+ /**
28
+ * Add hook.
29
+ *
30
+ * @param type
31
+ * @param hook
32
+ */
33
+ addHook(type: typeof HookType.POST_HANDLER, hook: PostHandlerHook): this;
28
34
  }
@@ -1,6 +1,6 @@
1
- import { TrieRouter } from '@e22m4u/js-trie-router';
2
1
  import { DebuggableService } from './debuggable-service.js';
3
- import { ControllerRegistry } from './controller-registry.js';
2
+ import { TrieRouter, } from '@e22m4u/js-trie-router';
3
+ import { ControllerRegistry, } from './controller-registry.js';
4
4
  /**
5
5
  * Rest router.
6
6
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@e22m4u/ts-rest-router",
3
- "version": "0.6.4",
3
+ "version": "0.6.5",
4
4
  "description": "Декларативный REST-маршрутизатор на основе контроллеров для TypeScript",
5
5
  "author": "Mikhail Evstropov <e22m4u@yandex.ru>",
6
6
  "license": "MIT",
@@ -41,27 +41,27 @@
41
41
  "prepare": "husky"
42
42
  },
43
43
  "dependencies": {
44
- "@e22m4u/js-debug": "~0.3.1",
45
- "@e22m4u/js-format": "~0.2.0",
46
- "@e22m4u/js-service": "~0.4.3",
47
- "@e22m4u/js-trie-router": "~0.3.2",
48
44
  "@e22m4u/js-data-schema": "~0.4.6",
45
+ "@e22m4u/js-debug": "~0.3.2",
46
+ "@e22m4u/js-format": "~0.2.0",
47
+ "@e22m4u/js-service": "~0.4.4",
48
+ "@e22m4u/js-trie-router": "~0.3.3",
49
49
  "@e22m4u/ts-reflector": "~0.1.8",
50
50
  "http-errors": "~2.0.0"
51
51
  },
52
52
  "devDependencies": {
53
53
  "@commitlint/cli": "~20.1.0",
54
54
  "@commitlint/config-conventional": "~20.0.0",
55
- "@eslint/js": "~9.37.0",
56
- "@types/chai": "~5.2.2",
55
+ "@eslint/js": "~9.38.0",
56
+ "@types/chai": "~5.2.3",
57
57
  "@types/debug": "~4.1.12",
58
58
  "@types/http-errors": "~2.0.5",
59
59
  "@types/mocha": "~10.0.10",
60
- "@types/node": "~24.7.2",
60
+ "@types/node": "~24.9.2",
61
61
  "c8": "~10.1.3",
62
62
  "chai": "~6.2.0",
63
- "esbuild": "~0.25.10",
64
- "eslint": "~9.37.0",
63
+ "esbuild": "~0.25.11",
64
+ "eslint": "~9.38.0",
65
65
  "eslint-config-prettier": "~10.1.8",
66
66
  "eslint-plugin-chai-expect": "~3.1.0",
67
67
  "eslint-plugin-mocha": "~11.2.0",
@@ -71,6 +71,6 @@
71
71
  "rimraf": "~6.0.1",
72
72
  "tsx": "~4.20.6",
73
73
  "typescript": "~5.9.3",
74
- "typescript-eslint": "~8.46.1"
74
+ "typescript-eslint": "~8.46.2"
75
75
  }
76
76
  }
@@ -1,10 +1,18 @@
1
1
  import {Constructor} from './types.js';
2
- import {HookType} from '@e22m4u/js-trie-router';
3
- import {RouterHook} from '@e22m4u/js-trie-router';
4
- import {TrieRouter} from '@e22m4u/js-trie-router';
5
2
  import {DebuggableService} from './debuggable-service.js';
6
- import {ControllerRegistry} from './controller-registry.js';
7
- import {ControllerRootOptions} from './controller-registry.js';
3
+
4
+ import {
5
+ TrieRouter,
6
+ RouterHook,
7
+ HookType,
8
+ PostHandlerHook,
9
+ PreHandlerHook,
10
+ } from '@e22m4u/js-trie-router';
11
+
12
+ import {
13
+ ControllerRegistry,
14
+ ControllerRootOptions,
15
+ } from './controller-registry.js';
8
16
 
9
17
  /**
10
18
  * Rest router.
@@ -31,6 +39,22 @@ export class RestRouter extends DebuggableService {
31
39
  return this;
32
40
  }
33
41
 
42
+ /**
43
+ * Add hook.
44
+ *
45
+ * @param type
46
+ * @param hook
47
+ */
48
+ addHook(type: typeof HookType.PRE_HANDLER, hook: PreHandlerHook): this;
49
+
50
+ /**
51
+ * Add hook.
52
+ *
53
+ * @param type
54
+ * @param hook
55
+ */
56
+ addHook(type: typeof HookType.POST_HANDLER, hook: PostHandlerHook): this;
57
+
34
58
  /**
35
59
  * Add hook.
36
60
  *