express-file-cluster 0.10.2 → 0.12.0

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 (142) hide show
  1. package/dist/auth/index.cjs +8 -7
  2. package/dist/auth/index.cjs.map +1 -1
  3. package/dist/auth/index.d.cts +3 -1
  4. package/dist/auth/index.d.ts +3 -1
  5. package/dist/auth/index.js +7 -5
  6. package/dist/{chunk-BG4A7Z32.js → chunk-3JQWQF2M.js} +3 -3
  7. package/dist/{chunk-4GHK27JA.cjs → chunk-4FQP6QX3.cjs} +3 -3
  8. package/dist/{chunk-4GHK27JA.cjs.map → chunk-4FQP6QX3.cjs.map} +1 -1
  9. package/dist/chunk-546TNO2V.js +226 -0
  10. package/dist/chunk-546TNO2V.js.map +1 -0
  11. package/dist/{chunk-MUVO7MGS.js → chunk-74R37C4I.js} +48 -21
  12. package/dist/chunk-74R37C4I.js.map +1 -0
  13. package/dist/{chunk-H2PVWCWC.cjs → chunk-A2QGDWCG.cjs} +15 -8
  14. package/dist/chunk-A2QGDWCG.cjs.map +1 -0
  15. package/dist/{chunk-5LPRKZPB.js → chunk-BCSJOPYH.js} +2 -2
  16. package/dist/chunk-BJR42CN3.cjs +872 -0
  17. package/dist/chunk-BJR42CN3.cjs.map +1 -0
  18. package/dist/{chunk-C2FOZ7ME.js → chunk-EBJELA7T.js} +30 -25
  19. package/dist/chunk-EBJELA7T.js.map +1 -0
  20. package/dist/{chunk-Y4NKIXUL.cjs → chunk-H6MHRHUP.cjs} +104 -50
  21. package/dist/chunk-H6MHRHUP.cjs.map +1 -0
  22. package/dist/{chunk-7BC3AN7R.cjs → chunk-IG3V2IOK.cjs} +57 -30
  23. package/dist/chunk-IG3V2IOK.cjs.map +1 -0
  24. package/dist/chunk-JAPZYQVJ.cjs +143 -0
  25. package/dist/chunk-JAPZYQVJ.cjs.map +1 -0
  26. package/dist/{chunk-JP36TLL4.cjs → chunk-JHCXIYJH.cjs} +25 -47
  27. package/dist/chunk-JHCXIYJH.cjs.map +1 -0
  28. package/dist/{chunk-IUZ6A7PB.cjs → chunk-JVB5NLEM.cjs} +15 -13
  29. package/dist/chunk-JVB5NLEM.cjs.map +1 -0
  30. package/dist/chunk-LIAGVWFQ.js +872 -0
  31. package/dist/chunk-LIAGVWFQ.js.map +1 -0
  32. package/dist/chunk-PUM5ZDAH.js +140 -0
  33. package/dist/chunk-PUM5ZDAH.js.map +1 -0
  34. package/dist/{chunk-CGY7JU4Y.cjs → chunk-PUYBKDYD.cjs} +11 -2
  35. package/dist/chunk-PUYBKDYD.cjs.map +1 -0
  36. package/dist/{chunk-RETV3GKE.js → chunk-QLM3JEER.js} +5 -3
  37. package/dist/{chunk-RETV3GKE.js.map → chunk-QLM3JEER.js.map} +1 -1
  38. package/dist/{chunk-R2K7AFIB.cjs → chunk-SV4C4HWP.cjs} +89 -89
  39. package/dist/{chunk-R2K7AFIB.cjs.map → chunk-SV4C4HWP.cjs.map} +1 -1
  40. package/dist/{chunk-V73R76I4.js → chunk-UJ2ISRLP.js} +11 -33
  41. package/dist/chunk-UJ2ISRLP.js.map +1 -0
  42. package/dist/chunk-URKE3OXN.cjs +226 -0
  43. package/dist/chunk-URKE3OXN.cjs.map +1 -0
  44. package/dist/{chunk-TBIVIR6L.cjs → chunk-VLGN3XUM.cjs} +40 -35
  45. package/dist/chunk-VLGN3XUM.cjs.map +1 -0
  46. package/dist/{chunk-Y75V5FCU.js → chunk-X2B7WBKH.js} +88 -34
  47. package/dist/chunk-X2B7WBKH.js.map +1 -0
  48. package/dist/chunk-Y7I2633P.js +12 -0
  49. package/dist/chunk-Y7I2633P.js.map +1 -0
  50. package/dist/{chunk-B6MB6HEG.js → chunk-ZBQUYFI3.js} +14 -7
  51. package/dist/chunk-ZBQUYFI3.js.map +1 -0
  52. package/dist/cli/db-runner.cjs +26 -25
  53. package/dist/cli/db-runner.cjs.map +1 -1
  54. package/dist/cli/db-runner.js +5 -3
  55. package/dist/cli/db-runner.js.map +1 -1
  56. package/dist/cli/index.cjs +16 -15
  57. package/dist/cli/index.cjs.map +1 -1
  58. package/dist/cli/index.js +9 -7
  59. package/dist/cli/index.js.map +1 -1
  60. package/dist/docs/api-reference/auth.md +2 -0
  61. package/dist/docs/api-reference/ignite.md +6 -0
  62. package/dist/docs/api-reference/openapi.md +36 -0
  63. package/dist/docs/api-reference/tasks.md +5 -1
  64. package/dist/docs/api-reference/testing.md +4 -0
  65. package/dist/docs/api-reference/tracing.md +18 -0
  66. package/dist/docs/api-reference/websockets.md +23 -0
  67. package/dist/docs/cli/add.md +1 -1
  68. package/dist/docs/core-concepts/background-tasks.md +5 -1
  69. package/dist/docs/core-concepts/clustering.md +2 -0
  70. package/dist/docs/core-concepts/file-based-routing.md +4 -0
  71. package/dist/docs/core-concepts/middleware.md +2 -0
  72. package/dist/docs/guides/caching.md +12 -0
  73. package/dist/docs/guides/error-handling.md +2 -0
  74. package/dist/docs/guides/feature-matrix.md +16 -0
  75. package/dist/docs/guides/logging.md +2 -0
  76. package/dist/docs/guides/openapi.md +57 -0
  77. package/dist/docs/guides/tracing.md +64 -0
  78. package/dist/docs/guides/validation.md +2 -0
  79. package/dist/docs/guides/websockets.md +60 -0
  80. package/dist/docs/index.md +4 -1
  81. package/dist/docs/skills/SKILL.md +7 -3
  82. package/dist/docs/skills/api-surface.md +18 -0
  83. package/dist/docs/skills/auth-internals.md +4 -2
  84. package/dist/docs/skills/pre-flight.md +6 -0
  85. package/dist/docs/skills/routing-rules.md +6 -0
  86. package/dist/docs/skills/tasks-internals.md +10 -2
  87. package/dist/docs/skills/what-not-to-invent.md +4 -0
  88. package/dist/index.cjs +185 -70
  89. package/dist/index.cjs.map +1 -1
  90. package/dist/index.d.cts +6 -14
  91. package/dist/index.d.ts +6 -14
  92. package/dist/index.js +143 -28
  93. package/dist/index.js.map +1 -1
  94. package/dist/openapi-cjs.cjs +5 -0
  95. package/dist/pgboss-backend-5DXF4G22.js +16 -0
  96. package/dist/pgboss-backend-KRTFHRNZ.cjs +16 -0
  97. package/dist/pgboss-backend-KRTFHRNZ.cjs.map +1 -0
  98. package/dist/registry/index.json +1 -1
  99. package/dist/tasks/index.cjs +3 -3
  100. package/dist/tasks/index.d.cts +4 -2
  101. package/dist/tasks/index.d.ts +4 -2
  102. package/dist/tasks/index.js +2 -1
  103. package/dist/testing.cjs +21 -13
  104. package/dist/testing.cjs.map +1 -1
  105. package/dist/testing.d.cts +5 -1
  106. package/dist/testing.d.ts +5 -1
  107. package/dist/testing.js +17 -8
  108. package/dist/testing.js.map +1 -1
  109. package/dist/thread-runner.cjs +5 -4
  110. package/dist/thread-runner.cjs.map +1 -1
  111. package/dist/thread-runner.d.cts +1 -1
  112. package/dist/thread-runner.d.ts +1 -1
  113. package/dist/thread-runner.js +4 -2
  114. package/dist/{types-CPMFTVXm.d.ts → types-Bgeqpm-n.d.cts} +91 -2
  115. package/dist/{types-CPMFTVXm.d.cts → types-Bgeqpm-n.d.ts} +91 -2
  116. package/package.json +11 -5
  117. package/dist/chunk-3SWI46YK.js +0 -74
  118. package/dist/chunk-3SWI46YK.js.map +0 -1
  119. package/dist/chunk-74BSJXWD.cjs +0 -220
  120. package/dist/chunk-74BSJXWD.cjs.map +0 -1
  121. package/dist/chunk-7BC3AN7R.cjs.map +0 -1
  122. package/dist/chunk-B6MB6HEG.js.map +0 -1
  123. package/dist/chunk-C2FOZ7ME.js.map +0 -1
  124. package/dist/chunk-CGY7JU4Y.cjs.map +0 -1
  125. package/dist/chunk-H2PVWCWC.cjs.map +0 -1
  126. package/dist/chunk-IUZ6A7PB.cjs.map +0 -1
  127. package/dist/chunk-JP36TLL4.cjs.map +0 -1
  128. package/dist/chunk-KLWL7XSC.js +0 -220
  129. package/dist/chunk-KLWL7XSC.js.map +0 -1
  130. package/dist/chunk-MUVO7MGS.js.map +0 -1
  131. package/dist/chunk-RPL2IFWK.cjs +0 -77
  132. package/dist/chunk-RPL2IFWK.cjs.map +0 -1
  133. package/dist/chunk-TBIVIR6L.cjs.map +0 -1
  134. package/dist/chunk-V73R76I4.js.map +0 -1
  135. package/dist/chunk-Y4NKIXUL.cjs.map +0 -1
  136. package/dist/chunk-Y75V5FCU.js.map +0 -1
  137. package/dist/pgboss-backend-4X2YT4RB.js +0 -14
  138. package/dist/pgboss-backend-UXQ3O2WT.cjs +0 -15
  139. package/dist/pgboss-backend-UXQ3O2WT.cjs.map +0 -1
  140. /package/dist/{chunk-BG4A7Z32.js.map → chunk-3JQWQF2M.js.map} +0 -0
  141. /package/dist/{chunk-5LPRKZPB.js.map → chunk-BCSJOPYH.js.map} +0 -0
  142. /package/dist/{pgboss-backend-4X2YT4RB.js.map → pgboss-backend-5DXF4G22.js.map} +0 -0
