glasswork 0.13.3 → 1.0.1

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 (229) hide show
  1. package/CHANGELOG.md +80 -0
  2. package/README.md +6 -2
  3. package/dist/auth/abilities.d.ts +9 -6
  4. package/dist/auth/abilities.d.ts.map +1 -1
  5. package/dist/auth/abilities.js +15 -19
  6. package/dist/auth/abilities.js.map +1 -1
  7. package/dist/auth/assert.d.ts +3 -3
  8. package/dist/auth/assert.d.ts.map +1 -1
  9. package/dist/auth/casl-bridge.d.ts +19 -0
  10. package/dist/auth/casl-bridge.d.ts.map +1 -0
  11. package/dist/auth/casl-bridge.js +29 -0
  12. package/dist/auth/casl-bridge.js.map +1 -0
  13. package/dist/auth/index.d.ts +1 -0
  14. package/dist/auth/index.d.ts.map +1 -1
  15. package/dist/auth/index.js +1 -0
  16. package/dist/auth/index.js.map +1 -1
  17. package/dist/auth/middleware.d.ts +3 -3
  18. package/dist/auth/middleware.d.ts.map +1 -1
  19. package/dist/auth/middleware.js +2 -2
  20. package/dist/auth/middleware.js.map +1 -1
  21. package/dist/auth/types.d.ts +2 -2
  22. package/dist/auth/types.d.ts.map +1 -1
  23. package/dist/config/index.d.ts +1 -1
  24. package/dist/config/index.js +1 -1
  25. package/dist/core/bootstrap.d.ts +0 -17
  26. package/dist/core/bootstrap.d.ts.map +1 -1
  27. package/dist/core/bootstrap.js +4 -240
  28. package/dist/core/bootstrap.js.map +1 -1
  29. package/dist/core/index.d.ts +19 -0
  30. package/dist/core/index.d.ts.map +1 -0
  31. package/dist/core/index.js +15 -0
  32. package/dist/core/index.js.map +1 -0
  33. package/dist/core/lifecycle.d.ts +7 -0
  34. package/dist/core/lifecycle.d.ts.map +1 -0
  35. package/dist/core/lifecycle.js +28 -0
  36. package/dist/core/lifecycle.js.map +1 -0
  37. package/dist/core/module-graph.d.ts +21 -0
  38. package/dist/core/module-graph.d.ts.map +1 -0
  39. package/dist/core/module-graph.js +169 -0
  40. package/dist/core/module-graph.js.map +1 -0
  41. package/dist/core/route-factory.d.ts +20 -0
  42. package/dist/core/route-factory.d.ts.map +1 -0
  43. package/dist/core/route-factory.js +2 -0
  44. package/dist/core/route-factory.js.map +1 -0
  45. package/dist/core/types.d.ts +4 -14
  46. package/dist/core/types.d.ts.map +1 -1
  47. package/dist/email/compiler/compile-templates.d.ts +3 -8
  48. package/dist/email/compiler/compile-templates.d.ts.map +1 -1
  49. package/dist/email/compiler/compile-templates.js +3 -3
  50. package/dist/email/compiler/compile-templates.js.map +1 -1
  51. package/dist/email/compiler/compiler.d.ts +5 -2
  52. package/dist/email/compiler/compiler.d.ts.map +1 -1
  53. package/dist/email/compiler/compiler.js +2 -21
  54. package/dist/email/compiler/compiler.js.map +1 -1
  55. package/dist/email/transports/ses-transport.d.ts.map +1 -1
  56. package/dist/email/transports/ses-transport.js +11 -18
  57. package/dist/email/transports/ses-transport.js.map +1 -1
  58. package/dist/email/webhooks/handler-factory.d.ts +1 -1
  59. package/dist/email/webhooks/handler-factory.js +1 -1
  60. package/dist/email/webhooks/notification-parser.d.ts +1 -1
  61. package/dist/email/webhooks/notification-parser.js +1 -1
  62. package/dist/email/webhooks/signature-verification.d.ts +1 -1
  63. package/dist/email/webhooks/signature-verification.js +1 -1
  64. package/dist/email/webhooks/subscription-handler.d.ts +1 -1
  65. package/dist/email/webhooks/subscription-handler.js +1 -1
  66. package/dist/hono-context.d.ts +13 -0
  67. package/dist/hono-context.d.ts.map +1 -0
  68. package/dist/hono-context.js +2 -0
  69. package/dist/hono-context.js.map +1 -0
  70. package/dist/http/index.d.ts +18 -0
  71. package/dist/http/index.d.ts.map +1 -0
  72. package/dist/http/index.js +15 -0
  73. package/dist/http/index.js.map +1 -0
  74. package/dist/http/route-authorization.d.ts +9 -0
  75. package/dist/http/route-authorization.d.ts.map +1 -0
  76. package/dist/http/route-authorization.js +19 -0
  77. package/dist/http/route-authorization.js.map +1 -0
  78. package/dist/http/route-context.d.ts +8 -0
  79. package/dist/http/route-context.d.ts.map +1 -0
  80. package/dist/http/route-context.js +26 -0
  81. package/dist/http/route-context.js.map +1 -0
  82. package/dist/http/route-helpers.d.ts +6 -419
  83. package/dist/http/route-helpers.d.ts.map +1 -1
  84. package/dist/http/route-helpers.js +7 -462
  85. package/dist/http/route-helpers.js.map +1 -1
  86. package/dist/http/route-openapi-context.d.ts +27 -0
  87. package/dist/http/route-openapi-context.d.ts.map +1 -0
  88. package/dist/http/route-openapi-context.js +16 -0
  89. package/dist/http/route-openapi-context.js.map +1 -0
  90. package/dist/http/route-openapi.d.ts +5 -0
  91. package/dist/http/route-openapi.d.ts.map +1 -0
  92. package/dist/http/route-openapi.js +112 -0
  93. package/dist/http/route-openapi.js.map +1 -0
  94. package/dist/http/route-response.d.ts +5 -0
  95. package/dist/http/route-response.d.ts.map +1 -0
  96. package/dist/http/route-response.js +78 -0
  97. package/dist/http/route-response.js.map +1 -0
  98. package/dist/http/route-types.d.ts +93 -0
  99. package/dist/http/route-types.d.ts.map +1 -0
  100. package/dist/http/route-types.js +22 -0
  101. package/dist/http/route-types.js.map +1 -0
  102. package/dist/http/route-validation.d.ts +11 -0
  103. package/dist/http/route-validation.d.ts.map +1 -0
  104. package/dist/http/route-validation.js +24 -0
  105. package/dist/http/route-validation.js.map +1 -0
  106. package/dist/index.d.ts +7 -45
  107. package/dist/index.d.ts.map +1 -1
  108. package/dist/index.js +5 -65
  109. package/dist/index.js.map +1 -1
  110. package/dist/jobs/drivers/eventbridge-scheduler-driver.d.ts.map +1 -1
  111. package/dist/jobs/drivers/eventbridge-scheduler-driver.js +1 -3
  112. package/dist/jobs/drivers/eventbridge-scheduler-driver.js.map +1 -1
  113. package/dist/jobs/drivers/sqs-driver.d.ts +1 -1
  114. package/dist/jobs/drivers/sqs-driver.d.ts.map +1 -1
  115. package/dist/jobs/drivers/sqs-driver.js +1 -3
  116. package/dist/jobs/drivers/sqs-driver.js.map +1 -1
  117. package/dist/jobs/worker.d.ts.map +1 -1
  118. package/dist/jobs/worker.js +3 -14
  119. package/dist/jobs/worker.js.map +1 -1
  120. package/dist/list-query/builder.d.ts +26 -5
  121. package/dist/list-query/builder.d.ts.map +1 -1
  122. package/dist/list-query/builder.js +18 -10
  123. package/dist/list-query/builder.js.map +1 -1
  124. package/dist/list-query/casl.d.ts +20 -4
  125. package/dist/list-query/casl.d.ts.map +1 -1
  126. package/dist/list-query/casl.js +3 -12
  127. package/dist/list-query/casl.js.map +1 -1
  128. package/dist/list-query/filter-value-schemas.d.ts +16 -0
  129. package/dist/list-query/filter-value-schemas.d.ts.map +1 -0
  130. package/dist/list-query/filter-value-schemas.js +46 -0
  131. package/dist/list-query/filter-value-schemas.js.map +1 -0
  132. package/dist/list-query/index.d.ts +7 -1
  133. package/dist/list-query/index.d.ts.map +1 -1
  134. package/dist/list-query/index.js +6 -2
  135. package/dist/list-query/index.js.map +1 -1
  136. package/dist/list-query/list-params.d.ts +17 -0
  137. package/dist/list-query/list-params.d.ts.map +1 -0
  138. package/dist/list-query/list-params.js +2 -0
  139. package/dist/list-query/list-params.js.map +1 -0
  140. package/dist/list-query/parse-filter-values.d.ts +21 -0
  141. package/dist/list-query/parse-filter-values.d.ts.map +1 -0
  142. package/dist/list-query/parse-filter-values.js +177 -0
  143. package/dist/list-query/parse-filter-values.js.map +1 -0
  144. package/dist/list-query/prisma-builder.d.ts.map +1 -1
  145. package/dist/list-query/prisma-builder.js +3 -50
  146. package/dist/list-query/prisma-builder.js.map +1 -1
  147. package/dist/list-query/prisma-executor.d.ts +63 -0
  148. package/dist/list-query/prisma-executor.d.ts.map +1 -0
  149. package/dist/list-query/prisma-executor.js +88 -0
  150. package/dist/list-query/prisma-executor.js.map +1 -0
  151. package/dist/list-query/schema-helpers.d.ts +37 -17
  152. package/dist/list-query/schema-helpers.d.ts.map +1 -1
  153. package/dist/list-query/schema-helpers.js +87 -24
  154. package/dist/list-query/schema-helpers.js.map +1 -1
  155. package/dist/list-query/sort-field-types.d.ts +21 -0
  156. package/dist/list-query/sort-field-types.d.ts.map +1 -0
  157. package/dist/list-query/sort-field-types.js +2 -0
  158. package/dist/list-query/sort-field-types.js.map +1 -0
  159. package/dist/list-query/unrestricted-schemas.d.ts +13 -0
  160. package/dist/list-query/unrestricted-schemas.d.ts.map +1 -0
  161. package/dist/list-query/unrestricted-schemas.js +9 -0
  162. package/dist/list-query/unrestricted-schemas.js.map +1 -0
  163. package/dist/list-query/validator.d.ts +2 -2
  164. package/dist/list-query/validator.d.ts.map +1 -1
  165. package/dist/observability/exception-tracking.d.ts +5 -4
  166. package/dist/observability/exception-tracking.d.ts.map +1 -1
  167. package/dist/observability/exception-tracking.js +4 -3
  168. package/dist/observability/exception-tracking.js.map +1 -1
  169. package/dist/observability/index.d.ts +8 -0
  170. package/dist/observability/index.d.ts.map +1 -0
  171. package/dist/observability/index.js +8 -0
  172. package/dist/observability/index.js.map +1 -0
  173. package/dist/observability/pino-logger.d.ts +3 -3
  174. package/dist/observability/pino-logger.js +3 -3
  175. package/dist/observability/request-context.d.ts +4 -4
  176. package/dist/observability/request-context.js +4 -4
  177. package/package.json +93 -53
  178. package/dist/authorization/ability-middleware.d.ts +0 -61
  179. package/dist/authorization/ability-middleware.d.ts.map +0 -1
  180. package/dist/authorization/ability-middleware.js +0 -74
  181. package/dist/authorization/ability-middleware.js.map +0 -1
  182. package/dist/authorization/index.d.ts +0 -46
  183. package/dist/authorization/index.d.ts.map +0 -1
  184. package/dist/authorization/index.js +0 -46
  185. package/dist/authorization/index.js.map +0 -1
  186. package/dist/authorization/route-helpers.d.ts +0 -106
  187. package/dist/authorization/route-helpers.d.ts.map +0 -1
  188. package/dist/authorization/route-helpers.js +0 -136
  189. package/dist/authorization/route-helpers.js.map +0 -1
  190. package/dist/authorization/service-proxy.d.ts +0 -59
  191. package/dist/authorization/service-proxy.d.ts.map +0 -1
  192. package/dist/authorization/service-proxy.js +0 -110
  193. package/dist/authorization/service-proxy.js.map +0 -1
  194. package/dist/authorization/types.d.ts +0 -58
  195. package/dist/authorization/types.d.ts.map +0 -1
  196. package/dist/authorization/types.js +0 -7
  197. package/dist/authorization/types.js.map +0 -1
  198. package/dist/hooks/authorization-hook.d.ts +0 -100
  199. package/dist/hooks/authorization-hook.d.ts.map +0 -1
  200. package/dist/hooks/authorization-hook.js +0 -93
  201. package/dist/hooks/authorization-hook.js.map +0 -1
  202. package/dist/hooks/index.d.ts +0 -54
  203. package/dist/hooks/index.d.ts.map +0 -1
  204. package/dist/hooks/index.js +0 -55
  205. package/dist/hooks/index.js.map +0 -1
  206. package/dist/hooks/service-hooks.d.ts +0 -82
  207. package/dist/hooks/service-hooks.d.ts.map +0 -1
  208. package/dist/hooks/service-hooks.js +0 -158
  209. package/dist/hooks/service-hooks.js.map +0 -1
  210. package/dist/hooks/types.d.ts +0 -151
  211. package/dist/hooks/types.d.ts.map +0 -1
  212. package/dist/hooks/types.js +0 -2
  213. package/dist/hooks/types.js.map +0 -1
  214. package/dist/openapi/hooks.d.ts +0 -14
  215. package/dist/openapi/hooks.d.ts.map +0 -1
  216. package/dist/openapi/hooks.js +0 -83
  217. package/dist/openapi/hooks.js.map +0 -1
  218. package/dist/openapi/openapi-transformer.d.ts +0 -13
  219. package/dist/openapi/openapi-transformer.d.ts.map +0 -1
  220. package/dist/openapi/openapi-transformer.js +0 -87
  221. package/dist/openapi/openapi-transformer.js.map +0 -1
  222. package/dist/utils/pagination.d.ts +0 -48
  223. package/dist/utils/pagination.d.ts.map +0 -1
  224. package/dist/utils/pagination.js +0 -42
  225. package/dist/utils/pagination.js.map +0 -1
  226. package/dist/utils/serialize-dates.d.ts +0 -27
  227. package/dist/utils/serialize-dates.d.ts.map +0 -1
  228. package/dist/utils/serialize-dates.js +0 -39
  229. package/dist/utils/serialize-dates.js.map +0 -1
