@guren/server 2.14.0 → 2.16.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 (297) hide show
  1. package/dist/{DocsViewerServiceProvider-qFCaeiUv.js → DocsViewerServiceProvider-D2cuVgtN.js} +7 -12
  2. package/dist/{Hash-CzrwKeDp.js → Hash-D2DFd8xX.js} +12 -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-nNcbCIQX.js} +11 -20
  6. package/dist/{Random-DbIJ22KQ.js → Random-S0OvCuR8.js} +9 -106
  7. package/dist/agent/AgentApprovalRequested.d.ts +31 -0
  8. package/dist/agent/approval.d.ts +184 -0
  9. package/dist/agent/audit-emitter.d.ts +36 -0
  10. package/dist/agent/audit.d.ts +67 -0
  11. package/dist/agent/derive.d.ts +32 -66
  12. package/dist/agent/dispatch.d.ts +53 -63
  13. package/dist/agent/events.d.ts +11 -19
  14. package/dist/agent/meta-tools.d.ts +34 -0
  15. package/dist/agent/public.d.ts +14 -0
  16. package/dist/agent/public.js +2 -0
  17. package/dist/agent/redact.d.ts +16 -38
  18. package/dist/agent/scopes.d.ts +23 -69
  19. package/dist/auth/AuthManager.d.ts +19 -40
  20. package/dist/auth/AuthenticatableModel.d.ts +2 -2
  21. package/dist/auth/SessionGuard.d.ts +0 -1
  22. package/dist/auth/TokenGuard.d.ts +6 -26
  23. package/dist/auth/api-token.d.ts +16 -148
  24. package/dist/auth/context.d.ts +5 -10
  25. package/dist/auth/email-verification.d.ts +29 -127
  26. package/dist/auth/index.js +1 -1
  27. package/dist/auth/oauth/index.d.ts +35 -57
  28. package/dist/auth/password/DefaultHasher.d.ts +9 -5
  29. package/dist/auth/password/PasswordHasher.d.ts +7 -0
  30. package/dist/auth/password/hash-format.d.ts +11 -0
  31. package/dist/auth/password-reset.d.ts +16 -42
  32. package/dist/auth/providers/ModelUserProvider.d.ts +3 -4
  33. package/dist/auth/providers/UserProvider.d.ts +4 -4
  34. package/dist/auth/signed-token.d.ts +18 -0
  35. package/dist/auth/types.d.ts +9 -32
  36. package/dist/auth/utils.d.ts +6 -27
  37. package/dist/{auth-BSUc14CD.js → auth-CbdPH4Cd.js} +252 -496
  38. package/dist/authorization/Gate.d.ts +9 -145
  39. package/dist/authorization/Policy.d.ts +6 -53
  40. package/dist/authorization/index.js +1 -1
  41. package/dist/authorization/middleware.d.ts +16 -62
  42. package/dist/authorization/types.d.ts +8 -64
  43. package/dist/{authorization-CdfbCj8J.js → authorization-CdEWZZw3.js} +44 -309
  44. package/dist/broadcasting/BroadcastManager.d.ts +29 -149
  45. package/dist/broadcasting/channels/Channel.d.ts +1 -19
  46. package/dist/broadcasting/channels/PresenceChannel.d.ts +1 -55
  47. package/dist/broadcasting/channels/PrivateChannel.d.ts +1 -23
  48. package/dist/broadcasting/drivers/MemoryDriver.d.ts +18 -70
  49. package/dist/broadcasting/drivers/RedisDriver.d.ts +3 -80
  50. package/dist/broadcasting/drivers/index.d.ts +1 -1
  51. package/dist/broadcasting/index.d.ts +1 -1
  52. package/dist/broadcasting/index.js +1 -1
  53. package/dist/broadcasting/types.d.ts +7 -88
  54. package/dist/{broadcasting-BxU-LIfF.js → broadcasting-B5RzB0A2.js} +87 -414
  55. package/dist/cache/CacheManager.d.ts +8 -62
  56. package/dist/cache/TaggedCache.d.ts +2 -35
  57. package/dist/cache/index.js +1 -1
  58. package/dist/cache/stores/FileStore.d.ts +2 -36
  59. package/dist/cache/stores/MemoryStore.d.ts +2 -26
  60. package/dist/cache/stores/RedisStore.d.ts +1 -29
  61. package/dist/cache/types.d.ts +21 -128
  62. package/dist/{cache-BYnZf2FR.js → cache-BOOIr324.js} +19 -198
  63. package/dist/client-C4TEr_Dd.js +9 -0
  64. package/dist/console/Command.d.ts +17 -126
  65. package/dist/console/ConsoleKernel.d.ts +2 -74
  66. package/dist/console/Input.d.ts +5 -113
  67. package/dist/console/Output.d.ts +3 -99
  68. package/dist/console/types.d.ts +3 -33
  69. package/dist/container/Container.d.ts +12 -103
  70. package/dist/container/ServiceProvider.d.ts +17 -61
  71. package/dist/container/bindings.d.ts +10 -12
  72. package/dist/container/defineModule.d.ts +16 -54
  73. package/dist/container/definePlugin.d.ts +12 -45
  74. package/dist/container/types.d.ts +2 -34
  75. package/dist/context-CXk_umpT.js +21 -0
  76. package/dist/database/Factory.d.ts +4 -57
  77. package/dist/database/Seeder.d.ts +8 -46
  78. package/dist/database/SeederRunner.d.ts +3 -33
  79. package/dist/database/types.d.ts +3 -24
  80. package/dist/discovery/AutoDiscovery.d.ts +10 -82
  81. package/dist/dispatch-BAwzftws.js +238 -0
  82. package/dist/docs-viewer/DocsViewerServiceProvider.d.ts +2 -5
  83. package/dist/docs-viewer/endpoint.d.ts +5 -11
  84. package/dist/encryption/Encrypter.d.ts +5 -71
  85. package/dist/encryption/Hash.d.ts +7 -57
  86. package/dist/encryption/Random.d.ts +6 -99
  87. package/dist/encryption/index.js +3 -3
  88. package/dist/encryption/types.d.ts +10 -72
  89. package/dist/{encryption-DJtkkhiw.js → encryption-uwP3Di4D.js} +13 -79
  90. package/dist/{endpoint-D6GIqOpe.js → endpoint-BXipU2Jj.js} +6 -12
  91. package/dist/endpoint-Dsw3Acvq.js +26 -0
  92. package/dist/errors/ExceptionHandler.d.ts +3 -90
  93. package/dist/errors/HttpException.d.ts +2 -79
  94. package/dist/errors/debug-page.d.ts +3 -17
  95. package/dist/errors/error-page.d.ts +1 -0
  96. package/dist/errors/exceptions/AuthenticationException.d.ts +2 -24
  97. package/dist/errors/exceptions/AuthorizationException.d.ts +1 -24
  98. package/dist/errors/exceptions/MethodNotAllowedException.d.ts +1 -23
  99. package/dist/errors/exceptions/NotFoundHttpException.d.ts +1 -27
  100. package/dist/errors/exceptions/ValidationException.d.ts +2 -43
  101. package/dist/errors/types.d.ts +1 -25
  102. package/dist/{errors-BgeOl_DC.js → errors-JpkcCjjn.js} +3 -41
  103. package/dist/events/Event.d.ts +1 -28
  104. package/dist/events/EventManager.d.ts +5 -107
  105. package/dist/events/Listener.d.ts +7 -55
  106. package/dist/events/builtin.d.ts +0 -24
  107. package/dist/events/index.js +1 -1
  108. package/dist/events/types.d.ts +4 -22
  109. package/dist/{events-aIH_bWRx.js → events-DOmAHDeP.js} +11 -191
  110. package/dist/facades/index.d.ts +2 -14
  111. package/dist/health/HealthCheck.d.ts +0 -24
  112. package/dist/health/HealthManager.d.ts +0 -36
  113. package/dist/health/checks/CacheCheck.d.ts +2 -17
  114. package/dist/health/checks/CustomCheck.d.ts +0 -9
  115. package/dist/health/checks/DatabaseCheck.d.ts +2 -17
  116. package/dist/health/checks/MemoryCheck.d.ts +3 -12
  117. package/dist/health/checks/RedisCheck.d.ts +1 -13
  118. package/dist/health/checks/StorageCheck.d.ts +2 -17
  119. package/dist/health/index.js +1 -1
  120. package/dist/health/types.d.ts +4 -24
  121. package/dist/{health-VWdWXRwh.js → health-DQSvUplL.js} +1 -76
  122. package/dist/hot-disposables-B5BXqaIH.js +167 -0
  123. package/dist/hot-reload/hot-disposables.d.ts +22 -74
  124. package/dist/hot-reload/testing.d.ts +4 -9
  125. package/dist/http/Application.d.ts +62 -208
  126. package/dist/http/FormRequest.d.ts +4 -55
  127. package/dist/http/dev-assets.d.ts +16 -18
  128. package/dist/http/dev-banner.d.ts +2 -5
  129. package/dist/http/inertia-assets.d.ts +3 -6
  130. package/dist/http/middleware/capabilities.d.ts +27 -50
  131. package/dist/http/middleware/cors.d.ts +4 -29
  132. package/dist/http/middleware/csp.d.ts +2 -25
  133. package/dist/http/middleware/csrf.d.ts +20 -95
  134. package/dist/http/middleware/detect-locale.d.ts +7 -27
  135. package/dist/http/middleware/force-https.d.ts +6 -24
  136. package/dist/http/middleware/host-authorization.d.ts +2 -12
  137. package/dist/http/middleware/loopback-guard.d.ts +15 -33
  138. package/dist/http/middleware/rate-limit.d.ts +29 -126
  139. package/dist/http/middleware/redirect-safety.d.ts +2 -20
  140. package/dist/http/middleware/request-id.d.ts +1 -14
  141. package/dist/http/middleware/request-logging.d.ts +2 -13
  142. package/dist/http/middleware/response-headers.d.ts +5 -13
  143. package/dist/http/middleware/security-headers.d.ts +2 -16
  144. package/dist/http/middleware/session.d.ts +15 -34
  145. package/dist/http/middleware/validation-errors-cookie.d.ts +7 -18
  146. package/dist/http/middleware/validation.d.ts +8 -63
  147. package/dist/http/public-assets.d.ts +14 -0
  148. package/dist/http/request.d.ts +49 -48
  149. package/dist/http/resources/CursorPaginator.d.ts +5 -64
  150. package/dist/http/resources/Paginator.d.ts +7 -84
  151. package/dist/http/resources/Resource.d.ts +9 -65
  152. package/dist/http/resources/ResourceCollection.d.ts +5 -39
  153. package/dist/http/resources/types.d.ts +10 -30
  154. package/dist/http/static-documents.d.ts +21 -0
  155. package/dist/http/validation/Validator.d.ts +25 -85
  156. package/dist/http/validation/rules.d.ts +48 -147
  157. package/dist/http/validation/types.d.ts +16 -61
  158. package/dist/http/vite-assets.d.ts +5 -28
  159. package/dist/http/vite-dev-server.d.ts +6 -9
  160. package/dist/http/vite-manifest.d.ts +19 -33
  161. package/dist/i18n/I18nManager.d.ts +12 -78
  162. package/dist/i18n/Translator.d.ts +3 -54
  163. package/dist/i18n/index.js +1 -1
  164. package/dist/i18n/loaders/JsonLoader.d.ts +4 -31
  165. package/dist/i18n/loaders/MemoryLoader.d.ts +1 -21
  166. package/dist/i18n/pluralization.d.ts +4 -13
  167. package/dist/i18n/types.d.ts +17 -69
  168. package/dist/{i18n-mcWi7LCd.js → i18n-Cg1aajRP.js} +31 -225
  169. package/dist/index.d.ts +13 -4
  170. package/dist/index.js +1036 -3080
  171. package/dist/internal/agent-preflight.d.ts +9 -21
  172. package/dist/internal/request.d.ts +10 -17
  173. package/dist/internal/request.js +2 -2
  174. package/dist/internal/route-path.d.ts +9 -21
  175. package/dist/internal/route-path.js +9 -21
  176. package/dist/internal/zod-compat.d.ts +55 -122
  177. package/dist/internal/zod-compat.js +39 -70
  178. package/dist/internal/zod-json-schema.d.ts +18 -54
  179. package/dist/internal/zod-json-schema.js +46 -123
  180. package/dist/jsx-runtime.d.ts +3 -8
  181. package/dist/lambda/index.d.ts +17 -79
  182. package/dist/lambda/index.js +11 -59
  183. package/dist/logging/LogManager.d.ts +1 -51
  184. package/dist/logging/Logger.d.ts +8 -47
  185. package/dist/logging/channels/ConsoleChannel.d.ts +1 -3
  186. package/dist/logging/channels/DailyFileChannel.d.ts +1 -5
  187. package/dist/logging/channels/FileChannel.d.ts +1 -3
  188. package/dist/logging/daily-file-path.d.ts +15 -0
  189. package/dist/logging/index.d.ts +1 -0
  190. package/dist/logging/index.js +2 -2
  191. package/dist/logging/types.d.ts +13 -45
  192. package/dist/{logging-CPaRMuPP.js → logging-zOY1XCtq.js} +83 -129
  193. package/dist/{loopback-guard-D0Kc7-xc.js → loopback-guard-DT9gHF0F.js} +41 -92
  194. package/dist/mail/Mail.d.ts +10 -106
  195. package/dist/mail/MailManager.d.ts +2 -60
  196. package/dist/mail/index.js +1 -1
  197. package/dist/mail/transports/LogTransport.d.ts +1 -4
  198. package/dist/mail/transports/MemoryTransport.d.ts +1 -63
  199. package/dist/mail/transports/ResendTransport.d.ts +1 -23
  200. package/dist/mail/transports/SmtpTransport.d.ts +1 -31
  201. package/dist/mail/types.d.ts +28 -150
  202. package/dist/{mail-DfEfSQEr.js → mail-76DWy9lj.js} +31 -289
  203. package/dist/mcp/McpServiceProvider.d.ts +4 -10
  204. package/dist/mcp/create-mcp-server.d.ts +25 -57
  205. package/dist/mcp/endpoint.d.ts +12 -36
  206. package/dist/mcp/index.js +1 -1
  207. package/dist/mvc/Controller.d.ts +46 -253
  208. package/dist/mvc/Router.d.ts +50 -129
  209. package/dist/mvc/inertia/InertiaEngine.d.ts +18 -48
  210. package/dist/mvc/inertia/shared.d.ts +6 -19
  211. package/dist/mvc/mount-route.d.ts +2 -6
  212. package/dist/mvc/view.d.ts +1 -2
  213. package/dist/notifications/Notification.d.ts +8 -75
  214. package/dist/notifications/NotificationManager.d.ts +15 -88
  215. package/dist/notifications/channels/DatabaseChannel.d.ts +1 -41
  216. package/dist/notifications/channels/MailChannel.d.ts +2 -31
  217. package/dist/notifications/channels/MemoryChannel.d.ts +2 -62
  218. package/dist/notifications/channels/SlackChannel.d.ts +3 -48
  219. package/dist/notifications/index.js +1 -1
  220. package/dist/notifications/notifiable-type.d.ts +3 -6
  221. package/dist/notifications/registry.d.ts +8 -27
  222. package/dist/notifications/types.d.ts +16 -53
  223. package/dist/{notifications-BGqmUNZ8.js → notifications-okWFs9ly.js} +37 -335
  224. package/dist/providers/AuthServiceProvider.d.ts +1 -3
  225. package/dist/providers/AuthorizationServiceProvider.d.ts +2 -3
  226. package/dist/providers/BroadcastServiceProvider.d.ts +1 -3
  227. package/dist/providers/CacheServiceProvider.d.ts +1 -3
  228. package/dist/providers/EncryptionServiceProvider.d.ts +1 -3
  229. package/dist/providers/ErrorServiceProvider.d.ts +1 -4
  230. package/dist/providers/EventServiceProvider.d.ts +1 -3
  231. package/dist/providers/HealthServiceProvider.d.ts +1 -3
  232. package/dist/providers/I18nServiceProvider.d.ts +6 -10
  233. package/dist/providers/InertiaServiceProvider.d.ts +1 -4
  234. package/dist/providers/LogServiceProvider.d.ts +1 -3
  235. package/dist/providers/MailServiceProvider.d.ts +1 -3
  236. package/dist/providers/NotificationServiceProvider.d.ts +1 -3
  237. package/dist/providers/OAuthServiceProvider.d.ts +1 -3
  238. package/dist/providers/QueueServiceProvider.d.ts +1 -3
  239. package/dist/providers/SchedulingServiceProvider.d.ts +1 -3
  240. package/dist/providers/StorageServiceProvider.d.ts +1 -3
  241. package/dist/queue/FailedJobReporter.d.ts +1 -24
  242. package/dist/queue/Job.d.ts +12 -99
  243. package/dist/queue/QueueManager.d.ts +6 -57
  244. package/dist/queue/Worker.d.ts +4 -65
  245. package/dist/queue/drivers/MemoryDriver.d.ts +3 -44
  246. package/dist/queue/drivers/RedisDriver.d.ts +7 -65
  247. package/dist/queue/drivers/SqsDriver.d.ts +6 -57
  248. package/dist/queue/drivers/SyncDriver.d.ts +10 -13
  249. package/dist/queue/index.js +2 -2
  250. package/dist/queue/types.d.ts +10 -92
  251. package/dist/{queue-CXrRK85G.js → queue-CcXCjuJI.js} +32 -260
  252. package/dist/redis/RedisApiTokenStore.d.ts +4 -56
  253. package/dist/redis/RedisEmailVerificationStore.d.ts +4 -37
  254. package/dist/redis/RedisOAuthStateStore.d.ts +2 -10
  255. package/dist/redis/RedisPasswordResetStore.d.ts +4 -37
  256. package/dist/redis/RedisRateLimitStore.d.ts +16 -49
  257. package/dist/redis/RedisSessionStore.d.ts +3 -44
  258. package/dist/redis/client.d.ts +2 -32
  259. package/dist/redis/index.js +47 -232
  260. package/dist/redis/redis-values.d.ts +6 -12
  261. package/dist/redis/scan-keys.d.ts +1 -4
  262. package/dist/request-CLOYytGP.js +68 -0
  263. package/dist/runtime/index.d.ts +2 -0
  264. package/dist/runtime/index.js +108 -74
  265. package/dist/scheduling/CronParser.d.ts +0 -29
  266. package/dist/scheduling/Schedule.d.ts +1 -153
  267. package/dist/scheduling/ScheduledTask.d.ts +0 -31
  268. package/dist/scheduling/Scheduler.d.ts +0 -70
  269. package/dist/scheduling/index.js +1 -1
  270. package/dist/scheduling/types.d.ts +4 -65
  271. package/dist/{scheduling-CPiEdtQd.js → scheduling-C6tcOtUl.js} +2 -287
  272. package/dist/storage/StorageManager.d.ts +0 -48
  273. package/dist/storage/drivers/LocalDriver.d.ts +1 -25
  274. package/dist/storage/drivers/MemoryDriver.d.ts +5 -35
  275. package/dist/storage/drivers/S3Driver.d.ts +6 -36
  276. package/dist/storage/drivers/s3-acl.d.ts +5 -10
  277. package/dist/storage/index.js +1 -1
  278. package/dist/storage/types.d.ts +27 -265
  279. package/dist/{storage-TLD9t0Q2.js → storage-BB59f07j.js} +17 -157
  280. package/dist/support/contained-path.d.ts +10 -20
  281. package/dist/support/error-polyfill.d.ts +4 -6
  282. package/dist/support/expiry.d.ts +17 -33
  283. package/dist/support/expiry.js +17 -33
  284. package/dist/support/import-map.d.ts +3 -7
  285. package/dist/support/inertia-defaults.d.ts +5 -10
  286. package/dist/support/redirect-target.d.ts +4 -6
  287. package/dist/support/stack-frames.d.ts +11 -50
  288. package/dist/support/trim-slashes.d.ts +4 -7
  289. package/dist/support/warn-once.d.ts +2 -6
  290. package/dist/{trim-slashes-ZJ_VsY5s.js → trim-slashes-BLY9hKAa.js} +4 -7
  291. package/dist/{vite-manifest-BGfWbPYp.js → vite-manifest-CTQp-SOo.js} +34 -58
  292. package/package.json +6 -2
  293. package/dist/client-Dd7vLcqp.js +0 -27
  294. package/dist/context-DoD0c7J_.js +0 -26
  295. package/dist/endpoint-D-20PiHY.js +0 -46
  296. package/dist/hot-disposables-WsTX2ySN.js +0 -281
  297. package/dist/request-CRVuIiQr.js +0 -78
