@getstrata/core 0.5.16 → 0.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/dist/bootstrap/membershipService.d.ts +3 -0
- package/dist/bootstrap/queue/defaultJobs.d.ts +2 -0
- package/dist/core/auth/authContext.d.ts +1 -2
- package/dist/core/auth/membershipContext.d.ts +1 -2
- package/dist/core/auth/membershipService.d.ts +1 -2
- package/dist/core/http/requestMetaContext.d.ts +1 -2
- package/dist/core/queue/createAppQueue.d.ts +3 -3
- package/dist/core/runtime/asyncContextStore.d.ts +3 -0
- package/dist/core/tenant/tenantContext.d.ts +1 -2
- package/dist/core/tracing/traceContext.d.ts +1 -2
- package/dist/entries/http/csrfToken.js +15 -2
- package/dist/entries/http/webErrorResponse.js +19 -8
- package/dist/entries/http/webFormRequest.js +16 -4
- package/dist/entries/jobs/dispatchWebhookJob.js +15 -2
- package/dist/entries/queue/createAppQueue.js +4383 -2000
- package/dist/entries/queue/publicQueue.js +15 -2
- package/dist/entries/queue/queueMetrics.js +4016 -1684
- package/dist/entries/view.js +19 -8
- package/dist/index.js +44 -24
- package/package.json +1 -1
|
@@ -644,9 +644,22 @@ function getBoundDatabaseConnection() {
|
|
|
644
644
|
return boundConnectionHolder.connection;
|
|
645
645
|
}
|
|
646
646
|
|
|
647
|
-
// ../../src/core/
|
|
647
|
+
// ../../src/core/runtime/asyncContextStore.ts
|
|
648
648
|
import { AsyncLocalStorage } from "async_hooks";
|
|
649
|
-
|
|
649
|
+
function createAsyncContextStore(key) {
|
|
650
|
+
const symbol = Symbol.for(key);
|
|
651
|
+
const globalRecord = globalThis;
|
|
652
|
+
const existing = globalRecord[symbol];
|
|
653
|
+
if (existing) {
|
|
654
|
+
return existing;
|
|
655
|
+
}
|
|
656
|
+
const store = new AsyncLocalStorage;
|
|
657
|
+
globalRecord[symbol] = store;
|
|
658
|
+
return store;
|
|
659
|
+
}
|
|
660
|
+
|
|
661
|
+
// ../../src/core/database/connectionContext.ts
|
|
662
|
+
var activeConnection = createAsyncContextStore("@getstrata/databaseConnectionContext");
|
|
650
663
|
function getActiveDatabaseConnection(fallback) {
|
|
651
664
|
return activeConnection.getStore() ?? fallback;
|
|
652
665
|
}
|