@@ -0,0 +1,8 @@
1
+ import type { Context } from 'hono';
2
+ import type { OpenAPIContext } from './route-openapi-context.js';
3
+ import type { RouteConfig, RouteContext, STATUS_DESCRIPTIONS, ValibotSchema } from './route-types.js';
4
+ /**
5
+ * Build the route context for a handler.
6
+ */
7
+ export declare function buildRouteContext<TBody extends ValibotSchema | undefined, TQuery extends ValibotSchema | undefined, TParams extends ValibotSchema | undefined, TResponses extends Partial<Record<keyof typeof STATUS_DESCRIPTIONS, ValibotSchema | undefined>>, TPublic extends boolean, TStrictTypes extends boolean>(c: Context, config: RouteConfig<TBody, TQuery, TParams, TResponses, TPublic, TStrictTypes>, openAPIContext: OpenAPIContext): RouteContext<unknown, unknown, unknown, false>;
8
+ //# sourceMappingURL=route-context.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"route-context.d.ts","sourceRoot":"","sources":["../../src/http/route-context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAIpC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,KAAK,EACV,WAAW,EACX,YAAY,EACZ,mBAAmB,EACnB,aAAa,EACd,MAAM,kBAAkB,CAAC;AAE1B;;GAEG;AACH,wBAAgB,iBAAiB,CAC/B,KAAK,SAAS,aAAa,GAAG,SAAS,EACvC,MAAM,SAAS,aAAa,GAAG,SAAS,EACxC,OAAO,SAAS,aAAa,GAAG,SAAS,EACzC,UAAU,SAAS,OAAO,CAAC,MAAM,CAAC,MAAM,OAAO,mBAAmB,EAAE,aAAa,GAAG,SAAS,CAAC,CAAC,EAC/F,OAAO,SAAS,OAAO,EACvB,YAAY,SAAS,OAAO,EAE5B,CAAC,EAAE,OAAO,EACV,MAAM,EAAE,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,YAAY,CAAC,EAC9E,cAAc,EAAE,cAAc,GAC7B,YAAY,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,CAAC,CAuBhD"}
@@ -0,0 +1,26 @@
1
+ import { createContextAwarePinoLogger } from '../observability/pino-logger.js';
2
+ import { getClientIp } from '../utils/get-client-ip.js';
3
+ import { createLogger } from '../utils/logger.js';
4
+ /**
5
+ * Build the route context for a handler.
6
+ */
7
+ export function buildRouteContext(c, config, openAPIContext) {
8
+ const req = c.req;
9
+ const serviceName = config.tags?.[0] || config.operationId || 'Route';
10
+ const routeLogger = openAPIContext.pino
11
+ ? createContextAwarePinoLogger({ pino: openAPIContext.pino, service: serviceName })
12
+ : createLogger(serviceName);
13
+ return {
14
+ ...c.var,
15
+ body: req.valid(config.bodyType || 'json'),
16
+ query: req.valid('query'),
17
+ params: req.valid('param'),
18
+ services: c.get('services') || {},
19
+ session: c.get('session'),
20
+ ip: getClientIp(c),
21
+ userAgent: c.req.header('user-agent'),
22
+ logger: routeLogger,
23
+ context: c,
24
+ };
25
+ }
26
+ //# sourceMappingURL=route-context.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"route-context.js","sourceRoot":"","sources":["../../src/http/route-context.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,4BAA4B,EAAE,MAAM,iCAAiC,CAAC;AAC/E,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,YAAY,EAAe,MAAM,oBAAoB,CAAC;AAS/D;;GAEG;AACH,MAAM,UAAU,iBAAiB,CAQ/B,CAAU,EACV,MAA8E,EAC9E,cAA8B;IAM9B,MAAM,GAAG,GAAG,CAAC,CAAC,GAAkC,CAAC;IACjD,MAAM,WAAW,GAAG,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,IAAI,MAAM,CAAC,WAAW,IAAI,OAAO,CAAC;IACtE,MAAM,WAAW,GAAW,cAAc,CAAC,IAAI;QAC7C,CAAC,CAAC,4BAA4B,CAAC,EAAE,IAAI,EAAE,cAAc,CAAC,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,CAAC;QACnF,CAAC,CAAC,YAAY,CAAC,WAAW,CAAC,CAAC;IAE9B,OAAO;QACL,GAAG,CAAC,CAAC,GAAG;QACR,IAAI,EAAE,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,QAAQ,IAAI,MAAM,CAAC;QAC1C,KAAK,EAAE,GAAG,CAAC,KAAK,CAAC,OAAO,CAA2B;QACnD,MAAM,EAAE,GAAG,CAAC,KAAK,CAAC,OAAO,CAA2B;QACpD,QAAQ,EAAE,CAAC,CAAC,GAAG,CAAC,UAAU,CAAC,IAAI,EAAE;QACjC,OAAO,EAAE,CAAC,CAAC,GAAG,CAAC,SAAS,CAAC;QACzB,EAAE,EAAE,WAAW,CAAC,CAAC,CAAC;QAClB,SAAS,EAAE,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,YAAY,CAAC;QACrC,MAAM,EAAE,WAAW;QACnB,OAAO,EAAE,CAAC;KACX,CAAC;AACJ,CAAC"}
@@ -1,428 +1,15 @@
1
- import type { Context, Hono, MiddlewareHandler } from 'hono';
2
- import { type DescribeRouteOptions } from 'hono-openapi';
3
- import type { BaseIssue, BaseSchema, BaseSchemaAsync, InferOutput } from 'valibot';
4
- import type { OpenAPIResponseProcessor, RouteConfigExtensions, RouteFactory, RouteHandlers } from '../core/types.js';
5
- import { type PinoLogger } from '../observability/pino-logger.js';
6
- import { type Logger } from '../utils/logger.js';
7
- import { type AcceptPrismaTypes, type SerializationConfig } from '../utils/serialize-prisma-types.js';
8
- /**
9
- * OpenAPI context stored in Hono app context.
10
- * Set during bootstrap and used when defining routes.
11
- */
12
- export interface OpenAPIContext {
13
- processors: OpenAPIResponseProcessor[];
14
- securitySchemes: string[];
15
- /**
16
- * Pino logger instance for creating context-aware loggers in route handlers.
17
- * When set, enables `logger` property in RouteContext.
18
- */
19
- pino?: PinoLogger;
20
- }
21
- /**
22
- * Set the OpenAPI context for a Hono app instance.
23
- * This is called during bootstrap and makes processors/schemes available to route definitions.
24
- *
25
- * @internal
26
- */
27
- export declare function setOpenAPIContext(app: Hono, context: OpenAPIContext): void;
28
- /**
29
- * Get the OpenAPI context for a Hono app instance.
30
- *
31
- * @internal
32
- */
33
- export declare function getOpenAPIContext(app: Hono): OpenAPIContext;
34
- /**
35
- * Valibot schema type (compatible with both sync and async schemas)
36
- */
37
- export type ValibotSchema = BaseSchema<unknown, unknown, BaseIssue<unknown>> | BaseSchemaAsync<unknown, unknown, BaseIssue<unknown>>;
38
- /**
39
- * Helper type to infer the output type from a Valibot schema
40
- */
41
- type InferSchemaType<T> = T extends ValibotSchema ? InferOutput<T> : never;
42
- /**
43
- * Helper type to extract and create a union of all 2xx and 3xx response types
44
- */
45
- type InferResponseUnion<TResponses> = {
46
- [K in keyof TResponses]: K extends 200 | 201 | 202 | 204 | 301 | 302 | 307 | 308 ? TResponses[K] extends ValibotSchema ? InferOutput<TResponses[K]> : never : never;
47
- }[keyof TResponses];
48
- /**
49
- * Helper type to infer the response type from all 2xx and 3xx status code schemas
50
- * Returns a union type of all defined success/redirect responses (200, 201, 202, 204, 301, 302, 307, 308)
51
- * Falls back to unknown if no success/redirect responses are defined
52
- */
53
- type InferResponseType<TResponses> = InferResponseUnion<TResponses> extends never ? unknown : InferResponseUnion<TResponses>;
54
- /**
55
- * HTTP status codes with descriptions
56
- */
57
- declare const STATUS_DESCRIPTIONS: {
58
- readonly 200: "Success";
59
- readonly 201: "Created";
60
- readonly 202: "Accepted";
61
- readonly 204: "No Content";
62
- readonly 301: "Moved Permanently";
63
- readonly 302: "Found";
64
- readonly 307: "Temporary Redirect";
65
- readonly 308: "Permanent Redirect";
66
- readonly 400: "Bad Request";
67
- readonly 401: "Unauthorized";
68
- readonly 403: "Forbidden";
69
- readonly 404: "Not Found";
70
- readonly 409: "Conflict";
71
- readonly 422: "Unprocessable Entity";
72
- readonly 429: "Too Many Requests";
73
- readonly 500: "Internal Server Error";
74
- };
75
- export type { RouteFactory };
76
- /**
77
- * Bound route function type - route() pre-bound to a router's OpenAPI context.
78
- */
79
- export type BoundRouteFunction = <TBody extends ValibotSchema | undefined = undefined, TQuery extends ValibotSchema | undefined = undefined, TParams extends ValibotSchema | undefined = undefined, TResponses extends Partial<Record<keyof typeof STATUS_DESCRIPTIONS, ValibotSchema | undefined>> = Record<never, never>, TPublic extends boolean = false, TStrictTypes extends boolean = false>(config: RouteConfig<TBody, TQuery, TParams, TResponses, TPublic, TStrictTypes>) => RouteHandlers;
1
+ import type { Hono } from 'hono';
2
+ import type { RouteFactory, RouteHandlers } from '../core/types.js';
3
+ import type { BoundRouteFunction, RouteConfig, STATUS_DESCRIPTIONS, ValibotSchema } from './route-types.js';
4
+ export type { OpenAPIContext } from './route-openapi-context.js';
5
+ export { getOpenAPIContext, setOpenAPIContext } from './route-openapi-context.js';
6
+ export type { BoundRouteFunction, RouteConfig, RouteContext, RouteFactory, RouteOpenAPIOptions, ValibotSchema, } from './route-types.js';
80
7
  /**
81
8
  * Create routes with typed service injection and pre-bound route function.
82
- *
83
- * The `route` function passed to your factory is pre-bound to the router's
84
- * OpenAPI context, so you don't need to pass the router to every route call.
85
- *
86
- * @template TServices - The shape of services required by these routes
87
- *
88
- * @example
89
- * ```typescript
90
- * interface AuthRoutesServices {
91
- * authService: AuthService;
92
- * userService: UserService;
93
- * }
94
- *
95
- * export const authRoutes = createRoutes<AuthRoutesServices>((router, services, route) => {
96
- * // services.authService is typed as AuthService!
97
- * // route is pre-bound to this router's OpenAPI context
98
- * router.post('/login', ...route({
99
- * body: LoginDto,
100
- * responses: { 200: SessionDto },
101
- * handler: async ({ body }) => {
102
- * return services.authService.login(body);
103
- * }
104
- * }));
105
- * });
106
- * ```
107
9
  */
