@guren/server 2.15.0 → 2.17.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 (302) hide show
  1. package/dist/{DocsViewerServiceProvider-qFCaeiUv.js → DocsViewerServiceProvider-D2cuVgtN.js} +7 -12
  2. package/dist/{Hash-C8aejmi8.js → Hash-D2DFd8xX.js} +7 -57
  3. package/dist/{HttpException-BkS3euNG.js → HttpException-BlQ2yEmT.js} +2 -79
  4. package/dist/{Job-BVT813DO.js → Job-DxQK8h3P.js} +24 -179
  5. package/dist/{McpServiceProvider-BawsYjgN.js → McpServiceProvider-Zihx3Bjq.js} +35 -20
  6. package/dist/{Random-DbIJ22KQ.js → Random-S0OvCuR8.js} +9 -106
  7. package/dist/agent/AgentApprovalRequested.d.ts +11 -39
  8. package/dist/agent/approval-status.d.ts +56 -0
  9. package/dist/agent/approval.d.ts +76 -187
  10. package/dist/agent/audit-emitter.d.ts +16 -44
  11. package/dist/agent/audit.d.ts +20 -56
  12. package/dist/agent/derive.d.ts +32 -66
  13. package/dist/agent/dispatch.d.ts +38 -90
  14. package/dist/agent/events.d.ts +17 -23
  15. package/dist/agent/gate.d.ts +118 -0
  16. package/dist/agent/meta-tools.d.ts +18 -46
  17. package/dist/agent/pipeline.d.ts +234 -0
  18. package/dist/agent/public.d.ts +6 -25
  19. package/dist/agent/public.js +1 -1
  20. package/dist/agent/redact.d.ts +16 -38
  21. package/dist/agent/scopes.d.ts +55 -69
  22. package/dist/auth/AgentPrincipalGuard.d.ts +49 -0
  23. package/dist/auth/AuthManager.d.ts +22 -43
  24. package/dist/auth/AuthenticatableModel.d.ts +2 -2
  25. package/dist/auth/SessionGuard.d.ts +0 -1
  26. package/dist/auth/TokenGuard.d.ts +6 -26
  27. package/dist/auth/api-token.d.ts +16 -148
  28. package/dist/auth/context.d.ts +5 -10
  29. package/dist/auth/email-verification.d.ts +29 -127
  30. package/dist/auth/index.js +1 -1
  31. package/dist/auth/oauth/index.d.ts +35 -57
  32. package/dist/auth/password/DefaultHasher.d.ts +5 -14
  33. package/dist/auth/password/PasswordHasher.d.ts +5 -13
  34. package/dist/auth/password/hash-format.d.ts +5 -13
  35. package/dist/auth/password-reset.d.ts +16 -42
  36. package/dist/auth/providers/ModelUserProvider.d.ts +3 -4
  37. package/dist/auth/providers/UserProvider.d.ts +4 -4
  38. package/dist/auth/signed-token.d.ts +18 -0
  39. package/dist/auth/types.d.ts +9 -32
  40. package/dist/auth/utils.d.ts +6 -27
  41. package/dist/{auth-DkYoAPVn.js → auth-Gg54ppQi.js} +279 -519
  42. package/dist/authorization/Gate.d.ts +9 -145
  43. package/dist/authorization/Policy.d.ts +6 -53
  44. package/dist/authorization/index.js +1 -1
  45. package/dist/authorization/middleware.d.ts +16 -62
  46. package/dist/authorization/types.d.ts +8 -64
  47. package/dist/{authorization-CdfbCj8J.js → authorization-CdEWZZw3.js} +44 -309
  48. package/dist/broadcasting/BroadcastManager.d.ts +29 -149
  49. package/dist/broadcasting/channels/Channel.d.ts +1 -19
  50. package/dist/broadcasting/channels/PresenceChannel.d.ts +1 -55
  51. package/dist/broadcasting/channels/PrivateChannel.d.ts +1 -23
  52. package/dist/broadcasting/drivers/MemoryDriver.d.ts +18 -70
  53. package/dist/broadcasting/drivers/RedisDriver.d.ts +3 -80
  54. package/dist/broadcasting/drivers/index.d.ts +1 -1
  55. package/dist/broadcasting/index.d.ts +1 -1
  56. package/dist/broadcasting/index.js +1 -1
  57. package/dist/broadcasting/types.d.ts +7 -88
  58. package/dist/{broadcasting-BwodCA4q.js → broadcasting-B5RzB0A2.js} +87 -414
  59. package/dist/cache/CacheManager.d.ts +8 -62
  60. package/dist/cache/TaggedCache.d.ts +2 -35
  61. package/dist/cache/index.js +1 -1
  62. package/dist/cache/stores/FileStore.d.ts +2 -36
  63. package/dist/cache/stores/MemoryStore.d.ts +2 -26
  64. package/dist/cache/stores/RedisStore.d.ts +1 -29
  65. package/dist/cache/types.d.ts +21 -128
  66. package/dist/{cache-BYnZf2FR.js → cache-BOOIr324.js} +19 -198
  67. package/dist/client-C4TEr_Dd.js +9 -0
  68. package/dist/console/Command.d.ts +17 -126
  69. package/dist/console/ConsoleKernel.d.ts +2 -74
  70. package/dist/console/Input.d.ts +5 -113
  71. package/dist/console/Output.d.ts +3 -99
  72. package/dist/console/types.d.ts +3 -33
  73. package/dist/container/Container.d.ts +12 -103
  74. package/dist/container/ServiceProvider.d.ts +17 -61
  75. package/dist/container/bindings.d.ts +5 -26
  76. package/dist/container/defineModule.d.ts +16 -54
  77. package/dist/container/definePlugin.d.ts +12 -45
  78. package/dist/container/types.d.ts +2 -34
  79. package/dist/context-CXk_umpT.js +21 -0
  80. package/dist/database/Factory.d.ts +4 -57
  81. package/dist/database/Seeder.d.ts +8 -46
  82. package/dist/database/SeederRunner.d.ts +3 -33
  83. package/dist/database/types.d.ts +3 -24
  84. package/dist/discovery/AutoDiscovery.d.ts +10 -82
  85. package/dist/{dispatch-erOS9epZ.js → dispatch-BAwzftws.js} +32 -79
  86. package/dist/docs-viewer/DocsViewerServiceProvider.d.ts +2 -5
  87. package/dist/docs-viewer/endpoint.d.ts +5 -11
  88. package/dist/encryption/Encrypter.d.ts +5 -71
  89. package/dist/encryption/Hash.d.ts +7 -57
  90. package/dist/encryption/Random.d.ts +6 -99
  91. package/dist/encryption/index.js +3 -3
  92. package/dist/encryption/types.d.ts +10 -72
  93. package/dist/{encryption-D99Vmls3.js → encryption-uwP3Di4D.js} +9 -78
  94. package/dist/{endpoint-D6GIqOpe.js → endpoint-BXipU2Jj.js} +6 -12
  95. package/dist/endpoint-Dsw3Acvq.js +26 -0
  96. package/dist/errors/ExceptionHandler.d.ts +3 -90
  97. package/dist/errors/HttpException.d.ts +2 -79
  98. package/dist/errors/debug-page.d.ts +3 -17
  99. package/dist/errors/error-page.d.ts +1 -0
  100. package/dist/errors/exceptions/AuthenticationException.d.ts +2 -24
  101. package/dist/errors/exceptions/AuthorizationException.d.ts +1 -24
  102. package/dist/errors/exceptions/MethodNotAllowedException.d.ts +1 -23
  103. package/dist/errors/exceptions/NotFoundHttpException.d.ts +1 -27
  104. package/dist/errors/exceptions/ValidationException.d.ts +2 -43
  105. package/dist/errors/types.d.ts +1 -25
  106. package/dist/{errors-BgeOl_DC.js → errors-JpkcCjjn.js} +3 -41
  107. package/dist/events/Event.d.ts +1 -28
  108. package/dist/events/EventManager.d.ts +5 -107
  109. package/dist/events/Listener.d.ts +7 -55
  110. package/dist/events/builtin.d.ts +0 -24
  111. package/dist/events/index.js +1 -1
  112. package/dist/events/types.d.ts +4 -22
  113. package/dist/{events-aIH_bWRx.js → events-DOmAHDeP.js} +11 -191
  114. package/dist/facades/index.d.ts +2 -14
  115. package/dist/health/HealthCheck.d.ts +0 -24
  116. package/dist/health/HealthManager.d.ts +0 -36
  117. package/dist/health/checks/CacheCheck.d.ts +2 -17
  118. package/dist/health/checks/CustomCheck.d.ts +0 -9
  119. package/dist/health/checks/DatabaseCheck.d.ts +2 -17
  120. package/dist/health/checks/MemoryCheck.d.ts +3 -12
  121. package/dist/health/checks/RedisCheck.d.ts +1 -13
  122. package/dist/health/checks/StorageCheck.d.ts +2 -17
  123. package/dist/health/index.js +1 -1
  124. package/dist/health/types.d.ts +4 -24
  125. package/dist/{health-VWdWXRwh.js → health-DQSvUplL.js} +1 -76
  126. package/dist/hot-disposables-B5BXqaIH.js +167 -0
  127. package/dist/hot-reload/hot-disposables.d.ts +22 -74
  128. package/dist/hot-reload/testing.d.ts +4 -9
  129. package/dist/http/Application.d.ts +77 -205
  130. package/dist/http/FormRequest.d.ts +4 -55
  131. package/dist/http/dev-assets.d.ts +13 -31
  132. package/dist/http/dev-banner.d.ts +2 -5
  133. package/dist/http/inertia-assets.d.ts +3 -6
  134. package/dist/http/middleware/capabilities.d.ts +27 -50
  135. package/dist/http/middleware/cors.d.ts +4 -29
  136. package/dist/http/middleware/csp.d.ts +2 -25
  137. package/dist/http/middleware/csrf.d.ts +28 -95
  138. package/dist/http/middleware/detect-locale.d.ts +7 -27
  139. package/dist/http/middleware/force-https.d.ts +6 -24
  140. package/dist/http/middleware/host-authorization.d.ts +2 -12
  141. package/dist/http/middleware/index.d.ts +1 -1
  142. package/dist/http/middleware/loopback-guard.d.ts +15 -33
  143. package/dist/http/middleware/rate-limit.d.ts +29 -126
  144. package/dist/http/middleware/redirect-safety.d.ts +2 -20
  145. package/dist/http/middleware/request-id.d.ts +1 -14
  146. package/dist/http/middleware/request-logging.d.ts +2 -13
  147. package/dist/http/middleware/response-headers.d.ts +5 -13
  148. package/dist/http/middleware/security-headers.d.ts +2 -16
  149. package/dist/http/middleware/session.d.ts +15 -34
  150. package/dist/http/middleware/validation-errors-cookie.d.ts +7 -18
  151. package/dist/http/middleware/validation.d.ts +8 -63
  152. package/dist/http/public-assets.d.ts +11 -7
  153. package/dist/http/request.d.ts +32 -118
  154. package/dist/http/resources/CursorPaginator.d.ts +5 -64
  155. package/dist/http/resources/Paginator.d.ts +7 -84
  156. package/dist/http/resources/Resource.d.ts +9 -65
  157. package/dist/http/resources/ResourceCollection.d.ts +5 -39
  158. package/dist/http/resources/types.d.ts +10 -30
  159. package/dist/http/static-documents.d.ts +10 -20
  160. package/dist/http/validation/Validator.d.ts +25 -85
  161. package/dist/http/validation/rules.d.ts +48 -147
  162. package/dist/http/validation/types.d.ts +16 -61
  163. package/dist/http/vite-assets.d.ts +5 -28
  164. package/dist/http/vite-dev-server.d.ts +6 -9
  165. package/dist/http/vite-manifest.d.ts +19 -33
  166. package/dist/i18n/I18nManager.d.ts +12 -78
  167. package/dist/i18n/Translator.d.ts +3 -54
  168. package/dist/i18n/index.js +1 -1
  169. package/dist/i18n/loaders/JsonLoader.d.ts +4 -31
  170. package/dist/i18n/loaders/MemoryLoader.d.ts +1 -21
  171. package/dist/i18n/pluralization.d.ts +4 -13
  172. package/dist/i18n/types.d.ts +17 -69
  173. package/dist/{i18n-mcWi7LCd.js → i18n-Cg1aajRP.js} +31 -225
  174. package/dist/index.d.ts +11 -4
  175. package/dist/index.js +1186 -3040
  176. package/dist/internal/agent-preflight.d.ts +9 -21
  177. package/dist/internal/agent-principal.d.ts +32 -0
  178. package/dist/internal/request.d.ts +6 -19
  179. package/dist/internal/request.js +1 -1
  180. package/dist/internal/route-path.d.ts +9 -21
  181. package/dist/internal/route-path.js +9 -21
  182. package/dist/internal/zod-compat.d.ts +55 -122
  183. package/dist/internal/zod-compat.js +39 -70
  184. package/dist/internal/zod-json-schema.d.ts +18 -54
  185. package/dist/internal/zod-json-schema.js +46 -123
  186. package/dist/jsx-runtime.d.ts +3 -8
  187. package/dist/lambda/index.d.ts +17 -79
  188. package/dist/lambda/index.js +11 -59
  189. package/dist/logging/LogManager.d.ts +1 -51
  190. package/dist/logging/Logger.d.ts +8 -47
  191. package/dist/logging/channels/ConsoleChannel.d.ts +1 -3
  192. package/dist/logging/channels/DailyFileChannel.d.ts +1 -3
  193. package/dist/logging/channels/FileChannel.d.ts +1 -3
  194. package/dist/logging/daily-file-path.d.ts +7 -16
  195. package/dist/logging/index.js +1 -1
  196. package/dist/logging/types.d.ts +13 -45
  197. package/dist/{logging-B-kngi3q.js → logging-zOY1XCtq.js} +52 -141
  198. package/dist/{loopback-guard-D0Kc7-xc.js → loopback-guard-DT9gHF0F.js} +41 -92
  199. package/dist/mail/Mail.d.ts +10 -106
  200. package/dist/mail/MailManager.d.ts +2 -60
  201. package/dist/mail/index.js +1 -1
  202. package/dist/mail/transports/LogTransport.d.ts +1 -4
  203. package/dist/mail/transports/MemoryTransport.d.ts +1 -63
  204. package/dist/mail/transports/ResendTransport.d.ts +1 -23
  205. package/dist/mail/transports/SmtpTransport.d.ts +1 -31
  206. package/dist/mail/types.d.ts +28 -150
  207. package/dist/{mail-DfEfSQEr.js → mail-76DWy9lj.js} +31 -289
  208. package/dist/mcp/McpServiceProvider.d.ts +4 -10
  209. package/dist/mcp/create-mcp-server.d.ts +42 -57
  210. package/dist/mcp/endpoint.d.ts +12 -36
  211. package/dist/mcp/index.js +1 -1
  212. package/dist/mvc/Controller.d.ts +46 -227
  213. package/dist/mvc/Router.d.ts +50 -129
  214. package/dist/mvc/inertia/InertiaEngine.d.ts +18 -48
  215. package/dist/mvc/inertia/shared.d.ts +6 -19
  216. package/dist/mvc/mount-route.d.ts +2 -6
  217. package/dist/mvc/view.d.ts +1 -2
  218. package/dist/notifications/Notification.d.ts +8 -75
  219. package/dist/notifications/NotificationManager.d.ts +15 -88
  220. package/dist/notifications/channels/DatabaseChannel.d.ts +1 -41
  221. package/dist/notifications/channels/MailChannel.d.ts +2 -31
  222. package/dist/notifications/channels/MemoryChannel.d.ts +2 -62
  223. package/dist/notifications/channels/SlackChannel.d.ts +3 -48
  224. package/dist/notifications/index.js +1 -1
  225. package/dist/notifications/notifiable-type.d.ts +3 -6
  226. package/dist/notifications/registry.d.ts +8 -27
  227. package/dist/notifications/types.d.ts +16 -53
  228. package/dist/{notifications-BGqmUNZ8.js → notifications-okWFs9ly.js} +37 -335
  229. package/dist/providers/AuthServiceProvider.d.ts +1 -3
  230. package/dist/providers/AuthorizationServiceProvider.d.ts +2 -3
  231. package/dist/providers/BroadcastServiceProvider.d.ts +1 -3
  232. package/dist/providers/CacheServiceProvider.d.ts +1 -3
  233. package/dist/providers/EncryptionServiceProvider.d.ts +1 -3
  234. package/dist/providers/ErrorServiceProvider.d.ts +1 -4
  235. package/dist/providers/EventServiceProvider.d.ts +1 -3
  236. package/dist/providers/HealthServiceProvider.d.ts +1 -3
  237. package/dist/providers/I18nServiceProvider.d.ts +6 -10
  238. package/dist/providers/InertiaServiceProvider.d.ts +1 -4
  239. package/dist/providers/LogServiceProvider.d.ts +1 -3
  240. package/dist/providers/MailServiceProvider.d.ts +1 -3
  241. package/dist/providers/NotificationServiceProvider.d.ts +1 -3
  242. package/dist/providers/OAuthServiceProvider.d.ts +1 -3
  243. package/dist/providers/QueueServiceProvider.d.ts +1 -3
  244. package/dist/providers/SchedulingServiceProvider.d.ts +1 -3
  245. package/dist/providers/StorageServiceProvider.d.ts +1 -3
  246. package/dist/queue/FailedJobReporter.d.ts +1 -24
  247. package/dist/queue/Job.d.ts +12 -99
  248. package/dist/queue/QueueManager.d.ts +6 -57
  249. package/dist/queue/Worker.d.ts +4 -65
  250. package/dist/queue/drivers/MemoryDriver.d.ts +3 -44
  251. package/dist/queue/drivers/RedisDriver.d.ts +7 -65
  252. package/dist/queue/drivers/SqsDriver.d.ts +6 -57
  253. package/dist/queue/drivers/SyncDriver.d.ts +10 -13
  254. package/dist/queue/index.js +2 -2
  255. package/dist/queue/types.d.ts +10 -92
  256. package/dist/{queue-CXrRK85G.js → queue-CcXCjuJI.js} +32 -260
  257. package/dist/redis/RedisApiTokenStore.d.ts +4 -56
  258. package/dist/redis/RedisEmailVerificationStore.d.ts +4 -37
  259. package/dist/redis/RedisOAuthStateStore.d.ts +2 -10
  260. package/dist/redis/RedisPasswordResetStore.d.ts +4 -37
  261. package/dist/redis/RedisRateLimitStore.d.ts +16 -49
  262. package/dist/redis/RedisSessionStore.d.ts +3 -44
  263. package/dist/redis/client.d.ts +2 -32
  264. package/dist/redis/index.js +47 -232
  265. package/dist/redis/redis-values.d.ts +6 -12
  266. package/dist/redis/scan-keys.d.ts +1 -4
  267. package/dist/request-CLOYytGP.js +68 -0
  268. package/dist/runtime/index.d.ts +2 -0
  269. package/dist/runtime/index.js +50 -92
  270. package/dist/scheduling/CronParser.d.ts +0 -29
  271. package/dist/scheduling/Schedule.d.ts +1 -153
  272. package/dist/scheduling/ScheduledTask.d.ts +0 -31
  273. package/dist/scheduling/Scheduler.d.ts +0 -70
  274. package/dist/scheduling/index.js +1 -1
  275. package/dist/scheduling/types.d.ts +4 -65
  276. package/dist/{scheduling-CPiEdtQd.js → scheduling-C6tcOtUl.js} +2 -287
  277. package/dist/storage/StorageManager.d.ts +0 -48
  278. package/dist/storage/drivers/LocalDriver.d.ts +1 -25
  279. package/dist/storage/drivers/MemoryDriver.d.ts +5 -35
  280. package/dist/storage/drivers/S3Driver.d.ts +6 -36
  281. package/dist/storage/drivers/s3-acl.d.ts +5 -10
  282. package/dist/storage/index.js +1 -1
  283. package/dist/storage/types.d.ts +27 -265
  284. package/dist/{storage-TLD9t0Q2.js → storage-BB59f07j.js} +17 -157
  285. package/dist/support/contained-path.d.ts +10 -20
  286. package/dist/support/error-polyfill.d.ts +4 -6
  287. package/dist/support/expiry.d.ts +17 -33
  288. package/dist/support/expiry.js +17 -33
  289. package/dist/support/import-map.d.ts +3 -7
  290. package/dist/support/inertia-defaults.d.ts +5 -10
  291. package/dist/support/redirect-target.d.ts +4 -6
  292. package/dist/support/stack-frames.d.ts +11 -50
  293. package/dist/support/trim-slashes.d.ts +4 -7
  294. package/dist/support/warn-once.d.ts +2 -6
  295. package/dist/{trim-slashes-ZJ_VsY5s.js → trim-slashes-BLY9hKAa.js} +4 -7
  296. package/dist/{vite-manifest-w_RSOvQW.js → vite-manifest-B_Iy5183.js} +34 -58
  297. package/package.json +2 -2
  298. package/dist/client-Dd7vLcqp.js +0 -27
  299. package/dist/context-DoD0c7J_.js +0 -26
  300. package/dist/endpoint-D-20PiHY.js +0 -46
  301. package/dist/hot-disposables-WsTX2ySN.js +0 -281
  302. package/dist/request-CVQwpu2J.js +0 -129
