@onlineapps/service-wrapper 2.2.1 → 2.2.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/package.json +5 -5
- package/src/ServiceWrapper.js +7 -7
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@onlineapps/service-wrapper",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.3",
|
|
4
4
|
"description": "Thin orchestration layer for microservices - delegates all infrastructure concerns to specialized connectors",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -27,11 +27,11 @@
|
|
|
27
27
|
"@onlineapps/conn-base-cache": "1.0.8",
|
|
28
28
|
"@onlineapps/conn-base-monitoring": "1.0.10",
|
|
29
29
|
"@onlineapps/conn-infra-error-handler": "1.0.9",
|
|
30
|
-
"@onlineapps/conn-infra-mq": "1.1.
|
|
30
|
+
"@onlineapps/conn-infra-mq": "1.1.68",
|
|
31
31
|
"@onlineapps/conn-orch-api-mapper": "1.0.30",
|
|
32
|
-
"@onlineapps/conn-orch-cookbook": "2.0.
|
|
33
|
-
"@onlineapps/conn-orch-orchestrator": "1.0.
|
|
34
|
-
"@onlineapps/conn-orch-registry": "1.1.
|
|
32
|
+
"@onlineapps/conn-orch-cookbook": "2.0.36",
|
|
33
|
+
"@onlineapps/conn-orch-orchestrator": "1.0.104",
|
|
34
|
+
"@onlineapps/conn-orch-registry": "1.1.53",
|
|
35
35
|
"@onlineapps/conn-orch-validator": "2.0.31",
|
|
36
36
|
"@onlineapps/monitoring-core": "1.0.21",
|
|
37
37
|
"@onlineapps/service-common": "1.0.17",
|
package/src/ServiceWrapper.js
CHANGED
|
@@ -1695,13 +1695,13 @@ class ServiceWrapper {
|
|
|
1695
1695
|
/**
|
|
1696
1696
|
* Bidirectional validation: operations.json <-> Express routes.
|
|
1697
1697
|
* Check A: every declared operation has a matching Express route.
|
|
1698
|
-
* Check B: every /api/* route has a matching operation or is in
|
|
1698
|
+
* Check B: every /api/* route has a matching operation or is in _exclude.
|
|
1699
1699
|
* @private
|
|
1700
1700
|
* @throws {Error} Permanent error listing all mismatches
|
|
1701
1701
|
*/
|
|
1702
1702
|
_validateOperationsRouteAlignment() {
|
|
1703
1703
|
const ops = this.operations?.operations || {};
|
|
1704
|
-
const
|
|
1704
|
+
const excludeEntries = this.operations?._exclude || [];
|
|
1705
1705
|
const expressRoutes = this._extractExpressRoutes();
|
|
1706
1706
|
|
|
1707
1707
|
const routeSet = new Set(
|
|
@@ -1731,17 +1731,17 @@ class ServiceWrapper {
|
|
|
1731
1731
|
opEndpoints.get(endpoint).add(method);
|
|
1732
1732
|
}
|
|
1733
1733
|
|
|
1734
|
-
// Build
|
|
1735
|
-
const
|
|
1736
|
-
|
|
1734
|
+
// Build _exclude lookup
|
|
1735
|
+
const excludeSet = new Set(
|
|
1736
|
+
excludeEntries.map(e => `${(e.method || 'GET').toUpperCase()}:${e.endpoint}`)
|
|
1737
1737
|
);
|
|
1738
1738
|
|
|
1739
|
-
// Check B: every /api/* route must have a matching operation or be
|
|
1739
|
+
// Check B: every /api/* route must have a matching operation or be in _exclude
|
|
1740
1740
|
for (const route of expressRoutes) {
|
|
1741
1741
|
if (!route.path.startsWith('/api')) continue;
|
|
1742
1742
|
|
|
1743
1743
|
const key = `${route.method}:${route.path}`;
|
|
1744
|
-
if (
|
|
1744
|
+
if (excludeSet.has(key)) continue;
|
|
1745
1745
|
|
|
1746
1746
|
const endpointOps = opEndpoints.get(route.path);
|
|
1747
1747
|
if (!endpointOps) {
|