@getstrata/bootstrap 2.2.60 → 3.0.5

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.
Files changed (90) hide show
  1. package/CHANGELOG.md +35 -0
  2. package/dist/bootstrap/app.d.ts +18 -7
  3. package/dist/bootstrap/buildModuleRoutes.d.ts +3 -5
  4. package/dist/bootstrap/buildWebModuleRoutes.d.ts +2 -3
  5. package/dist/bootstrap/cache/modelCacheTags.d.ts +3 -2
  6. package/dist/bootstrap/cachedJson.d.ts +7 -2
  7. package/dist/bootstrap/config.d.ts +1 -1
  8. package/dist/bootstrap/context.d.ts +25 -7
  9. package/dist/bootstrap/contracts.d.ts +1 -0
  10. package/dist/bootstrap/createWebRoutes.d.ts +2 -1
  11. package/dist/bootstrap/databaseReadiness.d.ts +3 -0
  12. package/dist/bootstrap/dependencies.d.ts +3 -2
  13. package/dist/bootstrap/discoverJobs.d.ts +3 -2
  14. package/dist/bootstrap/discoverListeners.d.ts +10 -7
  15. package/dist/bootstrap/discoverModels.d.ts +3 -2
  16. package/dist/bootstrap/discoverModules.d.ts +7 -6
  17. package/dist/bootstrap/health.d.ts +3 -2
  18. package/dist/bootstrap/http/securedRouteModelBinding.d.ts +1 -1
  19. package/dist/bootstrap/httpKernel.d.ts +43 -22
  20. package/dist/bootstrap/httpPersistence.d.ts +4 -0
  21. package/dist/bootstrap/inProcessCron.d.ts +5 -5
  22. package/dist/bootstrap/listeners/invalidateCacheOnModelWrite.d.ts +13 -12
  23. package/dist/bootstrap/metricsRoutes.d.ts +6 -1
  24. package/dist/bootstrap/moduleRouteMiddleware.d.ts +4 -4
  25. package/dist/bootstrap/modules.d.ts +1 -1
  26. package/dist/bootstrap/ownedHttpRoute.d.ts +23 -0
  27. package/dist/bootstrap/persistenceContracts.d.ts +70 -0
  28. package/dist/bootstrap/persistenceInvocation.d.ts +4 -0
  29. package/dist/bootstrap/providers/auth.d.ts +21 -0
  30. package/dist/bootstrap/providers/cache.d.ts +9 -3
  31. package/dist/bootstrap/providers/cacheProvider.d.ts +3 -0
  32. package/dist/bootstrap/providers/config.d.ts +6 -3
  33. package/dist/bootstrap/providers/events.d.ts +5 -2
  34. package/dist/bootstrap/providers/index.d.ts +3 -2
  35. package/dist/bootstrap/providers/listeners.d.ts +3 -3
  36. package/dist/bootstrap/providers/mail.d.ts +15 -0
  37. package/dist/bootstrap/providers/queue.d.ts +3 -2
  38. package/dist/bootstrap/providers/storage.d.ts +11 -2
  39. package/dist/bootstrap/providers/tracing.d.ts +4 -2
  40. package/dist/bootstrap/providers/view.d.ts +8 -5
  41. package/dist/bootstrap/public-api.d.ts +10 -7
  42. package/dist/bootstrap/queue/defaultJobs.d.ts +4 -2
  43. package/dist/bootstrap/rateLimit.d.ts +13 -3
  44. package/dist/bootstrap/routeCompiler.d.ts +20 -0
  45. package/dist/bootstrap/routeMetadata.d.ts +3 -3
  46. package/dist/bootstrap/routePlan.d.ts +11 -0
  47. package/dist/bootstrap/schedule.d.ts +11 -2
  48. package/dist/bootstrap/secretsGuard.d.ts +2 -3
  49. package/dist/bootstrap/web/routing.d.ts +6 -3
  50. package/dist/bootstrap/web/server.d.ts +14 -4
  51. package/dist/bootstrap/web/session.d.ts +23 -16
  52. package/dist/entries/buildModuleRoutes.js +602 -384
  53. package/dist/entries/buildWebModuleRoutes.js +596 -347
  54. package/dist/entries/cache/modelCacheTags.js +8 -186
  55. package/dist/entries/cachedJson.js +22 -0
  56. package/dist/entries/config.js +1 -3
  57. package/dist/entries/context.js +665 -700
  58. package/dist/entries/createSpaRoutes.js +194 -5
  59. package/dist/entries/createWebRoutes.js +618 -367
  60. package/dist/entries/databaseReadiness.js +267 -0
  61. package/dist/entries/dependencies.js +666 -701
  62. package/dist/entries/discoverJobs.js +18 -16
  63. package/dist/entries/discoverListeners.js +27 -38
  64. package/dist/entries/discoverModels.js +4 -3
  65. package/dist/entries/discoverModules.js +29 -67
  66. package/dist/entries/health.js +14 -34
  67. package/dist/entries/httpKernel.js +405 -89
  68. package/dist/entries/listeners/invalidateCacheOnModelWrite.js +43 -289
  69. package/dist/entries/metricsRoutes.js +9 -5
  70. package/dist/entries/persistenceContracts.js +1 -0
  71. package/dist/entries/persistenceInvocation.js +17 -0
  72. package/dist/entries/providers/auth.js +114 -0
  73. package/dist/entries/providers/cache.js +35 -0
  74. package/dist/entries/providers/events.js +55 -0
  75. package/dist/entries/providers/view.js +34 -44
  76. package/dist/entries/providers.js +392 -561
  77. package/dist/entries/queue/defaultJobs.js +9 -6
  78. package/dist/entries/routePlan.js +200 -0
  79. package/dist/entries/schedule.js +37 -37
  80. package/dist/entries/secretsGuard.js +10 -13
  81. package/dist/entries/web/routing.js +412 -96
  82. package/dist/entries/web/server.js +461 -29
  83. package/dist/entries/web/session.js +61 -73
  84. package/dist/index.js +1520 -1085
  85. package/dist/internal/ownedHttpRoute.js +66 -0
  86. package/package.json +52 -15
  87. package/dist/bootstrap/applicationRegistry.d.ts +0 -1
  88. package/dist/bootstrap/routeRegistry.d.ts +0 -10
  89. package/dist/entries/applicationRegistry.js +0 -24
  90. package/dist/entries/routeRegistry.js +0 -29
