@adaas/a-server 0.0.26 → 0.0.28
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/browser/index.mjs +20 -9
- package/dist/browser/index.mjs.map +1 -1
- package/dist/node/lib/A-Server/A-HttpServer.container.js +21 -10
- package/dist/node/lib/A-Server/A-HttpServer.container.js.map +1 -1
- package/dist/node/lib/A-Server/A-HttpServer.container.mjs +21 -10
- package/dist/node/lib/A-Server/A-HttpServer.container.mjs.map +1 -1
- package/package.json +3 -3
- package/src/lib/A-Server/A-HttpServer.container.ts +16 -3
package/dist/browser/index.mjs
CHANGED
|
@@ -1775,12 +1775,12 @@ __decorateClass([
|
|
|
1775
1775
|
__decorateParam(0, A_Inject(A_Server))
|
|
1776
1776
|
], A_ServerLogger.prototype, "logStop", 1);
|
|
1777
1777
|
var _a3, _b3, _c3, _d2, _e2;
|
|
1778
|
-
var
|
|
1778
|
+
var _A_HttpServer = class _A_HttpServer extends A_Service {
|
|
1779
1779
|
static get onBeforeRequest() {
|
|
1780
1780
|
return (target, propertyKey, descriptor) => {
|
|
1781
1781
|
return A_Feature.Extend({
|
|
1782
1782
|
name: A_HttpServerFeatures.onBeforeRequest,
|
|
1783
|
-
scope: [
|
|
1783
|
+
scope: [_A_HttpServer]
|
|
1784
1784
|
})(target, propertyKey, descriptor);
|
|
1785
1785
|
};
|
|
1786
1786
|
}
|
|
@@ -1788,7 +1788,7 @@ var A_HttpServer = class extends A_Service {
|
|
|
1788
1788
|
return (target, propertyKey, descriptor) => {
|
|
1789
1789
|
return A_Feature.Extend({
|
|
1790
1790
|
name: A_HttpServerFeatures.onRequest,
|
|
1791
|
-
scope: [
|
|
1791
|
+
scope: [_A_HttpServer]
|
|
1792
1792
|
})(target, propertyKey, descriptor);
|
|
1793
1793
|
};
|
|
1794
1794
|
}
|
|
@@ -1796,7 +1796,7 @@ var A_HttpServer = class extends A_Service {
|
|
|
1796
1796
|
return (target, propertyKey, descriptor) => {
|
|
1797
1797
|
return A_Feature.Extend({
|
|
1798
1798
|
name: A_HttpServerFeatures.onAfterRequest,
|
|
1799
|
-
scope: [
|
|
1799
|
+
scope: [_A_HttpServer]
|
|
1800
1800
|
})(target, propertyKey, descriptor);
|
|
1801
1801
|
};
|
|
1802
1802
|
}
|
|
@@ -1904,6 +1904,16 @@ var A_HttpServer = class extends A_Service {
|
|
|
1904
1904
|
case (error instanceof A_Error && error.originalError instanceof A_HttpServerError):
|
|
1905
1905
|
wrappedError = error.originalError;
|
|
1906
1906
|
break;
|
|
1907
|
+
// Duck-type: A_Error (e.g. A_FeatureError) wrapping an HttpError-like original.
|
|
1908
|
+
// A_Error.fromConstructor() unwraps nested A_Error chains, so originalError is
|
|
1909
|
+
// always the root non-A_Error cause — check it for a numeric statusCode.
|
|
1910
|
+
case (error instanceof A_Error && error.originalError instanceof Error && typeof error.originalError.statusCode === "number"):
|
|
1911
|
+
wrappedError = new A_HttpServerError({
|
|
1912
|
+
status: error.originalError.statusCode,
|
|
1913
|
+
description: error.originalError.message,
|
|
1914
|
+
originalError: error.originalError
|
|
1915
|
+
});
|
|
1916
|
+
break;
|
|
1907
1917
|
// Duck-type: any Error with a numeric statusCode property (e.g. http-errors,
|
|
1908
1918
|
// Express-style errors, or plain project HttpError classes). Honour the
|
|
1909
1919
|
// status code so the caller gets the right 4xx / 5xx rather than a blanket 500.
|
|
@@ -1935,21 +1945,22 @@ __decorateClass([
|
|
|
1935
1945
|
__decorateParam(0, A_Inject(A_Polyfill)),
|
|
1936
1946
|
__decorateParam(1, A_Dependency.Required()),
|
|
1937
1947
|
__decorateParam(1, A_Inject(A_Config))
|
|
1938
|
-
],
|
|
1948
|
+
], _A_HttpServer.prototype, _e2, 1);
|
|
1939
1949
|
__decorateClass([
|
|
1940
1950
|
A_Feature.Extend(),
|
|
1941
1951
|
__decorateParam(0, A_Inject(A_Config)),
|
|
1942
1952
|
__decorateParam(1, A_Inject(A_ServerLogger))
|
|
1943
|
-
],
|
|
1953
|
+
], _A_HttpServer.prototype, _d2, 1);
|
|
1944
1954
|
__decorateClass([
|
|
1945
1955
|
A_Feature.Extend()
|
|
1946
|
-
],
|
|
1956
|
+
], _A_HttpServer.prototype, _c3, 1);
|
|
1947
1957
|
__decorateClass([
|
|
1948
1958
|
A_Feature.Extend()
|
|
1949
|
-
],
|
|
1959
|
+
], _A_HttpServer.prototype, _b3, 1);
|
|
1950
1960
|
__decorateClass([
|
|
1951
1961
|
A_Feature.Extend()
|
|
1952
|
-
],
|
|
1962
|
+
], _A_HttpServer.prototype, _a3, 1);
|
|
1963
|
+
var A_HttpServer = _A_HttpServer;
|
|
1953
1964
|
var A_ServerError = class extends A_Error {
|
|
1954
1965
|
constructor() {
|
|
1955
1966
|
super(...arguments);
|