@@ -3,10 +3,7 @@ import { Controller } from './Controller.js';
3
3
  import type { Container } from '../container/Container.js';
4
4
  import type { ValidationSchema } from '../http/middleware/validation.js';
5
5
  import { type MiddlewareCapabilities } from '../http/middleware/capabilities.js';
6
- /**
7
- * Constructor type for Controller classes.
8
- * @template T - The controller type extending Controller
9
- */
6
+ /** Constructor type for Controller classes. */
10
7
  export type ControllerConstructor<T extends Controller = Controller> = (new (...args: any[]) => T) & {
11
8
  inject?: readonly string[];
12
9
  };
@@ -17,35 +14,26 @@ type ControllerMethodFor<C extends ControllerConstructor> = ControllerMethod<Ins
17
14
  export type ControllerAction<C extends ControllerConstructor = ControllerConstructor> = [C, ControllerMethodFor<C>];
18
15
  export type RouteResult = Response | string | number | boolean | Record<string, unknown> | Array<unknown> | null | void;
19
16
  /**
20
- * Handler for a route - either an inline function or a controller action tuple.
21
- * Inline handlers receive `next`, so any Hono middleware (e.g.
22
- * `broadcast.sseMiddleware()`) can be mounted directly as a terminal handler.
17
+ * Inline handlers receive `next`, so Hono middleware (e.g.
18
+ * `broadcast.sseMiddleware()`) can mount directly as a terminal handler.
23
19
  */
