@getstrata/core 2.2.60 → 3.0.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/CHANGELOG.md +22 -0
- package/dist/core/audit/exportAuditLogs.d.ts +12 -3
- package/dist/core/audit/exportStore.d.ts +6 -2
- package/dist/core/audit/siemFormatter.d.ts +2 -2
- package/dist/core/auth/abilityCatalog.d.ts +1 -9
- package/dist/core/auth/authContext.d.ts +2 -0
- package/dist/core/auth/authOutcome.d.ts +32 -0
- package/dist/core/auth/authReader.d.ts +22 -0
- package/dist/core/auth/basicAuthGuard.d.ts +19 -3
- package/dist/core/auth/emailVerification.d.ts +1 -1
- package/dist/core/auth/guard.d.ts +27 -6
- package/dist/core/auth/intendedUrlCookie.d.ts +13 -7
- package/dist/core/auth/jwt.d.ts +5 -4
- package/dist/core/auth/jwtGuard.d.ts +7 -6
- package/dist/core/auth/membershipContext.d.ts +10 -7
- package/dist/core/auth/membershipContextMiddleware.d.ts +3 -3
- package/dist/core/auth/membershipMiddleware.d.ts +1 -2
- package/dist/core/auth/membershipServiceImplementation.d.ts +1 -1
- package/dist/core/auth/oauth/oidcIdToken.d.ts +25 -16
- package/dist/core/auth/oauth/oidcProvider.d.ts +6 -4
- package/dist/core/auth/oauth/providers.d.ts +3 -1
- package/dist/core/auth/oneTimeToken.d.ts +2 -3
- package/dist/core/auth/passwordConfirmCookie.d.ts +15 -6
- package/dist/core/auth/passwordLogin.d.ts +5 -5
- package/dist/core/auth/pendingMfaCookie.d.ts +2 -2
- package/dist/core/auth/policy.d.ts +23 -10
- package/dist/core/auth/requireAuthCapability.d.ts +3 -0
- package/dist/core/auth/resolveMembershipService.d.ts +3 -2
- package/dist/core/auth/saml/samlAssertionReplay.d.ts +4 -4
- package/dist/core/auth/saml/samlServiceProvider.d.ts +11 -7
- package/dist/core/auth/scimAuthMiddleware.d.ts +10 -3
- package/dist/core/auth/sessionCookie.d.ts +20 -9
- package/dist/core/auth/sessionGuard.d.ts +14 -3
- package/dist/core/cache/createCacheStore.d.ts +6 -3
- package/dist/core/cache/redisCacheStore.d.ts +5 -1
- package/dist/core/cache/repository.d.ts +5 -1
- package/dist/core/cache/simpleCache.d.ts +2 -1
- package/dist/core/cache/tokens.d.ts +8 -0
- package/dist/core/config/applicationConfig.d.ts +21 -0
- package/dist/core/config/configSnapshot.d.ts +3 -0
- package/dist/core/config/envSchema.d.ts +3 -2
- package/dist/core/contracts/application.d.ts +153 -0
- package/dist/core/contracts/authUserDirectory.d.ts +24 -7
- package/dist/core/contracts/container.d.ts +20 -23
- package/dist/core/contracts/di.d.ts +4 -2
- package/dist/core/contracts/executionContext.d.ts +5 -0
- package/dist/core/contracts/executionOperations.d.ts +10 -0
- package/dist/core/contracts/executionOwnership.d.ts +38 -0
- package/dist/core/contracts/persistence.d.ts +20 -0
- package/dist/core/contracts/serviceTokens.d.ts +32 -18
- package/dist/core/contracts/services.d.ts +63 -0
- package/dist/core/contracts/token.d.ts +19 -0
- package/dist/core/crypto/fieldEncryption.d.ts +19 -7
- package/dist/core/crypto/fieldEncryptionRotation.d.ts +21 -5
- package/dist/core/crypto/mfaSecret.d.ts +10 -3
- package/dist/core/database/baseRepository.d.ts +14 -10
- package/dist/core/database/bindings.d.ts +6 -0
- package/dist/core/database/bunSql.d.ts +3 -12
- package/dist/core/database/definitions.d.ts +209 -0
- package/dist/core/database/dialect.d.ts +5 -24
- package/dist/core/database/driverPorts.d.ts +116 -0
- package/dist/core/database/errors.d.ts +47 -7
- package/dist/core/database/factory.d.ts +51 -31
- package/dist/core/database/index.d.ts +9 -10
- package/dist/core/database/keyset.d.ts +2 -1
- package/dist/core/database/legacyNativeTransaction.d.ts +5 -0
- package/dist/core/database/manager.d.ts +12 -0
- package/dist/core/database/model.d.ts +91 -97
- package/dist/core/database/modelQuery.d.ts +9 -5
- package/dist/core/database/modelRegistry.d.ts +52 -33
- package/dist/core/database/mysqlConnection.d.ts +1 -19
- package/dist/core/database/mysqlNative.d.ts +38 -0
- package/dist/core/database/nativeTransactions.d.ts +16 -0
- package/dist/core/database/ormInternal.d.ts +85 -0
- package/dist/core/database/ormRuntime.d.ts +4 -0
- package/dist/core/database/ownedReadOnlyObservation.d.ts +16 -0
- package/dist/core/database/postgresNative.d.ts +11 -0
- package/dist/core/database/query.d.ts +24 -23
- package/dist/core/database/queryPlanSnapshot.d.ts +7 -0
- package/dist/core/database/rawMysql.d.ts +7 -0
- package/dist/core/database/rawPostgres.d.ts +23 -0
- package/dist/core/database/rawSqlite.d.ts +6 -0
- package/dist/core/database/relationQueries.d.ts +3 -2
- package/dist/core/database/relationQuery.d.ts +24 -6
- package/dist/core/database/repositoryQuery.d.ts +6 -1
- package/dist/core/database/schema/driver.d.ts +1 -1
- package/dist/core/database/seeders/types.d.ts +1 -1
- package/dist/core/database/session.d.ts +13 -0
- package/dist/core/database/sessionFactory.d.ts +9 -0
- package/dist/core/database/sqlDialects.d.ts +22 -0
- package/dist/core/database/tokens.d.ts +7 -0
- package/dist/core/database/transactionSession.d.ts +43 -0
- package/dist/core/errors/http.d.ts +4 -1
- package/dist/core/events/{eventBus.d.ts → eventBusClass.d.ts} +1 -3
- package/dist/core/events/index.d.ts +2 -3
- package/dist/core/events/outbox/index.d.ts +44 -13
- package/dist/core/events/outbox/metrics.d.ts +4 -4
- package/dist/core/events/outbox/workerTransport.d.ts +17 -0
- package/dist/core/http/authMiddleware.d.ts +2 -2
- package/dist/core/http/authorizeMiddleware.d.ts +2 -2
- package/dist/core/http/bodySizeLimitMiddleware.d.ts +1 -1
- package/dist/core/http/conditionalResponse.d.ts +7 -2
- package/dist/core/http/contentSecurityPolicy.d.ts +4 -3
- package/dist/core/http/corsMiddleware.d.ts +2 -1
- package/dist/core/http/csrfMiddleware.d.ts +6 -1
- package/dist/core/http/csrfToken.d.ts +17 -7
- package/dist/core/http/databaseError.d.ts +4 -0
- package/dist/core/http/etag.d.ts +5 -2
- package/dist/core/http/flashMiddleware.d.ts +1 -1
- package/dist/core/http/flashSession.d.ts +13 -7
- package/dist/core/http/index.d.ts +1 -1
- package/dist/core/http/loginThrottleMiddleware.d.ts +3 -3
- package/dist/core/http/memoryThrottleMiddleware.d.ts +2 -2
- package/dist/core/http/parseMultipartUpload.d.ts +3 -2
- package/dist/core/http/requestMetaContext.d.ts +5 -0
- package/dist/core/http/requireAbilityMiddleware.d.ts +1 -1
- package/dist/core/http/requireAuthMiddleware.d.ts +2 -2
- package/dist/core/http/requirePasswordConfirmMiddleware.d.ts +2 -1
- package/dist/core/http/requireVerifiedMiddleware.d.ts +2 -2
- package/dist/core/http/requireWebAuthMiddleware.d.ts +2 -2
- package/dist/core/http/response.d.ts +4 -3
- package/dist/core/http/scimThrottleMiddleware.d.ts +4 -3
- package/dist/core/http/securedRouteModelBinding.d.ts +10 -3
- package/dist/core/http/securityHeadersMiddleware.d.ts +1 -2
- package/dist/core/http/signedUrl.d.ts +8 -6
- package/dist/core/http/throttleMiddleware.d.ts +9 -5
- package/dist/core/http/uploads.d.ts +9 -3
- package/dist/core/http/webErrorResponse.d.ts +8 -2
- package/dist/core/jobs/exportAuditLogsJob.d.ts +5 -2
- package/dist/core/jobs/invalidateCacheTagsJob.d.ts +5 -4
- package/dist/core/lifecycle/gracefulShutdown.d.ts +2 -5
- package/dist/core/logging/requestLoggingMiddleware.d.ts +1 -1
- package/dist/core/mail/mailer.d.ts +7 -5
- package/dist/core/openapi/generator.d.ts +12 -4
- package/dist/core/openapi/registeredRoute.d.ts +4 -4
- package/dist/core/queue/createAppQueue.d.ts +9 -4
- package/dist/core/queue/failedJobMetrics.d.ts +11 -2
- package/dist/core/queue/failedJobRepository.d.ts +6 -3
- package/dist/core/queue/failedJobService.d.ts +1 -0
- package/dist/core/queue/index.d.ts +16 -6
- package/dist/core/queue/jobRegistry.d.ts +3 -2
- package/dist/core/queue/jobRunner.d.ts +10 -4
- package/dist/core/queue/publicQueue.d.ts +18 -9
- package/dist/core/queue/queueConfig.d.ts +20 -10
- package/dist/core/queue/queueHandoff.d.ts +31 -0
- package/dist/core/queue/queueMetrics.d.ts +10 -3
- package/dist/core/queue/queueServices.d.ts +28 -0
- package/dist/core/queue/queueWorkerTransport.d.ts +28 -0
- package/dist/core/queue/redisQueue.d.ts +19 -10
- package/dist/core/queue/redisQueueKeys.d.ts +5 -5
- package/dist/core/queue/redisStreams.d.ts +17 -10
- package/dist/core/queue/resilientQueue.d.ts +10 -4
- package/dist/core/queue/types.d.ts +1 -0
- package/dist/core/runtime/appKeyPrefix.d.ts +5 -5
- package/dist/core/runtime/application.d.ts +7 -0
- package/dist/core/runtime/executionContext.d.ts +9 -0
- package/dist/core/runtime/executionTasks.d.ts +49 -0
- package/dist/core/runtime/resourceJournal.d.ts +67 -0
- package/dist/core/runtime/serviceGraph.d.ts +14 -0
- package/dist/core/security/oauthState.d.ts +13 -9
- package/dist/core/security/publicReads.d.ts +2 -2
- package/dist/core/security/safeFetch.d.ts +1 -0
- package/dist/core/security/safeUrl.d.ts +3 -0
- package/dist/core/security/scimTenantTokens.d.ts +1 -1
- package/dist/core/security/tokenExpiry.d.ts +1 -1
- package/dist/core/security/webhookSignature.d.ts +1 -1
- package/dist/core/storage/storage.d.ts +24 -16
- package/dist/core/tenant/databaseTenantContext.d.ts +5 -7
- package/dist/core/tenant/resolveTenant.d.ts +2 -2
- package/dist/core/tenant/scopedDatabasePolicy.d.ts +8 -0
- package/dist/core/tenant/tenantDatabaseScope.d.ts +3 -7
- package/dist/core/tenant/tenantMiddleware.d.ts +15 -4
- package/dist/core/tracing/otel.d.ts +4 -6
- package/dist/core/tracing/tracingMiddleware.d.ts +3 -3
- package/dist/core/view/etaViewEngine.d.ts +1 -1
- package/dist/core/view/index.d.ts +5 -4
- package/dist/core/view/tokens.d.ts +8 -0
- package/dist/core/view/viewRenderer.d.ts +2 -2
- package/dist/core/view/webErrorView.d.ts +8 -7
- package/dist/core/view/webLayoutData.d.ts +6 -4
- package/dist/entries/audit/exportAuditLogs.js +87 -1024
- package/dist/entries/audit/siemFormatter.js +4 -90
- package/dist/entries/auth/abilityCatalog.js +28 -0
- package/dist/entries/auth/accessControl.js +5 -16
- package/dist/entries/auth/accountStateMigration.js +216 -236
- package/dist/entries/auth/authOutcome.js +80 -0
- package/dist/entries/auth/authReader.js +68 -0
- package/dist/entries/auth/basicAuthGuard.js +144 -1249
- package/dist/entries/auth/emailVerification.js +2 -2
- package/dist/entries/auth/intendedUrlCookie.js +35 -59
- package/dist/entries/auth/jwt.js +22 -47
- package/dist/entries/auth/jwtGuard.js +99 -231
- package/dist/entries/auth/membershipMiddleware.js +71 -10
- package/dist/entries/auth/membershipScope.js +16 -22
- package/dist/entries/auth/membershipService.js +11 -28
- package/dist/entries/auth/oauth/oidcProvider.js +59 -64
- package/dist/entries/auth/oauth/providers.js +12 -95
- package/dist/entries/auth/oauth/samlProvider.js +53 -1080
- package/dist/entries/auth/oneTimeToken.js +27 -289
- package/dist/entries/auth/passwordConfirmCookie.js +40 -63
- package/dist/entries/auth/passwordLogin.js +94 -399
- package/dist/entries/auth/pendingMfaCookie.js +6 -6
- package/dist/entries/auth/policy.js +22 -56
- package/dist/entries/auth/saml/samlServiceProvider.js +55 -1084
- package/dist/entries/auth/scimAuthMiddleware.js +16 -3358
- package/dist/entries/auth/sessionCookie.js +58 -73
- package/dist/entries/auth/sessionGuard.js +95 -248
- package/dist/entries/auth/tokenHash.js +11 -43
- package/dist/entries/cache/createCacheStore.js +126 -117
- package/dist/entries/cache/repository.js +25 -0
- package/dist/entries/cache/simpleCache.js +12 -7
- package/dist/entries/cache/tokens.js +9 -0
- package/dist/entries/config/applicationConfig.js +163 -0
- package/dist/entries/config/envSchema.js +21 -4
- package/dist/entries/contracts/application.js +1 -0
- package/dist/entries/contracts/authUserDirectory.js +10 -0
- package/dist/entries/contracts/container.js +99 -26
- package/dist/entries/contracts/di.js +3 -0
- package/dist/entries/contracts/executionContext.js +7 -0
- package/dist/entries/contracts/executionOperations.js +7 -0
- package/dist/entries/contracts/executionOwnership.js +7 -0
- package/dist/entries/contracts/membership.js +1 -0
- package/dist/entries/contracts/persistence.js +1 -0
- package/dist/entries/contracts/serviceTokens.js +26 -116
- package/dist/entries/contracts/services.js +98 -0
- package/dist/entries/contracts/token.js +41 -0
- package/dist/entries/crypto/fieldEncryption.js +49 -50
- package/dist/entries/crypto/mfaSecret.js +86 -82
- package/dist/entries/database/acquisitionMetrics.js +107 -0
- package/dist/entries/database/baseRepository.d.ts +2 -0
- package/dist/entries/database/bindings.js +2082 -0
- package/dist/entries/database/definitions.js +175 -0
- package/dist/entries/database/errors.js +114 -89
- package/dist/entries/database/factory.js +67 -28
- package/dist/entries/database/migrations.js +172 -224
- package/dist/entries/database/model.d.ts +1 -0
- package/dist/entries/database/ownedReadOnlyObservation.js +1282 -0
- package/dist/entries/database/query.js +159 -161
- package/dist/entries/database/repositoryQuery.d.ts +1 -0
- package/dist/entries/database/repositoryQuery.js +1 -1373
- package/dist/entries/database/schema.js +216 -236
- package/dist/entries/database/session.js +1 -0
- package/dist/entries/database/sqliteConnection.js +525 -83
- package/dist/entries/database/tokens.js +9 -0
- package/dist/entries/errors/http.js +118 -1
- package/dist/entries/http/authMiddleware.js +8 -5
- package/dist/entries/http/authorizeMiddleware.js +1 -1
- package/dist/entries/http/bodySizeLimitMiddleware.js +2 -2
- package/dist/entries/http/clientIp.js +2 -2
- package/dist/entries/http/conditionalResponse.js +19 -7
- package/dist/entries/http/corsMiddleware.js +6 -101
- package/dist/entries/http/csrfMiddleware.js +92 -106
- package/dist/entries/http/csrfToken.js +58 -94
- package/dist/entries/http/etag.js +7 -4
- package/dist/entries/http/flashMiddleware.js +57 -99
- package/dist/entries/http/flashSession.js +41 -68
- package/dist/entries/http/memoryThrottleMiddleware.js +43 -186
- package/dist/entries/http/metricsMiddleware.js +2 -16
- package/dist/entries/http/parseMultipartUpload.js +15 -29
- package/dist/entries/http/requireAbilityMiddleware.js +2 -2
- package/dist/entries/http/requirePasswordConfirmMiddleware.js +19 -31
- package/dist/entries/http/requireVerifiedMiddleware.js +4 -7
- package/dist/entries/http/requireWebAuthMiddleware.js +2 -2
- package/dist/entries/http/response.js +67 -233
- package/dist/entries/http/routeMiddleware.js +0 -14
- package/dist/entries/http/scimThrottleMiddleware.js +43 -237
- package/dist/entries/http/securedRouteModelBinding.js +37 -25
- package/dist/entries/http/securityHeadersMiddleware.js +8 -25
- package/dist/entries/http/signedUrl.js +20 -110
- package/dist/entries/http/throttleMiddleware.js +41 -185
- package/dist/entries/http/uploads.js +9 -24
- package/dist/entries/jobs/exportAuditLogsJob.js +17 -1498
- package/dist/entries/jobs/invalidateCacheTagsJob.js +12 -47
- package/dist/entries/logging/requestLoggingMiddleware.js +4 -4
- package/dist/entries/mail/mailer.js +68 -78
- package/dist/entries/openapi/generator.js +33 -100
- package/dist/entries/queue/createAppQueue.js +416 -256
- package/dist/entries/queue/failedJobRepository.js +17 -8
- package/dist/entries/queue/failedJobService.js +1 -0
- package/dist/entries/queue/jobRunner.js +141 -66
- package/dist/entries/queue/publicQueue.js +411 -257
- package/dist/entries/queue/queueConfig.js +61 -0
- package/dist/entries/queue/queueHandoff.js +318 -0
- package/dist/entries/queue/queueMetrics.js +989 -1386
- package/dist/entries/queue/queueServices.js +133 -0
- package/dist/entries/queue/queueWorkerTransport.js +1703 -0
- package/dist/entries/queue/redisQueue.js +282 -180
- package/dist/entries/queue.js +6 -45
- package/dist/entries/runtime/application.js +1585 -0
- package/dist/entries/runtime/asyncContextStore.js +0 -16
- package/dist/entries/security/oauthState.js +35 -67
- package/dist/entries/security/publicReads.js +4 -4
- package/dist/entries/security/safeFetch.js +1 -0
- package/dist/entries/security/scimTenantTokens.js +3 -3
- package/dist/entries/security/tokenExpiry.js +2 -2
- package/dist/entries/security/totp.js +1 -87
- package/dist/entries/security/webhookSignature.js +2 -90
- package/dist/entries/storage/storage.js +120 -45
- package/dist/entries/tenant/databaseTenantContext.js +6 -907
- package/dist/entries/tenant/publicTenantHost.js +78 -0
- package/dist/entries/tenant/resolveTenant.js +14 -0
- package/dist/entries/tenant/scopedDatabasePolicy.js +75 -0
- package/dist/entries/tenant/tenancyConfig.js +1 -19
- package/dist/entries/tenant/tenantDatabaseScope.js +3 -892
- package/dist/entries/tracing/tracingMiddleware.js +104 -173
- package/dist/entries/view/tokens.js +11 -0
- package/dist/framework/public-api.d.ts +62 -44
- package/dist/index.js +10435 -11351
- package/dist/internal/ormInternal.js +117 -0
- package/dist/internal/ormRuntime.js +5000 -0
- package/package.json +158 -46
- package/dist/core/database/bindConnection.d.ts +0 -1
- package/dist/core/database/boundConnection.d.ts +0 -5
- package/dist/core/database/defaultConnection.d.ts +0 -7
- package/dist/core/database/namedConnections.d.ts +0 -15
- package/dist/core/database/readOnlyCollector.d.ts +0 -7
- package/dist/core/database/repositoryConnection.d.ts +0 -4
- package/dist/core/database/transaction.d.ts +0 -23
- package/dist/core/database/transactionControl.d.ts +0 -6
- package/dist/core/events/deferredModelEvents.d.ts +0 -7
- package/dist/core/facades/index.d.ts +0 -10
- package/dist/core/runtime/applicationRegistry.d.ts +0 -18
- package/dist/entries/database/bindConnection.js +0 -1
- package/dist/entries/database/boundConnection.js +0 -1
- package/dist/entries/database/defaultConnection.js +0 -1
- package/dist/entries/database/namedConnections.js +0 -1
- package/dist/entries/database/repositoryConnection.js +0 -1
- package/dist/entries/database/transaction.js +0 -1
- package/dist/entries/facades.js +0 -711
- package/dist/entries/runtime/applicationRegistry.js +0 -1
|
@@ -1,15 +1,6 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
try {
|
|
5
|
-
res = fn(fn = 0);
|
|
6
|
-
} catch (e) {
|
|
7
|
-
err = [e];
|
|
8
|
-
}
|
|
9
|
-
if (err)
|
|
10
|
-
throw err[0];
|
|
11
|
-
return res;
|
|
12
|
-
};
|
|
2
|
+
// ../../src/core/tracing/tracingMiddleware.ts
|
|
3
|
+
import { ROOT_CONTEXT, SpanKind, SpanStatusCode, trace } from "@opentelemetry/api";
|
|
13
4
|
|
|
14
5
|
// ../../src/core/runtime/asyncContextStore.ts
|
|
15
6
|
import { AsyncLocalStorage } from "async_hooks";
|
|
@@ -24,13 +15,8 @@ function createAsyncContextStore(key) {
|
|
|
24
15
|
globalRecord[symbol] = store;
|
|
25
16
|
return store;
|
|
26
17
|
}
|
|
27
|
-
var init_asyncContextStore = () => {};
|
|
28
|
-
|
|
29
|
-
// ../../src/core/tracing/tracingMiddleware.ts
|
|
30
|
-
import { ROOT_CONTEXT, SpanKind, SpanStatusCode, trace } from "@opentelemetry/api";
|
|
31
18
|
|
|
32
19
|
// ../../src/core/http/requestMetaContext.ts
|
|
33
|
-
init_asyncContextStore();
|
|
34
20
|
var requestMetaContext = createAsyncContextStore("@getstrata/requestMetaContext");
|
|
35
21
|
function runWithRequestMeta(meta, callback) {
|
|
36
22
|
return requestMetaContext.run(meta, callback);
|
|
@@ -42,105 +28,10 @@ function currentRequestMeta() {
|
|
|
42
28
|
};
|
|
43
29
|
}
|
|
44
30
|
|
|
45
|
-
// ../../src/core/tracing/
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
import { OTLPTraceExporter } from "@opentelemetry/exporter-trace-otlp-http";
|
|
50
|
-
import { resourceFromAttributes } from "@opentelemetry/resources";
|
|
51
|
-
import { BatchSpanProcessor } from "@opentelemetry/sdk-trace";
|
|
52
|
-
import {
|
|
53
|
-
AlwaysOffSampler,
|
|
54
|
-
AlwaysOnSampler,
|
|
55
|
-
ParentBasedSampler,
|
|
56
|
-
TraceIdRatioBasedSampler
|
|
57
|
-
} from "@opentelemetry/sdk-trace-base";
|
|
58
|
-
import { NodeTracerProvider } from "@opentelemetry/sdk-trace-node";
|
|
59
|
-
|
|
60
|
-
// ../../src/core/runtime/appEnv.ts
|
|
61
|
-
var NON_PRODUCTION_APP_ENVS = new Set(["local", "development", "dev", "test", "testing", "ci"]);
|
|
62
|
-
function normalizeEnvValue(value) {
|
|
63
|
-
return (value ?? "").trim().toLowerCase();
|
|
64
|
-
}
|
|
65
|
-
function isProductionEnv(env = process.env) {
|
|
66
|
-
const appEnv = normalizeEnvValue(env.APP_ENV);
|
|
67
|
-
const nodeEnv = normalizeEnvValue(env.NODE_ENV);
|
|
68
|
-
if (appEnv === "production" || nodeEnv === "production") {
|
|
69
|
-
return true;
|
|
70
|
-
}
|
|
71
|
-
if (appEnv === "") {
|
|
72
|
-
return false;
|
|
73
|
-
}
|
|
74
|
-
return !NON_PRODUCTION_APP_ENVS.has(appEnv);
|
|
75
|
-
}
|
|
76
|
-
function envFlagEnabled(value) {
|
|
77
|
-
return value === "true";
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
// ../../src/core/runtime/appKeyPrefix.ts
|
|
81
|
-
function appKeyPrefix() {
|
|
82
|
-
return process.env.APP_KEY_PREFIX?.trim() || "strata";
|
|
83
|
-
}
|
|
84
|
-
function appCookieName(kind) {
|
|
85
|
-
return `${appKeyPrefix()}_${kind}`;
|
|
86
|
-
}
|
|
87
|
-
function appDevSecret(kind) {
|
|
88
|
-
return `${appKeyPrefix()}-dev-${kind}`;
|
|
89
|
-
}
|
|
90
|
-
function requireConfiguredSecret(names, devKind, env = process.env) {
|
|
91
|
-
for (const name of names) {
|
|
92
|
-
const value = env[name]?.trim();
|
|
93
|
-
if (value) {
|
|
94
|
-
return value;
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
if (isProductionEnv(env)) {
|
|
98
|
-
throw new Error(`${names[0]} must be set outside development. Do not derive secrets from the app name.`);
|
|
99
|
-
}
|
|
100
|
-
return appDevSecret(devKind);
|
|
101
|
-
}
|
|
102
|
-
function namespacedRedisKey(kind) {
|
|
103
|
-
return `${appKeyPrefix()}:${kind}`;
|
|
104
|
-
}
|
|
105
|
-
function smtpEhloHost() {
|
|
106
|
-
const raw = process.env.MAIL_EHLO?.trim() || `${appKeyPrefix()}.local`;
|
|
107
|
-
const safe = raw.replace(/[^a-zA-Z0-9.-]/g, "");
|
|
108
|
-
return safe || "strata.local";
|
|
109
|
-
}
|
|
110
|
-
function siemEventType() {
|
|
111
|
-
return process.env.SIEM_EVENT_TYPE?.trim() || `${appKeyPrefix()}.audit`;
|
|
112
|
-
}
|
|
113
|
-
function appUserAgent() {
|
|
114
|
-
return process.env.APP_USER_AGENT?.trim() || appKeyPrefix();
|
|
115
|
-
}
|
|
116
|
-
function otelServiceName() {
|
|
117
|
-
return process.env.OTEL_SERVICE_NAME?.trim() || `${appKeyPrefix()}-api`;
|
|
118
|
-
}
|
|
119
|
-
function webhookSignatureHeader() {
|
|
120
|
-
return process.env.WEBHOOK_SIGNATURE_HEADER?.trim() || `x-${appKeyPrefix()}-signature`;
|
|
121
|
-
}
|
|
122
|
-
function appDisplayName() {
|
|
123
|
-
return process.env.APP_NAME?.trim() || "Strata";
|
|
124
|
-
}
|
|
125
|
-
function appEnv() {
|
|
126
|
-
return process.env.APP_ENV?.trim() || "local";
|
|
127
|
-
}
|
|
128
|
-
function appUrl() {
|
|
129
|
-
return (process.env.APP_URL?.trim() || "http://localhost:3000").replace(/\/$/, "");
|
|
130
|
-
}
|
|
131
|
-
function apiPrefix() {
|
|
132
|
-
const raw = process.env.API_PREFIX?.trim() || "/api/v1";
|
|
133
|
-
const withSlash = raw.startsWith("/") ? raw : `/${raw}`;
|
|
134
|
-
const trimmed = withSlash.replace(/\/+$/, "");
|
|
135
|
-
return trimmed || "/api/v1";
|
|
136
|
-
}
|
|
137
|
-
function sdkClientClassName() {
|
|
138
|
-
const override = process.env.APP_SDK_CLASS?.trim();
|
|
139
|
-
if (override && /^[A-Za-z_][A-Za-z0-9_]*$/.test(override)) {
|
|
140
|
-
return override;
|
|
141
|
-
}
|
|
142
|
-
const fromName = appDisplayName().replace(/[^A-Za-z0-9]/g, "");
|
|
143
|
-
return fromName ? `${fromName}Client` : "AppClient";
|
|
31
|
+
// ../../src/core/tracing/traceContext.ts
|
|
32
|
+
var traceContextStorage = createAsyncContextStore("@getstrata/traceContext");
|
|
33
|
+
function runWithTraceContext(context, callback) {
|
|
34
|
+
return traceContextStorage.run(context, callback);
|
|
144
35
|
}
|
|
145
36
|
|
|
146
37
|
// ../../src/core/tracing/health.ts
|
|
@@ -308,6 +199,74 @@ ${name} ${value}
|
|
|
308
199
|
}
|
|
309
200
|
return output;
|
|
310
201
|
}
|
|
202
|
+
// ../../src/core/tracing/otel.ts
|
|
203
|
+
import { context } from "@opentelemetry/api";
|
|
204
|
+
import { AsyncLocalStorageContextManager } from "@opentelemetry/context-async-hooks";
|
|
205
|
+
import { W3CTraceContextPropagator } from "@opentelemetry/core";
|
|
206
|
+
import { OTLPTraceExporter } from "@opentelemetry/exporter-trace-otlp-http";
|
|
207
|
+
import { resourceFromAttributes } from "@opentelemetry/resources";
|
|
208
|
+
import { BatchSpanProcessor } from "@opentelemetry/sdk-trace";
|
|
209
|
+
import {
|
|
210
|
+
AlwaysOffSampler,
|
|
211
|
+
AlwaysOnSampler,
|
|
212
|
+
ParentBasedSampler,
|
|
213
|
+
TraceIdRatioBasedSampler
|
|
214
|
+
} from "@opentelemetry/sdk-trace-base";
|
|
215
|
+
import { NodeTracerProvider } from "@opentelemetry/sdk-trace-node";
|
|
216
|
+
|
|
217
|
+
// ../../src/core/runtime/appEnv.ts
|
|
218
|
+
var NON_PRODUCTION_APP_ENVS = new Set(["local", "development", "dev", "test", "testing", "ci"]);
|
|
219
|
+
function normalizeEnvValue(value) {
|
|
220
|
+
return (value ?? "").trim().toLowerCase();
|
|
221
|
+
}
|
|
222
|
+
function isProductionEnv(env = process.env) {
|
|
223
|
+
const appEnv = normalizeEnvValue(env.APP_ENV);
|
|
224
|
+
const nodeEnv = normalizeEnvValue(env.NODE_ENV);
|
|
225
|
+
if (appEnv === "production" || nodeEnv === "production") {
|
|
226
|
+
return true;
|
|
227
|
+
}
|
|
228
|
+
if (appEnv === "") {
|
|
229
|
+
return false;
|
|
230
|
+
}
|
|
231
|
+
return !NON_PRODUCTION_APP_ENVS.has(appEnv);
|
|
232
|
+
}
|
|
233
|
+
function envFlagEnabled(value) {
|
|
234
|
+
return value === "true";
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
// ../../src/core/runtime/appKeyPrefix.ts
|
|
238
|
+
function appKeyPrefix(env = process.env) {
|
|
239
|
+
return env.APP_KEY_PREFIX?.trim() || "strata";
|
|
240
|
+
}
|
|
241
|
+
function appCookieName(kind, env = process.env) {
|
|
242
|
+
return `${appKeyPrefix(env)}_${kind}`;
|
|
243
|
+
}
|
|
244
|
+
function appDevSecret(kind, env = process.env) {
|
|
245
|
+
return `${appKeyPrefix(env)}-dev-${kind}`;
|
|
246
|
+
}
|
|
247
|
+
function requireConfiguredSecret(names, devKind, env = process.env) {
|
|
248
|
+
for (const name of names) {
|
|
249
|
+
const value = env[name]?.trim();
|
|
250
|
+
if (value) {
|
|
251
|
+
return value;
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
if (isProductionEnv(env)) {
|
|
255
|
+
throw new Error(`${names[0]} must be set outside development. Do not derive secrets from the app name.`);
|
|
256
|
+
}
|
|
257
|
+
return appDevSecret(devKind, env);
|
|
258
|
+
}
|
|
259
|
+
function namespacedRedisKey(kind) {
|
|
260
|
+
return `${appKeyPrefix()}:${kind}`;
|
|
261
|
+
}
|
|
262
|
+
function smtpEhloHost(env = process.env) {
|
|
263
|
+
const raw = env.MAIL_EHLO?.trim() || `${appKeyPrefix(env)}.local`;
|
|
264
|
+
const safe = raw.replace(/[^a-zA-Z0-9.-]/g, "");
|
|
265
|
+
return safe || "strata.local";
|
|
266
|
+
}
|
|
267
|
+
function otelServiceName(env = process.env) {
|
|
268
|
+
return env.OTEL_SERVICE_NAME?.trim() || `${appKeyPrefix(env)}-api`;
|
|
269
|
+
}
|
|
311
270
|
|
|
312
271
|
// ../../src/core/tracing/otel.ts
|
|
313
272
|
function numberOption(value, fallback, name, max = 1e6) {
|
|
@@ -326,25 +285,13 @@ function ensureContextManager() {
|
|
|
326
285
|
manager.disable();
|
|
327
286
|
state[key] = true;
|
|
328
287
|
}
|
|
329
|
-
function
|
|
330
|
-
|
|
331
|
-
const disabled = process.env.OTEL_SDK_DISABLED === "true";
|
|
332
|
-
const samplerName = options.sampleRatio === undefined ? process.env.OTEL_TRACES_SAMPLER ?? "parentbased_traceidratio" : "parentbased_traceidratio";
|
|
333
|
-
const rootName = samplerName.replace(/^parentbased_/, "");
|
|
334
|
-
if (!["always_on", "always_off", "traceidratio"].includes(rootName))
|
|
335
|
-
throw new TypeError("Unsupported tracing sampler.");
|
|
336
|
-
const ratio = options.sampleRatio ?? Number(process.env.OTEL_TRACES_SAMPLER_ARG ?? "1");
|
|
337
|
-
if (!Number.isFinite(ratio) || ratio < 0 || ratio > 1)
|
|
338
|
-
throw new TypeError("Invalid tracing sampleRatio.");
|
|
339
|
-
const rootSampler = rootName === "always_on" ? new AlwaysOnSampler : rootName === "always_off" ? new AlwaysOffSampler : new TraceIdRatioBasedSampler(ratio);
|
|
340
|
-
const sampler = disabled ? new AlwaysOffSampler : samplerName.startsWith("parentbased_") ? new ParentBasedSampler({ root: rootSampler }) : rootSampler;
|
|
341
|
-
const queueSize = numberOption(options.maxQueueSize, 2048, "maxQueueSize");
|
|
342
|
-
const batchSize = numberOption(options.maxExportBatchSize, Math.min(512, queueSize), "maxExportBatchSize", queueSize);
|
|
288
|
+
function captureTracingOptions(options = {}) {
|
|
289
|
+
const env = Object.freeze({ ...options.env ?? process.env });
|
|
343
290
|
const timeout = numberOption(options.exportTimeoutMillis, 5000, "exportTimeoutMillis", 60000);
|
|
344
|
-
const
|
|
345
|
-
let endpoint = options.endpoint ??
|
|
291
|
+
const disabled = env.OTEL_SDK_DISABLED === "true";
|
|
292
|
+
let endpoint = options.endpoint ?? env.OTEL_EXPORTER_OTLP_TRACES_ENDPOINT?.trim();
|
|
346
293
|
if (!endpoint) {
|
|
347
|
-
const base =
|
|
294
|
+
const base = env.OTEL_EXPORTER_OTLP_ENDPOINT?.trim();
|
|
348
295
|
if (base)
|
|
349
296
|
endpoint = base.endsWith("/v1/traces") ? base : `${base.replace(/\/$/, "")}/v1/traces`;
|
|
350
297
|
}
|
|
@@ -359,9 +306,31 @@ function createTracingRuntime(options = {}) {
|
|
|
359
306
|
throw new TypeError("Invalid tracing collector endpoint.");
|
|
360
307
|
}
|
|
361
308
|
const exporter = disabled ? undefined : options.exporter ?? (endpoint ? new OTLPTraceExporter({ url: endpoint, timeoutMillis: timeout, concurrencyLimit: 1 }) : undefined);
|
|
309
|
+
return Object.freeze({ ...options, env, exporter });
|
|
310
|
+
}
|
|
311
|
+
function createTracingRuntime(options = {}) {
|
|
312
|
+
ensureContextManager();
|
|
313
|
+
const env = options.env ?? process.env;
|
|
314
|
+
const disabled = env.OTEL_SDK_DISABLED === "true";
|
|
315
|
+
const samplerName = options.sampleRatio === undefined ? env.OTEL_TRACES_SAMPLER ?? "parentbased_traceidratio" : "parentbased_traceidratio";
|
|
316
|
+
const rootName = samplerName.replace(/^parentbased_/, "");
|
|
317
|
+
if (!["always_on", "always_off", "traceidratio"].includes(rootName))
|
|
318
|
+
throw new TypeError("Unsupported tracing sampler.");
|
|
319
|
+
const ratio = options.sampleRatio ?? Number(env.OTEL_TRACES_SAMPLER_ARG ?? "1");
|
|
320
|
+
if (!Number.isFinite(ratio) || ratio < 0 || ratio > 1)
|
|
321
|
+
throw new TypeError("Invalid tracing sampleRatio.");
|
|
322
|
+
const rootSampler = rootName === "always_on" ? new AlwaysOnSampler : rootName === "always_off" ? new AlwaysOffSampler : new TraceIdRatioBasedSampler(ratio);
|
|
323
|
+
const sampler = disabled ? new AlwaysOffSampler : samplerName.startsWith("parentbased_") ? new ParentBasedSampler({ root: rootSampler }) : rootSampler;
|
|
324
|
+
const queueSize = numberOption(options.maxQueueSize, 2048, "maxQueueSize");
|
|
325
|
+
const batchSize = numberOption(options.maxExportBatchSize, Math.min(512, queueSize), "maxExportBatchSize", queueSize);
|
|
326
|
+
const timeout = numberOption(options.exportTimeoutMillis, 5000, "exportTimeoutMillis", 60000);
|
|
327
|
+
const delay = numberOption(options.scheduledDelayMillis, 5000, "scheduledDelayMillis", 60000);
|
|
328
|
+
const exporter = captureTracingOptions(options).exporter;
|
|
362
329
|
const health = createTracingHealth(!disabled, exporter !== undefined, timeout);
|
|
363
330
|
const provider = new NodeTracerProvider({
|
|
364
|
-
resource: resourceFromAttributes({
|
|
331
|
+
resource: resourceFromAttributes({
|
|
332
|
+
"service.name": options.serviceName ?? otelServiceName(env)
|
|
333
|
+
}),
|
|
365
334
|
sampler,
|
|
366
335
|
spanProcessors: exporter ? [
|
|
367
336
|
new BatchSpanProcessor({
|
|
@@ -403,43 +372,6 @@ function createTracingRuntime(options = {}) {
|
|
|
403
372
|
})
|
|
404
373
|
};
|
|
405
374
|
}
|
|
406
|
-
var runtimeKey = Symbol.for("@getstrata/otel-runtime");
|
|
407
|
-
function runtimeState() {
|
|
408
|
-
const state = globalThis;
|
|
409
|
-
state[runtimeKey] ??= { owners: 0 };
|
|
410
|
-
return state[runtimeKey];
|
|
411
|
-
}
|
|
412
|
-
function getTracingRuntime() {
|
|
413
|
-
const state = runtimeState();
|
|
414
|
-
state.runtime ??= createTracingRuntime();
|
|
415
|
-
return state.runtime;
|
|
416
|
-
}
|
|
417
|
-
function acquireTracingRuntime() {
|
|
418
|
-
const state = runtimeState();
|
|
419
|
-
const runtime = getTracingRuntime();
|
|
420
|
-
state.owners++;
|
|
421
|
-
let released = false;
|
|
422
|
-
return {
|
|
423
|
-
flush: () => runtime.forceFlush(),
|
|
424
|
-
async release() {
|
|
425
|
-
if (released)
|
|
426
|
-
return;
|
|
427
|
-
released = true;
|
|
428
|
-
if (--state.owners === 0) {
|
|
429
|
-
if (state.runtime === runtime)
|
|
430
|
-
state.runtime = undefined;
|
|
431
|
-
await runtime.shutdown();
|
|
432
|
-
}
|
|
433
|
-
}
|
|
434
|
-
};
|
|
435
|
-
}
|
|
436
|
-
|
|
437
|
-
// ../../src/core/tracing/traceContext.ts
|
|
438
|
-
init_asyncContextStore();
|
|
439
|
-
var traceContextStorage = createAsyncContextStore("@getstrata/traceContext");
|
|
440
|
-
function runWithTraceContext(context, callback) {
|
|
441
|
-
return traceContextStorage.run(context, callback);
|
|
442
|
-
}
|
|
443
375
|
|
|
444
376
|
// ../../src/core/tracing/tracingMiddleware.ts
|
|
445
377
|
var headerGetter = {
|
|
@@ -459,7 +391,7 @@ var methods = new Set([
|
|
|
459
391
|
]);
|
|
460
392
|
function createTracingMiddleware(runtime) {
|
|
461
393
|
return async (request, next) => {
|
|
462
|
-
const telemetry = runtime
|
|
394
|
+
const telemetry = runtime;
|
|
463
395
|
const method = methods.has(request.method) ? request.method : "_OTHER";
|
|
464
396
|
const route = currentRequestMeta().routeTemplate ?? "__unmatched__";
|
|
465
397
|
const parent = telemetry.propagator.extract(ROOT_CONTEXT, request.headers, headerGetter);
|
|
@@ -498,9 +430,8 @@ function createTracingMiddleware(runtime) {
|
|
|
498
430
|
};
|
|
499
431
|
}
|
|
500
432
|
export {
|
|
501
|
-
|
|
433
|
+
captureTracingOptions,
|
|
502
434
|
createTracingMiddleware,
|
|
503
435
|
createTracingRuntime,
|
|
504
|
-
getTracingRuntime,
|
|
505
436
|
renderTracingMetrics
|
|
506
437
|
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
// ../../src/core/view/tokens.ts
|
|
3
|
+
import { createServiceToken } from "@getstrata/core/contracts/token";
|
|
4
|
+
var CORE_VIEW_RENDERER_TOKEN = createServiceToken("core.viewRenderer");
|
|
5
|
+
var CORE_VIEW_TOKEN = createServiceToken("core.view");
|
|
6
|
+
var CORE_WEB_ERROR_VIEW_TOKEN = createServiceToken("core.webErrorView");
|
|
7
|
+
export {
|
|
8
|
+
CORE_VIEW_RENDERER_TOKEN,
|
|
9
|
+
CORE_VIEW_TOKEN,
|
|
10
|
+
CORE_WEB_ERROR_VIEW_TOKEN
|
|
11
|
+
};
|
|
@@ -2,19 +2,48 @@
|
|
|
2
2
|
* Stable framework surface for application modules and future package extraction.
|
|
3
3
|
* Import from `@getstrata/core` (workspace) or `src/framework/public-api`.
|
|
4
4
|
*/
|
|
5
|
+
export { AuthenticationRequiredError } from "@getstrata/core/auth/authOutcome";
|
|
6
|
+
export type { PolicyAction, PolicyDecision } from "@getstrata/core/auth/policy";
|
|
7
|
+
export { Policy, PolicyDeniedError, PolicyGate } from "@getstrata/core/auth/policy";
|
|
8
|
+
export { CORE_CACHE_TOKEN } from "@getstrata/core/cache/tokens";
|
|
9
|
+
export type { ConfigIntegerBounds, DeepReadonly, ValidatedEnvironment, } from "@getstrata/core/config/applicationConfig";
|
|
10
|
+
export { configEnum, configInteger, parseApplicationConfig, } from "@getstrata/core/config/applicationConfig";
|
|
11
|
+
export type { AuthAccountLookup, AuthBearerResolver, AuthCredentialVerifier, AuthEmailLookup, AuthSessionValidity, } from "@getstrata/core/contracts/authUserDirectory";
|
|
12
|
+
export { AuthAccountNotFoundError } from "@getstrata/core/contracts/authUserDirectory";
|
|
13
|
+
export { ConfigStore, createServiceToken, ServiceContainer, type ServiceToken, } from "@getstrata/core/contracts/container";
|
|
14
|
+
export { CORE_EXECUTION_CONTEXT_TOKEN } from "@getstrata/core/contracts/executionContext";
|
|
15
|
+
export { CORE_EXECUTION_OPERATIONS_TOKEN, type ExecutionOperations, } from "@getstrata/core/contracts/executionOperations";
|
|
16
|
+
export { aliasService, resourceService, service, valueService, } from "@getstrata/core/contracts/services";
|
|
17
|
+
export { CORE_JSON_RESPONSE_POLICY_TOKEN, CORE_MAIL_TOKEN, CORE_STORAGE_TOKEN, CORE_TRACING_RUNTIME_TOKEN, } from "@getstrata/core/contracts/serviceTokens";
|
|
18
|
+
export type { TransactionAcquisitionMetrics, TransactionAcquisitionSnapshot, } from "@getstrata/core/database/acquisitionMetrics";
|
|
19
|
+
export { createTransactionAcquisitionMetrics, renderTransactionAcquisitionMetrics, } from "@getstrata/core/database/acquisitionMetrics";
|
|
20
|
+
export type { AfterCommitRepositoryContext, AfterCommitRepositoryListener, BoundModel, ModelBinding, ModelDefinition, ModelObserver, ModelState, RepositoryBinding, RepositoryDefinition, RepositoryEffectsDeclaration, RepositoryHooks, TransactionalRepositoryListener, TypedRepositoryEffect, } from "@getstrata/core/database/definitions";
|
|
21
|
+
export { defineModel, defineRepository, repositoryEffects, } from "@getstrata/core/database/definitions";
|
|
22
|
+
export type { PersistenceErrorCode, PersistenceErrorOptions, PersistenceResult, TransactionDataDisposition, } from "@getstrata/core/database/errors";
|
|
23
|
+
export { mapDatabaseError, PersistenceError, RecordNotFoundError, withDatabaseErrorHandling, } from "@getstrata/core/database/errors";
|
|
24
|
+
export type { FactoryBehavior, FactoryConstruction, FactoryDefinition, FactoryMakeResult, FactoryParent, FactoryPersist, StatelessFactoryConstruction, } from "@getstrata/core/database/factory";
|
|
25
|
+
export { defineFactory, Factory } from "@getstrata/core/database/factory";
|
|
26
|
+
export { DATABASE_SESSION_TOKEN } from "@getstrata/core/database/tokens";
|
|
27
|
+
export { BadRequestError, ConflictError, ForbiddenError, HttpError, InternalServerError, InvalidCredentialsError, isHttpErrorLike, NotFoundError, PayloadTooLargeError, PreconditionFailedError, toHttpError, UnauthorizedError, UnprocessableEntityError, ValidationError, } from "@getstrata/core/errors/http";
|
|
28
|
+
export type { RouteModelAuthorization, RouteModelBindingPorts, } from "@getstrata/core/http/securedRouteModelBinding";
|
|
29
|
+
export type { QueueHandoff, QueueIdentity } from "@getstrata/core/queue/queueHandoff";
|
|
30
|
+
export { createIdentityQueue, createQueueHandoff, QueueHandoffError, } from "@getstrata/core/queue/queueHandoff";
|
|
31
|
+
export { CORE_VIEW_RENDERER_TOKEN, CORE_WEB_ERROR_VIEW_TOKEN } from "@getstrata/core/view/tokens";
|
|
32
|
+
export { BaseRepository, BelongsToManyRelationQuery, BelongsToRelationQuery, HasManyRelationQuery, HasManyThroughRelationQuery, HasOneRelationQuery, Model, ModelQuery, MorphManyRelationQuery, MorphOneRelationQuery, MorphToRelationQuery, RepositoryQuery, } from "#strata-orm-runtime";
|
|
5
33
|
export type { AdminColumn, AdminColumnType, AdminResource, AdminResourceDefinition, AdminResourceHandlers, } from "../core/admin/index.ts";
|
|
6
34
|
export { AdminResourceRegistry, formatAdminValue, } from "../core/admin/index.ts";
|
|
7
35
|
export type { AbilityChecker } from "../core/auth/abilityChecker.ts";
|
|
8
36
|
export { isGlobalAdmin, resolveUserId } from "../core/auth/accessControl.ts";
|
|
9
37
|
export type { AuthUser, CredentialSource } from "../core/auth/authContext.ts";
|
|
10
38
|
export { authContext, currentAuthUser, currentCredentialSource, runWithAuthContext, runWithAuthUser, } from "../core/auth/authContext.ts";
|
|
39
|
+
export type { BasicAuthGuardOptions } from "../core/auth/basicAuthGuard.ts";
|
|
11
40
|
export { BasicAuthGuard } from "../core/auth/basicAuthGuard.ts";
|
|
12
|
-
export type { AuthGuard } from "../core/auth/guard.ts";
|
|
13
|
-
export { ApiTokenGuard, AuthManager, CompositeGuard, DatabaseTokenGuard, GuestGuard, } from "../core/auth/guard.ts";
|
|
41
|
+
export type { AuthGuard, AuthOutcome } from "../core/auth/guard.ts";
|
|
42
|
+
export { ApiTokenGuard, AuthManager, absentAuth, authenticatedAuth, authenticateProof, authUserFromOutcome, CompositeGuard, DatabaseTokenGuard, GuestGuard, invalidAuth, requireAuthCapability, validatedAuthOutcome, } from "../core/auth/guard.ts";
|
|
14
43
|
export type { JwtPayload } from "../core/auth/jwt.ts";
|
|
15
44
|
export { jwtTtlSeconds, signJwt, verifyJwt } from "../core/auth/jwt.ts";
|
|
16
45
|
export { JwtGuard } from "../core/auth/jwtGuard.ts";
|
|
17
|
-
export {
|
|
46
|
+
export { currentOrganizationIds, currentOrgRole, hasMinimumOrgRole, hasOrgMembership, loadMembershipSnapshot, membershipContext, runWithMembershipContext, runWithMembershipSnapshot, } from "../core/auth/membershipContext.ts";
|
|
18
47
|
export { createMembershipMiddleware } from "../core/auth/membershipMiddleware.ts";
|
|
19
48
|
export { appendOrganizationScope, appendProjectScope, assertOrganizationReadable, assertResourceInCurrentTenant, emptyPaginateResult, resolveOrganizationScope, scopedOrganizationIds, } from "../core/auth/membershipScope.ts";
|
|
20
49
|
export { default as MembershipService, resolveMembershipService, } from "../core/auth/membershipService.ts";
|
|
@@ -22,69 +51,58 @@ export { createOidcHandshake, OidcProvider } from "../core/auth/oauth/oidcProvid
|
|
|
22
51
|
export { SamlProvider } from "../core/auth/oauth/samlProvider.ts";
|
|
23
52
|
export { AUTH_ONE_TIME_PURPOSES, generateOneTimeToken, hashOneTimeToken, } from "../core/auth/oneTimeToken.ts";
|
|
24
53
|
export { completePasswordLogin } from "../core/auth/passwordLogin.ts";
|
|
25
|
-
export {
|
|
26
|
-
export {
|
|
54
|
+
export type { SamlAssertionReplayStore, SamlServiceProviderConfig, SamlServiceProviderOptions, } from "../core/auth/saml/samlServiceProvider.ts";
|
|
55
|
+
export { createSamlServiceProvider, InMemorySamlAssertionReplayStore, readSamlEnvOptions, SamlServiceProvider, setNodeSamlLoaderForTests, } from "../core/auth/saml/samlServiceProvider.ts";
|
|
27
56
|
export { createScimAuthMiddleware } from "../core/auth/scimAuthMiddleware.ts";
|
|
28
57
|
export { createTokenAbilityChecker } from "../core/auth/tokenAbilityChecker.ts";
|
|
29
58
|
export { type CacheDriver, type CreateCacheStoreOptions, createCacheStore, } from "../core/cache/createCacheStore.ts";
|
|
30
59
|
export { default as CacheRepository } from "../core/cache/repository.ts";
|
|
31
60
|
export { CACHE_TAGS } from "../core/cache/tags.ts";
|
|
32
|
-
export {
|
|
61
|
+
export type { ExecutionActor, ExecutionContext, ExecutionEnvelope, ExecutionTaskOutcome, } from "../core/contracts/application";
|
|
33
62
|
export type { ServiceProvider } from "../core/contracts/di.ts";
|
|
34
63
|
export { resolveService } from "../core/contracts/di.ts";
|
|
35
64
|
export type { FieldEncryptionRotationBatch, FieldEncryptionRotationOptions, } from "../core/crypto/fieldEncryptionRotation";
|
|
36
|
-
export { createFieldEncryptionRotationMigration, runFieldEncryptionRotationBatch, } from "../core/crypto/fieldEncryptionRotation";
|
|
37
|
-
export
|
|
38
|
-
export {
|
|
39
|
-
export { default as BaseRepository } from "../core/database/baseRepository.ts";
|
|
40
|
-
export { bindDatabaseConnection, getBoundDatabaseConnection, resetBoundDatabaseConnection, } from "../core/database/bindConnection.ts";
|
|
41
|
-
export { bindBunSql, createBunSqlPool } from "../core/database/bunSql.ts";
|
|
65
|
+
export { createFieldEncryptionRotationMigration, fieldEncryptionRotationRepository, runFieldEncryptionRotationBatch, } from "../core/crypto/fieldEncryptionRotation";
|
|
66
|
+
export { createDatabaseBindings } from "../core/database/bindings";
|
|
67
|
+
export { createBunSqlPool } from "../core/database/bunSql.ts";
|
|
42
68
|
export { createDatabaseConnection } from "../core/database/connection.ts";
|
|
43
69
|
export { getActiveDatabaseConnection, hasActiveDatabaseConnection, runWithDatabaseConnection, } from "../core/database/connectionContext.ts";
|
|
44
70
|
export type { DatabaseConnection } from "../core/database/connectionContracts.ts";
|
|
45
|
-
export { getDefaultDatabasePool, getDefaultDatabaseQuery, isDefaultDatabaseConnection, registerDefaultDatabasePool, resetDefaultDatabasePoolForTests, } from "../core/database/defaultConnection.ts";
|
|
46
71
|
export type { SqlDialect } from "../core/database/dialect.ts";
|
|
47
|
-
export { currentSqlDialect, dialectFor,
|
|
48
|
-
export { mapDatabaseError, withDatabaseErrorHandling } from "../core/database/errors.ts";
|
|
49
|
-
export { Factory } from "../core/database/factory.ts";
|
|
72
|
+
export { currentSqlDialect, dialectFor, runWithSqlDialect, sqlTimestamp, } from "../core/database/dialect.ts";
|
|
50
73
|
export { foreignKeyFromTable, pivotTableName, singularize } from "../core/database/inflection.ts";
|
|
51
74
|
export { withMigrationLock } from "../core/database/migrations/advisoryLock.ts";
|
|
52
75
|
export { freshDatabase, getMigrationStatus, loadMigrationsFromDirectory, migrateDatabase, rollbackDatabase, } from "../core/database/migrations/runner.ts";
|
|
53
76
|
export type { Migration, MigrationDatabase, MigrationStatus, } from "../core/database/migrations/types.ts";
|
|
54
|
-
export type { CastType,
|
|
55
|
-
export { applyCasts,
|
|
77
|
+
export type { CastType, ModelAttributes, ModelProjection, } from "../core/database/model.ts";
|
|
78
|
+
export { applyCasts, dehydrateValue, filterMassAssignable, hydrateValue, } from "../core/database/modelAttributes.ts";
|
|
56
79
|
export type { MysqlConnection, MysqlExecutable, MysqlPool, } from "../core/database/mysqlConnection.ts";
|
|
57
80
|
export { createMysqlConnection, createMysqlConnectionFromPool, createMysqlPool, resetMysqlLoaderForTests, } from "../core/database/mysqlConnection.ts";
|
|
58
|
-
export { getNamedConnection, hasNamedConnection, registerNamedConnection, resetNamedConnections, runOnNamedConnection, unregisterNamedConnection, } from "../core/database/namedConnections.ts";
|
|
59
81
|
export { buildAdvancedWhereClause, buildCountQuery, buildDeleteByIdQuery, buildGroupedCountQuery, buildInsertQuery, buildJoinClause, buildOrderByClause, buildProjectionQuery, buildQueryWhereClause, buildRestoreByIdQuery, buildSelectQuery, buildSoftDeleteByIdQuery, buildUpdateQuery, buildWhereClause, parseQualifiedColumn, qualifyColumn, quoteIdentifier, resolveQualifiedColumn, resolveSoftDeleteColumn, } from "../core/database/query.ts";
|
|
60
82
|
export { createDatabaseQueryProxy } from "../core/database/queryProxy.ts";
|
|
61
83
|
export type { BelongsToManyRelation, BelongsToRelation, HasManyRelation, HasManyThroughRelation, HasOneRelation, MorphManyRelation, MorphOneRelation, MorphToRelation, } from "../core/database/relationships.ts";
|
|
62
84
|
export { belongsTo, belongsToMany, hasMany, hasManyThrough, hasOne, indexBelongsToManyRelation, indexBelongsToRelation, indexHasManyRelation, indexHasManyThroughRelation, indexHasOneRelation, indexMorphManyRelation, indexMorphOneRelation, indexMorphToRelation, morphMany, morphOne, morphTo, } from "../core/database/relationships.ts";
|
|
63
|
-
export {
|
|
64
|
-
export { projectPluck, RepositoryQuery, uniqueColumnSelect, } from "../core/database/repositoryQuery.ts";
|
|
85
|
+
export { projectPluck, uniqueColumnSelect, } from "../core/database/repositoryQuery.ts";
|
|
65
86
|
export type { BlueprintAction, BlueprintCallback, ColumnKind, DatabaseDriver, ForeignKeyOptions, Grammar, IndexDefinition, IndexKind, ResolveDatabaseDriverOptions, SchemaBuilder, } from "../core/database/schema/index.ts";
|
|
66
87
|
export { Blueprint, ColumnDefinition, compileBlueprint, createSchemaBuilder, ForeignIdColumnDefinition, grammarForDriver, inferReferencedTable, MySqlGrammar, PostgresGrammar, resolveDatabaseDriver, Schema, SqliteGrammar, UnsupportedSchemaFeatureError, } from "../core/database/schema/index.ts";
|
|
67
88
|
export { loadSeedersFromDirectory, runSeedersFromDirectory, } from "../core/database/seeders/runner.ts";
|
|
68
89
|
export type { Seeder, SeederDatabase } from "../core/database/seeders/types.ts";
|
|
90
|
+
export type { DatabaseCapabilities, DatabaseConnectionOptions, DatabaseDefinition, DatabaseSession, SqlStatement, TransactionOptions, TransactionSession, } from "../core/database/session";
|
|
69
91
|
export { createSqliteConnection } from "../core/database/sqliteConnection.ts";
|
|
70
92
|
export { defineTable } from "../core/database/table.ts";
|
|
71
|
-
export type { TransactionOptions } from "../core/database/transaction.ts";
|
|
72
|
-
export { afterCommit, hasActiveTransaction, isActiveTransactionConnection, requestTransactionRollback, runInTransaction, } from "../core/database/transaction.ts";
|
|
73
93
|
export type { ModelWhere, ModelWriteValues, QueryJoin, QueryJoinOn, QueryOptions, QueryOrder, QuerySelectItem, QueryWhere, } from "../core/database/types.ts";
|
|
74
94
|
export type { WhereNode } from "../core/database/whereBuilder.ts";
|
|
75
95
|
export { WhereBuilder } from "../core/database/whereBuilder.ts";
|
|
76
|
-
export {
|
|
77
|
-
export
|
|
78
|
-
export {
|
|
79
|
-
export {
|
|
80
|
-
export
|
|
81
|
-
export { createOutboxMetricsCollector, createOutboxMigration, renderOutboxMetrics, SqlOutbox, } from "../core/events/outbox/index.ts";
|
|
82
|
-
export { auth, cache, config, events, log, mail, policyGate, queue, storage, } from "../core/facades/index.ts";
|
|
96
|
+
export type { EventListener } from "../core/events/eventBusClass";
|
|
97
|
+
export { EventBus } from "../core/events/eventBusClass";
|
|
98
|
+
export { modelEventName } from "../core/events/index.ts";
|
|
99
|
+
export type { DurableEvent, DurableListener, OutboxDeliverySnapshot, OutboxDeliveryStatus, OutboxMetricState, OutboxMetricsCollector, OutboxMetricsOptions, OutboxMetricsSnapshot, OutboxWorkerTransport, SqlOutboxBindingOptions, SqlOutboxBindings, SqlOutboxOptions, } from "../core/events/outbox/index.ts";
|
|
100
|
+
export { createOutboxMetricsCollector, createOutboxMigration, createOutboxWorkerTransport, createSqlOutboxBindings, renderOutboxMetrics, SqlOutbox, } from "../core/events/outbox/index.ts";
|
|
83
101
|
export { createBodySizeLimitMiddleware } from "../core/http/bodySizeLimitMiddleware.ts";
|
|
84
102
|
export { readClientIp, trustForwardedFor } from "../core/http/clientIp.ts";
|
|
85
|
-
export { conditionalJsonResponse } from "../core/http/conditionalResponse.ts";
|
|
103
|
+
export { conditionalJsonResponse, type JsonResponsePolicy, } from "../core/http/conditionalResponse.ts";
|
|
86
104
|
export type { ContentSecurityPolicyDirectives, ContentSecurityPolicyOptions, } from "../core/http/contentSecurityPolicy.ts";
|
|
87
|
-
export {
|
|
105
|
+
export { generateCspNonce, HTMX_2_0_4_INDICATOR_STYLE_HASH, resolveContentSecurityPolicy, resolveHtmlContentSecurityPolicy, serverHtmxContentSecurityPolicy, spaContentSecurityPolicy, strictApiContentSecurityPolicy, } from "../core/http/contentSecurityPolicy.ts";
|
|
88
106
|
export { readBunRequestCookie, readRequestCookie } from "../core/http/cookies.ts";
|
|
89
107
|
export { type CorsConfig, type CorsOptions, createCorsMiddleware, } from "../core/http/corsMiddleware.ts";
|
|
90
108
|
export { type CsrfOptions, createCsrfMiddleware } from "../core/http/csrfMiddleware.ts";
|
|
@@ -118,10 +136,10 @@ export { createThrottleMiddleware } from "../core/http/throttleMiddleware.ts";
|
|
|
118
136
|
export { expectObject, getQueryParams, parseJsonBody, parseOptionalBooleanQueryParam, parseOptionalEnumQueryParam, parseOptionalPositiveIntQueryParam, readOptionalEnum, readOptionalPositiveInt, readOptionalString, readRequiredEnum, readRequiredPositiveInt, readRequiredString, } from "../core/http/validation.ts";
|
|
119
137
|
export { logServerError, normalizeFieldErrors, webErrorResponse, } from "../core/http/webErrorResponse.ts";
|
|
120
138
|
export { WebFormRequest } from "../core/http/webFormRequest.ts";
|
|
121
|
-
export { installGracefulShutdownSignals, LifecycleCoordinator,
|
|
139
|
+
export { installGracefulShutdownSignals, LifecycleCoordinator, type ShutdownContext, type ShutdownResult, } from "../core/lifecycle/gracefulShutdown.ts";
|
|
122
140
|
export { createRequestLoggingMiddleware } from "../core/logging/requestLoggingMiddleware.ts";
|
|
123
|
-
export type { MailDriver, MailMessage } from "../core/mail/mailer.ts";
|
|
124
|
-
export { buildSmtpPayload, LogMailDriver, Mailer,
|
|
141
|
+
export type { MailDriver, MailMessage, SmtpConfig, SmtpTransport } from "../core/mail/mailer.ts";
|
|
142
|
+
export { buildSmtpPayload, createMailDriver, LogMailDriver, Mailer, resolveSmtpConfig, SmtpMailDriver, snapshotSmtpConfig, } from "../core/mail/mailer.ts";
|
|
125
143
|
export type { MarkdownMailLayoutOptions, RenderedMarkdownMail } from "../core/mail/markdownMail.ts";
|
|
126
144
|
export { markdownToHtml, renderMarkdownMail, stripMarkdown, wrapMarkdownMailLayout, } from "../core/mail/markdownMail.ts";
|
|
127
145
|
export type { MarkdownMailableInput } from "../core/mail/markdownMailable.ts";
|
|
@@ -136,13 +154,12 @@ export type { FailedJobMetricsCollector, FailedJobMetricsOptions, FailedJobMetri
|
|
|
136
154
|
export { createFailedJobMetricsCollector, renderFailedJobMetrics, } from "../core/queue/failedJobMetrics.ts";
|
|
137
155
|
export type { Queue, QueuePriority } from "../core/queue/index.ts";
|
|
138
156
|
export { AsyncQueue, createQueue, Job, SyncQueue } from "../core/queue/index.ts";
|
|
139
|
-
export { JobRegistry } from "../core/queue/jobRegistry.ts";
|
|
140
|
-
export { createFailedJobService, createProductionQueue, createQueueWorker, createTrackedJob, FailedJobRepository, FailedJobService,
|
|
157
|
+
export { JobRegistry, QUEUE_JOB_REGISTRY_TOKEN } from "../core/queue/jobRegistry.ts";
|
|
158
|
+
export { createFailedJobService, createProductionQueue, createQueueWorker, createTrackedJob, FailedJobRepository, FailedJobService, QueueWorker, RedisQueue, ResilientQueue, runQueueJob, } from "../core/queue/publicQueue.ts";
|
|
141
159
|
export type { QueueMetricsSnapshot } from "../core/queue/queueMetrics.ts";
|
|
142
160
|
export { collectQueueMetrics } from "../core/queue/queueMetrics.ts";
|
|
143
161
|
export { envFlagEnabled, isProductionEnv } from "../core/runtime/appEnv.ts";
|
|
144
162
|
export { apiPrefix, appCookieName, appDevSecret, appDisplayName, appEnv, appKeyPrefix, appUrl, appUserAgent, namespacedRedisKey, otelServiceName, requireConfiguredSecret, sdkClientClassName, siemEventType, smtpEhloHost, webhookSignatureHeader, } from "../core/runtime/appKeyPrefix.ts";
|
|
145
|
-
export { clearActiveApplicationContext, resolveApplicationAuth, resolveApplicationCache, resolveApplicationConfig, resolveApplicationDependencies, resolveApplicationEventBus, resolveApplicationLogger, resolveApplicationPolicyGate, resolveApplicationQueue, setActiveApplicationContext, } from "../core/runtime/applicationRegistry.ts";
|
|
146
163
|
export type { ScheduledTask, ScheduledTaskContext, SchedulerLease, SchedulerLeaseStore, SchedulerRunOptions, } from "../core/scheduler/schedule.ts";
|
|
147
164
|
export { appSchedule, RedisSchedulerLeaseStore, runDueScheduledTasks, Schedule, SchedulerLeaseLostError, } from "../core/scheduler/schedule.ts";
|
|
148
165
|
export { guestCanViewResource, isPublicReadsEnabled } from "../core/security/publicReads.ts";
|
|
@@ -151,25 +168,26 @@ export { assertSafeOutboundUrl, assertSafeOutboundUrlResolved, isBlockedHostname
|
|
|
151
168
|
export type { SecurityEventDetails } from "../core/security/securityEvents.ts";
|
|
152
169
|
export { logSecurityEvent } from "../core/security/securityEvents.ts";
|
|
153
170
|
export { signedWebhookHeaders, signWebhookBody } from "../core/security/webhookSignature.ts";
|
|
154
|
-
export type { StorageDriver } from "../core/storage/storage.ts";
|
|
155
|
-
export { createStorageDriver, LocalStorageDriver,
|
|
171
|
+
export type { S3StorageConfig, StorageConfig, StorageDriver } from "../core/storage/storage.ts";
|
|
172
|
+
export { createStorageDriver, LocalStorageDriver, resolveStorageConfig, StorageManager, snapshotStorageConfig, } from "../core/storage/storage.ts";
|
|
156
173
|
export { enableTenantRlsSql, enableUserOwnedRlsSql, generatedRlsBootstrapSql, RLS_HELPER_SQL, } from "../core/tenant/enableTenantRls.ts";
|
|
157
174
|
export type { TenancyDriver } from "../core/tenant/tenancyConfig.ts";
|
|
158
175
|
export { isRlsTenancy, isTenancyEnabled, readTenancyDriver, } from "../core/tenant/tenancyConfig.ts";
|
|
159
176
|
export type { TenantContext } from "../core/tenant/tenantContext.ts";
|
|
160
177
|
export { currentTenant, currentTenantId, runWithTenant, tenantContext, } from "../core/tenant/tenantContext.ts";
|
|
161
|
-
export {
|
|
178
|
+
export { runWithTenantDatabase } from "../core/tenant/tenantDatabaseScope.ts";
|
|
162
179
|
export type { PublicTenancyOptions, TenantMiddlewareOptions, TenantResolver, } from "../core/tenant/tenantMiddleware.ts";
|
|
163
|
-
export { auditChecksum, createTenantMiddleware, DEFAULT_TENANT, normalizeTenantHostname,
|
|
180
|
+
export { auditChecksum, createTenantMiddleware, DEFAULT_TENANT, normalizeTenantHostname, resolveTenantForRequest, } from "../core/tenant/tenantMiddleware.ts";
|
|
164
181
|
export type { TracingMetricsSnapshot } from "../core/tracing/health.ts";
|
|
165
182
|
export { renderTracingMetrics } from "../core/tracing/health.ts";
|
|
166
183
|
export type { TraceContext } from "../core/tracing/traceContext.ts";
|
|
167
184
|
export { currentTraceId, runWithTraceContext, traceContextStorage, } from "../core/tracing/traceContext.ts";
|
|
168
185
|
export type { TracingOptions, TracingRuntime } from "../core/tracing/tracingMiddleware.ts";
|
|
169
|
-
export {
|
|
186
|
+
export { createTracingMiddleware, createTracingRuntime, } from "../core/tracing/tracingMiddleware.ts";
|
|
170
187
|
export type { ValidationRule, ValidationSchema } from "../core/validation/rules.ts";
|
|
171
188
|
export { emailRule, maxLength, minLength, required, stringRule, validateObject, } from "../core/validation/rules.ts";
|
|
172
|
-
export {
|
|
189
|
+
export { createWebErrorView, createWebLayoutDataResolver, DEFAULT_VIEWS_DIRECTORY, EtaViewEngine, errorTemplateName, htmlErrorResponse, htmlResponse, isHtmxRequest, notFoundHtmlResponse, redirectResponse, renderKernelErrorChrome, renderWebErrorHtml, resolveWebLayoutData, rssResponse, textResponse, ViewRenderer, xmlResponse, } from "../core/view/index.ts";
|
|
173
190
|
export type { ViewEngine } from "../core/view/viewEngine.ts";
|
|
174
191
|
export type { HtmxViewResponseOptions, NamespacedViewRenderer, ViewNamespaceOptions, ViewResponseOptions, } from "../core/view/viewRenderer.ts";
|
|
192
|
+
export type { WebErrorView, WebErrorViewInput, WebErrorViewOptions, } from "../core/view/webErrorView.ts";
|
|
175
193
|
export type { WebLayoutAuthUser, WebLayoutData, WebLayoutDataOptions, WebLayoutUserKey, } from "../core/view/webLayoutData.ts";
|