@forklaunch/core 1.5.16 → 1.5.18
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/lib/http/index.js +31 -20
- package/lib/http/index.js.map +1 -1
- package/lib/http/index.mjs +30 -20
- package/lib/http/index.mjs.map +1 -1
- package/lib/http/middleware/request/auth.middleware.d.ts.map +1 -1
- package/lib/http/router/expressLikeRouter.d.ts +3 -1
- package/lib/http/router/expressLikeRouter.d.ts.map +1 -1
- package/lib/persistence/complianceTypes.d.ts +51 -2
- package/lib/persistence/complianceTypes.d.ts.map +1 -1
- package/lib/persistence/defineComplianceEntity.d.ts +3 -3
- package/lib/persistence/defineComplianceEntity.d.ts.map +1 -1
- package/lib/persistence/encryptionSafeEm.d.ts +82 -0
- package/lib/persistence/encryptionSafeEm.d.ts.map +1 -0
- package/lib/persistence/forgivingDecryptionEm.d.ts +12 -0
- package/lib/persistence/forgivingDecryptionEm.d.ts.map +1 -0
- package/lib/persistence/index.d.ts +3 -1
- package/lib/persistence/index.d.ts.map +1 -1
- package/lib/persistence/index.js +88 -6
- package/lib/persistence/index.js.map +1 -1
- package/lib/persistence/index.mjs +86 -6
- package/lib/persistence/index.mjs.map +1 -1
- package/lib/persistence/mikroOrm.types.d.ts +7 -1
- package/lib/persistence/mikroOrm.types.d.ts.map +1 -1
- package/lib/services/configInjector.d.ts.map +1 -1
- package/lib/services/index.js +6 -0
- package/lib/services/index.js.map +1 -1
- package/lib/services/index.mjs +6 -0
- package/lib/services/index.mjs.map +1 -1
- package/lib/services/retentionService.d.ts +3 -2
- package/lib/services/retentionService.d.ts.map +1 -1
- package/lib/services/runRetentionEnforcement.d.ts +2 -1
- package/lib/services/runRetentionEnforcement.d.ts.map +1 -1
- package/package.json +11 -12
package/lib/http/index.js
CHANGED
|
@@ -84,6 +84,7 @@ __export(http_exports, {
|
|
|
84
84
|
post: () => post,
|
|
85
85
|
put: () => put,
|
|
86
86
|
recordMetric: () => recordMetric,
|
|
87
|
+
resetProcessHandlersForTesting: () => resetProcessHandlersForTesting,
|
|
87
88
|
trace: () => trace3,
|
|
88
89
|
typedAuthHandler: () => typedAuthHandler,
|
|
89
90
|
typedHandler: () => typedHandler
|
|
@@ -1067,8 +1068,8 @@ async function checkAuthorizationToken(req, authorizationMethod, authorizationTo
|
|
|
1067
1068
|
);
|
|
1068
1069
|
if (collapsedAuthorizationMethod.scopeHeirarchy) {
|
|
1069
1070
|
if (collapsedAuthorizationMethod.requiredScope) {
|
|
1070
|
-
if (!resourceScopes.has(collapsedAuthorizationMethod.requiredScope) || Array.from(resourceScopes).every(
|
|
1071
|
-
(scope) => collapsedAuthorizationMethod.scopeHeirarchy?.indexOf(scope) ?? -1 > -1
|
|
1071
|
+
if (!resourceScopes.has(collapsedAuthorizationMethod.requiredScope) || !Array.from(resourceScopes).every(
|
|
1072
|
+
(scope) => (collapsedAuthorizationMethod.scopeHeirarchy?.indexOf(scope) ?? -1) > -1
|
|
1072
1073
|
)) {
|
|
1073
1074
|
return invalidScope;
|
|
1074
1075
|
}
|
|
@@ -1569,6 +1570,31 @@ function extractRouteHandlers(params) {
|
|
|
1569
1570
|
controllerHandler
|
|
1570
1571
|
};
|
|
1571
1572
|
}
|
|
1573
|
+
var processHandlersInstalled = false;
|
|
1574
|
+
function installProcessHandlers(openTelemetryCollector) {
|
|
1575
|
+
if (processHandlersInstalled) {
|
|
1576
|
+
return;
|
|
1577
|
+
}
|
|
1578
|
+
processHandlersInstalled = true;
|
|
1579
|
+
process.on("uncaughtException", (err) => {
|
|
1580
|
+
openTelemetryCollector.error(`Uncaught exception: ${err}`);
|
|
1581
|
+
process.exit(1);
|
|
1582
|
+
});
|
|
1583
|
+
process.on("unhandledRejection", (reason) => {
|
|
1584
|
+
openTelemetryCollector.error(`Unhandled rejection: ${reason}`);
|
|
1585
|
+
process.exit(1);
|
|
1586
|
+
});
|
|
1587
|
+
process.on("exit", () => {
|
|
1588
|
+
openTelemetryCollector.info("Shutting down application");
|
|
1589
|
+
});
|
|
1590
|
+
process.on("SIGINT", () => {
|
|
1591
|
+
openTelemetryCollector.info("Shutting down application");
|
|
1592
|
+
process.exit(0);
|
|
1593
|
+
});
|
|
1594
|
+
}
|
|
1595
|
+
function resetProcessHandlersForTesting() {
|
|
1596
|
+
processHandlersInstalled = false;
|
|
1597
|
+
}
|
|
1572
1598
|
var ForklaunchExpressLikeRouter = class _ForklaunchExpressLikeRouter {
|
|
1573
1599
|
constructor(basePath, schemaValidator, internal, postEnrichMiddleware, openTelemetryCollector, routerOptions) {
|
|
1574
1600
|
this.basePath = basePath;
|
|
@@ -1578,21 +1604,7 @@ var ForklaunchExpressLikeRouter = class _ForklaunchExpressLikeRouter {
|
|
|
1578
1604
|
this.openTelemetryCollector = openTelemetryCollector;
|
|
1579
1605
|
this.routerOptions = routerOptions;
|
|
1580
1606
|
if (process.env.NODE_ENV !== "test" && !process.env.VITEST && process.env.FORKLAUNCH_MODE !== "openapi") {
|
|
1581
|
-
|
|
1582
|
-
this.openTelemetryCollector.error(`Uncaught exception: ${err}`);
|
|
1583
|
-
process.exit(1);
|
|
1584
|
-
});
|
|
1585
|
-
process.on("unhandledRejection", (reason) => {
|
|
1586
|
-
this.openTelemetryCollector.error(`Unhandled rejection: ${reason}`);
|
|
1587
|
-
process.exit(1);
|
|
1588
|
-
});
|
|
1589
|
-
process.on("exit", () => {
|
|
1590
|
-
this.openTelemetryCollector.info("Shutting down application");
|
|
1591
|
-
});
|
|
1592
|
-
process.on("SIGINT", () => {
|
|
1593
|
-
this.openTelemetryCollector.info("Shutting down application");
|
|
1594
|
-
process.exit(0);
|
|
1595
|
-
});
|
|
1607
|
+
installProcessHandlers(this.openTelemetryCollector);
|
|
1596
1608
|
}
|
|
1597
1609
|
this.internal.use(createContext(this.schemaValidator));
|
|
1598
1610
|
}
|
|
@@ -3922,9 +3934,7 @@ function enrichExpressLikeSend(instance, req, res, originalOperation, originalSe
|
|
|
3922
3934
|
);
|
|
3923
3935
|
}
|
|
3924
3936
|
if ((0, import_common14.isNodeJsWriteableStream)(res)) {
|
|
3925
|
-
import_stream.Readable.from((0, import_common14.readableStreamToAsyncIterable)(data.stream())).pipe(
|
|
3926
|
-
res
|
|
3927
|
-
);
|
|
3937
|
+
import_stream.Readable.from((0, import_common14.readableStreamToAsyncIterable)(data.stream())).pipe(res);
|
|
3928
3938
|
} else {
|
|
3929
3939
|
res.type("text/plain");
|
|
3930
3940
|
res.status(500);
|
|
@@ -4550,6 +4560,7 @@ var RateLimiter = class {
|
|
|
4550
4560
|
post,
|
|
4551
4561
|
put,
|
|
4552
4562
|
recordMetric,
|
|
4563
|
+
resetProcessHandlersForTesting,
|
|
4553
4564
|
trace,
|
|
4554
4565
|
typedAuthHandler,
|
|
4555
4566
|
typedHandler
|