wooks 0.4.11 → 0.4.13
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/dist/index.cjs +0 -10
- package/dist/index.d.ts +52 -61
- package/dist/index.mjs +0 -10
- package/package.json +11 -3
package/dist/index.cjs
CHANGED
|
@@ -76,16 +76,6 @@ class WooksAdapterBase {
|
|
|
76
76
|
getWooks() {
|
|
77
77
|
return this.wooks;
|
|
78
78
|
}
|
|
79
|
-
/**
|
|
80
|
-
* Get logger instance for application logs
|
|
81
|
-
* ```js
|
|
82
|
-
* const app = createHttpApp()
|
|
83
|
-
* const logger = app.getLogger('app-logger')
|
|
84
|
-
* logger.log('My App log message')
|
|
85
|
-
* ```
|
|
86
|
-
* @param topic topic for logger
|
|
87
|
-
* @returns logger instance
|
|
88
|
-
*/
|
|
89
79
|
getLogger(topic) {
|
|
90
80
|
return this.getWooks().getLogger(topic);
|
|
91
81
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,61 +1,52 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import { TEventOptions } from '@wooksjs/event-core';
|
|
4
|
-
|
|
5
|
-
import { TProstoLoggerOptions } from '@prostojs/logger';
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
* @returns logger instance
|
|
54
|
-
*/
|
|
55
|
-
getLogger(topic: string): TConsoleBase;
|
|
56
|
-
protected getLoggerOptions(): TProstoLoggerOptions<Record<string, never>>;
|
|
57
|
-
protected mergeEventOptions(opts?: TEventOptions): TEventOptions;
|
|
58
|
-
on<ResType = unknown, ParamsType = Record<string, string | string[]>>(method: string, path: string, handler: TWooksHandler<ResType>): TProstoRouterPathHandle<ParamsType>;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
export { }
|
|
1
|
+
import * as _prostojs_router from '@prostojs/router';
|
|
2
|
+
import { ProstoRouter } from '@prostojs/router';
|
|
3
|
+
import { TEventOptions } from '@wooksjs/event-core';
|
|
4
|
+
export { useRouteParams } from '@wooksjs/event-core';
|
|
5
|
+
import { TConsoleBase, TProstoLoggerOptions } from '@prostojs/logger';
|
|
6
|
+
|
|
7
|
+
type TWooksHandler<ResType = unknown> = () => Promise<ResType> | ResType;
|
|
8
|
+
|
|
9
|
+
interface TWooksOptions {
|
|
10
|
+
logger?: TConsoleBase;
|
|
11
|
+
router?: {
|
|
12
|
+
ignoreTrailingSlash?: boolean;
|
|
13
|
+
ignoreCase?: boolean;
|
|
14
|
+
cacheLimit?: number;
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
declare class Wooks {
|
|
18
|
+
protected router: ProstoRouter<TWooksHandler>;
|
|
19
|
+
protected logger: TConsoleBase;
|
|
20
|
+
constructor(opts?: TWooksOptions);
|
|
21
|
+
getRouter(): ProstoRouter<TWooksHandler>;
|
|
22
|
+
getLogger(topic: string): TConsoleBase;
|
|
23
|
+
getLoggerOptions(): TProstoLoggerOptions;
|
|
24
|
+
lookup(method: string, path: string): {
|
|
25
|
+
handlers: TWooksHandler[] | null;
|
|
26
|
+
segments: _prostojs_router.TParsedSegment[] | null;
|
|
27
|
+
firstStatic: string | null;
|
|
28
|
+
};
|
|
29
|
+
on<ResType = unknown, ParamsType = Record<string, string | string[]>>(method: string, path: string, handler: TWooksHandler<ResType>): _prostojs_router.TProstoRouterPathHandle<ParamsType>;
|
|
30
|
+
}
|
|
31
|
+
declare function getGlobalWooks(logger?: TConsoleBase, routerOpts?: TWooksOptions['router']): Wooks;
|
|
32
|
+
declare class WooksAdapterBase {
|
|
33
|
+
protected wooks: Wooks;
|
|
34
|
+
constructor(wooks?: Wooks | WooksAdapterBase, logger?: TConsoleBase, routerOpts?: TWooksOptions['router']);
|
|
35
|
+
getWooks(): Wooks;
|
|
36
|
+
/**
|
|
37
|
+
* Get logger instance for application logs
|
|
38
|
+
* ```js
|
|
39
|
+
* const app = createHttpApp()
|
|
40
|
+
* const logger = app.getLogger('app-logger')
|
|
41
|
+
* logger.log('My App log message')
|
|
42
|
+
* ```
|
|
43
|
+
* @param topic topic for logger
|
|
44
|
+
* @returns logger instance
|
|
45
|
+
*/
|
|
46
|
+
getLogger(topic: string): TConsoleBase;
|
|
47
|
+
protected getLoggerOptions(): TProstoLoggerOptions<Record<string, never>>;
|
|
48
|
+
protected mergeEventOptions(opts?: TEventOptions): TEventOptions;
|
|
49
|
+
on<ResType = unknown, ParamsType = Record<string, string | string[]>>(method: string, path: string, handler: TWooksHandler<ResType>): _prostojs_router.TProstoRouterPathHandle<ParamsType>;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export { type TWooksHandler, type TWooksOptions, Wooks, WooksAdapterBase, getGlobalWooks };
|
package/dist/index.mjs
CHANGED
|
@@ -75,16 +75,6 @@ class WooksAdapterBase {
|
|
|
75
75
|
getWooks() {
|
|
76
76
|
return this.wooks;
|
|
77
77
|
}
|
|
78
|
-
/**
|
|
79
|
-
* Get logger instance for application logs
|
|
80
|
-
* ```js
|
|
81
|
-
* const app = createHttpApp()
|
|
82
|
-
* const logger = app.getLogger('app-logger')
|
|
83
|
-
* logger.log('My App log message')
|
|
84
|
-
* ```
|
|
85
|
-
* @param topic topic for logger
|
|
86
|
-
* @returns logger instance
|
|
87
|
-
*/
|
|
88
78
|
getLogger(topic) {
|
|
89
79
|
return this.getWooks().getLogger(topic);
|
|
90
80
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "wooks",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.13",
|
|
4
4
|
"description": "wooks",
|
|
5
5
|
"main": "dist/index.cjs",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -8,6 +8,14 @@
|
|
|
8
8
|
"files": [
|
|
9
9
|
"dist"
|
|
10
10
|
],
|
|
11
|
+
"exports": {
|
|
12
|
+
"./package.json": "./package.json",
|
|
13
|
+
".": {
|
|
14
|
+
"require": "./dist/index.cjs",
|
|
15
|
+
"import": "./dist/index.mjs",
|
|
16
|
+
"types": "./dist/index.d.ts"
|
|
17
|
+
}
|
|
18
|
+
},
|
|
11
19
|
"repository": {
|
|
12
20
|
"type": "git",
|
|
13
21
|
"url": "git+https://github.com/wooksjs/wooksjs.git",
|
|
@@ -32,8 +40,8 @@
|
|
|
32
40
|
},
|
|
33
41
|
"dependencies": {
|
|
34
42
|
"@prostojs/router": "^0.2.1",
|
|
35
|
-
"@prostojs/logger": "^0.
|
|
36
|
-
"@wooksjs/event-core": "0.4.
|
|
43
|
+
"@prostojs/logger": "^0.4.0",
|
|
44
|
+
"@wooksjs/event-core": "0.4.13"
|
|
37
45
|
},
|
|
38
46
|
"homepage": "https://github.com/wooksjs/wooksjs/tree/main/packages/wooks#readme"
|
|
39
47
|
}
|