108
10
  export declare function createRoutes<TServices = Record<string, unknown>>(factory: (router: Hono, services: TServices, route: BoundRouteFunction) => void): RouteFactory;
109
- /**
110
- * OpenAPI extensions for route configuration
111
- */
112
- export interface RouteOpenAPIOptions extends Partial<Omit<DescribeRouteOptions, 'responses' | 'operationId' | 'tags' | 'summary' | 'description'>> {
113
- /**
114
- * Response headers to document in OpenAPI spec.
115
- *
116
- * Headers reference components defined in your OpenAPI documentation.
117
- * Use array format for headers on all responses, or object format for status-specific headers.
118
- *
119
- * @example
120
- * ```typescript
121
- * // Simple: applies to all responses
122
- * responseHeaders: ['Api-Version', 'Server-Timing']
123
- *
124
- * // Flexible: status-code specific
125
- * responseHeaders: {
126
- * '200': ['X-Total-Count', 'X-Total-Pages'],
127
- * 'default': ['Api-Version']
128
- * }
129
- * ```
130
- */
131
- responseHeaders?: string[] | Record<string, string[]>;
132
- /**
133
- * Exclude this route from the OpenAPI specification.
134
- * Useful for internal or hidden endpoints.
135
- */
136
- exclude?: boolean;
137
- /**
138
- * Mark this route as deprecated.
139
- */
140
- deprecated?: boolean;
141
- /**
142
- * External documentation for this route.
143
- */
144
- docs?: {
145
- description?: string;
146
- url: string;
147
- };
148
- /**
149
- * Binary response content type for file download endpoints.
150
- * When set, documents the success response as binary content instead of JSON.
151
- * Handler should return a raw Response object.
152
- *
153
- * @example
154
- * ```typescript
155
- * router.get('/files/:id', ...route({
156
- * params: v.object({ id: v.string() }),
157
- * openapi: {
158
- * binaryResponse: {
159
- * contentType: 'application/pdf',
160
- * description: 'PDF document download',
161
- * },
162
- * },
163
- * handler: async ({ params }) => {
164
- * const stream = await getFileStream(params.id);
165
- * return new Response(stream, {
166
- * headers: { 'Content-Type': 'application/pdf' }
167
- * });
168
- * },
169
- * }));
170
- * ```
171
- */
172
- binaryResponse?: {
173
- /** MIME type (e.g., 'application/octet-stream', 'application/pdf', 'image/png') */
174
- contentType: string;
175
- /** Optional description for the response */
176
- description?: string;
177
- /** HTTP status code (default: 200) */
178
- statusCode?: number;
179
- };
180
- }
181
- /**
182
- * Route configuration with automatic type inference from Valibot schemas.
183
- *
184
- * Extends `RouteConfigExtensions` which can be augmented by framework users
185
- * to add custom properties processed by custom OpenAPI response processors.
186
- *
187
- * @template TBody - The body schema (automatically inferred)
188
- * @template TResponses - The responses object (automatically inferred)
189
- * @template TPublic - Whether the route is public (affects session typing)
190
- * @template TStrictTypes - Whether to enforce strict return types (no automatic Prisma type acceptance)
191
- *
192
- * @example
193
- * ```typescript
194
- * // Extend RouteConfigExtensions for custom properties
195
- * declare module 'glasswork' {
196
- * interface RouteConfigExtensions {
197
- * serverTiming?: boolean;
198
- * }
199
- * }
200
- *
201
- * // Use in routes
202
- * route({
203
- * serverTiming: true,
204
- * handler: ...
205
- * });
206
- * ```
207
- */
208
- export interface RouteConfig<TBody extends ValibotSchema | undefined = undefined, TQuery extends ValibotSchema | undefined = undefined, TParams extends ValibotSchema | undefined = undefined, TResponses extends Partial<Record<keyof typeof STATUS_DESCRIPTIONS, ValibotSchema | undefined>> = Record<never, never>, TPublic extends boolean = false, TStrictTypes extends boolean = false> extends RouteConfigExtensions {
209
- tags?: string[];
210
- summary?: string;
211
- description?: string;
212
- operationId?: string;
213
- /**
214
- * Whether this is a public route (no authentication required)
215
- * - false (default): Session is required and typed as non-nullable
216
- * - true: Session is optional and typed as nullable
217
- */
218
- public?: TPublic;
219
- body?: TBody;
220
- /**
221
- * Content type for request body validation.
222
- * - 'json': application/json (default)
223
- * - 'form': application/x-www-form-urlencoded or multipart/form-data
224
- */
225
- bodyType?: 'json' | 'form';
226
- query?: TQuery;
227
- params?: TParams;
228
- responses?: TResponses;
229
- /**
230
- * OpenAPI documentation options for this route
231
- */
232
- openapi?: RouteOpenAPIOptions;
233
- /**
234
- * Custom middleware to apply before validation and handler
235
- */
236
- middleware?: MiddlewareHandler[];
237
- /**
238
- * Enforce strict return types (requires explicit type assertions for Prisma objects)
239
- *
240
- * - false (default): Handler can return Prisma types (Date/Decimal) which are auto-serialized
241
- * - true: Handler must return exact schema types (requires explicit casting)
242
- *
243
- * @default false
244
- *
245
- * @example
246
- * ```typescript
247
- * // strictTypes: false (default) - Prisma types accepted
248
- * handler: async () => {
249
- * const user = await prisma.user.findUnique({ where: { id } });
250
- * return user; // ✅ Works - Date/Decimal auto-serialized
251
- * }
252
- *
253
- * // strictTypes: true - Exact types required
254
- * handler: async () => {
255
- * const user = await prisma.user.findUnique({ where: { id } });
256
- * return user as UserResponse; // Type assertion needed
257
- * }
258
- * ```
259
- */
260
- strictTypes?: TStrictTypes;
261
- /**
262
- * Custom serialization configuration for response data
263
- *
264
- * Allows you to add custom type transformers in addition to the default Date/Decimal handling.
265
- * Your custom transformers are prepended to the default transformers, so they take precedence.
266
- *
267
- * @example
268
- * ```typescript
269
- * // Define custom transformer for Money class
270
- * const moneyTransformer = (value: unknown) => {
271
- * if (value instanceof Money) {
272
- * return { amount: value.amount, currency: value.currency };
273
- * }
274
- * return undefined;
275
- * };
276
- *
277
- * route({
278
- * responses: { 200: ProductSchema },
279
- * serialization: {
280
- * transformers: [moneyTransformer]
281
- * },
282
- * handler: async () => {
283
- * return {
284
- * price: new Money(99.99, 'USD'), // Auto-serialized
285
- * createdAt: new Date(), // Still handled by default transformer
286
- * };
287
- * }
288
- * })
289
- * ```
290
- */
291
- serialization?: Partial<SerializationConfig>;
292
- /**
293
- * Authorization check applied before the handler runs.
294
- * Requires `ability` to be set on the Hono context (e.g., via auth middleware).
295
- */
296
- authorize?: {
297
- action: string;
298
- subject: string | {
299
- __caslSubjectType__?: string;
300
- };
301
- allowGuest?: boolean;
302
- };
303
- /**
304
- * Route handler - body and return types are automatically inferred from schemas
305
- * Session is required by default (unless public: true)
306
- *
307
- * **Return type behavior (controlled by strictTypes option):**
308
- *
309
- * When strictTypes is false (default):
310
- * - Uses `AcceptPrismaTypes<T>` which allows Date/Decimal objects
311
- * - Date objects are automatically converted to ISO strings
312
- * - Decimal objects are automatically converted to numbers
313
- * - ALL string fields accept Date, ALL number fields accept Decimal
314
- * - Pragmatic for Prisma integration, but permissive typing
315
- *
316
- * When strictTypes is true:
317
- * - Requires exact schema types (no automatic Prisma type acceptance)
318
- * - Provides stricter type safety
319
- * - Requires explicit type assertions when returning Prisma objects
320
- * - Serialization still works at runtime, but types are enforced
321
- */
322
- handler: (context: RouteContext<TBody extends ValibotSchema ? InferSchemaType<TBody> : never, TQuery extends ValibotSchema ? InferSchemaType<TQuery> : Record<string, string>, TParams extends ValibotSchema ? InferSchemaType<TParams> : Record<string, string>, TPublic extends true ? false : true>) => TStrictTypes extends true ? Promise<InferResponseType<TResponses>> | InferResponseType<TResponses> : Promise<AcceptPrismaTypes<InferResponseType<TResponses>>> | AcceptPrismaTypes<InferResponseType<TResponses>>;
323
- }
324
- /**
325
- * Route handler context with typed body
326
- *
327
- * Automatically includes all context variables from Hono's ContextVariableMap.
328
- * If your middleware extends ContextVariableMap (e.g., auth middleware adding ability/role),
329
- * those variables will be automatically typed and available for destructuring.
330
- *
331
- * @template TBody - The typed body (inferred from schema)
332
- * @template TSessionRequired - Whether session is guaranteed to exist (true by default, false for public routes)
333
- */
334
- export interface RouteContext<TBody = never, TQuery = Record<string, string>, TParams = Record<string, string>, TSessionRequired extends boolean = true> extends Omit<Context['var'], 'session'> {
335
- body: TBody;
336
- query: TQuery;
337
- params: TParams;
338
- services: Record<string, unknown>;
339
- /**
340
- * Session from context variables (typed via Hono's ContextVariableMap)
341
- * - Required by default (for authenticated routes)
342
- * - Optional only for public routes (public: true)
343
- */
344
- session: TSessionRequired extends true ? NonNullable<Context['var']['session']> : Context['var']['session'];
345
- /**
346
- * Client IP address (extracted from headers and connection info)
347
- */
348
- ip: string;
349
- /**
350
- * User agent string from request headers
351
- */
352
- userAgent: string | undefined;
353
- /**
354
- * Context-aware logger with automatic requestId correlation.
355
- * Uses the route's first tag as the service name.
356
- * Requires pino logger configured in bootstrap options.
357
- */
358
- logger: Logger;
359
- /**
360
- * Original Hono context (for advanced use cases)
361
- */
362
- context: Context;
363
- }
364
11
  /**
365
12
  * Create a route handler with validation and OpenAPI metadata.
366
- *
367
- * Type inference works automatically:
368
- * - Body type is inferred from the `body` schema
369
- * - Return type is inferred as a union of all 2xx response schemas (200, 201, etc.)
370
- * - Response data is automatically validated and extra keys are stripped
371
- * - HTTP status code is automatically set based on which schema matches
372
- *
373
- * Response Validation & Status Code:
374
- * - Responses are parsed through their corresponding 2xx schema
375
- * - Extra keys not defined in the schema are automatically stripped
376
- * - The HTTP status code is automatically set based on which schema validates
377
- * - If multiple 2xx schemas are defined, each is tried in order (200, 201)
378
- * - The first schema that successfully validates determines the status code
379
- *
380
- * @param router - The Hono router instance (needed for OpenAPI context)
381
- * @param config - Route configuration
382
- *
383
- * @example
384
- * ```typescript
385
- * // Single response type
386
- * router.post('/session', ...route(router, {
387
- * body: StartSessionDto,
388
- * responses: { 200: StartSessionResponseDto },
389
- * handler: async ({ body }) => {
390
- * // body is typed as InferOutput<typeof StartSessionDto>
391
- * return { email: body.email }; // Must match StartSessionResponseDto
392
- * }
393
- * }))
394
- *
395
- * // Union response type (multiple 2xx responses with automatic status)
396
- * router.post('/login', ...route(router, {
397
- * body: LoginDto,
398
- * responses: {
399
- * 200: MfaRequiredDto, // Returns 200 if data matches this
400
- * 201: SessionDto // Returns 201 if data matches this
401
- * },
402
- * handler: async ({ body }) => {
403
- * // Return type is: MfaRequiredDto | SessionDto
404
- * // Status code is set automatically based on which schema matches!
405
- * if (needsMfa) return { mfaRequired: true, methods: ['totp'] }; // 200
406
- * return { sessionId: '123', token: 'abc' }; // 201
407
- * }
408
- * }))
409
- *
410
- * // With pagination (auto-detected from ListQuerySchema)
411
- * router.get('/users', ...route(router, {
412
- * query: ListQuerySchema, // Contains page, pageSize - pagination headers auto-added
413
- * responses: { 200: UsersResponseDto },
414
- * handler: async ({ query }) => { ... }
415
- * }))
416
- *
417
- * // With custom response headers
418
- * router.get('/data', ...route(router, {
419
- * openapi: {
420
- * responseHeaders: ['Api-Version', 'Server-Timing']
421
- * },
422
- * responses: { 200: DataDto },
423
- * handler: async () => { ... }
424
- * }))
425
- * ```
426
13
  */
