@e22m4u/ts-rest-router 0.5.2 → 0.5.3
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 +2 -2
- package/package.json +3 -3
package/README.md
CHANGED
@@ -390,7 +390,7 @@ class OrderController {
|
|
390
390
|
|
391
391
|
## Хуки (`@beforeAction`, `@afterAction`)
|
392
392
|
|
393
|
-
Хуки
|
393
|
+
Хуки - это функции, выполняющиеся до (`@beforeAction`) или после
|
394
394
|
(`@afterAction`) основного метода контроллера. Они предназначены для
|
395
395
|
сквозной логики, такой как аутентификация, логирование или модификация
|
396
396
|
ответа.
|
@@ -419,8 +419,8 @@ async function loggerHook(ctx: RequestContext, data: any) {
|
|
419
419
|
return {...data, timestamp: new Date()};
|
420
420
|
}
|
421
421
|
|
422
|
-
@restController('profile')
|
423
422
|
@beforeAction(authHook) // Применение ко всем методам контроллера
|
423
|
+
@restController('profile')
|
424
424
|
class ProfileController {
|
425
425
|
@getAction('me')
|
426
426
|
@afterAction(loggerHook) // Применение только к этому методу
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@e22m4u/ts-rest-router",
|
3
|
-
"version": "0.5.
|
3
|
+
"version": "0.5.3",
|
4
4
|
"description": "Декларативный REST-маршрутизатор на основе контроллеров для TypeScript",
|
5
5
|
"author": "Mikhail Evstropov <e22m4u@yandex.ru>",
|
6
6
|
"license": "MIT",
|
@@ -44,8 +44,8 @@
|
|
44
44
|
"@e22m4u/js-debug": "~0.2.3",
|
45
45
|
"@e22m4u/js-format": "~0.2.0",
|
46
46
|
"@e22m4u/js-service": "~0.3.8",
|
47
|
-
"@e22m4u/js-trie-router": "~0.2.
|
48
|
-
"@e22m4u/ts-data-schema": "~0.4.
|
47
|
+
"@e22m4u/js-trie-router": "~0.2.1",
|
48
|
+
"@e22m4u/ts-data-schema": "~0.4.2",
|
49
49
|
"@e22m4u/ts-reflector": "~0.1.7",
|
50
50
|
"http-errors": "~2.0.0"
|
51
51
|
},
|