@getstrata/core 3.0.4 → 3.0.7
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 +28 -0
- 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/createCacheStore.d.ts +1 -1
- package/dist/core/cache/expiration.d.ts +2 -0
- package/dist/core/cache/redisCacheScript.d.ts +1 -1
- package/dist/core/cache/redisCacheStore.d.ts +5 -5
- package/dist/core/cache/repository.d.ts +2 -0
- package/dist/core/cache/simpleCache.d.ts +5 -5
- package/dist/core/cache/simpleCacheStore.d.ts +3 -3
- package/dist/core/cache/store.d.ts +5 -4
- package/dist/core/cache/taggedCache.d.ts +2 -0
- 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 +106 -18
- 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/createCacheStore.js +45 -23
- package/dist/entries/cache/repository.js +20 -5
- package/dist/entries/cache/simpleCache.js +21 -7
- package/dist/entries/cache/simpleCacheStore.js +2 -3
- package/dist/entries/config/envSchema.js +13 -0
- package/dist/entries/contracts/serviceTokens.js +2 -0
- package/dist/entries/database/bindings.js +19 -95
- package/dist/entries/database/factory.js +4 -0
- package/dist/entries/database/migrations.js +714 -1
- package/dist/entries/database/ownedReadOnlyObservation.js +1 -5
- package/dist/entries/database/sqliteConnection.js +1 -5
- package/dist/entries/http/flashMiddleware.js +33 -14
- package/dist/entries/http/flashSession.js +33 -14
- package/dist/entries/http/formRequest.js +12 -6
- package/dist/entries/http/memoryThrottleMiddleware.js +12 -11
- package/dist/entries/http/pagination.js +4 -4
- package/dist/entries/http/parseMultipartUpload.js +62 -9
- package/dist/entries/http/requirePasswordConfirmMiddleware.js +5 -2
- package/dist/entries/http/requireWebAuthMiddleware.js +5 -2
- package/dist/entries/http/routeModelBinding.js +4 -4
- package/dist/entries/http/safeInternalPath.js +5 -2
- package/dist/entries/http/scimThrottleMiddleware.js +5 -2
- package/dist/entries/http/securedRouteModelBinding.js +4 -4
- package/dist/entries/http/throttleMiddleware.js +5 -2
- 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 +380 -266
- 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 +8 -1
- package/package.json +17 -4
|
@@ -1,15 +1,68 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
// ../../src/core/
|
|
3
|
-
function
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
// ../../src/core/config/envSchema.ts
|
|
3
|
+
function defineEnvSchema(schema) {
|
|
4
|
+
return schema;
|
|
5
|
+
}
|
|
6
|
+
function validateEnv(schema, env = process.env) {
|
|
7
|
+
const resolved = {};
|
|
8
|
+
for (const [name, rule] of Object.entries(schema)) {
|
|
9
|
+
if (rule.integer) {
|
|
10
|
+
if (rule.minimum !== undefined && !Number.isSafeInteger(rule.minimum) || rule.maximum !== undefined && !Number.isSafeInteger(rule.maximum) || rule.minimum !== undefined && rule.maximum !== undefined && rule.minimum > rule.maximum) {
|
|
11
|
+
throw new TypeError(`Environment integer rule for "${name}" has invalid bounds.`);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
const rawValue = env[name];
|
|
15
|
+
if (rawValue !== undefined && typeof rawValue !== "string") {
|
|
16
|
+
throw new TypeError(`Environment variable "${name}" must be a string.`);
|
|
17
|
+
}
|
|
18
|
+
const value = rawValue === undefined || rawValue.trim() === "" ? rule.default : rawValue;
|
|
19
|
+
if (value !== undefined && typeof value !== "string") {
|
|
20
|
+
throw new TypeError(`Environment variable "${name}" must resolve to a string.`);
|
|
21
|
+
}
|
|
22
|
+
if (value === undefined || value.trim() === "") {
|
|
23
|
+
if (rule.required) {
|
|
24
|
+
throw new Error(`Missing required environment variable "${name}".`);
|
|
25
|
+
}
|
|
26
|
+
continue;
|
|
27
|
+
}
|
|
28
|
+
if (rule.integer) {
|
|
29
|
+
const completeInteger = /^[+-]?\d+$/.test(value.trim());
|
|
30
|
+
const parsed = Number.parseInt(value, 10);
|
|
31
|
+
const minimum = rule.minimum ?? Number.NEGATIVE_INFINITY;
|
|
32
|
+
const maximum = rule.maximum ?? Number.POSITIVE_INFINITY;
|
|
33
|
+
if (!completeInteger || !Number.isSafeInteger(parsed) || parsed < minimum || parsed > maximum) {
|
|
34
|
+
const comparison = minimum !== Number.NEGATIVE_INFINITY && maximum !== Number.POSITIVE_INFINITY ? `an integer between ${minimum} and ${maximum}` : maximum !== Number.POSITIVE_INFINITY ? `an integer <= ${maximum}` : minimum === Number.NEGATIVE_INFINITY ? "an integer" : `an integer >= ${minimum}`;
|
|
35
|
+
throw new Error(`Environment variable "${name}" must be ${comparison}.`);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
if (rule.pattern && !new RegExp(rule.pattern.source, rule.pattern.flags).test(value)) {
|
|
39
|
+
throw new Error(`Environment variable "${name}" has an invalid format.`);
|
|
40
|
+
}
|
|
41
|
+
Object.defineProperty(resolved, name, {
|
|
42
|
+
value,
|
|
43
|
+
enumerable: true,
|
|
44
|
+
configurable: true,
|
|
45
|
+
writable: true
|
|
46
|
+
});
|
|
7
47
|
}
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
48
|
+
return resolved;
|
|
49
|
+
}
|
|
50
|
+
function resolveEnv(schema, env = process.env) {
|
|
51
|
+
const validated = validateEnv(schema, env);
|
|
52
|
+
const resolved = {};
|
|
53
|
+
for (const [name, rule] of Object.entries(schema)) {
|
|
54
|
+
const value = validated[name];
|
|
55
|
+
Object.defineProperty(resolved, name, {
|
|
56
|
+
value: value === undefined ? undefined : rule.integer ? Number(value) : value,
|
|
57
|
+
enumerable: true
|
|
58
|
+
});
|
|
11
59
|
}
|
|
12
|
-
return
|
|
60
|
+
return Object.freeze(resolved);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
// ../../src/core/security/tokenExpiry.ts
|
|
64
|
+
function resolveDefaultTokenExpiryDays(value) {
|
|
65
|
+
return resolveEnv({ API_TOKEN_DEFAULT_EXPIRY_DAYS: { integer: true, minimum: 1 } }, { API_TOKEN_DEFAULT_EXPIRY_DAYS: value }).API_TOKEN_DEFAULT_EXPIRY_DAYS ?? null;
|
|
13
66
|
}
|
|
14
67
|
export {
|
|
15
68
|
resolveDefaultTokenExpiryDays
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
// ../../src/core/storage/storage.ts
|
|
3
|
-
import { mkdir, readFile, unlink, writeFile } from "fs/promises";
|
|
3
|
+
import { mkdir, readFile, stat, unlink, writeFile } from "fs/promises";
|
|
4
4
|
import { dirname, resolve as resolve2 } from "path";
|
|
5
5
|
import { CORE_STORAGE_TOKEN } from "@getstrata/core/contracts/serviceTokens";
|
|
6
6
|
var {S3Client } = globalThis.Bun;
|
|
@@ -81,6 +81,48 @@ function assertUrlPathUnderRoot(rootDirectory, urlPathname) {
|
|
|
81
81
|
}
|
|
82
82
|
|
|
83
83
|
// ../../src/core/storage/storage.ts
|
|
84
|
+
function requireStreamingStorage(storage) {
|
|
85
|
+
if (!("readStream" in storage) || typeof storage.readStream !== "function" || !("writeStream" in storage) || typeof storage.writeStream !== "function")
|
|
86
|
+
throw new TypeError("Storage does not support streaming.");
|
|
87
|
+
if (storage instanceof StorageManager)
|
|
88
|
+
storage.streamingDriver();
|
|
89
|
+
return storage;
|
|
90
|
+
}
|
|
91
|
+
async function openStream(source, missingCode) {
|
|
92
|
+
const reader = source.getReader();
|
|
93
|
+
let first;
|
|
94
|
+
try {
|
|
95
|
+
first = await reader.read();
|
|
96
|
+
} catch (error) {
|
|
97
|
+
reader.releaseLock();
|
|
98
|
+
if (hasErrorCode(error, missingCode))
|
|
99
|
+
return null;
|
|
100
|
+
throw error;
|
|
101
|
+
}
|
|
102
|
+
return new ReadableStream({
|
|
103
|
+
async pull(controller) {
|
|
104
|
+
try {
|
|
105
|
+
const next = first ?? await reader.read();
|
|
106
|
+
first = undefined;
|
|
107
|
+
if (next.done) {
|
|
108
|
+
reader.releaseLock();
|
|
109
|
+
controller.close();
|
|
110
|
+
} else
|
|
111
|
+
controller.enqueue(next.value);
|
|
112
|
+
} catch (error) {
|
|
113
|
+
reader.releaseLock();
|
|
114
|
+
controller.error(error);
|
|
115
|
+
}
|
|
116
|
+
},
|
|
117
|
+
async cancel(reason) {
|
|
118
|
+
try {
|
|
119
|
+
await reader.cancel(reason);
|
|
120
|
+
} finally {
|
|
121
|
+
reader.releaseLock();
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}, { highWaterMark: 0 });
|
|
125
|
+
}
|
|
84
126
|
function hasErrorCode(error, code) {
|
|
85
127
|
return typeof error === "object" && error !== null && "code" in error && error.code === code;
|
|
86
128
|
}
|
|
@@ -110,6 +152,24 @@ class LocalStorageDriver {
|
|
|
110
152
|
throw error;
|
|
111
153
|
}
|
|
112
154
|
}
|
|
155
|
+
async readStream(path) {
|
|
156
|
+
const absolutePath = this.resolvePath(path);
|
|
157
|
+
try {
|
|
158
|
+
if (!(await stat(absolutePath)).isFile())
|
|
159
|
+
throw new Error("Storage path is not a file.");
|
|
160
|
+
} catch (error) {
|
|
161
|
+
if (hasErrorCode(error, "ENOENT"))
|
|
162
|
+
return null;
|
|
163
|
+
throw error;
|
|
164
|
+
}
|
|
165
|
+
return openStream(Bun.file(absolutePath).stream(), "ENOENT");
|
|
166
|
+
}
|
|
167
|
+
async writeStream(path, contents) {
|
|
168
|
+
const absolutePath = this.resolvePath(path);
|
|
169
|
+
await mkdir(dirname(absolutePath), { recursive: true });
|
|
170
|
+
await Bun.write(absolutePath, contents);
|
|
171
|
+
return path;
|
|
172
|
+
}
|
|
113
173
|
async delete(path) {
|
|
114
174
|
try {
|
|
115
175
|
await unlink(this.resolvePath(path));
|
|
@@ -140,6 +200,33 @@ class S3StorageDriver {
|
|
|
140
200
|
throw error;
|
|
141
201
|
}
|
|
142
202
|
}
|
|
203
|
+
readStream(path) {
|
|
204
|
+
return openStream(this.client.file(path.replace(/^\/+/, "")).stream(), "NoSuchKey");
|
|
205
|
+
}
|
|
206
|
+
async writeStream(path, contents) {
|
|
207
|
+
const file = this.client.file(path.replace(/^\/+/, ""));
|
|
208
|
+
if (contents instanceof Blob)
|
|
209
|
+
await file.write(contents);
|
|
210
|
+
else {
|
|
211
|
+
const writer = file.writer();
|
|
212
|
+
try {
|
|
213
|
+
await contents.pipeTo(new WritableStream({
|
|
214
|
+
async write(chunk) {
|
|
215
|
+
await writer.write(chunk);
|
|
216
|
+
},
|
|
217
|
+
async close() {
|
|
218
|
+
await writer.end();
|
|
219
|
+
}
|
|
220
|
+
}));
|
|
221
|
+
} catch (error) {
|
|
222
|
+
try {
|
|
223
|
+
await writer.end(error instanceof Error ? error : new Error(String(error)));
|
|
224
|
+
} catch {}
|
|
225
|
+
throw error;
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
return path;
|
|
229
|
+
}
|
|
143
230
|
async delete(path) {
|
|
144
231
|
try {
|
|
145
232
|
await this.client.unlink(path.replace(/^\/+/, ""));
|
|
@@ -162,6 +249,19 @@ class StorageManager {
|
|
|
162
249
|
get(path) {
|
|
163
250
|
return this.driver.get(path);
|
|
164
251
|
}
|
|
252
|
+
streamingDriver() {
|
|
253
|
+
return requireStreamingStorage(this.driver);
|
|
254
|
+
}
|
|
255
|
+
readStream(path) {
|
|
256
|
+
if (!("readStream" in this.driver) || typeof this.driver.readStream !== "function")
|
|
257
|
+
return Promise.reject(new TypeError("Storage driver does not support streaming reads."));
|
|
258
|
+
return this.driver.readStream(path);
|
|
259
|
+
}
|
|
260
|
+
writeStream(path, contents) {
|
|
261
|
+
if (!("writeStream" in this.driver) || typeof this.driver.writeStream !== "function")
|
|
262
|
+
return Promise.reject(new TypeError("Storage driver does not support streaming writes."));
|
|
263
|
+
return this.driver.writeStream(path, contents);
|
|
264
|
+
}
|
|
165
265
|
delete(path) {
|
|
166
266
|
return this.driver.delete(path);
|
|
167
267
|
}
|
|
@@ -238,6 +338,7 @@ export {
|
|
|
238
338
|
StorageManager,
|
|
239
339
|
createS3Client,
|
|
240
340
|
createStorageDriver,
|
|
341
|
+
requireStreamingStorage,
|
|
241
342
|
resolveS3Config,
|
|
242
343
|
resolveStorageConfig,
|
|
243
344
|
snapshotStorageConfig
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
// ../../src/core/testing.ts
|
|
3
|
+
import { resetMysqlLoaderForTests } from "#strata-mysql-native";
|
|
4
|
+
import {
|
|
5
|
+
resetDnsLookupForTests,
|
|
6
|
+
resetMemoryLoginThrottleForTests,
|
|
7
|
+
resetMemoryThrottleForTests,
|
|
8
|
+
setDnsLookupForTests,
|
|
9
|
+
setNodeSamlLoaderForTests
|
|
10
|
+
} from "#strata-test-state";
|
|
11
|
+
export {
|
|
12
|
+
resetDnsLookupForTests,
|
|
13
|
+
resetMemoryLoginThrottleForTests,
|
|
14
|
+
resetMemoryThrottleForTests,
|
|
15
|
+
resetMysqlLoaderForTests,
|
|
16
|
+
setDnsLookupForTests,
|
|
17
|
+
setNodeSamlLoaderForTests
|
|
18
|
+
};
|
|
@@ -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";
|