@decohere/http 0.0.1-dev.125 → 0.0.1-dev.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (292) hide show
  1. package/package.json +4 -13
  2. package/src/app/app.ts +147 -0
  3. package/src/app/module.ts +19 -0
  4. package/src/auth/ability.ts +56 -0
  5. package/src/auth/auth.config.ts +34 -0
  6. package/src/auth/auth.extensions.ts +115 -0
  7. package/src/auth/auth.types.ts +124 -0
  8. package/src/auth/casl-authorization.service.ts +62 -0
  9. package/{types/src/auth/principal-provider.d.ts → src/auth/principal-provider.ts} +13 -5
  10. package/src/auth/safe-outbound-url.ts +117 -0
  11. package/src/auth/token-service.ts +192 -0
  12. package/src/builder/builder.ts +118 -0
  13. package/{es6/src/const.js → src/const.ts} +25 -17
  14. package/src/health/health.controller.ts +34 -0
  15. package/src/health/health.extensions.ts +53 -0
  16. package/src/health/readiness.service.ts +33 -0
  17. package/{types/src/health/readiness.types.d.ts → src/health/readiness.types.ts} +4 -8
  18. package/src/hosting/hosted-service-host.ts +102 -0
  19. package/src/hosting/hosted-service.ts +31 -0
  20. package/src/http/http.compression.ts +38 -0
  21. package/src/http/http.extensions.ts +244 -0
  22. package/{types/src/http/http.options.store.d.ts → src/http/http.options.store.ts} +11 -1
  23. package/src/http/http.options.ts +41 -0
  24. package/{types/src/http/http.security.d.ts → src/http/http.security.ts} +16 -10
  25. package/src/http/http.static.ts +359 -0
  26. package/{es6/src/index.js → src/index.ts} +1 -0
  27. package/src/openapi/index.ts +22 -0
  28. package/src/openapi/openapi.generator.ts +78 -0
  29. package/src/openapi/openapi.types.ts +60 -0
  30. package/src/openapi/request-schema.ts +155 -0
  31. package/src/openapi/request-validator.ts +95 -0
  32. package/src/providers/fastify.provider.ts +454 -0
  33. package/src/routing/anvil.types.ts +150 -0
  34. package/src/routing/decorators/argument.decorator.ts +33 -0
  35. package/src/routing/decorators/auth.decorator.ts +79 -0
  36. package/src/routing/decorators/controller.decorator.ts +9 -0
  37. package/src/routing/decorators/field.decorator.ts +15 -0
  38. package/src/routing/decorators/request.decorator.ts +34 -0
  39. package/src/routing/decorators/response.decorator.ts +18 -0
  40. package/src/routing/decorators/route.decorator.ts +52 -0
  41. package/src/routing/filters/exception-filter-host.ts +90 -0
  42. package/src/routing/filters/exception-filter.ts +29 -0
  43. package/src/routing/middleware/http-access-log.middleware.ts +36 -0
  44. package/src/routing/middleware/middleware.ts +26 -0
  45. package/src/routing/middleware/request-id.ts +18 -0
  46. package/src/routing/path.util.ts +38 -0
  47. package/src/routing/pipes/pipes.ts +132 -0
  48. package/src/routing/services/route-argument-resolver.ts +92 -0
  49. package/src/routing/services/route-registry.ts +229 -0
  50. package/src/routing/services/router.ts +166 -0
  51. package/src/sse/sse.decorator.ts +41 -0
  52. package/src/sse/sse.encoder.ts +86 -0
  53. package/src/sse/sse.types.ts +47 -0
  54. package/src/sse/sse.wire.ts +34 -0
  55. package/src/testing/boot-module.ts +63 -0
  56. package/src/testing/sse-reader.ts +120 -0
  57. package/tests/app.hosted-services.spec.ts +292 -0
  58. package/tests/app.shutdown.integration.spec.ts +160 -0
  59. package/tests/app.spec.ts +132 -0
  60. package/tests/auth.ability.spec.ts +48 -0
  61. package/tests/auth.decorators.spec.ts +20 -0
  62. package/tests/auth.fail-closed.pentest.spec.ts +77 -0
  63. package/tests/auth.integration.spec.ts +234 -0
  64. package/tests/auth.jwks-cache.spec.ts +52 -0
  65. package/tests/auth.missing-auth.pentest.spec.ts +56 -0
  66. package/tests/auth.oidc-ssrf.pentest.spec.ts +72 -0
  67. package/tests/auth.oidc.integration.spec.ts +161 -0
  68. package/tests/auth.token-service.spec.ts +251 -0
  69. package/tests/builder.spec.ts +12 -0
  70. package/tests/health.integration.spec.ts +111 -0
  71. package/tests/helpers/listen-ephemeral.ts +13 -0
  72. package/tests/helpers/local-oidc-server.ts +100 -0
  73. package/tests/http.access-log.integration.spec.ts +111 -0
  74. package/tests/http.boolean-query.integration.spec.ts +59 -0
  75. package/tests/http.compression.integration.spec.ts +604 -0
  76. package/tests/http.date-query.integration.spec.ts +71 -0
  77. package/tests/http.global-prefix.integration.spec.ts +284 -0
  78. package/tests/http.number-query.integration.spec.ts +65 -0
  79. package/tests/http.pino-roll-hmr.integration.spec.ts +79 -0
  80. package/tests/http.pipeline-order.integration.spec.ts +95 -0
  81. package/tests/http.request-cleanup.integration.spec.ts +57 -0
  82. package/tests/http.request-id-scope.pentest.spec.ts +50 -0
  83. package/tests/http.security.integration.spec.ts +106 -0
  84. package/tests/http.static.integration.spec.ts +847 -0
  85. package/tests/http.static.spec.ts +111 -0
  86. package/tests/http.surface.integration.spec.ts +167 -0
  87. package/tests/openapi.integration.spec.ts +193 -0
  88. package/tests/openapi.validator-cache.integration.spec.ts +55 -0
  89. package/tests/routing.decorators.spec.ts +15 -0
  90. package/tests/routing.registry.spec.ts +44 -0
  91. package/tests/routing.resolver.spec.ts +92 -0
  92. package/tests/sse.integration.spec.ts +421 -0
  93. package/tests/sse.wire.spec.ts +33 -0
  94. package/LICENSE +0 -15
  95. package/commonjs/src/app/app.js +0 -166
  96. package/commonjs/src/app/index.js +0 -19
  97. package/commonjs/src/app/module.js +0 -17
  98. package/commonjs/src/auth/ability.js +0 -54
  99. package/commonjs/src/auth/auth.config.js +0 -23
  100. package/commonjs/src/auth/auth.extensions.js +0 -106
  101. package/commonjs/src/auth/auth.types.js +0 -65
  102. package/commonjs/src/auth/casl-authorization.service.js +0 -36
  103. package/commonjs/src/auth/index.js +0 -23
  104. package/commonjs/src/auth/principal-provider.js +0 -19
  105. package/commonjs/src/auth/safe-outbound-url.js +0 -102
  106. package/commonjs/src/auth/token-service.js +0 -151
  107. package/commonjs/src/builder/builder.js +0 -95
  108. package/commonjs/src/builder/index.js +0 -18
  109. package/commonjs/src/const.js +0 -87
  110. package/commonjs/src/health/health.controller.js +0 -75
  111. package/commonjs/src/health/health.extensions.js +0 -50
  112. package/commonjs/src/health/index.js +0 -21
  113. package/commonjs/src/health/readiness.service.js +0 -67
  114. package/commonjs/src/health/readiness.types.js +0 -7
  115. package/commonjs/src/hosting/hosted-service-host.js +0 -88
  116. package/commonjs/src/hosting/hosted-service.js +0 -11
  117. package/commonjs/src/hosting/index.js +0 -19
  118. package/commonjs/src/http/http.compression.js +0 -27
  119. package/commonjs/src/http/http.extensions.js +0 -269
  120. package/commonjs/src/http/http.options.js +0 -26
  121. package/commonjs/src/http/http.options.store.js +0 -20
  122. package/commonjs/src/http/http.security.js +0 -27
  123. package/commonjs/src/http/http.static.js +0 -248
  124. package/commonjs/src/http/index.js +0 -22
  125. package/commonjs/src/index.js +0 -27
  126. package/commonjs/src/openapi/index.js +0 -45
  127. package/commonjs/src/openapi/openapi.generator.js +0 -103
  128. package/commonjs/src/openapi/openapi.types.js +0 -4
  129. package/commonjs/src/openapi/request-schema.js +0 -187
  130. package/commonjs/src/openapi/request-validator.js +0 -85
  131. package/commonjs/src/providers/fastify.provider.js +0 -391
  132. package/commonjs/src/providers/index.js +0 -18
  133. package/commonjs/src/routing/anvil.types.js +0 -99
  134. package/commonjs/src/routing/decorators/argument.decorator.js +0 -49
  135. package/commonjs/src/routing/decorators/auth.decorator.js +0 -70
  136. package/commonjs/src/routing/decorators/controller.decorator.js +0 -16
  137. package/commonjs/src/routing/decorators/field.decorator.js +0 -25
  138. package/commonjs/src/routing/decorators/index.js +0 -24
  139. package/commonjs/src/routing/decorators/request.decorator.js +0 -30
  140. package/commonjs/src/routing/decorators/response.decorator.js +0 -34
  141. package/commonjs/src/routing/decorators/route.decorator.js +0 -67
  142. package/commonjs/src/routing/filters/exception-filter-host.js +0 -145
  143. package/commonjs/src/routing/filters/exception-filter.js +0 -28
  144. package/commonjs/src/routing/index.js +0 -25
  145. package/commonjs/src/routing/middleware/http-access-log.middleware.js +0 -47
  146. package/commonjs/src/routing/middleware/middleware.js +0 -20
  147. package/commonjs/src/routing/middleware/request-id.js +0 -30
  148. package/commonjs/src/routing/path.util.js +0 -51
  149. package/commonjs/src/routing/pipes/index.js +0 -18
  150. package/commonjs/src/routing/pipes/pipes.js +0 -145
  151. package/commonjs/src/routing/services/index.js +0 -18
  152. package/commonjs/src/routing/services/route-argument-resolver.js +0 -77
  153. package/commonjs/src/routing/services/route-registry.js +0 -194
  154. package/commonjs/src/routing/services/router.js +0 -158
  155. package/commonjs/src/sse/index.js +0 -26
  156. package/commonjs/src/sse/sse.decorator.js +0 -42
  157. package/commonjs/src/sse/sse.encoder.js +0 -73
  158. package/commonjs/src/sse/sse.types.js +0 -36
  159. package/commonjs/src/sse/sse.wire.js +0 -40
  160. package/commonjs/src/testing/boot-module.js +0 -38
  161. package/commonjs/src/testing/index.js +0 -20
  162. package/commonjs/src/testing/sse-reader.js +0 -98
  163. package/es6/src/app/app.js +0 -148
  164. package/es6/src/app/index.js +0 -2
  165. package/es6/src/app/module.js +0 -7
  166. package/es6/src/auth/ability.js +0 -45
  167. package/es6/src/auth/auth.config.js +0 -19
  168. package/es6/src/auth/auth.extensions.js +0 -83
  169. package/es6/src/auth/auth.types.js +0 -35
  170. package/es6/src/auth/casl-authorization.service.js +0 -40
  171. package/es6/src/auth/index.js +0 -6
  172. package/es6/src/auth/principal-provider.js +0 -14
  173. package/es6/src/auth/safe-outbound-url.js +0 -99
  174. package/es6/src/auth/token-service.js +0 -141
  175. package/es6/src/builder/builder.js +0 -85
  176. package/es6/src/builder/index.js +0 -1
  177. package/es6/src/health/health.controller.js +0 -65
  178. package/es6/src/health/health.extensions.js +0 -40
  179. package/es6/src/health/index.js +0 -4
  180. package/es6/src/health/readiness.service.js +0 -57
  181. package/es6/src/health/readiness.types.js +0 -4
  182. package/es6/src/hosting/hosted-service-host.js +0 -81
  183. package/es6/src/hosting/hosted-service.js +0 -8
  184. package/es6/src/hosting/index.js +0 -2
  185. package/es6/src/http/http.compression.js +0 -9
  186. package/es6/src/http/http.extensions.js +0 -259
  187. package/es6/src/http/http.options.js +0 -16
  188. package/es6/src/http/http.options.store.js +0 -13
  189. package/es6/src/http/http.security.js +0 -9
  190. package/es6/src/http/http.static.js +0 -224
  191. package/es6/src/http/index.js +0 -5
  192. package/es6/src/openapi/index.js +0 -3
  193. package/es6/src/openapi/openapi.generator.js +0 -82
  194. package/es6/src/openapi/openapi.types.js +0 -1
  195. package/es6/src/openapi/request-schema.js +0 -160
  196. package/es6/src/openapi/request-validator.js +0 -71
  197. package/es6/src/providers/fastify.provider.js +0 -376
  198. package/es6/src/providers/index.js +0 -1
  199. package/es6/src/routing/anvil.types.js +0 -57
  200. package/es6/src/routing/decorators/argument.decorator.js +0 -28
  201. package/es6/src/routing/decorators/auth.decorator.js +0 -58
  202. package/es6/src/routing/decorators/controller.decorator.js +0 -6
  203. package/es6/src/routing/decorators/field.decorator.js +0 -15
  204. package/es6/src/routing/decorators/index.js +0 -7
  205. package/es6/src/routing/decorators/request.decorator.js +0 -24
  206. package/es6/src/routing/decorators/response.decorator.js +0 -16
  207. package/es6/src/routing/decorators/route.decorator.js +0 -37
  208. package/es6/src/routing/filters/exception-filter-host.js +0 -127
  209. package/es6/src/routing/filters/exception-filter.js +0 -10
  210. package/es6/src/routing/index.js +0 -8
  211. package/es6/src/routing/middleware/http-access-log.middleware.js +0 -37
  212. package/es6/src/routing/middleware/middleware.js +0 -10
  213. package/es6/src/routing/middleware/request-id.js +0 -14
  214. package/es6/src/routing/path.util.js +0 -33
  215. package/es6/src/routing/pipes/index.js +0 -1
  216. package/es6/src/routing/pipes/pipes.js +0 -118
  217. package/es6/src/routing/services/index.js +0 -1
  218. package/es6/src/routing/services/route-argument-resolver.js +0 -67
  219. package/es6/src/routing/services/route-registry.js +0 -184
  220. package/es6/src/routing/services/router.js +0 -148
  221. package/es6/src/sse/index.js +0 -2
  222. package/es6/src/sse/sse.decorator.js +0 -31
  223. package/es6/src/sse/sse.encoder.js +0 -67
  224. package/es6/src/sse/sse.types.js +0 -22
  225. package/es6/src/sse/sse.wire.js +0 -30
  226. package/es6/src/testing/boot-module.js +0 -35
  227. package/es6/src/testing/index.js +0 -2
  228. package/es6/src/testing/sse-reader.js +0 -91
  229. package/types/src/app/app.d.ts +0 -41
  230. package/types/src/app/module.d.ts +0 -15
  231. package/types/src/auth/ability.d.ts +0 -19
  232. package/types/src/auth/auth.config.d.ts +0 -28
  233. package/types/src/auth/auth.extensions.d.ts +0 -53
  234. package/types/src/auth/auth.types.d.ts +0 -73
  235. package/types/src/auth/casl-authorization.service.d.ts +0 -28
  236. package/types/src/auth/safe-outbound-url.d.ts +0 -9
  237. package/types/src/auth/token-service.d.ts +0 -31
  238. package/types/src/builder/builder.d.ts +0 -36
  239. package/types/src/const.d.ts +0 -32
  240. package/types/src/health/health.controller.d.ts +0 -16
  241. package/types/src/health/health.extensions.d.ts +0 -31
  242. package/types/src/health/readiness.service.d.ts +0 -9
  243. package/types/src/hosting/hosted-service-host.d.ts +0 -37
  244. package/types/src/hosting/hosted-service.d.ts +0 -31
  245. package/types/src/http/http.compression.d.ts +0 -32
  246. package/types/src/http/http.extensions.d.ts +0 -79
  247. package/types/src/http/http.options.d.ts +0 -39
  248. package/types/src/http/http.static.d.ts +0 -160
  249. package/types/src/index.d.ts +0 -10
  250. package/types/src/openapi/index.d.ts +0 -6
  251. package/types/src/openapi/openapi.generator.d.ts +0 -6
  252. package/types/src/openapi/openapi.types.d.ts +0 -58
  253. package/types/src/openapi/request-schema.d.ts +0 -21
  254. package/types/src/openapi/request-validator.d.ts +0 -9
  255. package/types/src/providers/fastify.provider.d.ts +0 -56
  256. package/types/src/routing/anvil.types.d.ts +0 -119
  257. package/types/src/routing/decorators/argument.decorator.d.ts +0 -11
  258. package/types/src/routing/decorators/auth.decorator.d.ts +0 -30
  259. package/types/src/routing/decorators/controller.decorator.d.ts +0 -3
  260. package/types/src/routing/decorators/field.decorator.d.ts +0 -2
  261. package/types/src/routing/decorators/request.decorator.d.ts +0 -8
  262. package/types/src/routing/decorators/response.decorator.d.ts +0 -4
  263. package/types/src/routing/decorators/route.decorator.d.ts +0 -7
  264. package/types/src/routing/filters/exception-filter-host.d.ts +0 -19
  265. package/types/src/routing/filters/exception-filter.d.ts +0 -16
  266. package/types/src/routing/middleware/http-access-log.middleware.d.ts +0 -8
  267. package/types/src/routing/middleware/middleware.d.ts +0 -10
  268. package/types/src/routing/middleware/request-id.d.ts +0 -6
  269. package/types/src/routing/path.util.d.ts +0 -9
  270. package/types/src/routing/pipes/pipes.d.ts +0 -21
  271. package/types/src/routing/services/route-argument-resolver.d.ts +0 -10
  272. package/types/src/routing/services/route-registry.d.ts +0 -20
  273. package/types/src/routing/services/router.d.ts +0 -22
  274. package/types/src/sse/sse.decorator.d.ts +0 -17
  275. package/types/src/sse/sse.encoder.d.ts +0 -16
  276. package/types/src/sse/sse.types.d.ts +0 -37
  277. package/types/src/sse/sse.wire.d.ts +0 -9
  278. package/types/src/testing/boot-module.d.ts +0 -34
  279. package/types/src/testing/sse-reader.d.ts +0 -29
  280. /package/{types/src/app/index.d.ts → src/app/index.ts} +0 -0
  281. /package/{types/src/auth/index.d.ts → src/auth/index.ts} +0 -0
  282. /package/{types/src/builder/index.d.ts → src/builder/index.ts} +0 -0
  283. /package/{types/src/health/index.d.ts → src/health/index.ts} +0 -0
  284. /package/{types/src/hosting/index.d.ts → src/hosting/index.ts} +0 -0
  285. /package/{types/src/http/index.d.ts → src/http/index.ts} +0 -0
  286. /package/{types/src/providers/index.d.ts → src/providers/index.ts} +0 -0
  287. /package/{types/src/routing/decorators/index.d.ts → src/routing/decorators/index.ts} +0 -0
  288. /package/{types/src/routing/index.d.ts → src/routing/index.ts} +0 -0
  289. /package/{types/src/routing/pipes/index.d.ts → src/routing/pipes/index.ts} +0 -0
  290. /package/{types/src/routing/services/index.d.ts → src/routing/services/index.ts} +0 -0
  291. /package/{types/src/sse/index.d.ts → src/sse/index.ts} +0 -0
  292. /package/{types/src/testing/index.d.ts → src/testing/index.ts} +0 -0