@@ -77,7 +77,7 @@ if (!def) throw Error(`[EFC] Cannot enqueue unknown task: "${name}"...`)
77
77
 
78
78
  So `enqueue` throws for both "no backend" and "unknown task name".
79
79
 
80
- It also rejects when Redis is unreachable: the Queue's ioredis connection has `enableOfflineQueue: false`, and `waitUntilReady()` + `queue.add()` is raced against `tasks.enqueueTimeout` (default 5000 ms). Message: `[EFC] Cannot enqueue task "X": Redis at host:port did not respond within Nms`. A rejected job is never queued later.
80
+ It also rejects when Redis is unreachable: the Queue's ioredis connection has `enableOfflineQueue: false`, and `waitUntilReady()` + `queue.add()` is raced against `tasks.enqueueTimeout` (default 5000 ms). Message: `[EFC] Cannot enqueue task "X": Redis at host:port did not respond within Nms`. An expired readiness wait cannot submit later. An already-sent backend command has an uncertain outcome on timeout/disconnect; handlers must be idempotent before retrying.
81
81
 
82
82
  ---
83
83
 
@@ -162,7 +162,7 @@ Defaults: `host: 'localhost'`, `port: 6379`. User/password are URI-decoded.
162
162
  - `new PgBoss({ connectionString: tasks.connectionString ?? databaseUrl, schema? })`, `start()`.
163
163
  - One pg-boss queue per task, named `<tasks.queue>.<TaskName>` (default prefix `efc`); `createQueue` is idempotent.
164
164
  - `retryLimit = retries` (pg-boss counts re-runs, like EFC), `retryDelay: 1`, `retryBackoff` for exponential.
165
- - Non-object payloads are boxed as `{ __efcValue: payload }` and unboxed for the handler.
165
+ - Non-object/reserved-key payloads use a versioned internal wrapper; application objects with `__efcValue` survive unchanged. Old one-key primitive boxes remain readable.
166
166
  - `enqueue` = `boss.send(...)` raced against `enqueueTimeout`.
167
167
 
168
168
  ## Dead letters (`tasks/admin.ts`, CLI `efc tasks failed|retry|purge`)