@@ -2,9 +2,7 @@ import type { Application } from '../http/Application.js';
2
2
  import type { Scheduler } from '../scheduling/Scheduler.js';
3
3
  import type { ConsoleKernel } from '../console/ConsoleKernel.js';
4
4
  export type { APIGatewayProxyResult, LambdaEvent } from 'hono/aws-lambda';
5
- /**
6
- * SQS event record from AWS Lambda.
7
- */
5
+ /** SQS event record from AWS Lambda. */
8
6
  export interface SqsRecord {
9
7
  messageId: string;
10
8
  receiptHandle: string;
@@ -16,36 +14,19 @@ export interface SqsRecord {
16
14
  eventSourceARN: string;
17
15
  awsRegion: string;
18
16
  }
19
- /**
20
- * SQS event payload from AWS Lambda.
21
- */
17
+ /** SQS event payload from AWS Lambda. */
22
18
  export interface SqsEvent {
23
19
  Records: SqsRecord[];
24
20
  }
25
- /**
26
- * SQS batch item failure for partial batch response.
27
- */
21
+ /** SQS batch item failure for partial batch response. */
28
22
  export interface SqsBatchItemFailure {
29
23
  itemIdentifier: string;
30
24
  }
31
- /**
32
- * SQS batch response with partial failures.
33
- */
25
+ /** SQS batch response with partial failures. */
34
26
  export interface SqsBatchResponse {
35
27
  batchItemFailures: SqsBatchItemFailure[];
36
28
  }
37
- /**
38
- * Create an AWS Lambda handler from a booted Guren application.
39
- *
40
- * @example
41
- * ```typescript
42
- * import app from './src/app'
43
- * import { createLambdaHandler } from '@guren/server/lambda'
44
- *
45
- * await app.boot()
46
- * export const handler = createLambdaHandler(app)
47
- * ```
48
- */
29
+ /** Create an AWS Lambda handler from an already booted Guren application. */
49
30
  export declare function createLambdaHandler(app: Application): <L extends import("hono/aws-lambda").LambdaEvent>(event: L, lambdaContext?: import("hono/aws-lambda").LambdaContext) => Promise<import("hono/aws-lambda").APIGatewayProxyResult & (L extends {
50
31
  multiValueHeaders: Record<string, string[]>;
51
32
  } ? {
@@ -56,77 +37,34 @@ export declare function createLambdaHandler(app: Application): <L extends import
56
37
  multiValueHeaders?: undefined;
57
38
  })>;
58
39
  /**
59
- * Create an AWS Lambda handler for processing SQS queue jobs.
60
- *
61
- * Supports partial batch failure reporting — only failed messages
62
- * are returned to SQS for retry, while successful ones are deleted.
63
- *
64
- * @example
65
- * ```typescript
66
- * import app from './src/app'
67
- * import { createSqsHandler } from '@guren/server/lambda'
68
- *
69
- * await app.boot()
70
- * export const queue = createSqsHandler()
71
- * ```
40
+ * Create an AWS Lambda handler for SQS queue jobs. Reports partial batch
41
+ * failures, so only failed messages go back to SQS for retry.
72
42
  */
73
43
  export declare function createSqsHandler(): (event: SqsEvent) => Promise<SqsBatchResponse>;
74
- /**
75
- * Create an AWS Lambda handler for running scheduled tasks via EventBridge.
76
- *
77
- * @example
78
- * ```typescript
79
- * import { createScheduleHandler } from '@guren/server/lambda'
80
- * import { scheduler } from './src/scheduler'
81
- *
82
- * export const schedule = createScheduleHandler(scheduler)
83
- * ```
84
- */
44
+ /** Create an AWS Lambda handler for running scheduled tasks via EventBridge. */
85
45
  export declare function createScheduleHandler(scheduler: Scheduler): () => Promise<void>;
86
- /**
87
- * Console command event payload for Lambda.
88
- */
46
+ /** Console command event payload for Lambda. */
89
47
  export interface ConsoleEvent {
90
- /**
91
- * Command string to execute (e.g. "db:migrate", "users:create john@example.com --admin").
92
- */
48
+ /** Command string to execute, e.g. `"users:create jo@example.com --admin"`. */
93
49
  command: string;
94
50
  }
95
- /**
96
- * Console command result from Lambda.
97
- */
51
+ /** Console command result from Lambda. */
98
52
  export interface ConsoleResult {
99
53
  exitCode: number;
100
54
  }
101
55
  /**
102
- * Create an AWS Lambda handler for running console commands.
103
- *
104
- * Invoke via AWS CLI, SDK, or EventBridge with a JSON payload:
105
- * `{ "command": "db:migrate" }`
106
- *
107
- * @example
108
- * ```typescript
109
- * import { createConsoleHandler } from '@guren/server/lambda'
110
- * import { kernel } from './src/console'
111
- *
112
- * export const console = createConsoleHandler(kernel)
113
- * ```
56
+ * Create an AWS Lambda handler for running console commands. Invoke via AWS
57
+ * CLI, SDK, or EventBridge with a payload like `{ "command": "db:migrate" }`.
114
58
  */
115
59
  export declare function createConsoleHandler(kernel: ConsoleKernel): (event: ConsoleEvent) => Promise<ConsoleResult>;
116
60
  /**
117
- * Detect if the current process is running inside AWS Lambda.
118
- *
119
- * Checks for the `AWS_LAMBDA_FUNCTION_NAME` environment variable,
120
- * which AWS sets automatically in all Lambda runtimes.
61
+ * Whether the process is running inside AWS Lambda, by the
62
+ * `AWS_LAMBDA_FUNCTION_NAME` variable AWS sets in every Lambda runtime.
121
63
  */
122
64
  export declare function isLambda(): boolean;
123
- /**
124
- * Get Lambda environment metadata, or null if not running on Lambda.
125
- */
65
+ /** Get Lambda environment metadata, or null if not running on Lambda. */
126
66
  export declare function getLambdaContext(): LambdaRuntimeContext | null;
127
- /**
128
- * Lambda runtime context metadata.
129
- */
67
+ /** Lambda runtime context metadata. */
130
68
  export interface LambdaRuntimeContext {
131
69
  functionName: string;
132
70
  functionVersion: string;
@@ -1,35 +1,13 @@
1
- import { r as getJob } from "../Job-BVT813DO.js";
1
+ import { r as getJob } from "../Job-DxQK8h3P.js";
2
2
  import { handle } from "hono/aws-lambda";
3
3
  //#region src/lambda/index.ts
4
- /**
5
- * Create an AWS Lambda handler from a booted Guren application.
6
- *
7
- * @example
8
- * ```typescript
9
- * import app from './src/app'
10
- * import { createLambdaHandler } from '@guren/server/lambda'
11
- *
12
- * await app.boot()
13
- * export const handler = createLambdaHandler(app)
14
- * ```
15
- */
4
+ /** Create an AWS Lambda handler from an already booted Guren application. */
16
5
  function createLambdaHandler(app) {
17
6
  return handle(app.hono);
18
7
  }
19
8
  /**
20
- * Create an AWS Lambda handler for processing SQS queue jobs.
21
- *
22
- * Supports partial batch failure reporting — only failed messages
23
- * are returned to SQS for retry, while successful ones are deleted.
24
- *
25
- * @example
26
- * ```typescript
27
- * import app from './src/app'
28
- * import { createSqsHandler } from '@guren/server/lambda'
29
- *
30
- * await app.boot()
31
- * export const queue = createSqsHandler()
32
- * ```
9
+ * Create an AWS Lambda handler for SQS queue jobs. Reports partial batch
10
+ * failures, so only failed messages go back to SQS for retry.
33
11
  */
34
12
  function createSqsHandler() {
35
13
  return async (event) => {
@@ -53,35 +31,15 @@ function createSqsHandler() {
53
31
  return { batchItemFailures: failures };
54
32
  };
55
33
  }
56
- /**
57
- * Create an AWS Lambda handler for running scheduled tasks via EventBridge.
58
- *
59
- * @example
60
- * ```typescript
61
- * import { createScheduleHandler } from '@guren/server/lambda'
62
- * import { scheduler } from './src/scheduler'
63
- *
64
- * export const schedule = createScheduleHandler(scheduler)
65
- * ```
66
- */
34
+ /** Create an AWS Lambda handler for running scheduled tasks via EventBridge. */
67
35
  function createScheduleHandler(scheduler) {
68
36
  return async () => {
69
37
  await scheduler.runDueTasks();
70
38
  };
71
39
  }
72
40
  /**
73
- * Create an AWS Lambda handler for running console commands.
74
- *
75
- * Invoke via AWS CLI, SDK, or EventBridge with a JSON payload:
76
- * `{ "command": "db:migrate" }`
77
- *
78
- * @example
79
- * ```typescript
80
- * import { createConsoleHandler } from '@guren/server/lambda'
81
- * import { kernel } from './src/console'
82
- *
83
- * export const console = createConsoleHandler(kernel)
84
- * ```
41
+ * Create an AWS Lambda handler for running console commands. Invoke via AWS
42
+ * CLI, SDK, or EventBridge with a payload like `{ "command": "db:migrate" }`.
85
43
  */
86
44
  function createConsoleHandler(kernel) {
87
45
  return async (event) => {
@@ -90,17 +48,13 @@ function createConsoleHandler(kernel) {
90
48
  };
91
49
  }
92
50
  /**
93
- * Detect if the current process is running inside AWS Lambda.
94
- *
95
- * Checks for the `AWS_LAMBDA_FUNCTION_NAME` environment variable,
96
- * which AWS sets automatically in all Lambda runtimes.
51
+ * Whether the process is running inside AWS Lambda, by the
52
+ * `AWS_LAMBDA_FUNCTION_NAME` variable AWS sets in every Lambda runtime.
97
53
  */
98
54
  function isLambda() {
99
55
  return typeof process !== "undefined" && !!process.env?.AWS_LAMBDA_FUNCTION_NAME;
100
56
  }
101
- /**
102
- * Get Lambda environment metadata, or null if not running on Lambda.
103
- */
57
+ /** Get Lambda environment metadata, or null if not running on Lambda. */
104
58
  function getLambdaContext() {
105
59
  if (!isLambda()) return null;
106
60
  return {
@@ -113,9 +67,7 @@ function getLambdaContext() {
113
67
  tmpDir: "/tmp"
114
68
  };
115
69
  }
116
- /**
117
- * Deserialize a JSON SQS message body into a QueuedJob-like object.
118
- */
70
+ /** Deserialize a JSON SQS message body into a QueuedJob-like object. */
119
71
  function deserializeSqsJob(body) {
120
72
  const raw = JSON.parse(body);
121
73
  return {
@@ -1,26 +1,6 @@
1
1
  import type { LogConfig, LogChannelFactory } from './types.js';
2
2
  import { Logger } from './Logger.js';
3
- /**
4
- * Log manager for managing multiple logging channels.
5
- *
6
- * @example
7
- * ```ts
8
- * const log = new LogManager({
9
- * default: 'stack',
10
- * channels: {
11
- * console: { driver: 'console', level: 'debug' },
12
- * file: { driver: 'daily', path: './storage/logs/app.log', days: 14 },
13
- * stack: { driver: 'stack', channels: ['console', 'file'] },
14
- * }
15
- * })
16
- *
17
- * log.info('User logged in', { userId: user.id })
18
- * log.error('Payment failed', { orderId, error: error.message })
19
- *
20
- * const requestLog = log.withContext({ requestId: ctx.requestId })
21
- * requestLog.info('Processing request')
22
- * ```
23
- */
3
+ /** Log manager for managing multiple logging channels. */
24
4
  export declare class LogManager {
25
5
  private readonly config;
26
6
  private readonly channelFactories;
@@ -30,22 +10,10 @@ export declare class LogManager {
30
10
  constructor(config: LogConfig);
31
11
  private registerDefaultDrivers;
32
12
  private createStackChannel;
33
- /**
34
- * Register a custom channel driver.
35
- */
36
13
  registerDriver(name: string, factory: LogChannelFactory): void;
37
- /**
38
- * Get a logger for a specific channel.
39
- */
40
14
  channel(name?: string): Logger;
41
- /**
42
- * Get a logger that writes to multiple channels.
43
- */
44
15
  stack(channelNames: string[]): Logger;
45
16
  private resolveChannel;
46
- /**
47
- * Create a logger with additional context using the default channel.
48
- */
49
17
  withContext(context: Record<string, unknown>): Logger;
50
18
  emergency(message: string, context?: Record<string, unknown>): void;
51
19
  alert(message: string, context?: Record<string, unknown>): void;
@@ -56,28 +24,10 @@ export declare class LogManager {
56
24
  notice(message: string, context?: Record<string, unknown>): void;
57
25
  info(message: string, context?: Record<string, unknown>): void;
58
26
  debug(message: string, context?: Record<string, unknown>): void;
59
- /**
60
- * Close all channel instances.
61
- */
62
27
  close(): Promise<void>;
63
- /**
64
- * Get the default channel name.
65
- */
66
28
  getDefaultChannel(): string;
67
- /**
68
- * Get available channel names.
69
- */
70
29
  getChannelNames(): string[];
71
30
  }
72
- /**
73
- * Create a log manager instance.
74
- */
75
31
  export declare function createLogManager(config: LogConfig): LogManager;
76
- /**
77
- * Set the global log manager instance.
78
- */
79
32
  export declare function setLogManager(manager: LogManager): void;
80
- /**
81
- * Get the global log manager instance.
82
- */
83
33
  export declare function getLogManager(): LogManager;
@@ -1,76 +1,37 @@
1
1
  import type { LogChannel, LogLevel, LogContext } from './types.js';
2
2
  export interface LoggerOptions {
3
- /**
4
- * Keys whose values should be replaced with the replacement string.
5
- * Matching is case-insensitive and recursive.
6
- */
3
+ /** Keys to redact. Matching is case-insensitive and recursive. */
7
4
  filterKeys?: string[];
8
5
  /** Replacement string for filtered values. Default: '[FILTERED]' */
9
6
  replacement?: string;
10
7
  }
11
- /**
12
- * Recursively replace values of sensitive keys in a log context object.
13
- */
8
+ /** Recursively replace values of sensitive keys in a log context object. */
14
9
  export declare function filterSensitiveData(data: Record<string, unknown>, filterKeys: string[], replacement?: string): Record<string, unknown>;
15
10
  /**
16
- * Logger instance for writing log entries.
11
+ * Whether a channel's `log()` handed back something to wait on. A duck-typed
12
+ * check rather than `instanceof Promise`: a promise created in another realm
13
+ * (a `node:vm` context, a worker's module graph) satisfies the channel
14
+ * contract and would otherwise slip past the reporter as an unhandled rejection.
17
15
  */
16
+ export declare function isPromiseLike(value: unknown): value is PromiseLike<unknown>;
17
+ /** Logger instance for writing log entries. */
18
18
  export declare class Logger {
19
19
  private readonly channels;
20
20
  private readonly baseContext;
21
21
  private readonly filterKeys;
22
22
  private readonly replacement;
23
23
  constructor(channels: LogChannel[], context?: LogContext, options?: LoggerOptions);
24
- /**
25
- * Log at emergency level (system is unusable).
26
- */
27
24
  emergency(message: string, context?: LogContext): void;
28
- /**
29
- * Log at alert level (action must be taken immediately).
30
- */
31
25
  alert(message: string, context?: LogContext): void;
32
- /**
33
- * Log at critical level (critical conditions).
34
- */
35
26
  critical(message: string, context?: LogContext): void;
36
- /**
37
- * Log at error level (error conditions).
38
- */
39
27
  error(message: string, context?: LogContext): void;
40
- /**
41
- * Log at warning level (warning conditions).
42
- */
43
28
  warning(message: string, context?: LogContext): void;
44
- /**
45
- * Alias for warning().
46
- */
47
29
  warn(message: string, context?: LogContext): void;
48
- /**
49
- * Log at notice level (normal but significant conditions).
50
- */
51
30
  notice(message: string, context?: LogContext): void;
52
- /**
53
- * Log at info level (informational messages).
54
- */
55
31
  info(message: string, context?: LogContext): void;
56
- /**
57
- * Log at debug level (debug-level messages).
58
- */
59
32
  debug(message: string, context?: LogContext): void;
60
- /**
61
- * Log a message at the specified level.
62
- */
63
33
  log(level: LogLevel, message: string, context?: LogContext): void;
64
- /**
65
- * Create a new logger with additional context.
66
- */
67
34
  withContext(context: LogContext): Logger;
68
- /**
69
- * Create a child logger with additional context (alias for withContext).
70
- */
71
35
  child(context: LogContext): Logger;
72
- /**
73
- * Close all channels.
74
- */
75
36
  close(): Promise<void>;
76
37
  }
@@ -1,7 +1,5 @@
1
1
  import type { LogChannel, LogEntry, ConsoleChannelConfig } from '../types.js';
2
- /**
3
- * Console log channel.
4
- */
2
+ /** Console log channel. */
5
3
  export declare class ConsoleChannel implements LogChannel {
6
4
  private readonly config;
7
5
  private readonly minLevel;
@@ -1,7 +1,5 @@
1
1
  import type { LogChannel, LogEntry, DailyFileChannelConfig } from '../types.js';
2
- /**
3
- * Daily rotating file log channel.
4
- */
2
+ /** Daily rotating file log channel. */
5
3
  export declare class DailyFileChannel implements LogChannel {
6
4
  private readonly config;
7
5
  private readonly minLevel;
@@ -1,7 +1,5 @@
1
1
  import type { LogChannel, LogEntry, FileChannelConfig } from '../types.js';
2
- /**
3
- * File log channel.
4
- */
2
+ /** File log channel. */
5
3
  export declare class FileChannel implements LogChannel {
6
4
  private readonly config;
7
5
  private readonly minLevel;
@@ -1,24 +1,15 @@
1
1
  /**
2
- * The `YYYY-MM-DD` stamp a file rotated at `date` carries.
3
- *
4
- * UTC, from the ISO form, because the rotation boundary has to be the same
5
- * instant for every process appending to the same directory — a fleet split
6
- * across time zones would otherwise write two different files for one day and
7
- * roll over at as many moments as it has zones.
2
+ * The `YYYY-MM-DD` stamp a file rotated at `date` carries. UTC, because the
3
+ * rotation boundary must be the same instant for every process appending to one
4
+ * directory — a fleet across time zones would write two files for one day.
8
5
  */
9
6
  export declare function dailyFileDateStamp(date: Date): string;
10
7
  /** The dated file a base path rotates to on `date`. */
11
8
  export declare function dailyFilePath(basePath: string, date: Date): string;
12
9
  /**
13
- * The date stamp of `fileName` if it is one of `basePath`'s dated files, and
14
- * `null` if it is anything else in the same directory.
15
- *
16
- * The inverse of {@link dailyFilePath}, and the reason a caller listing a
17
- * directory does not need to know the shape it is matching. The base path's
18
- * own name and extension are escaped before they enter the pattern: a log
19
- * called `app.v1.log` parses to the name `app.v1`, whose dots would otherwise
20
- * match any character and let a *different* app's files into another's
21
- * rotation set — which, for the cleanup that consumes this, means deleting
22
- * them.
10
+ * The date stamp of `fileName` if it is one of `basePath`'s dated files, else
11
+ * `null` — the inverse of {@link dailyFilePath}. The base name and extension
12
+ * are escaped first: `app.v1.log` would otherwise match another app's files
13
+ * into this rotation set, which for the cleanup consuming it means deleting them.
23
14
  */
24
15
  export declare function matchDailyFileDate(basePath: string, fileName: string): string | null;
@@ -1,2 +1,2 @@
1
- import { a as DailyFileChannel, c as matchDailyFileDate, d as Logger, f as filterSensitiveData, i as setLogManager, l as FileChannel, n as createLogManager, o as dailyFileDateStamp, p as LOG_LEVEL_PRIORITY, r as getLogManager, s as dailyFilePath, t as LogManager, u as ConsoleChannel } from "../logging-B-kngi3q.js";
1
+ import { a as DailyFileChannel, c as matchDailyFileDate, d as Logger, f as filterSensitiveData, i as setLogManager, l as FileChannel, n as createLogManager, o as dailyFileDateStamp, p as LOG_LEVEL_PRIORITY, r as getLogManager, s as dailyFilePath, t as LogManager, u as ConsoleChannel } from "../logging-zOY1XCtq.js";
2
2
  export { ConsoleChannel, DailyFileChannel, FileChannel, LOG_LEVEL_PRIORITY, LogManager, Logger, createLogManager, dailyFileDateStamp, dailyFilePath, filterSensitiveData, getLogManager, matchDailyFileDate, setLogManager };
@@ -1,85 +1,55 @@
1
- /**
2
- * Log level types (RFC 5424 severity levels).
3
- */
1
+ /** Log level types (RFC 5424 severity levels). */
4
2
  export type LogLevel = 'emergency' | 'alert' | 'critical' | 'error' | 'warning' | 'notice' | 'info' | 'debug';
5
- /**
6
- * Log level priority (lower = more severe).
7
- */
3
+ /** Log level priority (lower = more severe). */
8
4
  export declare const LOG_LEVEL_PRIORITY: Record<LogLevel, number>;
9
- /**
10
- * Log context (additional data attached to log entries).
11
- */
5
+ /** Log context (additional data attached to log entries). */
12
6
  export type LogContext = Record<string, unknown>;
13
- /**
14
- * Log entry structure.
15
- */
7
+ /** Log entry structure. */
16
8
  export interface LogEntry {
17
9
  level: LogLevel;
18
10
  message: string;
19
11
  context: LogContext;
20
12
  timestamp: Date;
21
13
  }
22
- /**
23
- * Log channel interface.
24
- */
14
+ /** Log channel interface. */
25
15
  export interface LogChannel {
26
- /**
27
- * Write a log entry.
28
- */
29
16
  log(entry: LogEntry): void | Promise<void>;
30
- /**
31
- * Close the channel (cleanup resources).
32
- */
33
17
  close?(): void | Promise<void>;
34
18
  }
35
- /**
36
- * Log channel factory.
37
- */
19
+ /** Log channel factory. */
38
20
  export type LogChannelFactory = (config: LogChannelConfig) => LogChannel;
39
- /**
40
- * Base channel configuration.
41
- */
21
+ /** Base channel configuration. */
42
22
  export interface LogChannelConfig {
43
23
  driver: string;
44
24
  level?: LogLevel;
45
25
  [key: string]: unknown;
46
26
  }
47
- /**
48
- * Console channel configuration.
49
- */
27
+ /** Console channel configuration. */
50
28
  export interface ConsoleChannelConfig extends LogChannelConfig {
51
29
  driver: 'console';
52
30
  colors?: boolean;
53
31
  timestamps?: boolean;
54
32
  format?: 'text' | 'json';
55
33
  }
56
- /**
57
- * File channel configuration.
58
- */
34
+ /** File channel configuration. */
59
35
  export interface FileChannelConfig extends LogChannelConfig {
60
36
  driver: 'file';
61
37
  path: string;
62
38
  format?: 'text' | 'json';
63
39
  }
64
- /**
65
- * Daily file channel configuration.
66
- */
40
+ /** Daily file channel configuration. */
67
41
  export interface DailyFileChannelConfig extends LogChannelConfig {
68
42
  driver: 'daily';
69
43
  path: string;
70
44
  days?: number;
71
45
  format?: 'text' | 'json';
72
46
  }
73
- /**
74
- * Stack channel configuration.
75
- */
47
+ /** Stack channel configuration. */
76
48
  export interface StackChannelConfig extends LogChannelConfig {
77
49
  driver: 'stack';
78
50
  channels: string[];
79
51
  }
80
- /**
81
- * Log manager configuration.
82
- */
52
+ /** Log manager configuration. */
83
53
  export interface LogConfig {
84
54
  default: string;
85
55
  channels: Record<string, LogChannelConfig>;
@@ -88,9 +58,7 @@ export interface LogConfig {
88
58
  /** Replacement string for filtered values. Default: '[FILTERED]' */
89
59
  filterReplacement?: string;
90
60
  }
91
- /**
92
- * Log formatter.
93
- */
61
+ /** Log formatter. */
94
62
  export interface LogFormatter {
95
63
  format(entry: LogEntry): string;
96
64
  }