24
20
  export type RouteHandler<C extends ControllerConstructor = ControllerConstructor> = ((c: Context, next: Next) => RouteResult | Promise<RouteResult>) | ControllerAction<C>;
25
- /**
26
- * Model binding resolver function.
27
- */
28
21
  type ModelBindingResolver = (value: string) => Promise<unknown>;
29
- /**
30
- * Model class with findOrFail static method.
31
- */
22
+ /** Model class with a findOrFail static method. */
32
23
  export interface BindableModel {
33
24
  findOrFail(id: unknown, key?: string): Promise<unknown>;
34
25
  /** Bound values are model classes at runtime; the constructor name is the introspection payload. */
35
26
  readonly name?: string;
36
27
  }
37
28
  /**
38
- * A model bound to a route parameter: the model class alone looks the value
39
- * up by primary key (`Model.findOrFail(value)`); a `[Model, column]` tuple
40
- * looks it up by that column (`Model.findOrFail(value, column)`), e.g.
41
- * `bind: { slug: [Post, 'slug'] }`. Either way the controller reads the
42
- * resolved record with `this.model(Model)`.
29
+ * A model bound to a route parameter: the class alone looks the value up by
30
+ * primary key, a `[Model, column]` tuple by that column. The controller reads
31
+ * the resolved record with `this.model(Model)`.
43
32
  */
