@webpieces/core-meta 0.2.14 → 0.2.16
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/package.json +2 -2
- package/src/index.d.ts +10 -1
- package/src/index.js +12 -6
- package/src/index.js.map +1 -1
- package/src/WebAppMeta.d.ts +0 -92
- package/src/WebAppMeta.js +0 -57
- package/src/WebAppMeta.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webpieces/core-meta",
|
|
3
|
-
"version": "0.2.
|
|
4
|
-
"description": "Core metadata interfaces for WebPieces framework",
|
|
3
|
+
"version": "0.2.16",
|
|
4
|
+
"description": "Core metadata interfaces for WebPieces framework (re-exports from http-routing)",
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"main": "./src/index.js",
|
|
7
7
|
"types": "./src/index.d.ts",
|
package/src/index.d.ts
CHANGED
|
@@ -1 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* @webpieces/core-meta - Reserved for future core metadata types.
|
|
3
|
+
*
|
|
4
|
+
* Routing types have been moved to @webpieces/http-routing.
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Placeholder class to keep this package around for future use.
|
|
8
|
+
*/
|
|
9
|
+
export declare class DummyClass {
|
|
10
|
+
}
|
package/src/index.js
CHANGED
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @webpieces/core-meta - Reserved for future core metadata types.
|
|
4
|
+
*
|
|
5
|
+
* Routing types have been moved to @webpieces/http-routing.
|
|
6
|
+
*/
|
|
2
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
8
|
+
exports.DummyClass = void 0;
|
|
9
|
+
/**
|
|
10
|
+
* Placeholder class to keep this package around for future use.
|
|
11
|
+
*/
|
|
12
|
+
class DummyClass {
|
|
13
|
+
}
|
|
14
|
+
exports.DummyClass = DummyClass;
|
|
9
15
|
//# sourceMappingURL=index.js.map
|
package/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../packages/core/core-meta/src/index.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../packages/core/core-meta/src/index.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAEH;;GAEG;AACH,MAAa,UAAU;CAEtB;AAFD,gCAEC","sourcesContent":["/**\n * @webpieces/core-meta - Reserved for future core metadata types.\n *\n * Routing types have been moved to @webpieces/http-routing.\n */\n\n/**\n * Placeholder class to keep this package around for future use.\n */\nexport class DummyClass {\n // Reserved for future use\n}\n"]}
|
package/src/WebAppMeta.d.ts
DELETED
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
import { ContainerModule } from 'inversify';
|
|
2
|
-
/**
|
|
3
|
-
* Represents a route configuration that can be registered with the router.
|
|
4
|
-
* Similar to Java WebPieces Routes interface.
|
|
5
|
-
*/
|
|
6
|
-
export interface Routes {
|
|
7
|
-
/**
|
|
8
|
-
* Configure routes using the provided RouteBuilder.
|
|
9
|
-
*/
|
|
10
|
-
configure(routeBuilder: RouteBuilder): void;
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* Builder for registering routes.
|
|
14
|
-
* Will be implemented in http-routing package.
|
|
15
|
-
*/
|
|
16
|
-
export interface RouteBuilder {
|
|
17
|
-
addRoute<TResult = unknown>(route: RouteDefinition<TResult>): void;
|
|
18
|
-
addFilter(filter: FilterDefinition): void;
|
|
19
|
-
}
|
|
20
|
-
export declare class RouteMetadata2 {
|
|
21
|
-
httpMethod: string;
|
|
22
|
-
path: string;
|
|
23
|
-
methodName: string;
|
|
24
|
-
parameterTypes?: any[];
|
|
25
|
-
constructor(httpMethod: string, path: string, methodName: string, parameterTypes?: any[]);
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* Definition of a single route.
|
|
29
|
-
*
|
|
30
|
-
* Generic type parameter TResult represents the return type of the route handler.
|
|
31
|
-
* This provides type safety for the entire request/response cycle.
|
|
32
|
-
*/
|
|
33
|
-
export declare class RouteDefinition<TResult = unknown> {
|
|
34
|
-
routeMeta: RouteMetadata2;
|
|
35
|
-
controllerClass: any;
|
|
36
|
-
controllerFilepath?: string | undefined;
|
|
37
|
-
constructor(routeMeta: RouteMetadata2, controllerClass: any, controllerFilepath?: string | undefined);
|
|
38
|
-
}
|
|
39
|
-
/**
|
|
40
|
-
* Definition of a filter with priority.
|
|
41
|
-
*
|
|
42
|
-
* Use filepathPattern to scope filters to specific controllers:
|
|
43
|
-
* - 'src/controllers/admin/**' + '/*.ts' - All admin controllers
|
|
44
|
-
* - '**' + '/admin/**' - Any file in admin directories
|
|
45
|
-
* - '**' + '/UserController.ts' - Specific controller file
|
|
46
|
-
*
|
|
47
|
-
* If filepathPattern is not specified, the filter matches all controllers.
|
|
48
|
-
*/
|
|
49
|
-
export declare class FilterDefinition {
|
|
50
|
-
priority: number;
|
|
51
|
-
filterClass: any;
|
|
52
|
-
filter?: any;
|
|
53
|
-
/**
|
|
54
|
-
* Glob pattern to match controller file paths.
|
|
55
|
-
* If not specified, defaults to matching all controllers.
|
|
56
|
-
*/
|
|
57
|
-
filepathPattern: string;
|
|
58
|
-
constructor(priority: number, filterClass: any, filepathPattern: string);
|
|
59
|
-
}
|
|
60
|
-
/**
|
|
61
|
-
* Holds Express Request and Response objects.
|
|
62
|
-
* JsonFilter uses these to read request body and write response.
|
|
63
|
-
*/
|
|
64
|
-
export declare class RouteRequest {
|
|
65
|
-
/**
|
|
66
|
-
* Express Request object
|
|
67
|
-
*/
|
|
68
|
-
request: unknown;
|
|
69
|
-
/**
|
|
70
|
-
* Express Response object
|
|
71
|
-
*/
|
|
72
|
-
response: unknown;
|
|
73
|
-
constructor(request: unknown, response: unknown);
|
|
74
|
-
}
|
|
75
|
-
/**
|
|
76
|
-
* Main application metadata interface.
|
|
77
|
-
* Similar to Java WebPieces WebAppMeta.
|
|
78
|
-
*
|
|
79
|
-
* This is the entry point that WebpiecesServer calls to configure your application.
|
|
80
|
-
*/
|
|
81
|
-
export interface WebAppMeta {
|
|
82
|
-
/**
|
|
83
|
-
* Returns the list of Inversify container modules for dependency injection.
|
|
84
|
-
* Similar to getGuiceModules() in Java.
|
|
85
|
-
*/
|
|
86
|
-
getDIModules(): ContainerModule[];
|
|
87
|
-
/**
|
|
88
|
-
* Returns the list of route configurations.
|
|
89
|
-
* Similar to getRouteModules() in Java.
|
|
90
|
-
*/
|
|
91
|
-
getRoutes(): Routes[];
|
|
92
|
-
}
|
package/src/WebAppMeta.js
DELETED
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.RouteRequest = exports.FilterDefinition = exports.RouteDefinition = exports.RouteMetadata2 = void 0;
|
|
4
|
-
class RouteMetadata2 {
|
|
5
|
-
constructor(httpMethod, path, methodName, parameterTypes) {
|
|
6
|
-
this.httpMethod = httpMethod;
|
|
7
|
-
this.path = path;
|
|
8
|
-
this.methodName = methodName;
|
|
9
|
-
this.parameterTypes = parameterTypes;
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
exports.RouteMetadata2 = RouteMetadata2;
|
|
13
|
-
/**
|
|
14
|
-
* Definition of a single route.
|
|
15
|
-
*
|
|
16
|
-
* Generic type parameter TResult represents the return type of the route handler.
|
|
17
|
-
* This provides type safety for the entire request/response cycle.
|
|
18
|
-
*/
|
|
19
|
-
class RouteDefinition {
|
|
20
|
-
constructor(routeMeta, controllerClass, controllerFilepath) {
|
|
21
|
-
this.routeMeta = routeMeta;
|
|
22
|
-
this.controllerClass = controllerClass;
|
|
23
|
-
this.controllerFilepath = controllerFilepath;
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
exports.RouteDefinition = RouteDefinition;
|
|
27
|
-
/**
|
|
28
|
-
* Definition of a filter with priority.
|
|
29
|
-
*
|
|
30
|
-
* Use filepathPattern to scope filters to specific controllers:
|
|
31
|
-
* - 'src/controllers/admin/**' + '/*.ts' - All admin controllers
|
|
32
|
-
* - '**' + '/admin/**' - Any file in admin directories
|
|
33
|
-
* - '**' + '/UserController.ts' - Specific controller file
|
|
34
|
-
*
|
|
35
|
-
* If filepathPattern is not specified, the filter matches all controllers.
|
|
36
|
-
*/
|
|
37
|
-
class FilterDefinition {
|
|
38
|
-
constructor(priority, filterClass, filepathPattern) {
|
|
39
|
-
this.priority = priority;
|
|
40
|
-
this.filterClass = filterClass;
|
|
41
|
-
this.filepathPattern = filepathPattern;
|
|
42
|
-
this.filter = undefined; // Set later by RouteBuilder
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
exports.FilterDefinition = FilterDefinition;
|
|
46
|
-
/**
|
|
47
|
-
* Holds Express Request and Response objects.
|
|
48
|
-
* JsonFilter uses these to read request body and write response.
|
|
49
|
-
*/
|
|
50
|
-
class RouteRequest {
|
|
51
|
-
constructor(request, response) {
|
|
52
|
-
this.request = request;
|
|
53
|
-
this.response = response;
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
exports.RouteRequest = RouteRequest;
|
|
57
|
-
//# sourceMappingURL=WebAppMeta.js.map
|
package/src/WebAppMeta.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"WebAppMeta.js","sourceRoot":"","sources":["../../../../../packages/core/core-meta/src/WebAppMeta.ts"],"names":[],"mappings":";;;AAsBA,MAAa,cAAc;IAMvB,YACI,UAAkB,EAClB,IAAY,EACZ,UAAkB,EAClB,cAAsB;QAEtB,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,cAAc,GAAG,cAAc,CAAC;IACzC,CAAC;CACJ;AAjBD,wCAiBC;AACD;;;;;GAKG;AACH,MAAa,eAAe;IAE1B,YACW,SAAyB,EAC3B,eAAoB,EACpB,kBAA2B;QAFzB,cAAS,GAAT,SAAS,CAAgB;QAC3B,oBAAe,GAAf,eAAe,CAAK;QACpB,uBAAkB,GAAlB,kBAAkB,CAAS;IAEpC,CAAC;CACF;AARD,0CAQC;AAED;;;;;;;;;GASG;AACH,MAAa,gBAAgB;IAW3B,YACE,QAAgB,EAChB,WAAgB,EAChB,eAAuB;QAEvB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QAC/B,IAAI,CAAC,eAAe,GAAG,eAAe,CAAC;QACvC,IAAI,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC,4BAA4B;IACvD,CAAC;CACF;AArBD,4CAqBC;AAED;;;GAGG;AACH,MAAa,YAAY;IAWvB,YAAY,OAAgB,EAAE,QAAiB;QAC7C,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC3B,CAAC;CACF;AAfD,oCAeC","sourcesContent":["import { ContainerModule, Container } from 'inversify';\n\n/**\n * Represents a route configuration that can be registered with the router.\n * Similar to Java WebPieces Routes interface.\n */\nexport interface Routes {\n /**\n * Configure routes using the provided RouteBuilder.\n */\n configure(routeBuilder: RouteBuilder): void;\n}\n\n/**\n * Builder for registering routes.\n * Will be implemented in http-routing package.\n */\nexport interface RouteBuilder {\n addRoute<TResult = unknown>(route: RouteDefinition<TResult>): void;\n addFilter(filter: FilterDefinition): void;\n}\n\nexport class RouteMetadata2 {\n httpMethod: string;\n path: string;\n methodName: string;\n parameterTypes?: any[];\n\n constructor(\n httpMethod: string,\n path: string,\n methodName: string,\n parameterTypes?: any[]\n ) {\n this.httpMethod = httpMethod;\n this.path = path;\n this.methodName = methodName;\n this.parameterTypes = parameterTypes;\n }\n}\n/**\n * Definition of a single route.\n *\n * Generic type parameter TResult represents the return type of the route handler.\n * This provides type safety for the entire request/response cycle.\n */\nexport class RouteDefinition<TResult = unknown> {\n\n constructor(\n public routeMeta: RouteMetadata2,\n public controllerClass: any,\n public controllerFilepath?: string\n ) {\n }\n}\n\n/**\n * Definition of a filter with priority.\n *\n * Use filepathPattern to scope filters to specific controllers:\n * - 'src/controllers/admin/**' + '/*.ts' - All admin controllers\n * - '**' + '/admin/**' - Any file in admin directories\n * - '**' + '/UserController.ts' - Specific controller file\n *\n * If filepathPattern is not specified, the filter matches all controllers.\n */\nexport class FilterDefinition {\n priority: number;\n filterClass: any;\n filter?: any; // Filter instance (set by RouteBuilder when resolving from DI)\n\n /**\n * Glob pattern to match controller file paths.\n * If not specified, defaults to matching all controllers.\n */\n filepathPattern: string;\n\n constructor(\n priority: number,\n filterClass: any,\n filepathPattern: string,\n ) {\n this.priority = priority;\n this.filterClass = filterClass;\n this.filepathPattern = filepathPattern;\n this.filter = undefined; // Set later by RouteBuilder\n }\n}\n\n/**\n * Holds Express Request and Response objects.\n * JsonFilter uses these to read request body and write response.\n */\nexport class RouteRequest {\n /**\n * Express Request object\n */\n request: unknown;\n\n /**\n * Express Response object\n */\n response: unknown;\n\n constructor(request: unknown, response: unknown) {\n this.request = request;\n this.response = response;\n }\n}\n\n\n/**\n * Main application metadata interface.\n * Similar to Java WebPieces WebAppMeta.\n *\n * This is the entry point that WebpiecesServer calls to configure your application.\n */\nexport interface WebAppMeta {\n /**\n * Returns the list of Inversify container modules for dependency injection.\n * Similar to getGuiceModules() in Java.\n */\n getDIModules(): ContainerModule[];\n\n /**\n * Returns the list of route configurations.\n * Similar to getRouteModules() in Java.\n */\n getRoutes(): Routes[];\n}\n"]}
|