@@ -171,3 +171,11 @@ Defaults: `host: 'localhost'`, `port: 6379`. User/password are URI-decoded.
171
171
  BullMQ: `queue.getFailed`, `job.retry('failed')`, `job.remove()`. pg-boss: reads `pgboss.job WHERE state='failed'`,
172
172
  then `boss.retry` / `boss.deleteJob`. A retried job gets exactly one more attempt on both backends.
173
173
  CLI picks BullMQ when `REDIS_URL` is set, else pg-boss for a `postgres` `DATABASE_URL`; `--backend/--queue` override.
174
+
175
+ Since 0.12.0 tracing: `tracing: true`/`{tasks:true}` enables native BullMQ telemetry (minimum 5.79.1) or pg-boss openTelemetry + propagateContext (minimum 12.38.0), using W3C trace-only metadata without changing payloads. Retries have separate consumer spans; cron runs have no boot-time parent. Task handlers get a fresh EFC auth/request scope. Thread consumer spans export on the queue worker; W3C context crosses thread/nested-enqueue messages without copying the SDK.
176
+
177
+ The task registry and enqueue implementation share process state across the package’s ESM/CJS exports; the worker-thread enqueue bridge stays isolate-local.
178
+
179
+ Hardening: thread completion waits for pending bridge acknowledgments and terminates the owned isolate; any exit before completion rejects, including exit code 0. Ignore unrelated progress messages. pg-boss null send acknowledgments reject. Async file/global middleware and custom error handlers are promise-aware. Shutdown waits for all task drains before cache, then telemetry; failures aggregate and exit nonzero.
180
+
181
+ Thread task progress messages are isolated from the internal completion/enqueue protocol by a per-worker token. Ordinary `parentPort.postMessage()` payloads cannot accidentally acknowledge a task or enqueue another one. This is protocol isolation, not a security sandbox for untrusted task code.
@@ -275,3 +275,7 @@ const conn = db.model('User') // throws: db not ready
275
275
  // ❌ With autoSync: false, using a model before `efc db sync` / a migration created its table
276
276
  // → "[EFC] <Model>: table "<t>" does not exist — autoSync is off…"