44
33
  export type RouteModelBinding = BindableModel | readonly [BindableModel, string];
45
34
  /**
46
- * A Resource class accepted as a response hint. Only the constructor name is
47
- * introspected — the router never instantiates it, so any class whose
48
- * instances expose `toJSON()` (every `Resource` subclass) qualifies.
35
+ * A Resource class accepted as a response hint. Never instantiated — only the
36
+ * constructor name is introspected.
49
37
  */
50
38
  interface ResponseResourceClass {
51
39
  new (resource: any): {
@@ -53,20 +41,14 @@ interface ResponseResourceClass {
53
41
  };
54
42
  }
55
43
  /**
56
- * Type-level response hint for a route: a Resource class, a single-element
57
- * array of a hint (a collection), or a plain object of hints (an envelope,
58
- * e.g. `{ data: [PostResource] }`). Purely declarative — nothing is validated
59
- * at runtime. `guren codegen` maps each Resource class to the `Data` type it
60
- * extracts from `app/Http/Resources` and types the API client's `json()`
61
- * with the assembled shape.
44
+ * Type-level response hint: a Resource class, a single-element array (a
45
+ * collection), or an object of hints (an envelope). Declarative only; `guren
46
+ * codegen` turns it into the API client's `json()` type.
62
47
  */
63
48
  export type ResourceResponseHint = ResponseResourceClass | readonly [ResourceResponseHint] | {
64
49
  readonly [key: string]: ResourceResponseHint;
65
50
  };
66
- /**
67
- * Serialized form of {@link ResourceResponseHint} carried by
68
- * {@link RouteDefinition}: Resource classes become their class names.
69
- */
51
+ /** Serialized {@link ResourceResponseHint}: Resource classes become their class names. */
70
52
  export type ResourceResponseShape = string | [ResourceResponseShape] | {
71
53
  [key: string]: ResourceResponseShape;
72
54
  };
@@ -96,17 +78,14 @@ export interface RouteContractOptions<TParamsSchema extends SchemaLike<unknown>
96
78
  body?: TBodySchema;
97
79
  output?: TOutputSchema;
98
80
  /**
99
- * Type-level response hint (see {@link ResourceResponseHint}). Unlike
100
- * `output`, nothing runs at request time — the route's JSON is assumed to
101
- * follow the shape. When both are set, `output` wins in generated types:
102
- * it is the one actually enforced.
81
+ * Type-level response hint (see {@link ResourceResponseHint}); nothing runs
82
+ * at request time. When both are set, `output` wins in generated types.
103
83
  */
104
84
  resource?: ResourceResponseHint;
105
85
  /**
106
86
  * Route model bindings: param name → model (see {@link RouteModelBinding}).
107
- * `{ id: Post }` resolves by primary key, `{ slug: [Post, 'slug'] }` by
108
- * that column; both throw the model's not-found exception (404) on a miss
109
- * and expose the record to the controller via `this.model(Post)`.
87
+ * A miss throws the model's not-found exception (404); the record reaches
88
+ * the controller via `this.model(Post)`.
110
89
  */
111
90
  bind?: Record<string, RouteModelBinding>;
112
91
  /** Agent exposure metadata (RFC 0016). See {@link AgentRouteMetadata}. */
@@ -120,16 +99,9 @@ export interface RouteOpenApiMetadata {
120
99
  deprecated?: boolean;
121
100
  }
122
101
  /**
123
- * Agent exposure metadata for a route (RFC 0016). Declaring it marks the
124
- * route as an agent tool; everything else about the tool — its input schema,
125
- * output schema, authorization — is derived from the contracts the route
126
- * already carries, never restated here.
127
- *
128
- * Storage only: no defaults are applied at registration, and the router does
129
- * not require a route name here — `.agent()` may legally be chained before
130
- * `.name()`, so name-requirement enforcement is deliberately left to static
131
- * checks over `definitions()` (a route without a name cannot become a tool;
132
- * the name is the tool's identity).
102
+ * Agent exposure metadata (RFC 0016); declaring it marks the route as a tool.
103
+ * Storage only: no defaults, and no route name required here (`.agent()` may
104
+ * precede `.name()`) — the name requirement is enforced over `definitions()`.
133
105
  */
134
106
  export interface AgentRouteMetadata {
135
107
  /** Tool description. Absent, the route's OpenAPI `description` ?? `summary` stands in. */
@@ -152,17 +124,12 @@ export interface AgentRouteMetadata {
152
124
  /** Argument fields masked in agent audit logs. */
153
125
  redact?: string[];
154
126
  }
155
- /**
156
- * Represents a registered route definition for introspection.
157
- */
127
+ /** A registered route definition, as handed out for introspection. */
158
128
  export interface RouteDefinition {
159
129
  /** Uppercased HTTP method (GET, POST, PUT, PATCH, DELETE, QUERY, or any custom method registered via on()) */
160
130
  method: string;
161
- /** URL path pattern (e.g., '/users/:id') */
162
131
  path: string;
163
- /** Optional route name for URL generation */
164
132
  name?: string;
165
- /** Schema metadata attached via RouteContractOptions */
166
133
  schemas?: {
167
134
  params?: SchemaLike<unknown>;
168
135
  query?: SchemaLike<unknown>;
@@ -170,36 +137,26 @@ export interface RouteDefinition {
170
137
  output?: SchemaLike<unknown>;
171
138
  };
172
139
  /**
173
- * Serialized response hint from `RouteContractOptions.resource` — Resource
174
- * class names in place of the classes. Absent when no hint was declared or
175
- * when any class in the hint has no usable name (a partially-typed response
176
- * would claim a shape the wire does not have).
140
+ * Serialized `RouteContractOptions.resource`. Absent when no hint was
141
+ * declared, or when any class in it has no usable name — a partial hint
142
+ * would claim a shape the wire does not have.
177
143
  */
178
144
  resource?: ResourceResponseShape;
179
- /** Named middleware (aliases or groups) applied to this route */
180
145
  middlewareNames?: string[];
181
- /** Whether inline (unnamed) middleware handlers are attached */
182
146
  hasInlineMiddleware?: boolean;
183
147
  /**
184
- * Security capabilities aggregated from the route's middleware chain
185
- * (named aliases, groups, and inline handlers). Always present on routers
186
- * from this release — an empty object means "no recognized capability" —
187
- * so consumers can distinguish that from definitions produced by older
188
- * servers, where the field is absent. The value shape is internal and may
189
- * change (RFC 0007).
148
+ * Capabilities aggregated from the route's middleware chain. Always present
149
+ * from this release (`{}` means none recognized), so consumers can tell that
150
+ * from an older server's absent field. Shape is internal (RFC 0007).
190
151
  */
191
152
  capabilities?: MiddlewareCapabilities;
192
- /** Controller binding when the handler is a [Controller, 'method'] tuple */
193
153
  controller?: {
194
154
  name: string;
195
155
  action: string;
196
156
  };
197
157
  /** Route model bindings: param name → bound model class name (from `bind`) */
198
158
  bindings?: Record<string, string>;
199
- /**
200
- * Agent exposure metadata as declared (RFC 0016) — raw, no defaults
201
- * applied. Absence means the route is not an agent tool.
202
- */
159
+ /** Agent metadata as declared (RFC 0016), no defaults applied. Absent: not a tool. */
203
160
  agent?: AgentRouteMetadata;
204
161
  summary?: string;
205
162
  description?: string;
@@ -207,12 +164,8 @@ export interface RouteDefinition {
207
164
  operationId?: string;
208
165
  deprecated?: boolean;
209
166
  }
210
- /**
211
- * Chainable builder for configuring a registered route.
212
- * @template M - Union of registered middleware alias names
213
- */
167
+ /** Chainable builder for configuring a registered route. */
214
168
  export interface RouteBuilder<M extends string = never> {
215
- /** Set the route name for URL generation. */
216
169
  name(routeName: string): RouteBuilder<M>;
217
170
  /** Attach middleware to this specific route. See {@link RouteMiddlewareInput}. */
218
171
  middleware(...items: RouteMiddlewareInput<M>[]): RouteBuilder<M>;
@@ -221,16 +174,10 @@ export interface RouteBuilder<M extends string = never> {
221
174
  }
222
175
  /**
223
176
  * Accepted by `.middleware()`: a registered alias name or a handler function.
224
- *
225
- * Resolution is by kind, not by position: every name in a route's chain runs
226
- * before every handler, across scopes as well as within one call. So an inline
227
- * handler on an outer group runs *after* a named one on an inner group, the
228
- * reverse of how they read. Use aliases throughout when relative order matters.
229
- *
230
- * Aliases are also the only form that lands in `RouteDefinition.middlewareNames`,
231
- * which is how `guren audit` reports middleware it cannot otherwise identify.
232
- * Guards the framework stamps with a capability (`requireAuthenticated`,
233
- * `requireGuest`) are recognized either way.
177
+ * Resolution is by kind, not position — every name runs before every handler,
178
+ * across scopes, so an inline handler on an outer group runs *after* a named
179
+ * one on an inner group. Only aliases land in `middlewareNames`, which is how
180
+ * `guren audit` reports middleware it cannot otherwise identify.
234
181
  */
235
182
  export type RouteMiddlewareInput<M extends string = never> = M | MiddlewareHandler;
236
183
  /** Storage form of {@link RouteMiddlewareInput}, unparameterized by alias union. */
@@ -238,31 +185,22 @@ type MiddlewareScopeEntry = string | MiddlewareHandler;
238
185
  export interface RouterMountOptions {
239
186
  container?: Container;
240
187
  }
241
- /**
242
- * Available actions for resource routes.
243
- */
188
+ /** Available actions for resource routes. */
244
189
  export type ResourceAction = 'index' | 'create' | 'store' | 'show' | 'edit' | 'update' | 'destroy';
245
- /**
246
- * Options for configuring resource routes.
247
- */
190
+ /** Options for configuring resource routes. */
248
191
  export interface ResourceRouteOptions {
249
192
  name?: string;
250
193
  param?: string;
251
194
  only?: ResourceAction[];
252
195
  except?: ResourceAction[];
253
196
  /**
254
- * Per-action agent exposure (RFC 0016). An action not listed here is not
255
- * exposed as a tool — deny by default, no `destroy: false` spelling needed.
256
- * Listing an action this call does not register (excluded via `only`/
257
- * `except`, or missing from the controller) throws: metadata for a tool
197
+ * Per-action agent exposure (RFC 0016); an action not listed is not exposed.
198
+ * Listing an action this call does not register throws — metadata for a tool
258
199
  * that cannot exist is a wiring mistake, not a no-op.
259
200
  */
260
201
  agent?: Partial<Record<ResourceAction, AgentRouteMetadata>>;
261
202
  }
262
- /**
263
- * Instance-based router for app-local route registration and mounting.
264
- * @template M - Union of registered middleware alias names (e.g. `'auth' | 'guest'`)
265
- */
203
+ /** Instance-based router for app-local route registration and mounting. */
266
204
  export declare class Router<M extends string = never> {
267
205
  private readonly registry;
268
206
  private readonly prefixStack;
@@ -273,24 +211,13 @@ export declare class Router<M extends string = never> {
273
211
  private readonly modelBindings;
274
212
  aliasMiddleware<N extends string>(name: N, handler: MiddlewareHandler): Router<M | N>;
275
213
  groupMiddleware<N extends string>(name: N, middlewareNames: M[]): Router<M | N>;
276
- /**
277
- * Open a middleware scope for the routes registered through the returned
278
- * builder. See {@link RouteMiddlewareInput}.
279
- */
214
+ /** Open a middleware scope for the returned builder. See {@link RouteMiddlewareInput}. */
280
215
  middleware(...items: RouteMiddlewareInput<M>[]): RouterMiddlewareGroupBuilder<M>;
281
216
  /**
282
- * Bind a route parameter for every route on this router whose path names
283
- * it. A model (class or `[Model, column]`) resolves through `findOrFail`
284
- * and reaches the controller both via `this.model(Model)` and as a
285
- * positional argument after the context; a custom resolver's value only
286
- * arrives positionally, in path-parameter order:
287
- *
288
- * ```ts
289
- * router.bind('post', async (slug) => Post.where('slug', slug).firstOrFail())
290
- * router.get('/posts/:post', [PostController, 'show'])
291
- *
292
- * async show(_ctx: Context, post: PostRecord) { ... }
293
- * ```
217
+ * Bind a route parameter for every route on this router whose path names it.
218
+ * A model resolves through `findOrFail` and reaches the controller both via
219
+ * `this.model(Model)` and positionally; a custom resolver's value arrives
220
+ * only positionally, in path-parameter order.
294
221
  */
295
222
  bind(param: string, modelOrResolver: RouteModelBinding | ModelBindingResolver): this;
296
223
  on<C extends ControllerConstructor>(method: string, path: string, handler: RouteHandler<C>, ...middlewares: MiddlewareHandler[]): RouteBuilder<M>;
@@ -312,10 +239,9 @@ export declare class Router<M extends string = never> {
312
239
  delete<TParamsSchema extends SchemaLike<unknown>, TQuerySchema extends SchemaLike<unknown>, TBodySchema extends SchemaLike<unknown>, TOutputSchema extends SchemaLike<unknown>>(path: string, options: RouteContractOptions<TParamsSchema, TQuerySchema, TBodySchema, TOutputSchema>, handler: TypedRouteHandler<TParamsSchema, TQuerySchema, TBodySchema, TOutputSchema>): RouteBuilder<M>;
313
240
  delete<C extends ControllerConstructor, TParamsSchema extends SchemaLike<unknown>, TQuerySchema extends SchemaLike<unknown>, TBodySchema extends SchemaLike<unknown>, TOutputSchema extends SchemaLike<unknown>>(path: string, options: RouteContractOptions<TParamsSchema, TQuerySchema, TBodySchema, TOutputSchema>, handler: ControllerAction<C>): RouteBuilder<M>;
314
241
  /**
315
- * Registers a route for the HTTP QUERY method (RFC 10008): safe and
316
- * idempotent like GET, but the request carries a body like POST. Handlers
317
- * must not mutate state — CSRF protection deliberately skips QUERY on that
318
- * assumption (see `createCsrfMiddleware`'s `methods` option to opt in).
242
+ * HTTP QUERY (RFC 10008): safe and idempotent like GET, but carries a body.
243
+ * Handlers must not mutate state — CSRF protection deliberately skips QUERY
244
+ * on that assumption (`createCsrfMiddleware`'s `methods` option opts in).
319
245
  */
320
246
  query<C extends ControllerConstructor>(path: string, handler: RouteHandler<C>, ...middlewares: MiddlewareHandler[]): RouteBuilder<M>;
321
247
  query<TParamsSchema extends SchemaLike<unknown>, TQuerySchema extends SchemaLike<unknown>, TBodySchema extends SchemaLike<unknown>, TOutputSchema extends SchemaLike<unknown>>(path: string, options: RouteContractOptions<TParamsSchema, TQuerySchema, TBodySchema, TOutputSchema>, handler: TypedRouteHandler<TParamsSchema, TQuerySchema, TBodySchema, TOutputSchema>): RouteBuilder<M>;
@@ -332,15 +258,10 @@ export declare class Router<M extends string = never> {
332
258
  private register;
333
259
  private add;
334
260
  /**
335
- * Security capabilities present on a route's middleware chain, aggregated
336
- * across named aliases (group-expanded) and inline handlers. Unlike
337
- * `resolveMiddlewareNames`, unregistered names are skipped rather than
338
- * thrown: `definitions()` must stay side-effect-free for introspection of
339
- * routers that never mount (audit, codegen), and an unresolvable alias
340
- * simply contributes no capabilities.
341
- *
342
- * This walks the chain; the rules for combining what it finds live with the
343
- * capability type, in `mergeCapabilities`.
261
+ * Security capabilities on a route's middleware chain, across named aliases
262
+ * (group-expanded) and inline handlers. Unlike `resolveMiddlewareNames`,
263
+ * unregistered names are skipped rather than thrown: `definitions()` must
264
+ * stay side-effect-free for routers that never mount (audit, codegen).
344
265
  */
345
266
  private aggregateCapabilities;
346
267
  private resolveMiddlewareNames;
@@ -1,7 +1,6 @@
1
1
  /**
2
- * Per-response form of {@link InertiaDocumentOptions}: the same fields, already
3
- * resolved to strings. Each one overrides the app-wide default registered
4
- * through {@link setInertiaDocument}.
2
+ * Per-response form of {@link InertiaDocumentOptions}, already resolved to
3
+ * strings. Each field overrides the app-wide {@link setInertiaDocument} default.
5
4
  */
6
5
  type InertiaDocumentOverrides = {
7
6
  readonly [K in keyof InertiaDocumentOptions]?: string;
@@ -48,66 +47,37 @@ export interface InertiaDocumentContext {
48
47
  }
49
48
  type InertiaDocumentValue = string | ((context: InertiaDocumentContext) => string | undefined);
50
49
  export interface InertiaDocumentOptions {
51
- /**
52
- * Class attribute for the root `<body>` element. Pass a function to vary it
53
- * per page component — a docs section that needs a light surface while the
54
- * marketing pages keep a dark one, for instance.
55
- */
50
+ /** Class for the root `<body>`; a function varies it per page component. */
56
51
  readonly bodyClass?: InertiaDocumentValue;
57
52
  /**
58
- * CSS inlined into `<head>` ahead of the stylesheet links. Keep it to the
59
- * few declarations that decide the first paint (surface and text colors);
60
- * the main stylesheet still wins for everything it defines later.
53
+ * CSS inlined into `<head>` ahead of the stylesheet links. Keep it to the few
54
+ * declarations that decide the first paint; the main stylesheet wins later.
61
55
  */
62
56
  readonly criticalCss?: InertiaDocumentValue;
63
57
  /**
64
- * Body of a blocking inline `<script>` executed before the first paint.
65
- * Use it for theme prepaint logic that has to read `localStorage` or
66
- * `matchMedia` before React hydrates.
58
+ * Body of a blocking inline `<script>` run before the first paint — theme
59
+ * prepaint logic reading `localStorage` or `matchMedia` before hydration.
67
60
  */
68
61
  readonly prepaintScript?: InertiaDocumentValue;
69
62
  /**
70
- * Raw markup inlined into `<head>`, ahead of the critical CSS and stylesheet
71
- * links. Unescaped — the app author owns this string. Use it for static,
72
- * site-wide tags the framework has no way to infer on its own, such as
73
- * `<link rel="icon">` favicons.
63
+ * Raw markup inlined into `<head>`, ahead of the critical CSS. Unescaped —
64
+ * the app author owns this string. For static site-wide tags like favicons.
74
65
  */
75
66
  readonly head?: InertiaDocumentValue;
76
67
  }
77
68
  /**
78
- * Register app-wide document defaults for server-rendered Inertia responses.
79
- *
80
- * Without this, the `<body>` ships without a class and nothing is inlined into
81
- * `<head>`, so a page whose theme is applied by a client effect flashes the
82
- * stylesheet's default surface color until React hydrates. Call it at module
83
- * scope in the app entry so every runtime (Bun, serverless handlers, generated
84
- * worker bundles) picks it up.
85
- *
86
- * Registration is process-wide and not request-scoped: calling this while
87
- * requests are in flight leaks the new policy into them. Use the matching
88
- * {@link InertiaOptions} fields for a single response instead.
89
- *
90
- * The values are emitted verbatim — inside `<style>` / `<script>` elements,
91
- * or as raw markup for `head` — they are developer-authored assets, never
92
- * user input.
93
- *
94
- * ```typescript
95
- * setInertiaDocument({
96
- * bodyClass: ({ component }) => (component.startsWith('Docs/') ? 'docs-theme' : undefined),
97
- * })
98
- * ```
99
- *
100
- * Pass `undefined` to clear (test isolation).
69
+ * Register app-wide document defaults for server-rendered Inertia responses;
70
+ * call it at module scope in the app entry so every runtime picks it up.
71
+ * Process-wide, not request-scoped: calling it mid-flight leaks the policy into
72
+ * in-flight requests — use the {@link InertiaOptions} fields per response.
73
+ * Values are emitted verbatim, so never pass user input. `undefined` clears.
101
74
  */
102
75
  export declare function setInertiaDocument(options: InertiaDocumentOptions | undefined): void;
103
76
  /**
104
- * Register a process-wide default SSR renderer.
105
- *
106
- * Serverless adapters whose bundlers cannot resolve a runtime file path
107
- * (Cloudflare Workers has no filesystem for `GUREN_INERTIA_SSR_ENTRY`'s
108
- * dynamic import) register the statically imported renderer once at module
109
- * scope. Per-call `ssr.render` still takes precedence; pass `undefined` to
110
- * clear (test isolation).
77
+ * Register a process-wide default SSR renderer, for adapters whose bundler
78
+ * cannot resolve a runtime path (Workers has no filesystem for
79
+ * `GUREN_INERTIA_SSR_ENTRY`'s dynamic import). Per-call `ssr.render` still
80
+ * wins; `undefined` clears (test isolation).
111
81
  */
112
82
  export declare function setInertiaSsrRenderer(renderer: InertiaSsrRenderer | undefined): void;
113
83
  export declare function inertia(component: string, props: Record<string, unknown>, options?: InertiaOptions): Promise<Response>;
@@ -1,8 +1,8 @@
1
1
  import type { Context } from 'hono';
2
2
  import type { ContainerLike } from '../../container/types.js';
3
3
  /**
4
- * Application-level shared props shape for Inertia responses.
5
- * Extend this interface in your app (via declaration merging) to type shared props.
4
+ * Application-level shared props shape for Inertia responses. Extend it in your
5
+ * app via declaration merging to type shared props.
6
6
  */
7
7
  export interface InertiaSharedProps {
8
8
  }
@@ -63,23 +63,10 @@ export declare function setInertiaSharedProps<Props extends Record<string, unkno
63
63
  */
64
64
  export declare function getInertiaSharedPropsResolver(): SharedInertiaPropsResolver<ResolvedSharedInertiaProps> | null;
65
65
  /**
66
- * Register additional shared props without replacing resolvers registered
67
- * earlier — the new resolver's props are merged over the previous ones.
68
- * Use this from app providers so multiple providers can each contribute
69
- * shared props (setInertiaSharedProps replaces the resolver wholesale).
70
- *
71
- * Pass the provider's `this.container` to scope the props to one application.
72
- * Without it the props are module-global, so a second Application booted in
73
- * the same process shares them.
74
- *
75
- * @example
76
- * ```typescript
77
- * export class AuthProvider extends ServiceProvider {
78
- * boot(): void {
79
- * shareInertiaProps(async (ctx) => ({ auth: { user: await currentUser(ctx) } }), this.container)
80
- * }
81
- * }
82
- * ```
66
+ * Register additional shared props without replacing earlier resolvers, so
67
+ * several providers can each contribute (`setInertiaSharedProps` replaces
68
+ * wholesale). Pass the provider's `this.container` to scope them; without it
69
+ * they are module-global and a second Application in the process shares them.
83
70
  */
84
71
  export declare function shareInertiaProps<Props extends Record<string, unknown>>(resolverFn: SharedInertiaPropsResolver<Props>, container?: SharedPropsContainer): void;
85
72
  /**
@@ -1,10 +1,6 @@
1
1
  import type { MiddlewareHandler, Hono } from 'hono';
2
2
  /**
3
- * Mounts a route on a Hono app with a dynamic HTTP method string.
4
- *
5
- * Hono's app.on() uses complex overloads that expect literal types for the
6
- * method parameter, making it incompatible with dynamic `string` values at
7
- * the type level. This helper encapsulates the single narrowing cast needed,
8
- * keeping the rest of the codebase cast-free.
3
+ * Mounts a route with a dynamic HTTP method string. Hono's `app.on()` overloads
4
+ * expect literal method types, so this helper holds the one narrowing cast.
9
5
  */
10
6
  export declare function mountRoute(app: Hono, method: string, path: string, ...handlers: MiddlewareHandler[]): void;
@@ -9,7 +9,6 @@ export type ViewOptions = ResponseInit & {
9
9
  };
10
10
  /**
11
11
  * Render a `hono/jsx` component to a plain server-rendered HTML `Response` —
12
- * the engine behind `Controller.view()` (RFC 0014), separated the way
13
- * `inertia()` is from `Controller.inertia()`.
12
+ * the engine behind `Controller.view()` (RFC 0014).
14
13
  */
15
14
  export declare function renderDocument<P>(component: FC<P>, props: P, options?: ViewOptions): Promise<Response>;
@@ -1,96 +1,29 @@
1
1
  import type { Notifiable, NotificationMailMessage, SlackMessage } from './types.js';
2
2
  /**
3
- * Base notification class.
4
- *
5
- * @example
6
- * ```typescript
7
- * class OrderShipped extends Notification {
8
- * static shouldQueue = true
9
- * static queue = 'notifications'
10
- *
11
- * constructor(private order: Order) {
12
- * super()
13
- * }
14
- *
15
- * via(notifiable: Notifiable): string[] {
16
- * return ['mail', 'database']
17
- * }
18
- *
19
- * toMail(notifiable: Notifiable): NotificationMailMessage {
20
- * return {
21
- * subject: `Order #${this.order.id} shipped`,
22
- * html: '<p>Your order is on its way!</p>',
23
- * }
24
- * }
25
- *
26
- * toDatabase(notifiable: Notifiable): Record<string, unknown> {
27
- * return {
28
- * orderId: this.order.id,
29
- * message: 'Your order has shipped',
30
- * }
31
- * }
32
- * }
33
- * ```
3
+ * Base notification class. Subclasses declare their channels in `via()` and one
4
+ * `to*()` method per channel; `static shouldQueue`/`queue`/`delay` control
5
+ * queueing.
34
6
  */
35
7
  export declare abstract class Notification {
36
- /**
37
- * Whether this notification should be queued.
38
- */
39
8
  static shouldQueue: boolean;
40
- /**
41
- * The queue name for this notification.
42
- */
43
9
  static queue?: string;
44
- /**
45
- * Delay in milliseconds before sending.
46
- */
10
+ /** Delay in milliseconds before sending. */
47
11
  static delay?: number;
48
- /**
49
- * Unique notification ID.
50
- */
51
12
  readonly id: string;
52
- /**
53
- * When the notification was created.
54
- */
55
13
  readonly createdAt: Date;
56
14
  constructor();
57
- /**
58
- * Get the notification's delivery channels.
59
- */
15
+ /** The notification's delivery channels. */
60
16
  abstract via(notifiable: Notifiable): string[];
61
- /**
62
- * Get the mail representation of the notification.
63
- */
64
17
  toMail?(notifiable: Notifiable): NotificationMailMessage;
65
- /**
66
- * Get the database representation of the notification.
67
- */
68
18
  toDatabase?(notifiable: Notifiable): Record<string, unknown>;
69
- /**
70
- * Get the Slack representation of the notification.
71
- */
72
19
  toSlack?(notifiable: Notifiable): SlackMessage;
73
- /**
74
- * Get the array representation of the notification.
75
- * Used as a fallback for any channel.
76
- */
20
+ /** Fallback representation for any channel with no dedicated method. */
77
21
  toArray?(notifiable: Notifiable): Record<string, unknown>;
78
- /**
79
- * Get the notification type (default: class name).
80
- */
22
+ /** Notification type; defaults to the class name. */
81
23
  get type(): string;
82
- /**
83
- * Check if the notification should be sent to the given notifiable.
84
- * Override to add custom logic.
85
- */
24
+ /** Override to skip delivery for a given notifiable. */
86
25
  shouldSend(_notifiable: Notifiable): boolean | Promise<boolean>;
87
- /**
88
- * Generate a unique notification ID.
89
- */
90
26
  protected generateId(): string;
91
- /**
92
- * Get static queue configuration.
93
- */
94
27
  static getQueueConfig(): {
95
28
  shouldQueue: boolean;
96
29
  queue?: string;