@getstrata/bootstrap 0.2.20 → 0.2.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bootstrap/applicationRegistry.d.ts +1 -1
- package/dist/bootstrap/config.d.ts +1 -1
- package/dist/bootstrap/providers/events.d.ts +1 -1
- package/dist/bootstrap/public-api.d.ts +5 -2
- package/dist/core/contracts/serviceTokens.d.ts +2 -1
- package/dist/core/runtime/applicationRegistry.d.ts +3 -1
- package/dist/entries/applicationRegistry.js +5 -0
- package/dist/entries/config.js +2 -0
- package/dist/entries/context.js +4 -1
- package/dist/entries/createWebRoutes.js +12 -1
- package/dist/entries/dependencies.js +4236 -0
- package/dist/entries/http/securedRouteModelBinding.js +4 -0
- package/dist/entries/httpKernel.js +1 -0
- package/dist/entries/membershipService.js +4 -0
- package/dist/entries/providers/view.js +1 -0
- package/dist/entries/providers.js +4 -1
- package/dist/entries/queue/defaultJobs.js +4 -0
- package/dist/entries/routeRegistry.js +29 -0
- package/dist/entries/secretsGuard.js +91 -0
- package/dist/entries/web/routing.js +4 -0
- package/dist/framework/public-api.d.ts +1 -1
- package/dist/index.js +25 -2
- package/dist/modules/scim/controller.d.ts +1 -1
- package/dist/modules/scim/service.d.ts +1 -1
- package/dist/modules/user/provider.d.ts +1 -1
- package/package.json +18 -3
|
@@ -90,6 +90,7 @@ function resolveService(dependencies, token) {
|
|
|
90
90
|
var CORE_CONFIG_TOKEN = "core.config";
|
|
91
91
|
var CORE_CACHE_TOKEN = "core.cache";
|
|
92
92
|
var CORE_QUEUE_TOKEN = "core.queue";
|
|
93
|
+
var CORE_EVENT_BUS_TOKEN = "core.eventBus";
|
|
93
94
|
var CORE_POLICY_GATE_TOKEN = "core.policyGate";
|
|
94
95
|
var CORE_AUTH_TOKEN = "core.auth";
|
|
95
96
|
var CORE_TOKEN_SERVICE_TOKEN = "core.tokenService";
|
|
@@ -160,6 +161,9 @@ function resolveApplicationCache() {
|
|
|
160
161
|
function resolveApplicationQueue() {
|
|
161
162
|
return requireActiveApplicationContext().container.resolve(CORE_QUEUE_TOKEN);
|
|
162
163
|
}
|
|
164
|
+
function resolveApplicationEventBus() {
|
|
165
|
+
return requireActiveApplicationContext().container.resolve(CORE_EVENT_BUS_TOKEN);
|
|
166
|
+
}
|
|
163
167
|
function resolveApplicationAuth() {
|
|
164
168
|
return requireActiveApplicationContext().container.resolve(CORE_AUTH_TOKEN);
|
|
165
169
|
}
|
|
@@ -78,6 +78,7 @@ function resolveRegisterRateLimit() {
|
|
|
78
78
|
var CORE_CONFIG_TOKEN = "core.config";
|
|
79
79
|
var CORE_CACHE_TOKEN = "core.cache";
|
|
80
80
|
var CORE_QUEUE_TOKEN = "core.queue";
|
|
81
|
+
var CORE_EVENT_BUS_TOKEN = "core.eventBus";
|
|
81
82
|
var CORE_POLICY_GATE_TOKEN = "core.policyGate";
|
|
82
83
|
var CORE_AUTH_TOKEN = "core.auth";
|
|
83
84
|
var CORE_TOKEN_SERVICE_TOKEN = "core.tokenService";
|
|
@@ -25,6 +25,7 @@ function resolveService(dependencies, token) {
|
|
|
25
25
|
var CORE_CONFIG_TOKEN = "core.config";
|
|
26
26
|
var CORE_CACHE_TOKEN = "core.cache";
|
|
27
27
|
var CORE_QUEUE_TOKEN = "core.queue";
|
|
28
|
+
var CORE_EVENT_BUS_TOKEN = "core.eventBus";
|
|
28
29
|
var CORE_POLICY_GATE_TOKEN = "core.policyGate";
|
|
29
30
|
var CORE_AUTH_TOKEN = "core.auth";
|
|
30
31
|
var CORE_TOKEN_SERVICE_TOKEN = "core.tokenService";
|
|
@@ -95,6 +96,9 @@ function resolveApplicationCache() {
|
|
|
95
96
|
function resolveApplicationQueue() {
|
|
96
97
|
return requireActiveApplicationContext().container.resolve(CORE_QUEUE_TOKEN);
|
|
97
98
|
}
|
|
99
|
+
function resolveApplicationEventBus() {
|
|
100
|
+
return requireActiveApplicationContext().container.resolve(CORE_EVENT_BUS_TOKEN);
|
|
101
|
+
}
|
|
98
102
|
function resolveApplicationAuth() {
|
|
99
103
|
return requireActiveApplicationContext().container.resolve(CORE_AUTH_TOKEN);
|
|
100
104
|
}
|
|
@@ -83,6 +83,7 @@ function htmlResponse(html, init = {}) {
|
|
|
83
83
|
var CORE_CONFIG_TOKEN = "core.config";
|
|
84
84
|
var CORE_CACHE_TOKEN = "core.cache";
|
|
85
85
|
var CORE_QUEUE_TOKEN = "core.queue";
|
|
86
|
+
var CORE_EVENT_BUS_TOKEN = "core.eventBus";
|
|
86
87
|
var CORE_POLICY_GATE_TOKEN = "core.policyGate";
|
|
87
88
|
var CORE_AUTH_TOKEN = "core.auth";
|
|
88
89
|
var CORE_TOKEN_SERVICE_TOKEN = "core.tokenService";
|
|
@@ -47,6 +47,7 @@ function resolveAbilitiesForRole(role) {
|
|
|
47
47
|
var CORE_CONFIG_TOKEN = "core.config";
|
|
48
48
|
var CORE_CACHE_TOKEN = "core.cache";
|
|
49
49
|
var CORE_QUEUE_TOKEN = "core.queue";
|
|
50
|
+
var CORE_EVENT_BUS_TOKEN = "core.eventBus";
|
|
50
51
|
var CORE_POLICY_GATE_TOKEN = "core.policyGate";
|
|
51
52
|
var CORE_AUTH_TOKEN = "core.auth";
|
|
52
53
|
var CORE_TOKEN_SERVICE_TOKEN = "core.tokenService";
|
|
@@ -1277,7 +1278,6 @@ function modelEventName(tableName, action) {
|
|
|
1277
1278
|
}
|
|
1278
1279
|
|
|
1279
1280
|
// ../../src/bootstrap/providers/events.ts
|
|
1280
|
-
var CORE_EVENT_BUS_TOKEN = "core.eventBus";
|
|
1281
1281
|
var eventsProvider = {
|
|
1282
1282
|
name: "core.events",
|
|
1283
1283
|
register({ container }) {
|
|
@@ -3332,6 +3332,9 @@ function resolveApplicationCache() {
|
|
|
3332
3332
|
function resolveApplicationQueue() {
|
|
3333
3333
|
return requireActiveApplicationContext().container.resolve(CORE_QUEUE_TOKEN);
|
|
3334
3334
|
}
|
|
3335
|
+
function resolveApplicationEventBus() {
|
|
3336
|
+
return requireActiveApplicationContext().container.resolve(CORE_EVENT_BUS_TOKEN);
|
|
3337
|
+
}
|
|
3335
3338
|
function resolveApplicationAuth() {
|
|
3336
3339
|
return requireActiveApplicationContext().container.resolve(CORE_AUTH_TOKEN);
|
|
3337
3340
|
}
|
|
@@ -410,6 +410,7 @@ function resolveService(dependencies, token) {
|
|
|
410
410
|
var CORE_CONFIG_TOKEN = "core.config";
|
|
411
411
|
var CORE_CACHE_TOKEN = "core.cache";
|
|
412
412
|
var CORE_QUEUE_TOKEN = "core.queue";
|
|
413
|
+
var CORE_EVENT_BUS_TOKEN = "core.eventBus";
|
|
413
414
|
var CORE_POLICY_GATE_TOKEN = "core.policyGate";
|
|
414
415
|
var CORE_AUTH_TOKEN = "core.auth";
|
|
415
416
|
var CORE_TOKEN_SERVICE_TOKEN = "core.tokenService";
|
|
@@ -480,6 +481,9 @@ function resolveApplicationCache() {
|
|
|
480
481
|
function resolveApplicationQueue() {
|
|
481
482
|
return requireActiveApplicationContext().container.resolve(CORE_QUEUE_TOKEN);
|
|
482
483
|
}
|
|
484
|
+
function resolveApplicationEventBus() {
|
|
485
|
+
return requireActiveApplicationContext().container.resolve(CORE_EVENT_BUS_TOKEN);
|
|
486
|
+
}
|
|
483
487
|
function resolveApplicationAuth() {
|
|
484
488
|
return requireActiveApplicationContext().container.resolve(CORE_AUTH_TOKEN);
|
|
485
489
|
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
// ../../src/bootstrap/routeRegistry.ts
|
|
3
|
+
class RouteRegistry {
|
|
4
|
+
routes = [];
|
|
5
|
+
register(route) {
|
|
6
|
+
this.routes.push(route);
|
|
7
|
+
}
|
|
8
|
+
clear() {
|
|
9
|
+
this.routes.length = 0;
|
|
10
|
+
}
|
|
11
|
+
list() {
|
|
12
|
+
return [...this.routes].sort((left, right) => left.path.localeCompare(right.path));
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
var ROUTE_REGISTRY_KEY = Symbol.for("@getstrata/routeRegistry");
|
|
16
|
+
function readSharedRouteRegistry() {
|
|
17
|
+
const globalRegistry = globalThis[ROUTE_REGISTRY_KEY];
|
|
18
|
+
if (globalRegistry) {
|
|
19
|
+
return globalRegistry;
|
|
20
|
+
}
|
|
21
|
+
const registry = new RouteRegistry;
|
|
22
|
+
globalThis[ROUTE_REGISTRY_KEY] = registry;
|
|
23
|
+
return registry;
|
|
24
|
+
}
|
|
25
|
+
var routeRegistry = readSharedRouteRegistry();
|
|
26
|
+
export {
|
|
27
|
+
routeRegistry,
|
|
28
|
+
RouteRegistry
|
|
29
|
+
};
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
// ../../src/config/app.ts
|
|
3
|
+
var appConfig = {
|
|
4
|
+
name: "WorkHub",
|
|
5
|
+
env: process.env.APP_ENV ?? "local",
|
|
6
|
+
debug: (process.env.APP_DEBUG ?? "true") !== "false",
|
|
7
|
+
url: process.env.APP_URL ?? "http://localhost:3000",
|
|
8
|
+
apiPrefix: process.env.API_PREFIX ?? "/api/v1"
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
// ../../src/config/features.ts
|
|
12
|
+
function readFeatureFlags() {
|
|
13
|
+
return {
|
|
14
|
+
webhooks: (process.env.FEATURE_WEBHOOKS ?? "true") !== "false",
|
|
15
|
+
fullTextSearch: (process.env.FEATURE_SEARCH ?? "true") !== "false",
|
|
16
|
+
auditLog: (process.env.FEATURE_AUDIT_LOG ?? "true") !== "false",
|
|
17
|
+
oauthLogin: (process.env.FEATURE_OAUTH ?? "true") !== "false",
|
|
18
|
+
samlLogin: (process.env.FEATURE_SAML ?? "false") === "true",
|
|
19
|
+
scim: (process.env.FEATURE_SCIM ?? "true") !== "false",
|
|
20
|
+
billing: (process.env.FEATURE_BILLING ?? "true") !== "false",
|
|
21
|
+
siemExport: (process.env.FEATURE_SIEM_EXPORT ?? "true") !== "false",
|
|
22
|
+
publicReads: (process.env.FEATURE_PUBLIC_READS ?? "true") !== "false",
|
|
23
|
+
emailVerification: (process.env.FEATURE_EMAIL_VERIFICATION ?? "false") === "true",
|
|
24
|
+
mfa: (process.env.FEATURE_MFA ?? "false") === "true"
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
var featureFlags = readFeatureFlags();
|
|
28
|
+
function isFeatureEnabled(feature) {
|
|
29
|
+
return readFeatureFlags()[feature];
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
// ../../src/domain/auth.ts
|
|
33
|
+
var TEST_ADMIN_API_TOKEN = "workhub-admin-test-token";
|
|
34
|
+
var TEST_MEMBER_API_TOKEN = "workhub-member-test-token";
|
|
35
|
+
|
|
36
|
+
// ../../src/domain/scim.ts
|
|
37
|
+
var TEST_SCIM_BEARER_TOKEN = "workhub-scim-test-token";
|
|
38
|
+
var DEFAULT_SCIM_BEARER_TOKEN = TEST_SCIM_BEARER_TOKEN;
|
|
39
|
+
|
|
40
|
+
// ../../src/bootstrap/secretsGuard.ts
|
|
41
|
+
var DEFAULT_TOKENS = new Set([TEST_ADMIN_API_TOKEN, TEST_MEMBER_API_TOKEN]);
|
|
42
|
+
var DEFAULT_SCIM_TOKENS = new Set([TEST_SCIM_BEARER_TOKEN, DEFAULT_SCIM_BEARER_TOKEN]);
|
|
43
|
+
function assertProductionSecrets(env = process.env) {
|
|
44
|
+
const appEnv = env.APP_ENV ?? appConfig.env;
|
|
45
|
+
if (appEnv !== "production") {
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
const adminToken = env.ADMIN_API_TOKEN ?? TEST_ADMIN_API_TOKEN;
|
|
49
|
+
const memberToken = env.MEMBER_API_TOKEN ?? TEST_MEMBER_API_TOKEN;
|
|
50
|
+
const scimToken = env.SCIM_BEARER_TOKEN ?? DEFAULT_SCIM_BEARER_TOKEN;
|
|
51
|
+
const encryptionEnabled = env.FEATURE_FIELD_ENCRYPTION !== "false";
|
|
52
|
+
const devHeadersEnabled = (env.AUTH_DEV_HEADERS ?? "true") !== "false";
|
|
53
|
+
if (devHeadersEnabled) {
|
|
54
|
+
throw new Error("Production startup blocked: set AUTH_DEV_HEADERS=false to disable development auth headers.");
|
|
55
|
+
}
|
|
56
|
+
if (DEFAULT_TOKENS.has(adminToken) || DEFAULT_TOKENS.has(memberToken)) {
|
|
57
|
+
throw new Error("Production startup blocked: rotate ADMIN_API_TOKEN and MEMBER_API_TOKEN away from default WorkHub test values.");
|
|
58
|
+
}
|
|
59
|
+
if (DEFAULT_SCIM_TOKENS.has(scimToken)) {
|
|
60
|
+
throw new Error("Production startup blocked: rotate SCIM_BEARER_TOKEN away from default WorkHub test values.");
|
|
61
|
+
}
|
|
62
|
+
if (encryptionEnabled && !env.KMS_ENCRYPTION_KEY?.trim()) {
|
|
63
|
+
throw new Error("Production startup blocked: set KMS_ENCRYPTION_KEY when field encryption is enabled.");
|
|
64
|
+
}
|
|
65
|
+
if (!env.SIEM_EXPORT_URL?.trim() && isFeatureEnabled("siemExport")) {
|
|
66
|
+
console.warn("[secrets] SIEM_EXPORT_URL is not configured; audit logs remain database-only.");
|
|
67
|
+
}
|
|
68
|
+
const billingEnabled = (env.FEATURE_BILLING ?? "true") !== "false";
|
|
69
|
+
if (billingEnabled && !env.STRIPE_WEBHOOK_SECRET?.trim()) {
|
|
70
|
+
throw new Error("Production startup blocked: set STRIPE_WEBHOOK_SECRET when billing webhooks are enabled.");
|
|
71
|
+
}
|
|
72
|
+
const corsOrigins = (env.CORS_ALLOWED_ORIGINS ?? "*").split(",").map((origin) => origin.trim());
|
|
73
|
+
if (corsOrigins.includes("*")) {
|
|
74
|
+
throw new Error("Production startup blocked: set explicit CORS_ALLOWED_ORIGINS instead of wildcard.");
|
|
75
|
+
}
|
|
76
|
+
if ((env.FEATURE_PUBLIC_READS ?? "true") !== "false") {
|
|
77
|
+
throw new Error("Production startup blocked: set FEATURE_PUBLIC_READS=false for authenticated-only reads.");
|
|
78
|
+
}
|
|
79
|
+
if (!env.OAUTH_STATE_SECRET?.trim()) {
|
|
80
|
+
throw new Error("Production startup blocked: set OAUTH_STATE_SECRET for OAuth CSRF protection.");
|
|
81
|
+
}
|
|
82
|
+
if (!env.TOKEN_HASH_PEPPER?.trim()) {
|
|
83
|
+
throw new Error("Production startup blocked: set TOKEN_HASH_PEPPER for API token hashing.");
|
|
84
|
+
}
|
|
85
|
+
if (!env.API_TOKEN_DEFAULT_EXPIRY_DAYS?.trim()) {
|
|
86
|
+
throw new Error("Production startup blocked: set API_TOKEN_DEFAULT_EXPIRY_DAYS to enforce token rotation.");
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
export {
|
|
90
|
+
assertProductionSecrets
|
|
91
|
+
};
|
|
@@ -93,6 +93,7 @@ function resolveService(dependencies, token) {
|
|
|
93
93
|
var CORE_CONFIG_TOKEN = "core.config";
|
|
94
94
|
var CORE_CACHE_TOKEN = "core.cache";
|
|
95
95
|
var CORE_QUEUE_TOKEN = "core.queue";
|
|
96
|
+
var CORE_EVENT_BUS_TOKEN = "core.eventBus";
|
|
96
97
|
var CORE_POLICY_GATE_TOKEN = "core.policyGate";
|
|
97
98
|
var CORE_AUTH_TOKEN = "core.auth";
|
|
98
99
|
var CORE_TOKEN_SERVICE_TOKEN = "core.tokenService";
|
|
@@ -163,6 +164,9 @@ function resolveApplicationCache() {
|
|
|
163
164
|
function resolveApplicationQueue() {
|
|
164
165
|
return requireActiveApplicationContext().container.resolve(CORE_QUEUE_TOKEN);
|
|
165
166
|
}
|
|
167
|
+
function resolveApplicationEventBus() {
|
|
168
|
+
return requireActiveApplicationContext().container.resolve(CORE_EVENT_BUS_TOKEN);
|
|
169
|
+
}
|
|
166
170
|
function resolveApplicationAuth() {
|
|
167
171
|
return requireActiveApplicationContext().container.resolve(CORE_AUTH_TOKEN);
|
|
168
172
|
}
|
|
@@ -95,7 +95,7 @@ export { AsyncQueue, createQueue, Job, SyncQueue } from "../core/queue/index.ts"
|
|
|
95
95
|
export { createFailedJobService, createProductionQueue, createQueueWorker, createTrackedJob, FailedJobRepository, FailedJobService, jobRegistry, QueueWorker, RedisQueue, ResilientQueue, runQueueJob, } from "../core/queue/publicQueue.ts";
|
|
96
96
|
export type { QueueMetricsSnapshot } from "../core/queue/queueMetrics.ts";
|
|
97
97
|
export { collectQueueMetrics } from "../core/queue/queueMetrics.ts";
|
|
98
|
-
export { resolveApplicationAuth, resolveApplicationCache, resolveApplicationConfig, resolveApplicationDependencies, resolveApplicationLogger, resolveApplicationPolicyGate, resolveApplicationQueue, setActiveApplicationContext, } from "../core/runtime/applicationRegistry.ts";
|
|
98
|
+
export { resolveApplicationAuth, resolveApplicationCache, resolveApplicationConfig, resolveApplicationDependencies, resolveApplicationEventBus, resolveApplicationLogger, resolveApplicationPolicyGate, resolveApplicationQueue, setActiveApplicationContext, } from "../core/runtime/applicationRegistry.ts";
|
|
99
99
|
export type { ScheduledTask } from "../core/scheduler/schedule.ts";
|
|
100
100
|
export { appSchedule, runDueScheduledTasks, Schedule } from "../core/scheduler/schedule.ts";
|
|
101
101
|
export { guestCanViewResource, isPublicReadsEnabled } from "../core/security/publicReads.ts";
|
package/dist/index.js
CHANGED
|
@@ -529,6 +529,7 @@ function resolveService(dependencies, token) {
|
|
|
529
529
|
var CORE_CONFIG_TOKEN = "core.config";
|
|
530
530
|
var CORE_CACHE_TOKEN = "core.cache";
|
|
531
531
|
var CORE_QUEUE_TOKEN = "core.queue";
|
|
532
|
+
var CORE_EVENT_BUS_TOKEN = "core.eventBus";
|
|
532
533
|
var CORE_POLICY_GATE_TOKEN = "core.policyGate";
|
|
533
534
|
var CORE_AUTH_TOKEN = "core.auth";
|
|
534
535
|
var CORE_TOKEN_SERVICE_TOKEN = "core.tokenService";
|
|
@@ -563,6 +564,9 @@ function resolveApplicationCache() {
|
|
|
563
564
|
function resolveApplicationQueue() {
|
|
564
565
|
return requireActiveApplicationContext().container.resolve(CORE_QUEUE_TOKEN);
|
|
565
566
|
}
|
|
567
|
+
function resolveApplicationEventBus() {
|
|
568
|
+
return requireActiveApplicationContext().container.resolve(CORE_EVENT_BUS_TOKEN);
|
|
569
|
+
}
|
|
566
570
|
function resolveApplicationAuth() {
|
|
567
571
|
return requireActiveApplicationContext().container.resolve(CORE_AUTH_TOKEN);
|
|
568
572
|
}
|
|
@@ -1790,7 +1794,6 @@ function modelEventName(tableName, action) {
|
|
|
1790
1794
|
}
|
|
1791
1795
|
|
|
1792
1796
|
// ../../src/bootstrap/providers/events.ts
|
|
1793
|
-
var CORE_EVENT_BUS_TOKEN = "core.eventBus";
|
|
1794
1797
|
var eventsProvider = {
|
|
1795
1798
|
name: "core.events",
|
|
1796
1799
|
register({ container }) {
|
|
@@ -4677,7 +4680,17 @@ class RouteRegistry {
|
|
|
4677
4680
|
return [...this.routes].sort((left, right) => left.path.localeCompare(right.path));
|
|
4678
4681
|
}
|
|
4679
4682
|
}
|
|
4680
|
-
var
|
|
4683
|
+
var ROUTE_REGISTRY_KEY = Symbol.for("@getstrata/routeRegistry");
|
|
4684
|
+
function readSharedRouteRegistry() {
|
|
4685
|
+
const globalRegistry = globalThis[ROUTE_REGISTRY_KEY];
|
|
4686
|
+
if (globalRegistry) {
|
|
4687
|
+
return globalRegistry;
|
|
4688
|
+
}
|
|
4689
|
+
const registry = new RouteRegistry;
|
|
4690
|
+
globalThis[ROUTE_REGISTRY_KEY] = registry;
|
|
4691
|
+
return registry;
|
|
4692
|
+
}
|
|
4693
|
+
var routeRegistry = readSharedRouteRegistry();
|
|
4681
4694
|
|
|
4682
4695
|
// ../../src/bootstrap/createWebRoutes.ts
|
|
4683
4696
|
function registerRoute(method, path, middleware) {
|
|
@@ -4739,6 +4752,10 @@ function mergeWebRoutes(dependencies, routes) {
|
|
|
4739
4752
|
...routes
|
|
4740
4753
|
};
|
|
4741
4754
|
}
|
|
4755
|
+
// ../../src/bootstrap/dependencies.ts
|
|
4756
|
+
function createAppDependencies() {
|
|
4757
|
+
return createAppContext().dependencies;
|
|
4758
|
+
}
|
|
4742
4759
|
// ../../src/core/crypto/nonCryptographicHash.ts
|
|
4743
4760
|
function nonCryptographicDigest(input) {
|
|
4744
4761
|
return Bun.hash(input).toString(16);
|
|
@@ -5270,12 +5287,14 @@ export {
|
|
|
5270
5287
|
scheduleRunCommand,
|
|
5271
5288
|
runProviderPhase,
|
|
5272
5289
|
runDueScheduledTasks,
|
|
5290
|
+
routeRegistry,
|
|
5273
5291
|
routeParams,
|
|
5274
5292
|
resolveService,
|
|
5275
5293
|
resolveMembershipService,
|
|
5276
5294
|
resolveApplicationQueue,
|
|
5277
5295
|
resolveApplicationPolicyGate,
|
|
5278
5296
|
resolveApplicationLogger,
|
|
5297
|
+
resolveApplicationEventBus,
|
|
5279
5298
|
resolveApplicationDependencies,
|
|
5280
5299
|
resolveApplicationConfig,
|
|
5281
5300
|
resolveApplicationCache,
|
|
@@ -5291,14 +5310,17 @@ export {
|
|
|
5291
5310
|
createRouteKernel,
|
|
5292
5311
|
createHttpKernel,
|
|
5293
5312
|
createCsrfProtection,
|
|
5313
|
+
createAppDependencies,
|
|
5294
5314
|
createAppContext,
|
|
5295
5315
|
coreProviders,
|
|
5296
5316
|
collectProviders,
|
|
5297
5317
|
cacheTagsForModelWrite,
|
|
5318
|
+
assertProductionSecrets,
|
|
5298
5319
|
assertAppDependenciesComplete,
|
|
5299
5320
|
appSchedule,
|
|
5300
5321
|
ServiceContainer,
|
|
5301
5322
|
Schedule,
|
|
5323
|
+
RouteRegistry,
|
|
5302
5324
|
REDIS_URL_CONFIG_KEY,
|
|
5303
5325
|
DEFAULT_APP_PORT,
|
|
5304
5326
|
DATABASE_URL_CONFIG_KEY,
|
|
@@ -5306,6 +5328,7 @@ export {
|
|
|
5306
5328
|
CORE_TOKEN_SERVICE_TOKEN,
|
|
5307
5329
|
CORE_QUEUE_TOKEN,
|
|
5308
5330
|
CORE_POLICY_GATE_TOKEN,
|
|
5331
|
+
CORE_EVENT_BUS_TOKEN,
|
|
5309
5332
|
CORE_CONFIG_TOKEN,
|
|
5310
5333
|
CORE_CACHE_TOKEN,
|
|
5311
5334
|
CORE_AUTH_TOKEN,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AppDependencies } from "@getstrata/
|
|
1
|
+
import type { AppDependencies } from "@getstrata/core/contracts/di";
|
|
2
2
|
import OrganizationMemberRepository from "../organization/memberRepository";
|
|
3
3
|
import OrganizationRepository from "../organization/repository";
|
|
4
4
|
import type UserRepository from "../user/repository";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ServiceProvider } from "@getstrata/
|
|
1
|
+
import type { ServiceProvider } from "@getstrata/core/contracts/di";
|
|
2
2
|
declare const userRepositoryToken = "user.repository";
|
|
3
3
|
declare const apiTokenRepositoryToken = "user.apiTokenRepository";
|
|
4
4
|
declare const tokenServiceToken = "core.tokenService";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@getstrata/bootstrap",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.21",
|
|
4
4
|
"description": "Strata application bootstrap — HttpKernel, DI, web session helpers",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -45,6 +45,11 @@
|
|
|
45
45
|
"import": "./dist/entries/createWebRoutes.js",
|
|
46
46
|
"default": "./dist/entries/createWebRoutes.js"
|
|
47
47
|
},
|
|
48
|
+
"./dependencies": {
|
|
49
|
+
"types": "./dist/bootstrap/dependencies.d.ts",
|
|
50
|
+
"import": "./dist/entries/dependencies.js",
|
|
51
|
+
"default": "./dist/entries/dependencies.js"
|
|
52
|
+
},
|
|
48
53
|
"./http/securedRouteModelBinding": {
|
|
49
54
|
"types": "./dist/bootstrap/http/securedRouteModelBinding.d.ts",
|
|
50
55
|
"import": "./dist/entries/http/securedRouteModelBinding.js",
|
|
@@ -75,6 +80,16 @@
|
|
|
75
80
|
"import": "./dist/entries/providers/view.js",
|
|
76
81
|
"default": "./dist/entries/providers/view.js"
|
|
77
82
|
},
|
|
83
|
+
"./routeRegistry": {
|
|
84
|
+
"types": "./dist/bootstrap/routeRegistry.d.ts",
|
|
85
|
+
"import": "./dist/entries/routeRegistry.js",
|
|
86
|
+
"default": "./dist/entries/routeRegistry.js"
|
|
87
|
+
},
|
|
88
|
+
"./secretsGuard": {
|
|
89
|
+
"types": "./dist/bootstrap/secretsGuard.d.ts",
|
|
90
|
+
"import": "./dist/entries/secretsGuard.js",
|
|
91
|
+
"default": "./dist/entries/secretsGuard.js"
|
|
92
|
+
},
|
|
78
93
|
"./web/forms": {
|
|
79
94
|
"types": "./dist/bootstrap/web/forms.d.ts",
|
|
80
95
|
"import": "./dist/entries/web/forms.js",
|
|
@@ -112,14 +127,14 @@
|
|
|
112
127
|
"build:bundle": "bun build index.ts --outdir dist --target bun --external bun --external eta --external @getstrata/core",
|
|
113
128
|
"build:types": "tsc -p tsconfig.types.json",
|
|
114
129
|
"prepublishOnly": "bun run build",
|
|
115
|
-
"build:subpaths": "bun build entries/applicationRegistry.ts entries/cache/modelCacheTags.ts entries/config.ts entries/context.ts entries/contracts.ts entries/createWebRoutes.ts entries/http/securedRouteModelBinding.ts entries/httpKernel.ts entries/membershipService.ts entries/queue/defaultJobs.ts entries/providers.ts entries/providers/view.ts entries/web/forms.ts entries/web/routing.ts entries/web/server.ts entries/web/session.ts entries/web/slug.ts --outdir dist --root . --target bun --external bun --external eta --external @getstrata/core",
|
|
130
|
+
"build:subpaths": "bun build entries/applicationRegistry.ts entries/cache/modelCacheTags.ts entries/config.ts entries/context.ts entries/contracts.ts entries/createWebRoutes.ts entries/dependencies.ts entries/http/securedRouteModelBinding.ts entries/httpKernel.ts entries/membershipService.ts entries/queue/defaultJobs.ts entries/providers.ts entries/providers/view.ts entries/routeRegistry.ts entries/secretsGuard.ts entries/web/forms.ts entries/web/routing.ts entries/web/server.ts entries/web/session.ts entries/web/slug.ts --outdir dist --root . --target bun --external bun --external eta --external @getstrata/core",
|
|
116
131
|
"build:shims": "true"
|
|
117
132
|
},
|
|
118
133
|
"publishConfig": {
|
|
119
134
|
"access": "public"
|
|
120
135
|
},
|
|
121
136
|
"peerDependencies": {
|
|
122
|
-
"@getstrata/core": "^0.5.
|
|
137
|
+
"@getstrata/core": "^0.5.29",
|
|
123
138
|
"typescript": "^5.9.0"
|
|
124
139
|
}
|
|
125
140
|
}
|