277
277
  ```
278
+
279
+ Since 0.11.0, WebSockets and OpenAPI are implemented. Read the new guides/API references before using them. Use `WS` file exports and `ignite({openapi})`/`generateOpenAPI`, with the four existing import paths only. No Socket.IO protocol, cross-worker broadcast bus, message-schema validator, Swagger UI, or automatic auth-policy inference is provided.
280
+
281
+ Since 0.12.0 tracing exception: HTTP/task instrumentation exists behind `tracing`, with app-owned SDK/exporter/context manager. No EFC OTLP endpoint/env config, auto-instrumentation installer, message tracing, SQL tracing or baggage propagation is supplied.
package/dist/index.cjs CHANGED
@@ -2,38 +2,42 @@
2
2
 
3
3
 
4
4
 
5
- var _chunk74BSJXWDcjs = require('./chunk-74BSJXWD.cjs');
6
5
 
7
6
 
8
7
 
9
8
 
9
+ var _chunkBJR42CN3cjs = require('./chunk-BJR42CN3.cjs');
10
10
 
11
11
 
12
12
 
13
13
 
14
- var _chunkY4NKIXULcjs = require('./chunk-Y4NKIXUL.cjs');
15
14
 
16
15
 
17
- var _chunk4GHK27JAcjs = require('./chunk-4GHK27JA.cjs');
18
16
 
19
17
 
18
+ var _chunkH6MHRHUPcjs = require('./chunk-H6MHRHUP.cjs');
20
19
 
21
- var _chunkTBIVIR6Lcjs = require('./chunk-TBIVIR6L.cjs');
22
20
 
21
+ var _chunk4FQP6QX3cjs = require('./chunk-4FQP6QX3.cjs');
23
22
 
24
23
 
25
24
 
25
+ var _chunkVLGN3XUMcjs = require('./chunk-VLGN3XUM.cjs');
26
26
 
27
27
 
28
28
 
29
29
 
30
30
 
31
- var _chunkR2K7AFIBcjs = require('./chunk-R2K7AFIB.cjs');
32
31
 
33
32
 
34
33
 
35
34
 
36
- var _chunkIUZ6A7PBcjs = require('./chunk-IUZ6A7PB.cjs');
35
+ var _chunkSV4C4HWPcjs = require('./chunk-SV4C4HWP.cjs');
36
+
37
+
38
+
39
+
40
+ var _chunkJVB5NLEMcjs = require('./chunk-JVB5NLEM.cjs');
37
41
 
38
42
 
39
43
 
@@ -41,26 +45,49 @@ var _chunkAGOYTFROcjs = require('./chunk-AGOYTFRO.cjs');
41
45
 
42
46
 
43
47
 
44
- var _chunk7BC3AN7Rcjs = require('./chunk-7BC3AN7R.cjs');
45
- require('./chunk-RPL2IFWK.cjs');
48
+ var _chunkIG3V2IOKcjs = require('./chunk-IG3V2IOK.cjs');
49
+ require('./chunk-JAPZYQVJ.cjs');
50
+
51
+
52
+
53
+ var _chunkA2QGDWCGcjs = require('./chunk-A2QGDWCG.cjs');
46
54
 
47
55
 
48
56
 
49
- var _chunkH2PVWCWCcjs = require('./chunk-H2PVWCWC.cjs');
50
57
 
51
58
 
52
59
 
53
60
 
54
61
 
55
62
 
63
+ var _chunkJHCXIYJHcjs = require('./chunk-JHCXIYJH.cjs');
56
64
 
57
65
 
58
66
 
59
67
 
60
- var _chunkJP36TLL4cjs = require('./chunk-JP36TLL4.cjs');
61
- require('./chunk-CGY7JU4Y.cjs');
68
+ var _chunkURKE3OXNcjs = require('./chunk-URKE3OXN.cjs');
69
+ require('./chunk-PUYBKDYD.cjs');
70
+
71
+ // src/shutdown.ts
72
+ async function drainServices(options) {
73
+ const errors = [];
74
+ const outcomes = await Promise.allSettled([
75
+ ...options.transports,
76
+ ...options.tasks.map((close) => Promise.resolve().then(close))
77
+ ]);
78
+ for (const outcome of outcomes) if (outcome.status === "rejected") errors.push(outcome.reason);
79
+ for (const close of [options.cache, options.tracing]) {
80
+ try {
81
+ await close();
82
+ } catch (error) {
83
+ errors.push(error);
84
+ }
85
+ }
86
+ if (errors.length) throw new AggregateError(errors, "Service shutdown failed");
87
+ }
62
88
 
63
89
  // src/index.ts
90
+ var _http = require('http'); var _http2 = _interopRequireDefault(_http);
64
91
  var _fs = require('fs'); var _fs2 = _interopRequireDefault(_fs);
65
92
  var _express = require('express'); var _express2 = _interopRequireDefault(_express);
66
93
  var _cluster = require('cluster'); var _cluster2 = _interopRequireDefault(_cluster);
@@ -75,7 +102,7 @@ function workerCount() {
75
102
  }
76
103
  function shutdownMaster() {
77
104
  isShuttingDown = true;
78
- _chunkJP36TLL4cjs.getLogger.call(void 0, ).info(`Cluster primary (pid=${process.pid}) shutting down, waiting for workers\u2026`);
105
+ _chunkJHCXIYJHcjs.getLogger.call(void 0, ).info(`Cluster primary (pid=${process.pid}) shutting down, waiting for workers\u2026`);
79
106
  if (workerCount() === 0) process.exit(0);
80
107
  for (const worker of Object.values(_nullishCoalesce(_cluster2.default.workers, () => ( {})))) {
81
108
  _optionalChain([worker, 'optionalAccess', _ => _.process, 'access', _2 => _2.kill, 'call', _3 => _3("SIGTERM")]);
@@ -83,7 +110,7 @@ function shutdownMaster() {
83
110
  }
84
111
  function runMaster(options = {}) {
85
112
  const count = _nullishCoalesce(options.workers, () => ( 1));
86
- _chunkJP36TLL4cjs.getLogger.call(void 0, ).info(`Primary ${process.pid} starting ${count} workers`);
113
+ _chunkJHCXIYJHcjs.getLogger.call(void 0, ).info(`Primary ${process.pid} starting ${count} workers`);
87
114
  for (let i = 0; i < count; i++) {
88
115
  _cluster2.default.fork();
89
116
  }
@@ -93,14 +120,14 @@ function runMaster(options = {}) {
93
120
  _cluster2.default.on("exit", (worker, code, signal) => {
94
121
  const exitCode = _nullishCoalesce(code, () => ( (signal ? -1 : 0)));
95
122
  if (isShuttingDown) {
96
- _chunkJP36TLL4cjs.getLogger.call(void 0, ).info(`Worker ${worker.id} gracefully exited`);
123
+ _chunkJHCXIYJHcjs.getLogger.call(void 0, ).info(`Worker ${worker.id} gracefully exited`);
97
124
  if (workerCount() === 0) {
98
- _chunkJP36TLL4cjs.getLogger.call(void 0, ).info("All workers exited. Primary exiting.");
125
+ _chunkJHCXIYJHcjs.getLogger.call(void 0, ).info("All workers exited. Primary exiting.");
99
126
  process.exit(0);
100
127
  }
101
128
  return;
102
129
  }
103
- _chunkJP36TLL4cjs.getLogger.call(void 0, ).warn(`Worker ${worker.id} exited (code=${exitCode}), respawning\u2026`);
130
+ _chunkJHCXIYJHcjs.getLogger.call(void 0, ).warn(`Worker ${worker.id} exited (code=${exitCode}), respawning\u2026`);
104
131
  _optionalChain([options, 'access', _6 => _6.onWorkerCrash, 'optionalCall', _7 => _7(worker.id, exitCode)]);
105
132
  _cluster2.default.fork();
106
133
  });
@@ -119,13 +146,13 @@ async function scanTasks(tasksDir) {
119
146
  const mod = await Promise.resolve().then(() => _interopRequireWildcard(require(filePath)));
120
147
  const def = mod["default"];
121
148
  if (!def || typeof def.handler !== "function") {
122
- _chunkJP36TLL4cjs.getLogger.call(void 0, ).warn(`Task file ${file} has no valid default export \u2014 skipping`);
149
+ _chunkJHCXIYJHcjs.getLogger.call(void 0, ).warn(`Task file ${file} has no valid default export \u2014 skipping`);
123
150
  continue;
124
151
  }
125
- _chunkH2PVWCWCcjs.registerTask.call(void 0, taskName, { ...def, filePath });
126
- _chunkJP36TLL4cjs.getLogger.call(void 0, ).debug(`Registered task: ${taskName}`);
152
+ _chunkA2QGDWCGcjs.registerTask.call(void 0, taskName, { ...def, filePath });
153
+ _chunkJHCXIYJHcjs.getLogger.call(void 0, ).debug(`Registered task: ${taskName}`);
127
154
  } catch (err) {
128
- _chunkJP36TLL4cjs.getLogger.call(void 0, ).warn({ err }, `Failed to load task ${file}`);
155
+ _chunkJHCXIYJHcjs.getLogger.call(void 0, ).warn({ err }, `Failed to load task ${file}`);
129
156
  }
130
157
  }
131
158
  }
@@ -150,7 +177,7 @@ function generateDashboard(routes, basePath, port, projectName, projectVersion)
150
177
  const safeRoutes = JSON.stringify(
151
178
  routes.map((r) => ({
152
179
  urlPath: r.urlPath,
153
- methods: r.methods,
180
+ methods: r.websocket ? [...r.methods, "WS"] : r.methods,
154
181
  params: r.params,
155
182
  meta: _nullishCoalesce(r.meta, () => ( null))
156
183
  }))
@@ -731,18 +758,19 @@ function generateDashboard(routes, basePath, port, projectName, projectVersion)
731
758
  // src/rate-limit.ts
732
759
  var UNITS = { s: 1, m: 60, h: 3600, d: 86400 };
733
760
  function parseWindow(window) {
734
- if (typeof window === "number") {
735
- if (window > 0) return window;
736
- } else {
737
- const m = /^(\d+(?:\.\d+)?)\s*(s|m|h|d)$/.exec(window.trim());
738
- if (m) return Number(m[1]) * UNITS[m[2]];
761
+ let seconds = typeof window === "number" ? window : NaN;
762
+ if (typeof window === "string") {
763
+ const match = /^(\d+(?:\.\d+)?)\s*(s|m|h|d)$/.exec(window.trim());
764
+ if (match) seconds = Number(match[1]) * UNITS[match[2]];
739
765
  }
766
+ if (Number.isFinite(seconds) && seconds * 1e3 >= 1 && seconds * 1e3 <= Number.MAX_SAFE_INTEGER)
767
+ return seconds;
740
768
  throw new Error(`[EFC] rateLimit: window must be seconds or like '15m' \u2014 got ${String(window)}`);
741
769
  }
742
770
  var lastCacheError = 0;
743
771
  function rateLimit(options) {
744
772
  const windowSeconds = parseWindow(options.window);
745
- if (!Number.isInteger(options.max) || options.max < 1) {
773
+ if (!Number.isSafeInteger(options.max) || options.max < 1) {
746
774
  throw new Error("[EFC] rateLimit: max must be a positive integer");
747
775
  }
748
776
  const keyOf = _nullishCoalesce(options.key, () => ( ((req) => _nullishCoalesce(req.ip, () => ( req.socket.remoteAddress)))));
@@ -752,7 +780,7 @@ function rateLimit(options) {
752
780
  void (async () => {
753
781
  const who = keyOf(req);
754
782
  if (who === void 0) return next();
755
- if (!_chunkY4NKIXULcjs.isCacheConfigured.call(void 0, )) {
783
+ if (!_chunkH6MHRHUPcjs.isCacheConfigured.call(void 0, )) {
756
784
  throw new Error("[EFC] rateLimit needs a cache \u2014 pass cache: { backend } to ignite()");
757
785
  }
758
786
  const bucket = _nullishCoalesce(options.name, () => ( req.baseUrl + (_nullishCoalesce(_optionalChain([req, 'access', _8 => _8.route, 'optionalAccess', _9 => _9.path]), () => ( req.path)))));
@@ -762,11 +790,14 @@ function rateLimit(options) {
762
790
  const resetMs = (slot + 1) * windowMs - now;
763
791
  let count;
764
792
  try {
765
- count = (await _chunkY4NKIXULcjs.rawIncr.call(void 0, `rl:${bucket}:${who}:${slot}`, Math.ceil(resetMs / 1e3) + 1)).value;
793
+ count = (await _chunkH6MHRHUPcjs.rawIncr.call(void 0,
794
+ `rl:${JSON.stringify([String(bucket), who, slot])}`,
795
+ Math.ceil(resetMs / 1e3) + 1
796
+ )).value;
766
797
  } catch (err) {
767
798
  if (Date.now() - lastCacheError > 3e4) {
768
799
  lastCacheError = Date.now();
769
- _chunkJP36TLL4cjs.getLogger.call(void 0, ).error(
800
+ _chunkJHCXIYJHcjs.getLogger.call(void 0, ).error(
770
801
  { err },
771
802
  `rateLimit: cache unavailable \u2014 ${options.onCacheError === "reject" ? "rejecting with 503" : "allowing requests"}`
772
803
  );
@@ -794,32 +825,85 @@ function rateLimit(options) {
794
825
  }
795
826
 
796
827
  // src/cache/response.ts
828
+ var _crypto = require('crypto');
797
829
  var RESPONSE_PREFIX = "res:";
830
+ var representationHeaders = [
831
+ "content-type",
832
+ "cache-control",
833
+ "vary",
834
+ "content-language",
835
+ "content-disposition",
836
+ "etag",
837
+ "last-modified"
838
+ ];
839
+ var variant = (req, names) => _crypto.createHash.call(void 0, "sha256").update(JSON.stringify(names.map((name) => [name, _nullishCoalesce(req.get(name), () => ( null))]))).digest("hex");
798
840
  function cacheResponse(options) {
799
841
  const opts = typeof options === "number" ? { ttl: options } : options;
800
842
  return (req, res, next) => {
801
843
  if (req.method !== "GET" && req.method !== "HEAD") return next();
802
844
  let scope = "";
803
845
  if (opts.perUser) {
804
- const user = _chunkJP36TLL4cjs.getCurrentUser.call(void 0, );
846
+ const user = _chunkURKE3OXNcjs.getCurrentUser.call(void 0, );
805
847
  const id = _nullishCoalesce(_optionalChain([user, 'optionalAccess', _10 => _10["sub"]]), () => ( _optionalChain([user, 'optionalAccess', _11 => _11["id"]])));
806
- if (id === void 0) return next();
807
- scope = `u:${String(id)}:`;
848
+ if (typeof id !== "string" && (typeof id !== "number" || !Number.isFinite(id))) return next();
849
+ scope = `u:${JSON.stringify([id])}:`;
808
850
  }
809
- const key = RESPONSE_PREFIX + scope + (opts.key ? opts.key(req) : req.originalUrl);
851
+ const key = RESPONSE_PREFIX + scope + (opts.key ? opts.key(req) : req.originalUrl) + "\0" + req.method;
810
852
  void (async () => {
811
- const hit = await _chunkY4NKIXULcjs.cache.get(key);
812
- if (hit) {
853
+ const hit = await _chunkH6MHRHUPcjs.cache.get(key);
854
+ if (hit && typeof hit.json === "string" && Array.isArray(hit.vary) && hit.variant === variant(req, hit.vary)) {
855
+ res.set(hit.headers);
813
856
  res.setHeader("X-Cache", "HIT");
814
- res.status(hit.status).json(hit.body);
857
+ res.status(hit.status).send(hit.json);
815
858
  return;
816
859
  }
817
860
  res.setHeader("X-Cache", "MISS");
861
+ let captured = false;
862
+ let snapshot = "";
818
863
  const json = res.json.bind(res);
819
864
  res.json = (body) => {
820
- if (res.statusCode === 200) void _chunkY4NKIXULcjs.cache.set(key, { status: 200, body }, { ttl: opts.ttl });
821
- return json(body);
865
+ const send = res.send;
866
+ const eligible = !res.headersSent && res.statusCode === 200;
867
+ res.send = (rendered) => {
868
+ if (eligible && typeof rendered === "string") {
869
+ try {
870
+ JSON.parse(rendered);
871
+ snapshot = rendered;
872
+ captured = true;
873
+ } catch (e) {
874
+ }
875
+ }
876
+ return send.call(res, rendered);
877
+ };
878
+ try {
879
+ return json(body);
880
+ } finally {
881
+ res.send = send;
882
+ }
822
883
  };
884
+ res.once("finish", () => {
885
+ if (!captured || res.statusCode !== 200 || res.getHeader("set-cookie") !== void 0)
886
+ return;
887
+ const control = String(_nullishCoalesce(res.getHeader("cache-control"), () => ( "")));
888
+ if (/(?:^|,)\s*(?:no-store|no-cache)(?:\s|,|=|$)/i.test(control) || !opts.perUser && /(?:^|,)\s*private(?:\s|,|=|$)/i.test(control))
889
+ return;
890
+ const vary = String(_nullishCoalesce(res.getHeader("vary"), () => ( ""))).split(",").map((name) => name.trim().toLowerCase()).filter(Boolean);
891
+ if (vary.includes("*")) return;
892
+ const headers = {};
893
+ for (const name of representationHeaders) {
894
+ const value = res.getHeader(name);
895
+ if (value !== void 0)
896
+ headers[name] = Array.isArray(value) ? value.join(", ") : String(value);
897
+ }
898
+ const stored = {
899
+ status: 200,
900
+ json: snapshot,
901
+ headers,
902
+ vary,
903
+ variant: variant(req, vary)
904
+ };
905
+ void _chunkH6MHRHUPcjs.cache.set(key, stored, { ttl: opts.ttl }).catch((error) => _chunkJHCXIYJHcjs.getLogger.call(void 0, ).debug({ err: error }, "Response cache write failed"));
906
+ });
823
907
  next();
824
908
  })().catch(next);
825
909
  };
@@ -876,7 +960,7 @@ async function ignite(config) {
876
960
  const raw = _fs2.default.readFileSync(_path2.default.join(process.cwd(), "package.json"), "utf8");
877
961
  const pkg = JSON.parse(raw);
878
962
  return { name: _nullishCoalesce(pkg.name, () => ( "API")), version: _nullishCoalesce(pkg.version, () => ( "")) };
879
- } catch (e) {
963
+ } catch (e2) {
880
964
  return { name: "API", version: "" };
881
965
  }
882
966
  }
@@ -886,21 +970,22 @@ async function ignite(config) {
886
970
  const jwtSecret = config.jwtSecret;
887
971
  const authStrategy = _nullishCoalesce(config.authStrategy, () => ( "http-only"));
888
972
  const clusterEnabled = _nullishCoalesce(config.cluster, () => ( process.env["NODE_ENV"] === "production"));
889
- _chunkJP36TLL4cjs.configureLogger.call(void 0, config.logging);
973
+ _chunkJHCXIYJHcjs.configureLogger.call(void 0, config.logging);
890
974
  if (!["http-only", "bearer", "localStorage"].includes(authStrategy) && (!clusterEnabled || _cluster2.default.isPrimary)) {
891
- _chunkJP36TLL4cjs.getLogger.call(void 0, ).warn(
975
+ _chunkJHCXIYJHcjs.getLogger.call(void 0, ).warn(
892
976
  `[EFC] Unknown authStrategy "${String(authStrategy)}" \u2014 treated as 'bearer'. Use 'http-only' or 'bearer'; this will be an error in 1.0.`
893
977
  );
894
978
  }
895
979
  if (jwtSecret && Buffer.byteLength(jwtSecret) < 32 && process.env["NODE_ENV"] === "production" && (!clusterEnabled || _cluster2.default.isPrimary)) {
896
- _chunkJP36TLL4cjs.getLogger.call(void 0, ).warn(
980
+ _chunkJHCXIYJHcjs.getLogger.call(void 0, ).warn(
897
981
  `[EFC] jwtSecret is ${Buffer.byteLength(jwtSecret)} bytes \u2014 use at least 32 random bytes in production (openssl rand -hex 64).`
898
982
  );
899
983
  }
900
- _chunkJP36TLL4cjs.configureQueryLog.call(void 0, config.logging);
984
+ _chunkJHCXIYJHcjs.configureQueryLog.call(void 0, config.logging);
985
+ _chunkURKE3OXNcjs.configureTracing.call(void 0, config.tracing);
901
986
  if (clusterEnabled && _cluster2.default.isPrimary) {
902
987
  if (config.cache && config.cache.backend === "memory") {
903
- _chunkY4NKIXULcjs.servePrimaryCache.call(void 0, _nullishCoalesce(config.cache.maxEntries, () => ( 1e4)));
988
+ _chunkH6MHRHUPcjs.servePrimaryCache.call(void 0, _nullishCoalesce(config.cache.maxEntries, () => ( 1e4)));
904
989
  }
905
990
  runMaster({
906
991
  workers: _nullishCoalesce(workers, () => ( _os2.default.cpus().length)),
@@ -909,35 +994,35 @@ async function ignite(config) {
909
994
  });
910
995
  return;
911
996
  }
912
- const app = _chunk74BSJXWDcjs.createHttpApp.call(void 0, config);
913
- if (database) _chunkIUZ6A7PBcjs.setDbEngine.call(void 0, database);
914
- _chunkIUZ6A7PBcjs.setAutoSync.call(void 0, _nullishCoalesce(config.autoSync, () => ( true)));
997
+ const app = _chunkBJR42CN3cjs.createHttpApp.call(void 0, config);
998
+ if (database) _chunkJVB5NLEMcjs.setDbEngine.call(void 0, database);
999
+ _chunkJVB5NLEMcjs.setAutoSync.call(void 0, _nullishCoalesce(config.autoSync, () => ( true)));
915
1000
  const poolWorkers = clusterEnabled ? _nullishCoalesce(workers, () => ( _os2.default.cpus().length)) : 1;
916
1001
  const reportsPools = !clusterEnabled || _optionalChain([_cluster2.default, 'access', _12 => _12.worker, 'optionalAccess', _13 => _13.id]) === 1;
917
1002
  if (database === "mongodb" && databaseUrl) {
918
- const conn = await _chunkR2K7AFIBcjs.connectMongo.call(void 0, databaseUrl, config.databasePool);
919
- _chunkR2K7AFIBcjs.setDbClient.call(void 0, conn);
1003
+ const conn = await _chunkSV4C4HWPcjs.connectMongo.call(void 0, databaseUrl, config.databasePool);
1004
+ _chunkSV4C4HWPcjs.setDbClient.call(void 0, conn);
920
1005
  if (reportsPools) {
921
1006
  const max = _nullishCoalesce(_optionalChain([config, 'access', _14 => _14.databasePool, 'optionalAccess', _15 => _15.max]), () => ( 100));
922
- _chunkJP36TLL4cjs.getLogger.call(void 0, ).info(
1007
+ _chunkJHCXIYJHcjs.getLogger.call(void 0, ).info(
923
1008
  `MongoDB connections: up to ${poolWorkers * max} from this machine (${poolWorkers} worker(s) \xD7 maxPoolSize ${max})`
924
1009
  );
925
1010
  }
926
1011
  } else if (database === "postgresql" && databaseUrl) {
927
- const pool = await _chunkJP36TLL4cjs.connectPostgres.call(void 0, databaseUrl, config.databasePool);
928
- _chunkR2K7AFIBcjs.setDbClient.call(void 0, pool);
1012
+ const pool = await _chunkJHCXIYJHcjs.connectPostgres.call(void 0, databaseUrl, config.databasePool);
1013
+ _chunkSV4C4HWPcjs.setDbClient.call(void 0, pool);
929
1014
  if (reportsPools) {
930
1015
  const max = _nullishCoalesce(_optionalChain([config, 'access', _16 => _16.databasePool, 'optionalAccess', _17 => _17.max]), () => ( 10));
931
1016
  const boss = config.tasks && config.tasks.backend === "pg-boss" && !config.tasks.connectionString ? 10 : 0;
932
1017
  const breakdown = `${poolWorkers} worker(s) \xD7 (pool ${max}${boss ? ` + pg-boss ${boss}` : ""})`;
933
- await _chunkJP36TLL4cjs.checkConnectionBudget.call(void 0, poolWorkers * (max + boss), breakdown);
1018
+ await _chunkJHCXIYJHcjs.checkConnectionBudget.call(void 0, poolWorkers * (max + boss), breakdown);
934
1019
  }
935
1020
  }
936
1021
  if (config.cache) {
937
- await _chunkY4NKIXULcjs.configureCache.call(void 0, config.cache);
1022
+ await _chunkH6MHRHUPcjs.configureCache.call(void 0, config.cache);
938
1023
  }
939
1024
  if (jwtSecret) {
940
- _chunkY4NKIXULcjs.configureAuth.call(void 0, {
1025
+ _chunkH6MHRHUPcjs.configureAuth.call(void 0, {
941
1026
  secret: jwtSecret,
942
1027
  strategy: authStrategy,
943
1028
  expiresIn: _nullishCoalesce(config.jwtExpiresIn, () => ( "7d")),
@@ -949,7 +1034,8 @@ async function ignite(config) {
949
1034
  }
950
1035
  if (config.tasks) {
951
1036
  if (config.tasks.backend === "bullmq") {
952
- await _chunkTBIVIR6Lcjs.initBullMQ.call(void 0, {
1037
+ await _chunkVLGN3XUMcjs.initBullMQ.call(void 0, {
1038
+ tracing: !!config.tracing && (config.tracing === true || config.tracing.tasks !== false),
953
1039
  redisUrl: _nullishCoalesce(config.tasks.redisUrl, () => ( "redis://localhost:6379")),
954
1040
  concurrency: _nullishCoalesce(config.tasks.concurrency, () => ( 5)),
955
1041
  enqueueTimeout: _nullishCoalesce(config.tasks.enqueueTimeout, () => ( 5e3)),
@@ -962,7 +1048,8 @@ async function ignite(config) {
962
1048
  '[EFC] tasks.backend "pg-boss" needs tasks.connectionString or databaseUrl'
963
1049
  );
964
1050
  }
965
- await _chunk7BC3AN7Rcjs.initPgBoss.call(void 0, {
1051
+ await _chunkIG3V2IOKcjs.initPgBoss.call(void 0, {
1052
+ tracing: !!config.tracing && (config.tracing === true || config.tracing.tasks !== false),
966
1053
  connectionString,
967
1054
  concurrency: _nullishCoalesce(config.tasks.concurrency, () => ( 5)),
968
1055
  enqueueTimeout: _nullishCoalesce(config.tasks.enqueueTimeout, () => ( 5e3)),
@@ -971,9 +1058,18 @@ async function ignite(config) {
971
1058
  });
972
1059
  }
973
1060
  }
974
- const routes = _chunk4GHK27JAcjs.scanDir.call(void 0, apiDir);
1061
+ const routes = _chunk4FQP6QX3cjs.scanDir.call(void 0, apiDir);
975
1062
  const apiRouter = _express2.default.Router();
976
- const mounted = await _chunk74BSJXWDcjs.mountRoutes.call(void 0, apiRouter, routes);
1063
+ const mounted = await _chunkBJR42CN3cjs.mountRoutes.call(void 0, apiRouter, routes);
1064
+ if (config.openapi) {
1065
+ const meta = readProjectMeta();
1066
+ const options = config.openapi === true ? {} : config.openapi;
1067
+ await _chunkBJR42CN3cjs.mountOpenAPI.call(void 0, app, mounted, {
1068
+ info: { title: meta.name, version: meta.version },
1069
+ ...options,
1070
+ basePath
1071
+ });
1072
+ }
977
1073
  app.use(basePath, apiRouter);
978
1074
  if (config.dashboard !== false && process.env["NODE_ENV"] === "development") {
979
1075
  app.get("/", (_req, res) => {
@@ -982,16 +1078,19 @@ async function ignite(config) {
982
1078
  res.send(generateDashboard(mounted, basePath, port, name, version));
983
1079
  });
984
1080
  }
985
- _chunk74BSJXWDcjs.mountErrorHandler.call(void 0, app, onError);
1081
+ _chunkBJR42CN3cjs.mountErrorHandler.call(void 0, app, onError);
986
1082
  return new Promise((resolve, reject) => {
987
- const server = app.listen(port);
1083
+ const server = _http2.default.createServer(app);
1084
+ if (config.websocket !== false && mounted.some((route) => route.websocket))
1085
+ _chunkBJR42CN3cjs.attachWebSockets.call(void 0, server, app, config.websocket);
988
1086
  server.once("listening", () => {
989
1087
  const wid = _nullishCoalesce(_optionalChain([_cluster2.default, 'access', _18 => _18.worker, 'optionalAccess', _19 => _19.id]), () => ( "primary"));
990
1088
  const addr = server.address();
991
- _chunkJP36TLL4cjs.getLogger.call(void 0, ).info(`Worker ${wid} listening on :${_nullishCoalesce(_optionalChain([addr, 'optionalAccess', _20 => _20.port]), () => ( port))}`);
1089
+ _chunkJHCXIYJHcjs.getLogger.call(void 0, ).info(`Worker ${wid} listening on :${_nullishCoalesce(_optionalChain([addr, 'optionalAccess', _20 => _20.port]), () => ( port))}`);
992
1090
  resolve(server);
993
1091
  });
994
1092
  server.once("error", reject);
1093
+ server.listen(port);
995
1094
  });
996
1095
  }
997
1096
  function gracefulShutdown(server, timeoutMs = 1e4) {
@@ -999,21 +1098,33 @@ function gracefulShutdown(server, timeoutMs = 1e4) {
999
1098
  const shutdown = (signal) => {
1000
1099
  if (shuttingDown) return;
1001
1100
  shuttingDown = true;
1002
- _chunkJP36TLL4cjs.getLogger.call(void 0, ).info(`${signal} received \u2014 closing server gracefully\u2026`);
1101
+ _chunkJHCXIYJHcjs.getLogger.call(void 0, ).info(`${signal} received \u2014 closing server gracefully\u2026`);
1003
1102
  if (server) {
1103
+ const websocketDrain = _chunkBJR42CN3cjs.closeWebSockets.call(void 0, server, Math.max(1, Math.min(1e3, timeoutMs / 2)));
1004
1104
  server.closeIdleConnections();
1005
1105
  server.close(() => {
1006
- _chunkJP36TLL4cjs.getLogger.call(void 0, ).info("Server closed");
1007
- Promise.all([_chunkTBIVIR6Lcjs.closeBullMQ.call(void 0, ), _chunk7BC3AN7Rcjs.closePgBoss.call(void 0, ), _chunkY4NKIXULcjs.closeCache.call(void 0, )]).catch((err) => _chunkJP36TLL4cjs.getLogger.call(void 0, ).error({ err }, "Task backend close failed")).finally(() => process.exit(0));
1106
+ _chunkJHCXIYJHcjs.getLogger.call(void 0, ).info("Server closed");
1107
+ drainServices({
1108
+ transports: [websocketDrain],
1109
+ tasks: [_chunkVLGN3XUMcjs.closeBullMQ, _chunkIG3V2IOKcjs.closePgBoss],
1110
+ cache: _chunkH6MHRHUPcjs.closeCache,
1111
+ tracing: _chunkURKE3OXNcjs.shutdownTracing
1112
+ }).then(
1113
+ () => process.exit(0),
1114
+ (err) => {
1115
+ _chunkJHCXIYJHcjs.getLogger.call(void 0, ).error({ err }, "Service shutdown failed");
1116
+ process.exit(1);
1117
+ }
1118
+ );
1008
1119
  });
1009
1120
  setTimeout(() => {
1010
- _chunkJP36TLL4cjs.getLogger.call(void 0, ).error("Forced exit after timeout");
1121
+ _chunkJHCXIYJHcjs.getLogger.call(void 0, ).error("Forced exit after timeout");
1011
1122
  process.exit(1);
1012
1123
  }, timeoutMs).unref();
1013
1124
  } else {
1014
1125
  shutdownMaster();
1015
1126
  setTimeout(() => {
1016
- _chunkJP36TLL4cjs.getLogger.call(void 0, ).error("Workers did not exit in time \u2014 forcing primary exit");
1127
+ _chunkJHCXIYJHcjs.getLogger.call(void 0, ).error("Workers did not exit in time \u2014 forcing primary exit");
1017
1128
  process.exit(1);
1018
1129
  }, timeoutMs + 2e3).unref();
1019
1130
  }
@@ -1045,5 +1156,9 @@ function gracefulShutdown(server, timeoutMs = 1e4) {
1045
1156
 
1046
1157
 
1047
1158
 
1048
- exports.HttpError = _chunkAGOYTFROcjs.HttpError; exports.ModelValidationError = _chunkIUZ6A7PBcjs.ModelValidationError; exports.cache = _chunkY4NKIXULcjs.cache; exports.cacheResponse = cacheResponse; exports.compose = compose; exports.db = _chunkR2K7AFIBcjs.db; exports.defineCollection = _chunkR2K7AFIBcjs.defineCollection; exports.defineModel = _chunkR2K7AFIBcjs.defineModel; exports.defineTable = _chunkR2K7AFIBcjs.defineTable; exports.getDbClient = _chunkR2K7AFIBcjs.getDbClient; exports.getLogger = _chunkJP36TLL4cjs.getLogger; exports.getQueryMetrics = _chunkJP36TLL4cjs.getQueryMetrics; exports.gracefulShutdown = gracefulShutdown; exports.ignite = ignite; exports.isHttpError = _chunkAGOYTFROcjs.isHttpError; exports.listTasks = _chunkH2PVWCWCcjs.listTasks; exports.logger = _chunkJP36TLL4cjs.logger; exports.rateLimit = rateLimit; exports.resetQueryMetrics = _chunkJP36TLL4cjs.resetQueryMetrics; exports.scanDir = _chunk4GHK27JAcjs.scanDir; exports.setDbClient = _chunkR2K7AFIBcjs.setDbClient; exports.transaction = _chunkR2K7AFIBcjs.transaction; exports.workerCount = workerCount;
1049
- //# sourceMappingURL=index.cjs.map
1159
+
1160
+
1161
+
1162
+ exports.HttpError = _chunkAGOYTFROcjs.HttpError; exports.ModelValidationError = _chunkJVB5NLEMcjs.ModelValidationError; exports.attachWebSockets = _chunkBJR42CN3cjs.attachWebSockets; exports.cache = _chunkH6MHRHUPcjs.cache; exports.cacheResponse = cacheResponse; exports.closeWebSockets = _chunkBJR42CN3cjs.closeWebSockets; exports.compose = compose; exports.db = _chunkSV4C4HWPcjs.db; exports.defineCollection = _chunkSV4C4HWPcjs.defineCollection; exports.defineModel = _chunkSV4C4HWPcjs.defineModel; exports.defineTable = _chunkSV4C4HWPcjs.defineTable; exports.generateOpenAPI = _chunkBJR42CN3cjs.generateOpenAPI; exports.getDbClient = _chunkSV4C4HWPcjs.getDbClient; exports.getLogger = _chunkJHCXIYJHcjs.getLogger; exports.getQueryMetrics = _chunkJHCXIYJHcjs.getQueryMetrics; exports.gracefulShutdown = gracefulShutdown; exports.ignite = ignite; exports.isHttpError = _chunkAGOYTFROcjs.isHttpError; exports.listTasks = _chunkA2QGDWCGcjs.listTasks; exports.logger = _chunkJHCXIYJHcjs.logger; exports.rateLimit = rateLimit; exports.resetQueryMetrics = _chunkJHCXIYJHcjs.resetQueryMetrics; exports.scanDir = _chunk4FQP6QX3cjs.scanDir; exports.setDbClient = _chunkSV4C4HWPcjs.setDbClient; exports.transaction = _chunkSV4C4HWPcjs.transaction; exports.workerCount = workerCount;
1163
+ //# sourceMappingURL=index.cjs.map
1164
+ exports.generateOpenAPI = require("./openapi-cjs.cjs").generateOpenAPI;