@@ -2,7 +2,6 @@
2
2
  // ../../src/bootstrap/discoverJobs.ts
3
3
  import { join as join2, resolve } from "path";
4
4
  import { Job } from "@getstrata/core/queue";
5
- import { jobRegistry } from "@getstrata/core/queue/jobRegistry";
6
5
 
7
6
  // ../../src/bootstrap/infrastructureDiscovery.ts
8
7
  import { readdir } from "fs/promises";
@@ -54,17 +53,20 @@ async function importInfrastructure(file) {
54
53
  }
55
54
 
56
55
  // ../../src/bootstrap/discoverJobs.ts
57
- var KEY = Symbol.for("@getstrata/discoverJobsState");
58
- function state() {
59
- const globals = globalThis;
60
- globals[KEY] ??= { loads: new Map, registered: new Map };
61
- return globals[KEY];
56
+ var states = new WeakMap;
57
+ function state(registry) {
58
+ let value = states.get(registry);
59
+ if (!value) {
60
+ value = { loads: new Map, registered: new Map };
61
+ states.set(registry, value);
62
+ }
63
+ return value;
62
64
  }
63
65
  function validateClass(value, location) {
64
66
  if (typeof value !== "function" || typeof value.jobName !== "string" || !value.jobName.trim() || !(value.prototype instanceof Job) && typeof value.prototype?.handle !== "function")
65
67
  throw new TypeError(`Invalid job at ${location}: expected a class with nonempty static jobName and handle().`);
66
68
  }
67
- async function load(options, current) {
69
+ async function load(registry, options, current) {
68
70
  const jobs = new Map;
69
71
  const add = (name, identity, create, location) => {
70
72
  const previous = jobs.get(name);
@@ -109,23 +111,23 @@ async function load(options, current) {
109
111
  }
110
112
  if (!current())
111
113
  return [...jobs.keys()];
112
- const registered = state().registered;
114
+ const registered = state(registry).registered;
113
115
  for (const [name, entry] of jobs) {
114
116
  const previous = registered.get(name);
115
117
  if (previous && previous.identity !== entry.identity)
116
118
  throw new Error(`Duplicate discovered job "${name}" at ${entry.location}; first declared at ${previous.location}.`);
117
119
  }
118
- const existing = new Set(jobRegistry.names());
120
+ const existing = new Set(registry.names());
119
121
  for (const [name, entry] of jobs) {
120
122
  if (!existing.has(name)) {
121
- jobRegistry.register(name, entry.create);
123
+ registry.register(name, entry.create);
122
124
  registered.set(name, entry);
123
125
  }
124
126
  }
125
127
  return [...jobs.keys()];
126
128
  }
127
- function discoverJobs(options = {}) {
128
- const cache = state().loads;
129
+ function discoverJobs(registry, options = {}) {
130
+ const cache = state(registry).loads;
129
131
  const key = options.manifest ?? JSON.stringify([
130
132
  resolve(options.directory ?? join2(process.cwd(), "src", "jobs")),
131
133
  [...options.exclude ?? []].sort()
@@ -133,7 +135,7 @@ function discoverJobs(options = {}) {
133
135
  const existing = cache.get(key);
134
136
  if (existing)
135
137
  return existing;
136
- const pending = load(options, () => state().loads === cache).catch((error) => {
138
+ const pending = load(registry, options, () => state(registry).loads === cache).catch((error) => {
137
139
  if (cache.get(key) === pending)
138
140
  cache.delete(key);
139
141
  throw error;
@@ -141,9 +143,9 @@ function discoverJobs(options = {}) {
141
143
  cache.set(key, pending);
142
144
  return pending;
143
145
  }
144
- function resetDiscoverJobsForTests() {
145
- state().loads = new Map;
146
- state().registered = new Map;
146
+ function resetDiscoverJobsForTests(registry) {
147
+ state(registry).loads = new Map;
148
+ state(registry).registered = new Map;
147
149
  }
148
150
  export {
149
151
  discoverJobs,
@@ -1,6 +1,6 @@
1
1
  // @bun
2
2
  // ../../src/bootstrap/discoverListeners.ts
3
- import { join as join2, resolve } from "path";
3
+ import { join as join2 } from "path";
4
4
 
5
5
  // ../../src/bootstrap/infrastructureDiscovery.ts
6
6
  import { readdir } from "fs/promises";
@@ -52,51 +52,40 @@ async function importInfrastructure(file) {
52
52
  }
53
53
 
54
54
  // ../../src/bootstrap/discoverListeners.ts
55
- var KEY = Symbol.for("@getstrata/discoverListenersState");
56
- function state() {
57
- const globals = globalThis;
58
- globals[KEY] ??= { loads: new Map };
59
- return globals[KEY];
55
+ function snapshot(value, location) {
56
+ if (!value || typeof value !== "object")
57
+ throw new TypeError(`Invalid listener declarations at ${location}.`);
58
+ const fields = Object.getOwnPropertyDescriptors(value);
59
+ const services = fields.services?.value, effects = fields.repositoryEffects?.value;
60
+ if (!fields.services || !("value" in fields.services) || !Array.isArray(services) || !fields.repositoryEffects || !("value" in fields.repositoryEffects) || !Array.isArray(effects))
61
+ throw new TypeError(`Listener ${location} must export services and repositoryEffects declarations; registrar callbacks are no longer supported.`);
62
+ return Object.freeze({
63
+ services: Object.freeze([...services]),
64
+ repositoryEffects: Object.freeze([...effects])
65
+ });
60
66
  }
61
- async function load(options) {
62
- const listeners = new Set;
63
- const add = (value, location) => {
64
- if (typeof value !== "function")
65
- throw new TypeError(`Invalid listener registrar at ${location}: expected a default function.`);
66
- listeners.add(value);
67
+ async function discoverListeners(options = {}) {
68
+ const result = [];
69
+ const seen = new Set;
70
+ const add = (input, location) => {
71
+ const value = input && typeof input === "object" && Object.getOwnPropertyDescriptor(input, "default")?.value ? Object.getOwnPropertyDescriptor(input, "default")?.value : input;
72
+ if (value && typeof value === "object") {
73
+ if (seen.has(value))
74
+ return;
75
+ seen.add(value);
76
+ }
77
+ result.push(snapshot(value, location));
67
78
  };
68
79
  if (options.manifest)
69
80
  for (const [index, value] of options.manifest.entries())
70
- add(value, `listener manifest[${index}]`);
81
+ add(value, `manifest[${index}]`);
71
82
  else
72
83
  for (const file of await infrastructureFiles(options.directory ?? join2(process.cwd(), "src", "listeners"), options.exclude)) {
73
84
  const exports = await importInfrastructure(file);
74
- const value = exports.default;
75
- add(value && typeof value === "object" && "default" in value ? value.default : value, file);
85
+ add(exports.default, file);
76
86
  }
77
- return [...listeners];
78
- }
79
- function discoverListeners(options = {}) {
80
- const cache = state().loads;
81
- const key = options.manifest ?? JSON.stringify([
82
- resolve(options.directory ?? join2(process.cwd(), "src", "listeners")),
83
- [...options.exclude ?? []].sort()
84
- ]);
85
- const existing = cache.get(key);
86
- if (existing)
87
- return existing;
88
- const pending = load(options).catch((error) => {
89
- if (cache.get(key) === pending)
90
- cache.delete(key);
91
- throw error;
92
- });
93
- cache.set(key, pending);
94
- return pending;
95
- }
96
- function resetDiscoverListenersForTests() {
97
- state().loads = new Map;
87
+ return Object.freeze(result);
98
88
  }
99
89
  export {
100
- discoverListeners,
101
- resetDiscoverListenersForTests
90
+ discoverListeners
102
91
  };
@@ -3,7 +3,7 @@
3
3
  import { readdir } from "fs/promises";
4
4
  import { join } from "path";
5
5
  import { pathToFileURL } from "url";
6
- import { bootModels, Model } from "@getstrata/core/database/model";
6
+ import { assertDefinition } from "@getstrata/core/database/definitions";
7
7
  async function discoverModels(directory = join(process.cwd(), "src", "models"), options = {}) {
8
8
  const excluded = new Set([
9
9
  "register.ts",
@@ -23,15 +23,16 @@ async function discoverModels(directory = join(process.cwd(), "src", "models"),
23
23
  else if (!excluded.has(entry.name) && entry.isFile() && /\.(ts|js|mts|mjs)$/.test(entry.name) && !/\.d\.[cm]?ts$/.test(entry.name)) {
24
24
  const exports = await import(pathToFileURL(file).href);
25
25
  for (const value of Object.values(exports)) {
26
- if (typeof value === "function" && value.prototype instanceof Model)
26
+ if (value && typeof value === "object" && Object.getOwnPropertyDescriptor(value, "kind")?.value === "model") {
27
+ assertDefinition(value, "model");
27
28
  models.add(value);
29
+ }
28
30
  }
29
31
  }
30
32
  }
31
33
  }
32
34
  await visit(directory);
33
35
  const result = [...models];
34
- bootModels(result);
35
36
  return result;
36
37
  }
37
38
  export {
@@ -53,32 +53,6 @@ async function importInfrastructure(file) {
53
53
  }
54
54
 
55
55
  // ../../src/bootstrap/discoverModules.ts
56
- var KEY = Symbol.for("@getstrata/discoverModulesState");
57
- function state() {
58
- const globals = globalThis;
59
- globals[KEY] ??= { appModules: [] };
60
- return globals[KEY];
61
- }
62
- function configureModulesDirectory(modulesDir) {
63
- const current = state();
64
- const directory = resolve(modulesDir);
65
- if (current.configuredModulesDir !== directory || current.configuredManifest) {
66
- current.appModules.length = 0;
67
- current.modulesReady = undefined;
68
- current.source = undefined;
69
- }
70
- current.configuredManifest = undefined;
71
- current.configuredModulesDir = directory;
72
- }
73
- function configureModulesManifest(manifest) {
74
- const current = state();
75
- if (current.configuredManifest !== manifest) {
76
- current.appModules.length = 0;
77
- current.modulesReady = undefined;
78
- current.source = undefined;
79
- }
80
- current.configuredManifest = manifest;
81
- }
82
56
  function validateModule(value, location) {
83
57
  if (!value || typeof value !== "object" || Array.isArray(value))
84
58
  throw new TypeError(`Invalid application module at ${location}.`);
@@ -100,21 +74,21 @@ function validateModule(value, location) {
100
74
  }
101
75
  }
102
76
  async function load(options) {
103
- const manifest = options.manifest ?? (options.modulesDir === undefined ? state().configuredManifest : undefined);
77
+ const manifest = options.manifest;
104
78
  const entries = [];
105
79
  if (manifest)
106
80
  for (const [index, value] of manifest.entries())
107
81
  entries.push({ value, location: `module manifest[${index}]` });
108
82
  else {
109
- const directory = options.modulesDir ?? state().configuredModulesDir;
83
+ const directory = options.modulesDir;
110
84
  if (!directory)
111
- throw new Error("configureModulesDirectory() or configureModulesManifest() must be called before discovering modules.");
85
+ throw new Error("An explicit modulesDir or manifest is required to discover modules.");
112
86
  let folders;
113
87
  try {
114
88
  folders = await readdir2(directory, { withFileTypes: true });
115
89
  } catch (error) {
116
90
  if (error.code === "ENOENT")
117
- return [];
91
+ return Object.freeze([]);
118
92
  throw error;
119
93
  }
120
94
  const excluded = new Set(options.exclude ?? []);
@@ -139,46 +113,34 @@ async function load(options) {
139
113
  names.set(value.name, location);
140
114
  modules.push(value);
141
115
  }
142
- return modules.sort((left, right) => (left.order ?? 100) - (right.order ?? 100));
116
+ return Object.freeze(modules.sort((left, right) => (left.order ?? 100) - (right.order ?? 100)));
143
117
  }
144
- function ensureModulesLoaded(options = {}) {
145
- const current = state();
146
- const key = options.manifest ?? (options.modulesDir === undefined ? current.configuredManifest : undefined) ?? JSON.stringify([
147
- options.modulesDir ? resolve(options.modulesDir) : current.configuredModulesDir,
148
- [...options.exclude ?? []].sort()
149
- ]);
150
- if (current.modulesReady && current.source === key)
151
- return current.modulesReady;
152
- current.appModules.length = 0;
153
- current.source = key;
154
- const pending = load(options).then((modules) => {
155
- if (current.modulesReady !== pending)
156
- return modules;
157
- current.appModules.splice(0, current.appModules.length, ...modules);
158
- return current.appModules;
159
- }).catch((error) => {
160
- if (current.modulesReady === pending)
161
- current.modulesReady = undefined;
162
- throw error;
118
+ function createModuleDiscovery(options) {
119
+ const source = Object.freeze({
120
+ ...options,
121
+ modulesDir: options.modulesDir === undefined ? undefined : resolve(options.modulesDir),
122
+ manifest: options.manifest === undefined ? undefined : Object.freeze([...options.manifest]),
123
+ exclude: options.exclude === undefined ? undefined : Object.freeze([...options.exclude])
124
+ });
125
+ let pending;
126
+ return Object.freeze({
127
+ load() {
128
+ if (pending)
129
+ return pending;
130
+ const result = load(source).catch((error) => {
131
+ if (pending === result)
132
+ pending = undefined;
133
+ throw error;
134
+ });
135
+ pending = result;
136
+ return result;
137
+ }
163
138
  });
164
- current.modulesReady = pending;
165
- return pending;
166
- }
167
- function discoverModules() {
168
- return state().appModules;
169
139
  }
170
- function resetDiscoverModulesForTests() {
171
- const current = state();
172
- current.configuredModulesDir = undefined;
173
- current.configuredManifest = undefined;
174
- current.appModules.length = 0;
175
- current.modulesReady = undefined;
176
- current.source = undefined;
140
+ function ensureModulesLoaded(options) {
141
+ return createModuleDiscovery(options).load();
177
142
  }
178
143
  export {
179
- configureModulesDirectory,
180
- configureModulesManifest,
181
- discoverModules,
182
- ensureModulesLoaded,
183
- resetDiscoverModulesForTests
144
+ createModuleDiscovery,
145
+ ensureModulesLoaded
184
146
  };
@@ -1,7 +1,5 @@
1
1
  // @bun
2
2
  // ../../src/bootstrap/health.ts
3
- import { getBoundDatabaseConnection } from "@getstrata/core/database/boundConnection";
4
- import { getDefaultDatabasePool } from "@getstrata/core/database/defaultConnection";
5
3
  import { jsonResponse } from "@getstrata/core/http/response";
6
4
  import { envFlagEnabled } from "@getstrata/core/runtime/appEnv";
7
5
  var {RedisClient } = globalThis.Bun;
@@ -19,8 +17,7 @@ import {
19
17
  CORE_PUBLIC_TENANCY_TOKEN,
20
18
  CORE_QUEUE_TOKEN,
21
19
  CORE_TENANT_RESOLVER_TOKEN,
22
- CORE_THROTTLE_QUOTA_POLICY_TOKEN,
23
- CORE_TOKEN_SERVICE_TOKEN
20
+ CORE_THROTTLE_QUOTA_POLICY_TOKEN
24
21
  } from "@getstrata/core/contracts/serviceTokens";
25
22
  var APP_PORT_CONFIG_KEY = "app.port";
26
23
  var CACHE_TTL_MS_CONFIG_KEY = "cache.ttlMs";
@@ -46,35 +43,16 @@ function resolveRedisUrl(dependencies) {
46
43
  const redisUrl = config.get(REDIS_URL_CONFIG_KEY)?.trim();
47
44
  return redisUrl || undefined;
48
45
  }
49
- function resolveHealthDatabase() {
50
- const bound = getBoundDatabaseConnection();
51
- if (bound) {
52
- return bound;
53
- }
54
- try {
55
- return getDefaultDatabasePool();
56
- } catch {
57
- return null;
58
- }
59
- }
60
- async function pingDatabaseClient(connection) {
46
+ async function pingDatabase(invoke) {
61
47
  try {
62
- await connection.unsafe("SELECT 1");
63
- return true;
48
+ return await invoke({ kind: "request", actor: { kind: "system", policy: "http.health" } }, async ({ database }) => {
49
+ await database.execute({ text: "SELECT 1", params: [] });
50
+ return true;
51
+ });
64
52
  } catch {
65
53
  return false;
66
54
  }
67
55
  }
68
- async function checkDatabase() {
69
- const connection = resolveHealthDatabase();
70
- if (!connection) {
71
- return false;
72
- }
73
- return await pingDatabaseClient(connection);
74
- }
75
- async function pingDatabase() {
76
- return await checkDatabase();
77
- }
78
56
  async function checkRedis(redisUrl) {
79
57
  let client;
80
58
  try {
@@ -97,11 +75,10 @@ async function resolveExtraFields(extra) {
97
75
  }
98
76
  return typeof extra === "function" ? await extra() : extra;
99
77
  }
100
- async function collectDependencyChecks(dependencies) {
78
+ async function collectDependencyChecks(dependencies, redisUrl) {
101
79
  const checks = {
102
- database: await checkDatabase() ? "ok" : "error"
80
+ database: await pingDatabase(dependencies.invoke) ? "ok" : "error"
103
81
  };
104
- const redisUrl = resolveRedisUrl(dependencies);
105
82
  if (redisUrl) {
106
83
  checks.redis = await checkRedis(redisUrl) ? "ok" : "error";
107
84
  } else {
@@ -111,6 +88,9 @@ async function collectDependencyChecks(dependencies) {
111
88
  return { checks, ready };
112
89
  }
113
90
  function createHealthRoutes(dependencies, options = {}) {
91
+ const redisUrl = resolveRedisUrl(dependencies);
92
+ const config = dependencies.container.has(CORE_CONFIG_TOKEN) ? dependencies.container.resolve(CORE_CONFIG_TOKEN) : undefined;
93
+ const debug = config ? config.get("app.debug") === true : envFlagEnabled(process.env.APP_DEBUG);
114
94
  return {
115
95
  "/health": async (request) => {
116
96
  if (request && request.method !== "GET" && request.method !== "HEAD") {
@@ -123,7 +103,7 @@ function createHealthRoutes(dependencies, options = {}) {
123
103
  headers: { ...headers, "content-type": "text/plain; charset=utf-8" }
124
104
  }) : jsonResponse({ status: "ok", ...extra }, { headers });
125
105
  }
126
- const { checks, ready: dependenciesReady } = await collectDependencyChecks(dependencies);
106
+ const { checks, ready: dependenciesReady } = await collectDependencyChecks(dependencies, redisUrl);
127
107
  let schemaReady = true;
128
108
  if (options.schemaCheck) {
129
109
  try {
@@ -149,8 +129,7 @@ function createHealthRoutes(dependencies, options = {}) {
149
129
  },
150
130
  "/ready": async () => {
151
131
  const extra = await resolveExtraFields(options.extra);
152
- const { checks, ready } = await collectDependencyChecks(dependencies);
153
- const debug = envFlagEnabled(process.env.APP_DEBUG);
132
+ const { checks, ready } = await collectDependencyChecks(dependencies, redisUrl);
154
133
  return jsonResponse({
155
134
  status: ready ? "ready" : "not_ready",
156
135
  ...debug ? { checks, ...extra } : {}
@@ -158,6 +137,7 @@ function createHealthRoutes(dependencies, options = {}) {
158
137
  }
159
138
  };
160
139
  }
140
+ var checkDatabase = pingDatabase;
161
141
  export {
162
142
  checkDatabase,
163
143
  checkRedis,