427
14
  export declare function route<TBody extends ValibotSchema | undefined = undefined, TQuery extends ValibotSchema | undefined = undefined, TParams extends ValibotSchema | undefined = undefined, TResponses extends Partial<Record<keyof typeof STATUS_DESCRIPTIONS, ValibotSchema | undefined>> = Record<never, never>, TPublic extends boolean = false, TStrictTypes extends boolean = false>(router: Hono, config: RouteConfig<TBody, TQuery, TParams, TResponses, TPublic, TStrictTypes>): RouteHandlers;
428
15
  //# sourceMappingURL=route-helpers.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"route-helpers.d.ts","sourceRoot":"","sources":["../../src/http/route-helpers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,iBAAiB,EAAE,MAAM,MAAM,CAAC;AAE7D,OAAO,EACL,KAAK,oBAAoB,EAI1B,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAEnF,OAAO,KAAK,EAGV,wBAAwB,EACxB,qBAAqB,EACrB,YAAY,EACZ,aAAa,EACd,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAgC,KAAK,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAGhG,OAAO,EAAgB,KAAK,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC/D,OAAO,EACL,KAAK,iBAAiB,EAEtB,KAAK,mBAAmB,EAEzB,MAAM,oCAAoC,CAAC;AAQ5C;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B,UAAU,EAAE,wBAAwB,EAAE,CAAC;IACvC,eAAe,EAAE,MAAM,EAAE,CAAC;IAC1B;;;OAGG;IACH,IAAI,CAAC,EAAE,UAAU,CAAC;CACnB;AAQD;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,IAAI,EAAE,OAAO,EAAE,cAAc,GAAG,IAAI,CAE1E;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,IAAI,GAAG,cAAc,CAE3D;AAED;;GAEG;AACH,MAAM,MAAM,aAAa,GACrB,UAAU,CAAC,OAAO,EAAE,OAAO,EAAE,SAAS,CAAC,OAAO,CAAC,CAAC,GAChD,eAAe,CAAC,OAAO,EAAE,OAAO,EAAE,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC;AAE1D;;GAEG;AACH,KAAK,eAAe,CAAC,CAAC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