@@ -1,160 +0,0 @@
1
- /**
2
- * Serving a module's built UI from its API (`builder.withStatic`). Everything here is
3
- * provider-neutral: the options, the caching rules and the missing-directory policy.
4
- * Only the HTTP provider knows how to put files on the wire. See ADR 0007.
5
- */
6
- /** Cache header for files whose name carries a content hash. The name changes when the content does. */
7
- export declare const STATIC_IMMUTABLE_CACHE_CONTROL = "public, max-age=31536000, immutable";
8
- /** Cache header for files that must be revalidated on every use (the entry points of a UI). */
9
- export declare const STATIC_NO_CACHE_CONTROL = "no-cache";
10
- /** Cache header for every other file: cacheable, but always revalidated (ETag / Last-Modified). */
11
- export declare const STATIC_DEFAULT_CACHE_CONTROL = "public, max-age=0, must-revalidate";
12
- /**
13
- * The entry points of a UI. `index.html` names the hashed bundles, and a module-federation host
14
- * loads `remoteEntry.js` by a fixed name to find the current remote, so neither can be cached.
15
- */
16
- export declare const STATIC_DEFAULT_NO_CACHE: readonly string[];
17
- /**
18
- * A build tool's hashed file name: `index-DiwrgTda.js`, `chunk.3f9a8c1b.css`, `app-abc123de.js.map`.
19
- * The hash is 8 or more letters, digits or `_` after a `-` or `.`, and holds a digit or a lowercase
20
- * letter followed by an uppercase one. Plain words (`logo-background.png`) are not hashes.
21
- */
22
- export declare const STATIC_DEFAULT_IMMUTABLE: RegExp;
23
- export type StaticOptions = {
24
- /**
25
- * Serve `index.html` for an unknown path under the prefix, so a client-side route survives a
26
- * reload. Only for GET and HEAD, and never for a path that looks like a file (has an
27
- * extension), so a missing asset stays a 404. Defaults to `true`.
28
- */
29
- spaFallback?: boolean;
30
- /**
31
- * Path patterns this mount never answers, neither a file nor the fallback: the request gets the
32
- * normal JSON 404. Globs on the full request path (not relative to the prefix), for example
33
- * `["/api/**", "/docs/**"]`: `*` is any run of characters inside one segment, `**` crosses
34
- * segments, `?` is one character. `/api/**` also covers `/api` itself. Rarely needed: a path
35
- * that starts with the first segment of a registered controller route is already never
36
- * answered with the fallback (see `staticFiles.isUnderRoute`).
37
- */
38
- exclude?: string[];
39
- /** The file served for the prefix itself and for the fallback. Defaults to `index.html`. */
40
- index?: string;
41
- /**
42
- * Files sent with `Cache-Control: no-cache`, by file name (`index.html`) or by path relative to
43
- * the directory (`remote/remoteEntry.js`). Replaces the default `["index.html", "remoteEntry.js"]`,
44
- * so list `index.html` again if you override it.
45
- */
46
- noCache?: string[];
47
- /**
48
- * Files whose name holds a content hash get `public, max-age=31536000, immutable`. Replace the
49
- * pattern if your build names files differently (it is tested against the path relative to the
50
- * directory), or pass `false` to give no file the immutable header.
51
- */
52
- immutable?: RegExp | false;
53
- /** `Cache-Control` for every other file. Defaults to `public, max-age=0, must-revalidate`. */
54
- cacheControl?: string;
55
- /**
56
- * What to do when the directory does not exist at start. `"fail"` stops the app with an error;
57
- * `"warn"` logs a warning and serves nothing, so the API still boots before the UI is built.
58
- * Defaults to `"warn"` when NODE_ENV is `development` or `dev`, and to `"fail"` otherwise.
59
- */
60
- onMissingDirectory?: "fail" | "warn";
61
- };
62
- /** A `withStatic` call, as the builder keeps it. */
63
- export type StaticMount = {
64
- /** Normalised: starts and ends with `/`, for example `/ui/`. */
65
- prefix: string;
66
- /** As given by the caller, resolved from the process working directory when the app starts. */
67
- directory: string;
68
- options: StaticOptions;
69
- };
70
- /** A mount the provider can register: the directory exists and every option has its value. */
71
- export type ResolvedStaticMount = {
72
- prefix: string;
73
- /** Absolute path of the directory. */
74
- root: string;
75
- spaFallback: boolean;
76
- index: string;
77
- noCache: readonly string[];
78
- immutable: RegExp | false;
79
- cacheControl: string;
80
- exclude: readonly string[];
81
- };
82
- declare function toMount(prefix: string, directory: string, options?: StaticOptions): StaticMount;
83
- type DirectoryProbe = (absolutePath: string) => Promise<boolean>;
84
- export type ResolveStaticOptions = {
85
- /** Where relative directories are resolved from. Defaults to the process working directory. */
86
- cwd?: string;
87
- nodeEnv?: string;
88
- directoryExists: DirectoryProbe;
89
- warn: (message: string) => void;
90
- };
91
- /**
92
- * Checks every mount at start. Returns the ones that can be served; a missing directory fails or
93
- * warns according to the mount's `onMissingDirectory`. Two mounts on one prefix always fail.
94
- */
95
- declare function resolve(mounts: readonly StaticMount[], env: ResolveStaticOptions): Promise<ResolvedStaticMount[]>;
96
- /** `Cache-Control` for a file, given its path relative to the mount's directory. */
97
- declare function cacheControlFor(mount: ResolvedStaticMount, relativePath: string): string;
98
- /**
99
- * Does this path look like a file: an extension on the last segment, or a dotfile anywhere?
100
- * Then a miss is a real 404, not a client-side route.
101
- */
102
- declare function looksLikeFile(pathname: string): boolean;
103
- /** The request path as the mount sees it: no query, decoded, repeated slashes collapsed. */
104
- declare function normalizePathname(url: string): string;
105
- /** Builds the test for a mount's `exclude` patterns. Matches on the normalised path. */
106
- declare function excluder(patterns: readonly string[]): (pathname: string) => boolean;
107
- /**
108
- * The first path segment of every registered route, for {@link isUnderRoute}. A segment that is a
109
- * parameter or wildcard (`:id`, `*`) says nothing about the path and is skipped.
110
- */
111
- declare function routeSegments(routePaths: Iterable<string>): Set<string>;
112
- /**
113
- * Is this path under one of the app's own routes? True when its first segment is the first
114
- * segment of a registered route: with a controller route `/lp/portfolio`, `/lp/portfolo` and
115
- * `/lp/anything/else` belong to the API and keep the JSON 404, while `/lpx` does not.
116
- */
117
- declare function isUnderRoute(pathname: string, segments: ReadonlySet<string>): boolean;
118
- /**
119
- * What the fallback treats as the API, as a test on the normalised path. With a global prefix it
120
- * is the prefix, the OpenAPI path and every route left outside the prefix
121
- * (`@Controller({ globalPrefix: false })`, such as `/health`), each with the paths below it, so a
122
- * client route may share a first segment with a controller. Without a prefix it is
123
- * {@link isUnderRoute} (the first segment of every registered route), the safe guess when nothing
124
- * says where the API lives.
125
- */
126
- declare function apiBoundary(boundary: {
127
- /** Normalised global prefix (`/api`), or `""` when there is none. */
128
- globalPrefix: string;
129
- openApiPath?: string;
130
- /** Every registered route path, global prefix included. */
131
- routePaths: Iterable<string>;
132
- }): (pathname: string) => boolean;
133
- /** Does the `Accept` header ask for HTML (a browser navigation)? `text/html;q=0` does not. */
134
- declare function acceptsHtml(accept: string | undefined): boolean;
135
- export type FallbackRequest = {
136
- method: string;
137
- /** Normalised, see `normalizePathname`. */
138
- pathname: string;
139
- accept: string | undefined;
140
- };
141
- /**
142
- * Should an unknown path get the app's `index.html`? Only a browser navigation: GET or HEAD, no
143
- * file extension and no dotfile in the path, an `Accept` that includes `text/html`, and not under
144
- * the API (see {@link apiBoundary}). Everything else keeps the normal JSON 404.
145
- */
146
- declare function shouldFallBack(request: FallbackRequest, belongsToApi: (pathname: string) => boolean): boolean;
147
- export declare const staticFiles: {
148
- toMount: typeof toMount;
149
- resolve: typeof resolve;
150
- cacheControlFor: typeof cacheControlFor;
151
- looksLikeFile: typeof looksLikeFile;
152
- normalizePathname: typeof normalizePathname;
153
- excluder: typeof excluder;
154
- routeSegments: typeof routeSegments;
155
- isUnderRoute: typeof isUnderRoute;
156
- apiBoundary: typeof apiBoundary;
157
- acceptsHtml: typeof acceptsHtml;
158
- shouldFallBack: typeof shouldFallBack;
159
- };
160
- export {};
@@ -1,10 +0,0 @@
1
- export type { StartOptions } from "./app/index.js";
2
- export * from "./app/index.js";
3
- export * from "./auth/index.js";
4
- export * from "./builder/index.js";
5
- export * from "./const.js";
6
- export * from "./health/index.js";
7
- export * from "./hosting/index.js";
8
- export * from "./openapi/index.js";
9
- export * from "./routing/index.js";
10
- export * from "./sse/index.js";
@@ -1,6 +0,0 @@
1
- export type { ValidationIssue } from "../routing/anvil.types.js";
2
- export { generateOpenApiDocument, resolveOpenApiPath, toOpenApiPath, } from "./openapi.generator.js";
3
- export type { JsonSchema, OpenApiDocument, OpenApiOperation, OpenApiOptions, OpenApiParameter, } from "./openapi.types.js";
4
- export type { RouteRequestSchemas } from "./request-schema.js";
5
- export { buildRouteRequestSchemas, mergeObjectSchemas, objectArgToParts, pathParamsToSchema, typeToSchema, } from "./request-schema.js";
6
- export { ValidationError, validateRequest } from "./request-validator.js";
@@ -1,6 +0,0 @@
1
- import type { RouteRegistry } from "../routing/services/route-registry.js";
2
- import type { OpenApiDocument, OpenApiOptions } from "./openapi.types.js";
3
- export declare function resolveOpenApiPath(options: OpenApiOptions): string;
4
- /** Convert Fastify-style `:id` path params to OpenAPI `{id}`. */
5
- export declare function toOpenApiPath(fastifyPath: string): string;
6
- export declare function generateOpenApiDocument(registry: RouteRegistry, options: OpenApiOptions): OpenApiDocument;
@@ -1,58 +0,0 @@
1
- export type OpenApiInfo = {
2
- title: string;
3
- version: string;
4
- description?: string;
5
- };
6
- export type OpenApiServer = {
7
- url: string;
8
- description?: string;
9
- };
10
- export type OpenApiOptions = {
11
- /** Defaults to `/openapi.json`. Absolute Fastify path (not affected by globalPrefix). */
12
- path?: string;
13
- info: OpenApiInfo;
14
- servers?: OpenApiServer[];
15
- /** When true (default), validate request params/query/body before the handler. */
16
- validateRequests?: boolean;
17
- };
18
- export type JsonSchema = {
19
- type?: string;
20
- properties?: Record<string, JsonSchema>;
21
- required?: string[];
22
- items?: JsonSchema;
23
- additionalProperties?: boolean | JsonSchema;
24
- format?: string;
25
- description?: string;
26
- minLength?: number;
27
- maxLength?: number;
28
- };
29
- export type OpenApiParameter = {
30
- name: string;
31
- in: "query" | "path" | "header" | "cookie";
32
- required?: boolean;
33
- schema?: JsonSchema;
34
- };
35
- export type OpenApiOperation = {
36
- operationId?: string;
37
- summary?: string;
38
- tags?: string[];
39
- parameters?: OpenApiParameter[];
40
- requestBody?: {
41
- required?: boolean;
42
- content: Record<string, {
43
- schema: JsonSchema;
44
- }>;
45
- };
46
- responses: Record<string, {
47
- description: string;
48
- content?: Record<string, {
49
- schema: JsonSchema;
50
- }>;
51
- }>;
52
- };
53
- export type OpenApiDocument = {
54
- openapi: "3.0.3";
55
- info: OpenApiInfo;
56
- servers?: OpenApiServer[];
57
- paths: Record<string, Partial<Record<string, OpenApiOperation>>>;
58
- };
@@ -1,21 +0,0 @@
1
- import { type MappedRoute, type RouteArg } from "../routing/anvil.types.js";
2
- import type { JsonSchema, OpenApiParameter } from "./openapi.types.js";
3
- /**
4
- * Request shapes derived from route / `@Field` metadata (same source as OpenAPI).
5
- * Used by the document generator and the AJV request validator.
6
- */
7
- export type RouteRequestSchemas = {
8
- queryParams: OpenApiParameter[];
9
- pathParams: OpenApiParameter[];
10
- body?: JsonSchema;
11
- };
12
- export declare function buildRouteRequestSchemas(route: MappedRoute): RouteRequestSchemas;
13
- export declare function objectArgToParts(routeArg: RouteArg): {
14
- queryParams: OpenApiParameter[];
15
- pathParams: OpenApiParameter[];
16
- body?: JsonSchema;
17
- };
18
- export declare function mergeObjectSchemas(a: JsonSchema | undefined, b: JsonSchema): JsonSchema;
19
- export declare function typeToSchema(typeName?: string): JsonSchema;
20
- /** JSON Schema object for required path params (HTTP path values are always strings). */
21
- export declare function pathParamsToSchema(params: OpenApiParameter[]): JsonSchema | undefined;
@@ -1,9 +0,0 @@
1
- import type { HttpRequest, MappedRoute, ValidationIssue } from "../routing/anvil.types.js";
2
- import { ValidationError } from "../routing/anvil.types.js";
3
- export type { ValidationIssue };
4
- export { ValidationError };
5
- /**
6
- * Fail-closed request validation from route / OpenAPI / `@Field` metadata.
7
- * Uses AJV against the same schemas as the OpenAPI generator (no type coercion).
8
- */
9
- export declare function validateRequest(route: MappedRoute, request: HttpRequest): void;
@@ -1,56 +0,0 @@
1
- import { type FastifyInstance } from "fastify";
2
- import type { HttpOptions } from "../http/http.options.js";
3
- import { type HttpProvider, type StartOptions, type StartResponse, type StopResponse } from "../routing/anvil.types.js";
4
- import { type ExceptionFilterHost } from "../routing/filters/exception-filter-host.js";
5
- import type { RouteRegistry } from "../routing/services/route-registry.js";
6
- import type { Router } from "../routing/services/router.js";
7
- export declare class FastifyProvider implements HttpProvider {
8
- readonly provider: FastifyInstance;
9
- readonly router: Router;
10
- private readonly routeRegistry;
11
- private readonly httpOptions?;
12
- private readonly exceptionFilterHost?;
13
- private closing;
14
- private readonly logger;
15
- /** One per live `@Sse()` request, so stopping the app can end the streams. */
16
- private readonly openStreams;
17
- constructor(routeRegistry?: RouteRegistry, router?: Router, httpOptions?: HttpOptions, exceptionFilterHost?: ExceptionFilterHost);
18
- start<T extends StartOptions>(options?: T): Promise<StartResponse>;
19
- stop(): Promise<StopResponse>;
20
- [Symbol.asyncDispose](): Promise<void>;
21
- /**
22
- * Once stopping, tell clients to drop the connection after their response. Otherwise
23
- * a request that was in flight leaves a kept-alive socket that holds `close()` open
24
- * until Node's keep-alive timeout (5s).
25
- */
26
- private closeConnectionsWhileStopping;
27
- get addresses(): string[];
28
- private registerHelmet;
29
- private registerRateLimit;
30
- private resolveStatics;
31
- /**
32
- * One encapsulated context per mount: its not-found handler (the SPA fallback) applies to
33
- * paths under the prefix and nowhere else, so an API 404 is never answered with the UI.
34
- */
35
- private registerStatic;
36
- /** What the static fallback leaves to the API: the global prefix, else the registered routes. ADR 0007. */
37
- private apiBoundary;
38
- /**
39
- * `@fastify/compress` with best-practice defaults; the plugin owns the policy. Registered
40
- * before any route so every response goes through it, errors and static files included.
41
- * `providerOptions` is merged last, so a user can override any plugin option.
42
- */
43
- private registerCompression;
44
- private registerCors;
45
- private registerOpenApi;
46
- private registerAllRoutes;
47
- private routeRequest;
48
- /**
49
- * Gives the handler a signal that aborts when the client goes away before the response
50
- * finished. Streams are also tracked so that stopping the app can abort them.
51
- */
52
- private abortOnDisconnect;
53
- private sendEventStream;
54
- private applyResponseHeaders;
55
- private fastifyToRequest;
56
- }
@@ -1,119 +0,0 @@
1
- import type { Constructable, Type } from "@decohere/core/reflection";
2
- import type { HTTPMethod } from "../const.js";
3
- import type { SseOptions } from "../sse/sse.types.js";
4
- import type { Pipe } from "./pipes/pipes.js";
5
- export type Metadata = "controller" | "route" | "parameter" | "fieldMap" | "authorize" | "allowAnonymous" | "httpCode" | "headers" | "catch";
6
- export type CorsOptions = {
7
- origin?: boolean | string | string[];
8
- methods?: string[];
9
- allowedHeaders?: string[];
10
- exposedHeaders?: string[];
11
- credentials?: boolean;
12
- maxAge?: number;
13
- };
14
- export declare const RequestParts: {
15
- query: "query";
16
- params: "params";
17
- body: "body";
18
- principal: "principal";
19
- signal: "signal";
20
- lastEventId: "lastEventId";
21
- };
22
- export interface HttpProvider {
23
- start<T extends StartOptions>(options: T): Promise<StartResponse>;
24
- stop(): Promise<StopResponse>;
25
- [Symbol.asyncDispose](): Promise<void>;
26
- }
27
- export type RequestPart = "query" | "params" | "body" | "principal" | "signal" | "lastEventId";
28
- /** Argument locations filled by the HTTP package itself rather than read from the request payload. */
29
- export declare const InjectedParts: readonly RequestPart[];
30
- export type MappedRoute = {
31
- key: string;
32
- controller: Constructable;
33
- handler: string;
34
- routeArgs?: RouteArg[];
35
- httpCode?: number;
36
- headers?: Record<string, string>;
37
- /** Set by `@Sse()`: the handler returns a stream of events instead of a single response. */
38
- sse?: SseOptions;
39
- } & RouteMetadata;
40
- export type RouteArg = {
41
- argumentType: Constructable;
42
- fieldMap?: Map<string, FieldMeta>;
43
- pipes?: Constructable<Pipe>[];
44
- } & ArgumentMeta;
45
- export declare class HttpRequest {
46
- constructor(data?: Partial<HttpRequest>);
47
- requestId: string;
48
- url: string;
49
- method: string;
50
- params: Record<string, string>;
51
- query: Record<string, string>;
52
- body: unknown;
53
- headers: Record<string, string>;
54
- /** Aborts when the client disconnects or the app stops. Never aborts if the provider cannot tell. */
55
- signal: AbortSignal;
56
- /** Outbound headers set by middleware; applied by the HTTP provider. */
57
- responseHeaders: Record<string, string>;
58
- }
59
- export type StartResponse = {
60
- addresses: string[];
61
- };
62
- export type StopResponse = {
63
- message: string;
64
- };
65
- export type StartOptions = {
66
- port: number;
67
- host?: string;
68
- };
69
- export type ArgumentMeta = {
70
- argumentIndex: number;
71
- mappingKey?: string;
72
- argumentLocation?: RequestPart;
73
- pipes: Constructable<Pipe>[];
74
- };
75
- export type ControllerMetadata = {
76
- prefix: string;
77
- /**
78
- * `false` leaves this controller's routes out of the global prefix (`withGlobalPrefix`), for
79
- * paths something outside the app expects at a fixed place: probes, webhooks, metrics. Default
80
- * `true`.
81
- */
82
- globalPrefix?: boolean;
83
- };
84
- export type FieldMeta = {
85
- fieldKey: string;
86
- fieldType: Type;
87
- mappingKey: string;
88
- fieldLocation?: RequestPart;
89
- pipes?: Constructable<Pipe>[];
90
- };
91
- export type RouteMetadata = {
92
- path: string;
93
- method: HTTPMethod;
94
- };
95
- export declare class RouteConfigurationError extends Error {
96
- }
97
- export declare class RoutingError extends Error {
98
- }
99
- export declare class TransformError extends Error {
100
- }
101
- export declare class HttpError extends Error {
102
- readonly status: number;
103
- constructor(message: string, status: number);
104
- }
105
- export declare class UnauthorizedError extends HttpError {
106
- constructor(message?: string);
107
- }
108
- export declare class ForbiddenError extends HttpError {
109
- constructor(message?: string);
110
- }
111
- export type ValidationIssue = {
112
- path: string;
113
- message: string;
114
- keyword?: string;
115
- };
116
- export declare class ValidationError extends HttpError {
117
- readonly errors: ValidationIssue[];
118
- constructor(message?: string, errors?: ValidationIssue[]);
119
- }
@@ -1,11 +0,0 @@
1
- import type { Constructable } from "@decohere/core/reflection";
2
- import { type RequestPart } from "../anvil.types.js";
3
- import type { Pipe } from "../pipes/pipes.js";
4
- export type ArgumentOptions = {
5
- mappingKey?: string;
6
- argumentLocation?: RequestPart;
7
- pipes?: Constructable<Pipe>[];
8
- };
9
- export declare function Query(key: string): (target: object, functionName: string, argumentIndex: number) => void;
10
- export declare function Param(key: string): (target: object, functionName: string, argumentIndex: number) => void;
11
- export declare function Argument(options: ArgumentOptions): (target: object, functionName: string, argumentIndex: number) => void;
@@ -1,30 +0,0 @@
1
- import type { Constructable } from "@decohere/core/reflection";
2
- export type AuthorizeOptions = {
3
- action: string;
4
- subject: string;
5
- };
6
- /**
7
- * Require the principal to be able to perform `action` on `subject`.
8
- * Uses an IAuthorizationService (e.g. CaslAuthorizationService) registered in DI.
9
- * When applied to a class, all methods inherit the constraint.
10
- * When applied to a method, it takes precedence over the class-level decorator.
11
- *
12
- * @example
13
- * \@Authorize("delete", "Article")
14
- * \@Authorize("manage", "all")
15
- */
16
- export declare function Authorize(action: string, subject?: string): (target: object | Constructable, methodName?: string, _descriptor?: PropertyDescriptor) => void;
17
- /**
18
- * Opt a specific route method out of authentication, even when the controller
19
- * class is decorated with @Authorize.
20
- */
21
- export declare function AllowAnonymous(): (target: object, methodName: string, _descriptor?: PropertyDescriptor) => void;
22
- /** Read the effective @Authorize options for a handler function. */
23
- export declare function getAuthorizeOptions(controllerPrototype: object, handlerFn: object): AuthorizeOptions | undefined;
24
- /** Returns true only when the handler is explicitly marked @AllowAnonymous. */
25
- export declare function isAllowAnonymous(_controllerPrototype: object, handlerFn: object): boolean;
26
- /**
27
- * Parameter decorator — injects the authenticated Principal into this argument.
28
- * The argument resolver will supply the principal verified during the auth step.
29
- */
30
- export declare function CurrentUser(): (target: object, propertyKey: string, parameterIndex: number) => void;
@@ -1,3 +0,0 @@
1
- import type { Constructable } from "@decohere/core/reflection";
2
- import type { ControllerMetadata } from "../anvil.types.js";
3
- export declare function Controller(options?: ControllerMetadata): (target: Constructable) => void;
@@ -1,2 +0,0 @@
1
- import type { RequestPart } from "../anvil.types.js";
2
- export declare function Field(fieldLocation?: RequestPart, mappingKey?: string): (target: object, fieldName: string) => void;
@@ -1,8 +0,0 @@
1
- import type { Constructable } from "@decohere/core/reflection";
2
- import type { RequestPart } from "../anvil.types.js";
3
- /**
4
- * Used to map a request object to route params
5
- * @param mappingKey
6
- * @returns
7
- */
8
- export declare function Request(mappingKey?: RequestPart): (target: Constructable) => void;
@@ -1,4 +0,0 @@
1
- /** Set the HTTP status code returned on a successful handler response. */
2
- export declare function HttpCode(statusCode: number): (_target: object, _methodName: string, descriptor: PropertyDescriptor) => void;
3
- /** Set a response header on a successful handler response. Stackable. */
4
- export declare function Header(name: string, value: string): (_target: object, _methodName: string, descriptor: PropertyDescriptor) => void;
@@ -1,7 +0,0 @@
1
- import { type HTTPMethod } from "../../const.js";
2
- export declare function Get(path?: string): (targetClass: object, functionName: string, descriptor?: TypedPropertyDescriptor<(...args: any[]) => any>) => void;
3
- export declare function Post(path?: string): (targetClass: object, functionName: string, descriptor?: TypedPropertyDescriptor<(...args: any[]) => any>) => void;
4
- export declare function Put(path?: string): (targetClass: object, functionName: string, descriptor?: TypedPropertyDescriptor<(...args: any[]) => any>) => void;
5
- export declare function Patch(path?: string): (targetClass: object, functionName: string, descriptor?: TypedPropertyDescriptor<(...args: any[]) => any>) => void;
6
- export declare function Delete(path?: string): (targetClass: object, functionName: string, descriptor?: TypedPropertyDescriptor<(...args: any[]) => any>) => void;
7
- export declare function Route(method: HTTPMethod, path?: string): (targetClass: object, functionName: string, descriptor?: TypedPropertyDescriptor<(...args: any[]) => any>) => void;
@@ -1,19 +0,0 @@
1
- import { type LifetimeScope } from "@decohere/crucible";
2
- import type { HttpOptions } from "../../http/http.options.js";
3
- import { type ExceptionContext, type ExceptionFilter, type ExceptionResult } from "./exception-filter.js";
4
- export declare class DefaultHttpExceptionFilter implements ExceptionFilter {
5
- private readonly logger;
6
- catch(error: unknown, _ctx: ExceptionContext): ExceptionResult;
7
- }
8
- /**
9
- * Resolves the first matching filter for an error.
10
- * Custom filters (registered via builder) are tried first; default is last.
11
- */
12
- export declare class ExceptionFilterHost {
13
- private readonly options?;
14
- private readonly scope?;
15
- private filters?;
16
- constructor(options?: HttpOptions, scope?: LifetimeScope);
17
- handle(error: unknown, ctx: ExceptionContext): Promise<ExceptionResult>;
18
- private getFilters;
19
- }
@@ -1,16 +0,0 @@
1
- import type { Constructable } from "@decohere/core/reflection";
2
- import type { HttpRequest } from "../anvil.types.js";
3
- export type ExceptionResult = {
4
- status: number;
5
- body: unknown;
6
- headers?: Record<string, string>;
7
- };
8
- export type ExceptionContext = {
9
- request: HttpRequest;
10
- };
11
- export interface ExceptionFilter {
12
- catch(error: unknown, ctx: ExceptionContext): ExceptionResult | Promise<ExceptionResult>;
13
- }
14
- /** Declare which error types this filter handles. Empty = catch-all. */
15
- export declare function Catch(...types: Constructable[]): (target: Constructable) => void;
16
- export declare function getCatchTypes(filterType: Constructable): Constructable[];
@@ -1,8 +0,0 @@
1
- import type { Middleware, MiddlewareContext } from "./middleware.js";
2
- /**
3
- * Echoes `x-request-id` on the response and writes an HTTP access line via Scribe
4
- * (method, path, status, durationMs, requestId). Enabled by default through `withHttp`.
5
- */
6
- export declare class HttpAccessLogMiddleware implements Middleware {
7
- use(ctx: MiddlewareContext, next: () => Promise<unknown>): Promise<unknown>;
8
- }
@@ -1,10 +0,0 @@
1
- import type { HttpRequest, MappedRoute } from "../anvil.types.js";
2
- export type MiddlewareContext = {
3
- request: HttpRequest;
4
- route: MappedRoute;
5
- };
6
- export interface Middleware {
7
- use(ctx: MiddlewareContext, next: () => Promise<unknown>): Promise<unknown>;
8
- }
9
- /** Compose middleware around a terminal handler; returns the handler result. */
10
- export declare function composeMiddleware(middlewares: Middleware[], handler: () => Promise<unknown>, ctx: MiddlewareContext): Promise<unknown>;
@@ -1,6 +0,0 @@
1
- /** Canonical inbound/outbound request id header (lowercase). */
2
- export declare const REQUEST_ID_HEADER = "x-request-id";
3
- /**
4
- * Prefer an inbound `x-request-id`, then an existing id, otherwise generate one.
5
- */
6
- export declare function resolveRequestId(headers: Record<string, string>, fallback?: string): string;
@@ -1,9 +0,0 @@
1
- /** Normalize a prefix to `/foo` form with no trailing slash. Empty → `""`. */
2
- export declare function normalizePrefix(prefix: string | undefined | null): string;
3
- /**
4
- * Join a controller prefix with a method-relative route path.
5
- * Preserves `@Get("/")` trailing-slash semantics (`/hello` + `/` → `/hello/`).
6
- */
7
- export declare function joinRoutePath(prefix: string, routePath: string): string;
8
- /** Prepend a global prefix onto an already-joined controller route path. */
9
- export declare function applyGlobalPrefix(globalPrefix: string, path: string): string;
@@ -1,21 +0,0 @@
1
- import type { Type } from "@decohere/core/reflection";
2
- export type PipeContext = {
3
- fieldTypes: Record<string, Type>;
4
- };
5
- export declare abstract class Pipe<T = unknown> {
6
- abstract transform(value: unknown, context?: PipeContext): T;
7
- }
8
- export declare class BooleanPipe extends Pipe<boolean> {
9
- transform(value: unknown, _context?: unknown): boolean;
10
- }
11
- export declare class DatePipe extends Pipe<Date> {
12
- transform(value: unknown, _context?: unknown): Date;
13
- }
14
- export declare class JsonPipe extends Pipe<object> {
15
- transform(value: string, context?: PipeContext): object;
16
- private reviver;
17
- }
18
- export declare class NumberPipe extends Pipe<number> {
19
- /** Finite numbers only. Blank or non-numeric input is a 400, not `undefined` (#503). */
20
- transform(value: unknown, _context?: unknown): number;
21
- }
@@ -1,10 +0,0 @@
1
- import type { IPrincipalProvider } from "../../auth/principal-provider.js";
2
- import type { HttpRequest, RouteArg } from "../anvil.types.js";
3
- export declare class RouteArgumentResolve {
4
- resolveArguments(httpRequest: HttpRequest, routeArgs: RouteArg[], principalProvider?: IPrincipalProvider): any[];
5
- private getValue;
6
- private mapPrimitive;
7
- private mapObject;
8
- private transform;
9
- private pipeContext;
10
- }