@getstrata/core 3.0.5 → 3.0.8
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 -9
- package/README.md +17 -9
- package/dist/core/auth/policy.d.ts +4 -1
- package/dist/core/auth/saml/samlServiceProvider.d.ts +2 -3
- package/dist/core/cache/store.d.ts +2 -2
- package/dist/core/cache/tokens.d.ts +1 -1
- package/dist/core/config/envSchema.d.ts +13 -0
- package/dist/core/contracts/application.d.ts +4 -0
- package/dist/core/contracts/di.d.ts +2 -2
- package/dist/core/contracts/provider.d.ts +13 -0
- package/dist/core/contracts/serviceTokens.d.ts +12 -11
- package/dist/core/database/factory.d.ts +3 -0
- package/dist/core/database/index.d.ts +1 -1
- package/dist/core/database/migrations/declaration.d.ts +11 -0
- package/dist/core/database/migrations/runner.d.ts +2 -0
- package/dist/core/database/model.d.ts +16 -3
- package/dist/core/database/modelQuery.d.ts +1 -10
- package/dist/core/database/modelRelationLoader.d.ts +31 -0
- package/dist/core/database/mysqlConnection.d.ts +2 -2
- package/dist/core/database/mysqlNative.d.ts +2 -0
- package/dist/core/database/ormRuntime.d.ts +1 -1
- package/dist/core/database/rawMysql.d.ts +1 -1
- package/dist/core/events/eventBusClass.d.ts +6 -3
- package/dist/core/events/index.d.ts +1 -1
- package/dist/core/http/formRequest.d.ts +2 -0
- package/dist/core/http/loginThrottleMiddleware.d.ts +1 -2
- package/dist/core/http/memoryThrottleMiddleware.d.ts +1 -3
- package/dist/core/http/webFormRequest.d.ts +3 -5
- package/dist/core/mail/mailer.d.ts +6 -3
- package/dist/core/mail/markdownMailable.d.ts +2 -2
- package/dist/core/notifications/dispatcher.d.ts +5 -5
- package/dist/core/notifications/index.d.ts +1 -1
- package/dist/core/notifications/types.d.ts +9 -2
- package/dist/core/queue/index.d.ts +8 -3
- package/dist/core/queue/queueHandoff.d.ts +2 -2
- package/dist/core/runtime/application.d.ts +2 -0
- package/dist/core/security/oauthState.d.ts +12 -2
- package/dist/core/security/safeUrl.d.ts +1 -11
- package/dist/core/storage/storage.d.ts +23 -6
- package/dist/core/testing.d.ts +5 -0
- package/dist/core/testingState.d.ts +22 -0
- package/dist/entries/audit/exportAuditLogs.js +1 -0
- package/dist/entries/auth/intendedUrlCookie.js +68 -2
- package/dist/entries/auth/jwt.js +68 -6
- package/dist/entries/auth/jwtGuard.js +76 -12
- package/dist/entries/auth/oauth/samlProvider.js +4 -5
- package/dist/entries/auth/passwordConfirmCookie.js +69 -3
- package/dist/entries/auth/saml/samlServiceProvider.js +5 -7
- package/dist/entries/auth/sessionCookie.js +69 -6
- package/dist/entries/auth/sessionGuard.js +69 -6
- package/dist/entries/cache/repository.js +4 -5
- package/dist/entries/config/envSchema.js +13 -0
- package/dist/entries/contracts/serviceTokens.js +2 -0
- package/dist/entries/database/bindings.js +18 -90
- package/dist/entries/database/factory.js +4 -0
- package/dist/entries/database/migrations.js +714 -1
- package/dist/entries/http/formRequest.js +12 -6
- package/dist/entries/http/memoryThrottleMiddleware.js +7 -9
- package/dist/entries/http/pagination.js +4 -4
- package/dist/entries/http/parseMultipartUpload.js +62 -9
- package/dist/entries/http/routeModelBinding.js +4 -4
- package/dist/entries/http/securedRouteModelBinding.js +4 -4
- package/dist/entries/http/uploads.js +62 -9
- package/dist/entries/http/validation.js +4 -4
- package/dist/entries/http/webFormRequest.js +74 -95
- package/dist/entries/jobs/exportAuditLogsJob.js +9 -4
- package/dist/entries/jobs/invalidateCacheTagsJob.js +9 -4
- package/dist/entries/queue/createAppQueue.js +10 -5
- package/dist/entries/queue/publicQueue.js +10 -5
- package/dist/entries/queue/queueWorkerTransport.js +10 -5
- package/dist/entries/queue.js +9 -4
- package/dist/entries/runtime/application.js +50 -3
- package/dist/entries/security/oauthState.js +61 -2
- package/dist/entries/security/tokenExpiry.js +62 -9
- package/dist/entries/storage/storage.js +102 -1
- package/dist/entries/testing.js +18 -0
- package/dist/framework/public-api.d.ts +16 -13
- package/dist/index.js +316 -222
- package/dist/internal/mysqlNative.js +97 -0
- package/dist/internal/ormRuntime.js +41 -4
- package/dist/internal/testingState.js +31 -0
- package/dist/types/services.d.ts +4 -1
- package/package.json +17 -4
|
@@ -1,9 +1,12 @@
|
|
|
1
|
+
export type { ApplicationProviderOptions } from "../core/contracts/provider";
|
|
2
|
+
export { defineProvider } from "../core/contracts/provider";
|
|
3
|
+
export type { CacheReader, CacheWriter } from "../types/services";
|
|
1
4
|
/**
|
|
2
5
|
* Stable framework surface for application modules and future package extraction.
|
|
3
6
|
* Import from `@getstrata/core` (workspace) or `src/framework/public-api`.
|
|
4
7
|
*/
|
|
5
8
|
export { AuthenticationRequiredError } from "@getstrata/core/auth/authOutcome";
|
|
6
|
-
export type { PolicyAction, PolicyDecision } from "@getstrata/core/auth/policy";
|
|
9
|
+
export type { PolicyAction, PolicyAuthorizer, PolicyDecision, PolicyRegistry, } from "@getstrata/core/auth/policy";
|
|
7
10
|
export { Policy, PolicyDeniedError, PolicyGate } from "@getstrata/core/auth/policy";
|
|
8
11
|
export { CORE_CACHE_TOKEN } from "@getstrata/core/cache/tokens";
|
|
9
12
|
export type { ConfigIntegerBounds, DeepReadonly, ValidatedEnvironment, } from "@getstrata/core/config/applicationConfig";
|
|
@@ -29,7 +32,7 @@ export type { RouteModelAuthorization, RouteModelBindingPorts, } from "@getstrat
|
|
|
29
32
|
export type { QueueHandoff, QueueIdentity } from "@getstrata/core/queue/queueHandoff";
|
|
30
33
|
export { createIdentityQueue, createQueueHandoff, QueueHandoffError, } from "@getstrata/core/queue/queueHandoff";
|
|
31
34
|
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";
|
|
35
|
+
export { BaseRepository, BelongsToManyRelationQuery, BelongsToRelationQuery, createModel, HasManyRelationQuery, HasManyThroughRelationQuery, HasOneRelationQuery, Model, ModelQuery, MorphManyRelationQuery, MorphOneRelationQuery, MorphToRelationQuery, RepositoryQuery, } from "#strata-orm-runtime";
|
|
33
36
|
export type { AdminColumn, AdminColumnType, AdminResource, AdminResourceDefinition, AdminResourceHandlers, } from "../core/admin/index.ts";
|
|
34
37
|
export { AdminResourceRegistry, formatAdminValue, } from "../core/admin/index.ts";
|
|
35
38
|
export type { AbilityChecker } from "../core/auth/abilityChecker.ts";
|
|
@@ -52,7 +55,7 @@ export { SamlProvider } from "../core/auth/oauth/samlProvider.ts";
|
|
|
52
55
|
export { AUTH_ONE_TIME_PURPOSES, generateOneTimeToken, hashOneTimeToken, } from "../core/auth/oneTimeToken.ts";
|
|
53
56
|
export { completePasswordLogin } from "../core/auth/passwordLogin.ts";
|
|
54
57
|
export type { SamlAssertionReplayStore, SamlServiceProviderConfig, SamlServiceProviderOptions, } from "../core/auth/saml/samlServiceProvider.ts";
|
|
55
|
-
export { createSamlServiceProvider, InMemorySamlAssertionReplayStore, readSamlEnvOptions, SamlServiceProvider,
|
|
58
|
+
export { createSamlServiceProvider, InMemorySamlAssertionReplayStore, readSamlEnvOptions, SamlServiceProvider, } from "../core/auth/saml/samlServiceProvider.ts";
|
|
56
59
|
export { createScimAuthMiddleware } from "../core/auth/scimAuthMiddleware.ts";
|
|
57
60
|
export { createTokenAbilityChecker } from "../core/auth/tokenAbilityChecker.ts";
|
|
58
61
|
export { type CacheDriver, type CreateCacheStoreOptions, createCacheStore, } from "../core/cache/createCacheStore.ts";
|
|
@@ -77,7 +80,7 @@ export type { Migration, MigrationDatabase, MigrationStatus, } from "../core/dat
|
|
|
77
80
|
export type { CastType, ModelAttributes, ModelProjection, } from "../core/database/model.ts";
|
|
78
81
|
export { applyCasts, dehydrateValue, filterMassAssignable, hydrateValue, } from "../core/database/modelAttributes.ts";
|
|
79
82
|
export type { MysqlConnection, MysqlExecutable, MysqlPool, } from "../core/database/mysqlConnection.ts";
|
|
80
|
-
export { createMysqlConnection, createMysqlConnectionFromPool, createMysqlPool,
|
|
83
|
+
export { createMysqlConnection, createMysqlConnectionFromPool, createMysqlPool, } from "../core/database/mysqlConnection.ts";
|
|
81
84
|
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";
|
|
82
85
|
export { createDatabaseQueryProxy } from "../core/database/queryProxy.ts";
|
|
83
86
|
export type { BelongsToManyRelation, BelongsToRelation, HasManyRelation, HasManyThroughRelation, HasOneRelation, MorphManyRelation, MorphOneRelation, MorphToRelation, } from "../core/database/relationships.ts";
|
|
@@ -93,7 +96,7 @@ export { defineTable } from "../core/database/table.ts";
|
|
|
93
96
|
export type { ModelWhere, ModelWriteValues, QueryJoin, QueryJoinOn, QueryOptions, QueryOrder, QuerySelectItem, QueryWhere, } from "../core/database/types.ts";
|
|
94
97
|
export type { WhereNode } from "../core/database/whereBuilder.ts";
|
|
95
98
|
export { WhereBuilder } from "../core/database/whereBuilder.ts";
|
|
96
|
-
export type { EventListener } from "../core/events/eventBusClass";
|
|
99
|
+
export type { EventDispatcher, EventListener } from "../core/events/eventBusClass";
|
|
97
100
|
export { EventBus } from "../core/events/eventBusClass";
|
|
98
101
|
export { modelEventName } from "../core/events/index.ts";
|
|
99
102
|
export type { DurableEvent, DurableListener, OutboxDeliverySnapshot, OutboxDeliveryStatus, OutboxMetricState, OutboxMetricsCollector, OutboxMetricsOptions, OutboxMetricsSnapshot, OutboxWorkerTransport, SqlOutboxBindingOptions, SqlOutboxBindings, SqlOutboxOptions, } from "../core/events/outbox/index.ts";
|
|
@@ -112,9 +115,9 @@ export { applyConditionalGet, assertIfMatch, computeEtagFromJson, type EtagVersi
|
|
|
112
115
|
export { createFlashMiddleware } from "../core/http/flashMiddleware.ts";
|
|
113
116
|
export { FormRequest, QueryFormRequest } from "../core/http/formRequest.ts";
|
|
114
117
|
export { applyMiddlewareToRoutes, bindRouteModel, buildPaginationMeta, buildRequestCacheKey, composeMiddleware, createAuthMiddleware, createAuthorizeMiddleware, createRequireAuthMiddleware, DEFAULT_PER_PAGE, MAX_PER_PAGE, paginatedResponse, parsePaginationQuery, parsePositiveIntParam, requestIdMiddleware, securedBindRouteModel, securedBindRouteModelByKey, withMiddleware, wrapRouteHandler, } from "../core/http/index.ts";
|
|
115
|
-
export { createLoginThrottleMiddleware, createMemoryLoginThrottleMiddleware,
|
|
118
|
+
export { createLoginThrottleMiddleware, createMemoryLoginThrottleMiddleware, resolveLoginEmail, resolveLoginIdentity, } from "../core/http/loginThrottleMiddleware.ts";
|
|
116
119
|
export type { DisposableMemoryThrottle, MemoryThrottleOptions, MemoryThrottleStats, MemoryThrottleStorageOptions, } from "../core/http/memoryThrottleMiddleware.ts";
|
|
117
|
-
export { createMemoryThrottleMiddleware
|
|
120
|
+
export { createMemoryThrottleMiddleware } from "../core/http/memoryThrottleMiddleware.ts";
|
|
118
121
|
export { createMetricsMiddleware } from "../core/http/metricsMiddleware.ts";
|
|
119
122
|
export type { Middleware, RouteHandler } from "../core/http/middleware.ts";
|
|
120
123
|
export { type ParsedUpload, parseMultipartUpload, sanitizeUploadFileName, validateUploadFile, } from "../core/http/parseMultipartUpload.ts";
|
|
@@ -138,7 +141,7 @@ export { logServerError, normalizeFieldErrors, webErrorResponse, } from "../core
|
|
|
138
141
|
export { WebFormRequest } from "../core/http/webFormRequest.ts";
|
|
139
142
|
export { installGracefulShutdownSignals, LifecycleCoordinator, type ShutdownContext, type ShutdownResult, } from "../core/lifecycle/gracefulShutdown.ts";
|
|
140
143
|
export { createRequestLoggingMiddleware } from "../core/logging/requestLoggingMiddleware.ts";
|
|
141
|
-
export type { MailDriver, MailMessage, SmtpConfig, SmtpTransport } from "../core/mail/mailer.ts";
|
|
144
|
+
export type { MailDriver, MailMessage, MailSender, SmtpConfig, SmtpTransport, } from "../core/mail/mailer.ts";
|
|
142
145
|
export { buildSmtpPayload, createMailDriver, LogMailDriver, Mailer, resolveSmtpConfig, SmtpMailDriver, snapshotSmtpConfig, } from "../core/mail/mailer.ts";
|
|
143
146
|
export type { MarkdownMailLayoutOptions, RenderedMarkdownMail } from "../core/mail/markdownMail.ts";
|
|
144
147
|
export { markdownToHtml, renderMarkdownMail, stripMarkdown, wrapMarkdownMailLayout, } from "../core/mail/markdownMail.ts";
|
|
@@ -147,12 +150,12 @@ export { buildMarkdownMailMessage, sendMarkdownMail } from "../core/mail/markdow
|
|
|
147
150
|
export { sanitizeMailHtml } from "../core/mail/sanitizeMailHtml.ts";
|
|
148
151
|
export type { MetricLabels } from "../core/metrics/prometheus.ts";
|
|
149
152
|
export { HTTP_DURATION_BUCKETS_MS, PrometheusRegistry, prometheusRegistry, } from "../core/metrics/prometheus.ts";
|
|
150
|
-
export type { DatabaseNotificationPayload, DatabaseNotificationStore, MailNotificationMessage, Notifiable, NotificationChannelName, } from "../core/notifications/index.ts";
|
|
153
|
+
export type { DatabaseNotificationPayload, DatabaseNotificationStore, MailNotificationMessage, Notifiable, NotificationChannel, NotificationChannelName, NotificationChannels, } from "../core/notifications/index.ts";
|
|
151
154
|
export { createNotificationDispatcher, Notification, NotificationDispatcher, } from "../core/notifications/index.ts";
|
|
152
155
|
export type { CursorPaginatedResult, KeysetColumn, KeysetCursor, KeysetOptions, PaginatedResult, PaginationMeta, } from "../core/pagination/index.ts";
|
|
153
156
|
export type { FailedJobMetricsCollector, FailedJobMetricsOptions, FailedJobMetricsSnapshot, } from "../core/queue/failedJobMetrics.ts";
|
|
154
157
|
export { createFailedJobMetricsCollector, renderFailedJobMetrics, } from "../core/queue/failedJobMetrics.ts";
|
|
155
|
-
export type { Queue, QueuePriority } from "../core/queue/index.ts";
|
|
158
|
+
export type { Queue, QueueDispatcher, QueuePriority } from "../core/queue/index.ts";
|
|
156
159
|
export { AsyncQueue, createQueue, Job, SyncQueue } from "../core/queue/index.ts";
|
|
157
160
|
export { JobRegistry, QUEUE_JOB_REGISTRY_TOKEN } from "../core/queue/jobRegistry.ts";
|
|
158
161
|
export { createFailedJobService, createProductionQueue, createQueueWorker, createTrackedJob, FailedJobRepository, FailedJobService, QueueWorker, RedisQueue, ResilientQueue, runQueueJob, } from "../core/queue/publicQueue.ts";
|
|
@@ -164,12 +167,12 @@ export type { ScheduledTask, ScheduledTaskContext, SchedulerLease, SchedulerLeas
|
|
|
164
167
|
export { appSchedule, RedisSchedulerLeaseStore, runDueScheduledTasks, Schedule, SchedulerLeaseLostError, } from "../core/scheduler/schedule.ts";
|
|
165
168
|
export { guestCanViewResource, isPublicReadsEnabled } from "../core/security/publicReads.ts";
|
|
166
169
|
export { assertPathUnderRoot, assertUrlPathUnderRoot } from "../core/security/safePath.ts";
|
|
167
|
-
export { assertSafeOutboundUrl, assertSafeOutboundUrlResolved, isBlockedHostname, isBlockedIpAddress, pinUrlToAddress,
|
|
170
|
+
export { assertSafeOutboundUrl, assertSafeOutboundUrlResolved, isBlockedHostname, isBlockedIpAddress, pinUrlToAddress, resolveSafeOutboundTarget, } from "../core/security/safeUrl.ts";
|
|
168
171
|
export type { SecurityEventDetails } from "../core/security/securityEvents.ts";
|
|
169
172
|
export { logSecurityEvent } from "../core/security/securityEvents.ts";
|
|
170
173
|
export { signedWebhookHeaders, signWebhookBody } from "../core/security/webhookSignature.ts";
|
|
171
|
-
export type { S3StorageConfig, StorageConfig, StorageDriver } from "../core/storage/storage.ts";
|
|
172
|
-
export { createStorageDriver, LocalStorageDriver, resolveStorageConfig, StorageManager, snapshotStorageConfig, } from "../core/storage/storage.ts";
|
|
174
|
+
export type { S3StorageConfig, Storage, StorageConfig, StorageDriver, StreamingStorage, } from "../core/storage/storage.ts";
|
|
175
|
+
export { createStorageDriver, LocalStorageDriver, requireStreamingStorage, resolveStorageConfig, StorageManager, snapshotStorageConfig, } from "../core/storage/storage.ts";
|
|
173
176
|
export { enableTenantRlsSql, enableUserOwnedRlsSql, generatedRlsBootstrapSql, RLS_HELPER_SQL, } from "../core/tenant/enableTenantRls.ts";
|
|
174
177
|
export type { TenancyDriver } from "../core/tenant/tenancyConfig.ts";
|
|
175
178
|
export { isRlsTenancy, isTenancyEnabled, readTenancyDriver, } from "../core/tenant/tenancyConfig.ts";
|