@fluojs/http 1.0.0-beta.1 → 1.0.0-beta.10

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 (94) hide show
  1. package/README.ko.md +36 -5
  2. package/README.md +36 -5
  3. package/dist/adapter.d.ts +31 -0
  4. package/dist/adapter.d.ts.map +1 -1
  5. package/dist/adapter.js +37 -0
  6. package/dist/adapters/binding.d.ts +6 -0
  7. package/dist/adapters/binding.d.ts.map +1 -1
  8. package/dist/adapters/binding.js +54 -55
  9. package/dist/adapters/dto-binding-plan.d.ts +22 -0
  10. package/dist/adapters/dto-binding-plan.d.ts.map +1 -0
  11. package/dist/adapters/dto-binding-plan.js +86 -0
  12. package/dist/adapters/dto-validation-adapter.d.ts +3 -1
  13. package/dist/adapters/dto-validation-adapter.d.ts.map +1 -1
  14. package/dist/adapters/dto-validation-adapter.js +10 -16
  15. package/dist/context/sse.d.ts +38 -0
  16. package/dist/context/sse.d.ts.map +1 -1
  17. package/dist/context/sse.js +50 -2
  18. package/dist/decorators.d.ts.map +1 -1
  19. package/dist/decorators.js +262 -53
  20. package/dist/dispatch/dispatch-content-negotiation.d.ts +17 -0
  21. package/dist/dispatch/dispatch-content-negotiation.d.ts.map +1 -1
  22. package/dist/dispatch/dispatch-content-negotiation.js +21 -0
  23. package/dist/dispatch/dispatch-error-policy.d.ts +8 -0
  24. package/dist/dispatch/dispatch-error-policy.d.ts.map +1 -1
  25. package/dist/dispatch/dispatch-error-policy.js +9 -0
  26. package/dist/dispatch/dispatch-handler-policy.d.ts +11 -1
  27. package/dist/dispatch/dispatch-handler-policy.d.ts.map +1 -1
  28. package/dist/dispatch/dispatch-handler-policy.js +17 -5
  29. package/dist/dispatch/dispatch-response-policy.d.ts +11 -1
  30. package/dist/dispatch/dispatch-response-policy.d.ts.map +1 -1
  31. package/dist/dispatch/dispatch-response-policy.js +44 -2
  32. package/dist/dispatch/dispatch-routing-policy.d.ts +13 -0
  33. package/dist/dispatch/dispatch-routing-policy.d.ts.map +1 -1
  34. package/dist/dispatch/dispatch-routing-policy.js +49 -4
  35. package/dist/dispatch/dispatcher.d.ts +24 -7
  36. package/dist/dispatch/dispatcher.d.ts.map +1 -1
  37. package/dist/dispatch/dispatcher.js +460 -48
  38. package/dist/dispatch/fast-path/debug-visibility.d.ts +18 -0
  39. package/dist/dispatch/fast-path/debug-visibility.d.ts.map +1 -0
  40. package/dist/dispatch/fast-path/debug-visibility.js +39 -0
  41. package/dist/dispatch/fast-path/eligibility-checker.d.ts +22 -0
  42. package/dist/dispatch/fast-path/eligibility-checker.d.ts.map +1 -0
  43. package/dist/dispatch/fast-path/eligibility-checker.js +107 -0
  44. package/dist/dispatch/fast-path/eligibility.d.ts +61 -0
  45. package/dist/dispatch/fast-path/eligibility.d.ts.map +1 -0
  46. package/dist/dispatch/fast-path/eligibility.js +23 -0
  47. package/dist/dispatch/fast-path/fast-path-executor.d.ts +21 -0
  48. package/dist/dispatch/fast-path/fast-path-executor.d.ts.map +1 -0
  49. package/dist/dispatch/fast-path/fast-path-executor.js +80 -0
  50. package/dist/dispatch/fast-path/index.d.ts +6 -0
  51. package/dist/dispatch/fast-path/index.d.ts.map +1 -0
  52. package/dist/dispatch/fast-path/index.js +4 -0
  53. package/dist/dispatch/native-route-handoff.d.ts +53 -0
  54. package/dist/dispatch/native-route-handoff.d.ts.map +1 -0
  55. package/dist/dispatch/native-route-handoff.js +97 -0
  56. package/dist/errors.d.ts +3 -0
  57. package/dist/errors.d.ts.map +1 -1
  58. package/dist/errors.js +4 -0
  59. package/dist/guards.d.ts +7 -0
  60. package/dist/guards.d.ts.map +1 -1
  61. package/dist/guards.js +11 -0
  62. package/dist/index.d.ts +2 -0
  63. package/dist/index.d.ts.map +1 -1
  64. package/dist/index.js +1 -0
  65. package/dist/input-error-detail.d.ts +9 -0
  66. package/dist/input-error-detail.d.ts.map +1 -1
  67. package/dist/input-error-detail.js +10 -0
  68. package/dist/interceptors.d.ts +8 -0
  69. package/dist/interceptors.d.ts.map +1 -1
  70. package/dist/interceptors.js +14 -1
  71. package/dist/internal.d.ts +1 -0
  72. package/dist/internal.d.ts.map +1 -1
  73. package/dist/internal.js +2 -1
  74. package/dist/mapping.d.ts +7 -0
  75. package/dist/mapping.d.ts.map +1 -1
  76. package/dist/mapping.js +93 -11
  77. package/dist/middleware/correlation.d.ts +5 -0
  78. package/dist/middleware/correlation.d.ts.map +1 -1
  79. package/dist/middleware/correlation.js +6 -0
  80. package/dist/middleware/cors.d.ts +9 -0
  81. package/dist/middleware/cors.d.ts.map +1 -1
  82. package/dist/middleware/cors.js +11 -0
  83. package/dist/middleware/middleware.d.ts +34 -0
  84. package/dist/middleware/middleware.d.ts.map +1 -1
  85. package/dist/middleware/middleware.js +47 -0
  86. package/dist/middleware/security-headers.d.ts +9 -0
  87. package/dist/middleware/security-headers.d.ts.map +1 -1
  88. package/dist/middleware/security-headers.js +11 -0
  89. package/dist/route-path.d.ts +41 -0
  90. package/dist/route-path.d.ts.map +1 -1
  91. package/dist/route-path.js +50 -0
  92. package/dist/types.d.ts +17 -0
  93. package/dist/types.d.ts.map +1 -1
  94. package/package.json +4 -4
@@ -0,0 +1,22 @@
1
+ import type { Container } from '@fluojs/di';
2
+ import type { Binder, HandlerDescriptor } from '../../types.js';
3
+ import type { CreateDispatcherOptions } from '../dispatcher.js';
4
+ import { type FastPathEligibility } from './eligibility.js';
5
+ interface CompiledEligibilityPlan {
6
+ eligibility: FastPathEligibility;
7
+ isEligible: boolean;
8
+ }
9
+ export declare function compileFastPathEligibility(handler: HandlerDescriptor, options: CreateDispatcherOptions, adapter: string): CompiledEligibilityPlan;
10
+ export declare function getHandlerFastPathEligibility(handler: HandlerDescriptor): FastPathEligibility | undefined;
11
+ export declare function setHandlerFastPathEligibility(handler: HandlerDescriptor, eligibility: FastPathEligibility): void;
12
+ export interface FastPathExecutorOptions {
13
+ binder?: Binder;
14
+ rootContainer: Container;
15
+ }
16
+ export interface FastPathExecutionResult {
17
+ executed: boolean;
18
+ result?: unknown;
19
+ error?: unknown;
20
+ }
21
+ export {};
22
+ //# sourceMappingURL=eligibility-checker.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"eligibility-checker.d.ts","sourceRoot":"","sources":["../../../src/dispatch/fast-path/eligibility-checker.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAG5C,OAAO,KAAK,EACV,MAAM,EACN,iBAAiB,EAElB,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAChE,OAAO,EAAE,KAAK,mBAAmB,EAAgC,MAAM,kBAAkB,CAAC;AAM1F,UAAU,uBAAuB;IAC/B,WAAW,EAAE,mBAAmB,CAAC;IACjC,UAAU,EAAE,OAAO,CAAC;CACrB;AA0DD,wBAAgB,0BAA0B,CACxC,OAAO,EAAE,iBAAiB,EAC1B,OAAO,EAAE,uBAAuB,EAChC,OAAO,EAAE,MAAM,GACd,uBAAuB,CA6DzB;AAED,wBAAgB,6BAA6B,CAC3C,OAAO,EAAE,iBAAiB,GACzB,mBAAmB,GAAG,SAAS,CAIjC;AAED,wBAAgB,6BAA6B,CAC3C,OAAO,EAAE,iBAAiB,EAC1B,WAAW,EAAE,mBAAmB,GAC/B,IAAI,CAGN;AAED,MAAM,WAAW,uBAAuB;IACtC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,aAAa,EAAE,SAAS,CAAC;CAC1B;AAED,MAAM,WAAW,uBAAuB;IACtC,QAAQ,EAAE,OAAO,CAAC;IAClB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB"}
@@ -0,0 +1,107 @@
1
+ import { getCompiledDtoBindingPlan } from '../../adapters/dto-binding-plan.js';
2
+ import { FAST_PATH_ELIGIBILITY_SYMBOL } from './eligibility.js';
3
+ function hasRequestScopeInspector(container) {
4
+ return typeof container === 'object' && container !== null && 'hasRequestScopedDependency' in container && typeof container.hasRequestScopedDependency === 'function';
5
+ }
6
+ function requestDtoMayRequireRequestScope(handler, options) {
7
+ if (!handler.route.request) {
8
+ return false;
9
+ }
10
+ if ((options.requestScope?.converterDefinitions ?? []).length > 0) {
11
+ return true;
12
+ }
13
+ if (options.binder) {
14
+ return true;
15
+ }
16
+ const plan = getCompiledDtoBindingPlan(handler.route.request);
17
+ return plan.entries.some(entry => entry.converter !== undefined);
18
+ }
19
+ function determineRequestScopeRequirement(handler, options) {
20
+ if (handler.route.guards && handler.route.guards.length > 0) {
21
+ return true;
22
+ }
23
+ if (handler.route.interceptors && handler.route.interceptors.length > 0) {
24
+ return true;
25
+ }
26
+ if (handler.metadata.moduleMiddleware && handler.metadata.moduleMiddleware.length > 0) {
27
+ return true;
28
+ }
29
+ if (requestDtoMayRequireRequestScope(handler, options)) {
30
+ return true;
31
+ }
32
+ if (hasRequestScopeInspector(options.rootContainer)) {
33
+ return options.rootContainer.hasRequestScopedDependency(handler.controllerToken);
34
+ }
35
+ return true;
36
+ }
37
+ function determineMiddlewareRequirement(handler, appMiddleware) {
38
+ if (appMiddleware.length > 0) {
39
+ return true;
40
+ }
41
+ const moduleMiddleware = handler.metadata.moduleMiddleware;
42
+ return moduleMiddleware !== undefined && moduleMiddleware.length > 0;
43
+ }
44
+ export function compileFastPathEligibility(handler, options, adapter) {
45
+ const routeId = `${handler.route.method}:${handler.route.path}`;
46
+ const hasGuard = (handler.route.guards?.length ?? 0) > 0;
47
+ const hasInterceptor = (handler.route.interceptors?.length ?? 0) > 0 || (options.interceptors?.length ?? 0) > 0;
48
+ const hasPipe = handler.route.request !== undefined;
49
+ const hasRequestScopedDI = determineRequestScopeRequirement(handler, options);
50
+ const hasMiddleware = determineMiddlewareRequirement(handler, options.appMiddleware ?? []);
51
+ const hasContentNegotiation = options.contentNegotiation?.formatters !== undefined && options.contentNegotiation.formatters.length > 0;
52
+ const eligibility = {
53
+ adapter,
54
+ executionPath: 'full',
55
+ hasAdapterPluginInfluence: false,
56
+ hasCustomBodyParser: options.binder !== undefined,
57
+ hasCustomErrorFilter: options.onError !== undefined,
58
+ hasGlobalHook: (options.observers?.length ?? 0) > 0,
59
+ hasGuard,
60
+ hasInterceptor,
61
+ hasMiddleware,
62
+ hasPipe,
63
+ hasRequestScopedDI,
64
+ routeId
65
+ };
66
+ const blockingReasons = [];
67
+ if (eligibility.hasGuard) {
68
+ blockingReasons.push('guards');
69
+ }
70
+ if (eligibility.hasInterceptor) {
71
+ blockingReasons.push('interceptors');
72
+ }
73
+ if (eligibility.hasRequestScopedDI) {
74
+ blockingReasons.push('request-scoped DI');
75
+ }
76
+ if (eligibility.hasMiddleware) {
77
+ blockingReasons.push('middleware');
78
+ }
79
+ if (eligibility.hasGlobalHook) {
80
+ blockingReasons.push('request observers');
81
+ }
82
+ if (eligibility.hasCustomErrorFilter) {
83
+ blockingReasons.push('custom error filter');
84
+ }
85
+ if (eligibility.hasCustomBodyParser) {
86
+ blockingReasons.push('custom binder');
87
+ }
88
+ if (hasContentNegotiation) {
89
+ blockingReasons.push('content negotiation');
90
+ }
91
+ const isEligible = blockingReasons.length === 0;
92
+ if (!isEligible) {
93
+ eligibility.fallbackReason = `Full path required due to: ${blockingReasons.join(', ')}`;
94
+ } else {
95
+ eligibility.executionPath = 'fast';
96
+ }
97
+ return {
98
+ eligibility,
99
+ isEligible
100
+ };
101
+ }
102
+ export function getHandlerFastPathEligibility(handler) {
103
+ return handler[FAST_PATH_ELIGIBILITY_SYMBOL];
104
+ }
105
+ export function setHandlerFastPathEligibility(handler, eligibility) {
106
+ handler[FAST_PATH_ELIGIBILITY_SYMBOL] = eligibility;
107
+ }
@@ -0,0 +1,61 @@
1
+ /**
2
+ * Per-route capability model used to decide whether a route can safely bypass
3
+ * optional framework overhead and execute through the fast path.
4
+ *
5
+ * Fast path selection is automatic and conservative: if safety cannot be proven,
6
+ * the route uses the full path with all framework features enabled.
7
+ */
8
+ export interface FastPathEligibility {
9
+ /** Stable identifier for the route being analyzed. */
10
+ readonly routeId: string;
11
+ /** Active runtime adapter such as Fastify or Bun. */
12
+ readonly adapter: string;
13
+ /** Benchmark or runtime scenario associated with the route. */
14
+ readonly scenario?: string;
15
+ /** Whether a global hook may affect route execution. */
16
+ readonly hasGlobalHook: boolean;
17
+ /** Whether middleware applies to the route. */
18
+ readonly hasMiddleware: boolean;
19
+ /** Whether guard logic applies to the route. */
20
+ readonly hasGuard: boolean;
21
+ /** Whether pipe or validation logic applies to the route. */
22
+ readonly hasPipe: boolean;
23
+ /** Whether interceptor logic applies to the route. */
24
+ readonly hasInterceptor: boolean;
25
+ /** Whether request-scoped dependency resolution is needed. */
26
+ readonly hasRequestScopedDI: boolean;
27
+ /** Whether body parsing behavior has been customized. */
28
+ readonly hasCustomBodyParser: boolean;
29
+ /** Whether a custom exception filter applies. */
30
+ readonly hasCustomErrorFilter: boolean;
31
+ /** Whether adapter-level plugin behavior may affect execution. */
32
+ readonly hasAdapterPluginInfluence: boolean;
33
+ /** Resolved execution path, either 'fast' or 'full'. */
34
+ executionPath: 'fast' | 'full';
35
+ /** Explanation for full-path fallback when fast path is not selected. */
36
+ fallbackReason?: string;
37
+ }
38
+ /**
39
+ * Statistics collected about fast path decisions for observability.
40
+ */
41
+ export interface FastPathStats {
42
+ /** Total number of routes analyzed. */
43
+ totalRoutes: number;
44
+ /** Number of routes eligible for fast path. */
45
+ fastPathRoutes: number;
46
+ /** Number of routes using full path. */
47
+ fullPathRoutes: number;
48
+ /** Per-route eligibility details. */
49
+ routes: ReadonlyArray<Readonly<FastPathEligibility>>;
50
+ }
51
+ /**
52
+ * Symbol used to attach fast path eligibility metadata to handler descriptors.
53
+ * @internal
54
+ */
55
+ export declare const FAST_PATH_ELIGIBILITY_SYMBOL: unique symbol;
56
+ /**
57
+ * Symbol used to attach fast path execution stats to dispatcher.
58
+ * @internal
59
+ */
60
+ export declare const FAST_PATH_STATS_SYMBOL: unique symbol;
61
+ //# sourceMappingURL=eligibility.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"eligibility.d.ts","sourceRoot":"","sources":["../../../src/dispatch/fast-path/eligibility.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,WAAW,mBAAmB;IAClC,sDAAsD;IACtD,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IAEzB,qDAAqD;IACrD,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IAEzB,+DAA+D;IAC/D,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAE3B,wDAAwD;IACxD,QAAQ,CAAC,aAAa,EAAE,OAAO,CAAC;IAEhC,+CAA+C;IAC/C,QAAQ,CAAC,aAAa,EAAE,OAAO,CAAC;IAEhC,gDAAgD;IAChD,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;IAE3B,6DAA6D;IAC7D,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAE1B,sDAAsD;IACtD,QAAQ,CAAC,cAAc,EAAE,OAAO,CAAC;IAEjC,8DAA8D;IAC9D,QAAQ,CAAC,kBAAkB,EAAE,OAAO,CAAC;IAErC,yDAAyD;IACzD,QAAQ,CAAC,mBAAmB,EAAE,OAAO,CAAC;IAEtC,iDAAiD;IACjD,QAAQ,CAAC,oBAAoB,EAAE,OAAO,CAAC;IAEvC,kEAAkE;IAClE,QAAQ,CAAC,yBAAyB,EAAE,OAAO,CAAC;IAE5C,wDAAwD;IACxD,aAAa,EAAE,MAAM,GAAG,MAAM,CAAC;IAE/B,yEAAyE;IACzE,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,uCAAuC;IACvC,WAAW,EAAE,MAAM,CAAC;IAEpB,+CAA+C;IAC/C,cAAc,EAAE,MAAM,CAAC;IAEvB,wCAAwC;IACxC,cAAc,EAAE,MAAM,CAAC;IAEvB,qCAAqC;IACrC,MAAM,EAAE,aAAa,CAAC,QAAQ,CAAC,mBAAmB,CAAC,CAAC,CAAC;CACtD;AAED;;;GAGG;AACH,eAAO,MAAM,4BAA4B,eAAgC,CAAC;AAE1E;;;GAGG;AACH,eAAO,MAAM,sBAAsB,eAA0B,CAAC"}
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Per-route capability model used to decide whether a route can safely bypass
3
+ * optional framework overhead and execute through the fast path.
4
+ *
5
+ * Fast path selection is automatic and conservative: if safety cannot be proven,
6
+ * the route uses the full path with all framework features enabled.
7
+ */
8
+
9
+ /**
10
+ * Statistics collected about fast path decisions for observability.
11
+ */
12
+
13
+ /**
14
+ * Symbol used to attach fast path eligibility metadata to handler descriptors.
15
+ * @internal
16
+ */
17
+ export const FAST_PATH_ELIGIBILITY_SYMBOL = Symbol('fastPathEligibility');
18
+
19
+ /**
20
+ * Symbol used to attach fast path execution stats to dispatcher.
21
+ * @internal
22
+ */
23
+ export const FAST_PATH_STATS_SYMBOL = Symbol('fastPathStats');
@@ -0,0 +1,21 @@
1
+ import type { RequestScopeContainer } from '@fluojs/di';
2
+ import { type ResolvedContentNegotiation } from '../dispatch-response-policy.js';
3
+ import type { Binder, FrameworkRequest, FrameworkResponse, HandlerDescriptor, RequestContext } from '../../types.js';
4
+ import type { FastPathExecutionResult } from './eligibility-checker.js';
5
+ interface ExecuteFastPathOptions {
6
+ binder?: Binder;
7
+ contentNegotiation?: ResolvedContentNegotiation;
8
+ controllerContainer: RequestScopeContainer;
9
+ controller?: object;
10
+ handler: HandlerDescriptor;
11
+ method?: (this: object, input: unknown, requestContext: RequestContext) => unknown;
12
+ request: FrameworkRequest;
13
+ requestContext: RequestContext;
14
+ response: FrameworkResponse;
15
+ }
16
+ export declare function executeFastPath(options: ExecuteFastPathOptions): Promise<FastPathExecutionResult>;
17
+ export declare function shouldUseFastPathForRequest(eligibility: {
18
+ executionPath: 'fast' | 'full';
19
+ } | undefined, request: FrameworkRequest): boolean;
20
+ export {};
21
+ //# sourceMappingURL=fast-path-executor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fast-path-executor.d.ts","sourceRoot":"","sources":["../../../src/dispatch/fast-path/fast-path-executor.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAOxD,OAAO,EAAE,KAAK,0BAA0B,EAAwB,MAAM,gCAAgC,CAAC;AACvG,OAAO,KAAK,EACV,MAAM,EACN,gBAAgB,EAChB,iBAAiB,EACjB,iBAAiB,EACjB,cAAc,EACf,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AASxE,UAAU,sBAAsB;IAC9B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,kBAAkB,CAAC,EAAE,0BAA0B,CAAC;IAChD,mBAAmB,EAAE,qBAAqB,CAAC;IAC3C,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,iBAAiB,CAAC;IAC3B,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,cAAc,EAAE,cAAc,KAAK,OAAO,CAAC;IACnF,OAAO,EAAE,gBAAgB,CAAC;IAC1B,cAAc,EAAE,cAAc,CAAC;IAC/B,QAAQ,EAAE,iBAAiB,CAAC;CAC7B;AAED,wBAAsB,eAAe,CACnC,OAAO,EAAE,sBAAsB,GAC9B,OAAO,CAAC,uBAAuB,CAAC,CAoDlC;AASD,wBAAgB,2BAA2B,CACzC,WAAW,EAAE;IAAE,aAAa,EAAE,MAAM,GAAG,MAAM,CAAA;CAAE,GAAG,SAAS,EAC3D,OAAO,EAAE,gBAAgB,GACxB,OAAO,CAWT"}
@@ -0,0 +1,80 @@
1
+ import { DefaultBinder } from '../../adapters/binding.js';
2
+ import { getCompiledDtoBindingPlan } from '../../adapters/dto-binding-plan.js';
3
+ import { HttpDtoValidationAdapter } from '../../adapters/dto-validation-adapter.js';
4
+ import { SseResponse } from '../../context/sse.js';
5
+ import { RequestAbortedError } from '../../errors.js';
6
+ import { writeSuccessResponse } from '../dispatch-response-policy.js';
7
+ const defaultBinder = new DefaultBinder();
8
+ const defaultValidator = new HttpDtoValidationAdapter();
9
+ export async function executeFastPath(options) {
10
+ const {
11
+ binder,
12
+ contentNegotiation,
13
+ controllerContainer,
14
+ handler,
15
+ request,
16
+ requestContext,
17
+ response
18
+ } = options;
19
+ try {
20
+ const controller = options.controller ?? (await controllerContainer.resolve(handler.controllerToken));
21
+ const method = options.method ?? controller[handler.methodName];
22
+ if (typeof method !== 'function') {
23
+ return {
24
+ error: new Error(`Controller ${handler.controllerToken.name} does not expose handler method ${handler.methodName}.`),
25
+ executed: false
26
+ };
27
+ }
28
+ const requestDto = handler.route.request;
29
+ let input;
30
+ if (requestDto) {
31
+ const bindingPlan = getCompiledDtoBindingPlan(requestDto);
32
+ const activeBinder = binder ?? defaultBinder;
33
+ input = await activeBinder.bind(requestDto, {
34
+ handler,
35
+ requestContext
36
+ });
37
+ if (bindingPlan.needsValidation) {
38
+ await defaultValidator.validate(input, requestDto);
39
+ }
40
+ }
41
+ const maybeResult = method.call(controller, input, requestContext);
42
+ const result = isThenable(maybeResult) ? await maybeResult : maybeResult;
43
+ if (isRequestAborted(request)) {
44
+ throw new RequestAbortedError();
45
+ }
46
+ if (!(result instanceof SseResponse) && !response.committed) {
47
+ const writeResult = writeSuccessResponse(handler, request, response, result, contentNegotiation);
48
+ if (isThenable(writeResult)) {
49
+ await writeResult;
50
+ }
51
+ }
52
+ return {
53
+ executed: true,
54
+ result
55
+ };
56
+ } catch (error) {
57
+ return {
58
+ error,
59
+ executed: false
60
+ };
61
+ }
62
+ }
63
+ function isThenable(value) {
64
+ return typeof value === 'object' && value !== null && 'then' in value && typeof value.then === 'function';
65
+ }
66
+ export function shouldUseFastPathForRequest(eligibility, request) {
67
+ if (!eligibility) {
68
+ return false;
69
+ }
70
+ if (eligibility.executionPath !== 'fast') {
71
+ return false;
72
+ }
73
+ if (isRequestAborted(request)) {
74
+ return false;
75
+ }
76
+ return true;
77
+ }
78
+ function isRequestAborted(request) {
79
+ return request.isAborted?.() ?? request.signal?.aborted === true;
80
+ }
@@ -0,0 +1,6 @@
1
+ export type { FastPathEligibility, FastPathStats } from './eligibility.js';
2
+ export { FAST_PATH_ELIGIBILITY_SYMBOL, FAST_PATH_STATS_SYMBOL } from './eligibility.js';
3
+ export { compileFastPathEligibility, getHandlerFastPathEligibility, setHandlerFastPathEligibility, type FastPathExecutionResult, } from './eligibility-checker.js';
4
+ export { executeFastPath, shouldUseFastPathForRequest } from './fast-path-executor.js';
5
+ export { addPathDebugHeader, createFastPathStats, createPathDebugInfo, formatFastPathStats, } from './debug-visibility.js';
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/dispatch/fast-path/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,mBAAmB,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAC3E,OAAO,EAAE,4BAA4B,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AACxF,OAAO,EACL,0BAA0B,EAC1B,6BAA6B,EAC7B,6BAA6B,EAC7B,KAAK,uBAAuB,GAC7B,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,eAAe,EAAE,2BAA2B,EAAE,MAAM,yBAAyB,CAAC;AACvF,OAAO,EACL,kBAAkB,EAClB,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,GACpB,MAAM,uBAAuB,CAAC"}
@@ -0,0 +1,4 @@
1
+ export { FAST_PATH_ELIGIBILITY_SYMBOL, FAST_PATH_STATS_SYMBOL } from './eligibility.js';
2
+ export { compileFastPathEligibility, getHandlerFastPathEligibility, setHandlerFastPathEligibility } from './eligibility-checker.js';
3
+ export { executeFastPath, shouldUseFastPathForRequest } from './fast-path-executor.js';
4
+ export { addPathDebugHeader, createFastPathStats, createPathDebugInfo, formatFastPathStats } from './debug-visibility.js';
@@ -0,0 +1,53 @@
1
+ import type { FrameworkRequest, HandlerMatch } from '../types.js';
2
+ /** Internal handoff payload that lets adapters skip duplicate route matching safely. */
3
+ export type NativeRouteHandoff = HandlerMatch;
4
+ /**
5
+ * Associates one adapter-selected route handoff with a raw platform request.
6
+ *
7
+ * Platform adapters call this before translating the native request into a
8
+ * `FrameworkRequest`, allowing the shared dispatcher to reuse the semantically
9
+ * safe native match without changing the public dispatcher surface.
10
+ *
11
+ * @param rawRequest Raw platform request object used as the lookup key.
12
+ * @param handoff Pre-matched descriptor and params selected by the adapter.
13
+ */
14
+ export declare function bindRawRequestNativeRouteHandoff(rawRequest: object, handoff: NativeRouteHandoff): void;
15
+ /**
16
+ * Reads and clears a native route handoff previously bound to a raw request.
17
+ *
18
+ * Request factories consume this once while constructing `FrameworkRequest`
19
+ * instances so the handoff remains request-local and does not leak across
20
+ * platform object reuse.
21
+ *
22
+ * @param rawRequest Raw platform request object used as the lookup key.
23
+ * @returns The cloned handoff when one was registered for this request.
24
+ */
25
+ export declare function consumeRawRequestNativeRouteHandoff(rawRequest: unknown): NativeRouteHandoff | undefined;
26
+ /**
27
+ * Stores a pre-matched native route handoff on one framework request.
28
+ *
29
+ * @param request Framework request that should carry the adapter-native match.
30
+ * @param handoff Pre-matched descriptor and params selected by the adapter.
31
+ * @returns The same request instance for fluent adapter construction.
32
+ */
33
+ export declare function attachFrameworkRequestNativeRouteHandoff(request: FrameworkRequest, handoff: NativeRouteHandoff): FrameworkRequest;
34
+ /**
35
+ * Reads a pre-matched native route handoff from one framework request.
36
+ *
37
+ * @param request Framework request being dispatched.
38
+ * @returns The cloned handoff when the adapter supplied one.
39
+ */
40
+ export declare function readFrameworkRequestNativeRouteHandoff(request: FrameworkRequest): NativeRouteHandoff | undefined;
41
+ /**
42
+ * Reports whether a request path depends on fluo's normalization semantics.
43
+ *
44
+ * Duplicate slashes and trailing slashes are intentionally normalized by the
45
+ * shared matcher. Adapters use this helper to keep those requests on the
46
+ * generic dispatcher path when native routing may not preserve identical path
47
+ * selection semantics.
48
+ *
49
+ * @param path Raw framework request path.
50
+ * @returns `true` when normalization would change the incoming path.
51
+ */
52
+ export declare function isRoutePathNormalizationSensitive(path: string): boolean;
53
+ //# sourceMappingURL=native-route-handoff.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"native-route-handoff.d.ts","sourceRoot":"","sources":["../../src/dispatch/native-route-handoff.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AA2BlE,wFAAwF;AACxF,MAAM,MAAM,kBAAkB,GAAG,YAAY,CAAC;AAE9C;;;;;;;;;GASG;AACH,wBAAgB,gCAAgC,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,kBAAkB,GAAG,IAAI,CAEtG;AAED;;;;;;;;;GASG;AACH,wBAAgB,mCAAmC,CAAC,UAAU,EAAE,OAAO,GAAG,kBAAkB,GAAG,SAAS,CAavG;AAED;;;;;;GAMG;AACH,wBAAgB,wCAAwC,CACtD,OAAO,EAAE,gBAAgB,EACzB,OAAO,EAAE,kBAAkB,GAC1B,gBAAgB,CAYlB;AAED;;;;;GAKG;AACH,wBAAgB,sCAAsC,CACpD,OAAO,EAAE,gBAAgB,GACxB,kBAAkB,GAAG,SAAS,CAWhC;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,iCAAiC,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAEvE"}
@@ -0,0 +1,97 @@
1
+ const FRAMEWORK_REQUEST_NATIVE_ROUTE_HANDOFF = Symbol('fluo.http.nativeRouteHandoff');
2
+ const RAW_REQUEST_NATIVE_ROUTE_HANDOFFS = new WeakMap();
3
+ const EMPTY_ROUTE_PARAMS = Object.freeze({});
4
+ function cloneNativeRouteHandoff(handoff) {
5
+ return {
6
+ descriptor: handoff.descriptor,
7
+ params: cloneRouteParams(handoff.params)
8
+ };
9
+ }
10
+ function cloneRouteParams(params) {
11
+ return Object.keys(params).length === 0 ? EMPTY_ROUTE_PARAMS : {
12
+ ...params
13
+ };
14
+ }
15
+
16
+ /** Internal handoff payload that lets adapters skip duplicate route matching safely. */
17
+
18
+ /**
19
+ * Associates one adapter-selected route handoff with a raw platform request.
20
+ *
21
+ * Platform adapters call this before translating the native request into a
22
+ * `FrameworkRequest`, allowing the shared dispatcher to reuse the semantically
23
+ * safe native match without changing the public dispatcher surface.
24
+ *
25
+ * @param rawRequest Raw platform request object used as the lookup key.
26
+ * @param handoff Pre-matched descriptor and params selected by the adapter.
27
+ */
28
+ export function bindRawRequestNativeRouteHandoff(rawRequest, handoff) {
29
+ RAW_REQUEST_NATIVE_ROUTE_HANDOFFS.set(rawRequest, cloneNativeRouteHandoff(handoff));
30
+ }
31
+
32
+ /**
33
+ * Reads and clears a native route handoff previously bound to a raw request.
34
+ *
35
+ * Request factories consume this once while constructing `FrameworkRequest`
36
+ * instances so the handoff remains request-local and does not leak across
37
+ * platform object reuse.
38
+ *
39
+ * @param rawRequest Raw platform request object used as the lookup key.
40
+ * @returns The cloned handoff when one was registered for this request.
41
+ */
42
+ export function consumeRawRequestNativeRouteHandoff(rawRequest) {
43
+ if (typeof rawRequest !== 'object' || rawRequest === null) {
44
+ return undefined;
45
+ }
46
+ const handoff = RAW_REQUEST_NATIVE_ROUTE_HANDOFFS.get(rawRequest);
47
+ if (!handoff) {
48
+ return undefined;
49
+ }
50
+ RAW_REQUEST_NATIVE_ROUTE_HANDOFFS.delete(rawRequest);
51
+ return cloneNativeRouteHandoff(handoff);
52
+ }
53
+
54
+ /**
55
+ * Stores a pre-matched native route handoff on one framework request.
56
+ *
57
+ * @param request Framework request that should carry the adapter-native match.
58
+ * @param handoff Pre-matched descriptor and params selected by the adapter.
59
+ * @returns The same request instance for fluent adapter construction.
60
+ */
61
+ export function attachFrameworkRequestNativeRouteHandoff(request, handoff) {
62
+ Reflect.set(request, FRAMEWORK_REQUEST_NATIVE_ROUTE_HANDOFF, {
63
+ handoff: cloneNativeRouteHandoff(handoff),
64
+ method: request.method,
65
+ path: request.path
66
+ });
67
+ return request;
68
+ }
69
+
70
+ /**
71
+ * Reads a pre-matched native route handoff from one framework request.
72
+ *
73
+ * @param request Framework request being dispatched.
74
+ * @returns The cloned handoff when the adapter supplied one.
75
+ */
76
+ export function readFrameworkRequestNativeRouteHandoff(request) {
77
+ const record = Reflect.get(request, FRAMEWORK_REQUEST_NATIVE_ROUTE_HANDOFF);
78
+ if (!record || record.method !== request.method || record.path !== request.path) {
79
+ return undefined;
80
+ }
81
+ return cloneNativeRouteHandoff(record.handoff);
82
+ }
83
+
84
+ /**
85
+ * Reports whether a request path depends on fluo's normalization semantics.
86
+ *
87
+ * Duplicate slashes and trailing slashes are intentionally normalized by the
88
+ * shared matcher. Adapters use this helper to keep those requests on the
89
+ * generic dispatcher path when native routing may not preserve identical path
90
+ * selection semantics.
91
+ *
92
+ * @param path Raw framework request path.
93
+ * @returns `true` when normalization would change the incoming path.
94
+ */
95
+ export function isRoutePathNormalizationSensitive(path) {
96
+ return path.length > 1 && path.endsWith('/') || path.includes('//');
97
+ }
package/dist/errors.d.ts CHANGED
@@ -5,6 +5,9 @@ import { FluoError } from '@fluojs/core';
5
5
  export declare class RouteConflictError extends FluoError {
6
6
  constructor(message: string);
7
7
  }
8
+ /**
9
+ * Represents the invalid route path error.
10
+ */
8
11
  export declare class InvalidRoutePathError extends FluoError {
9
12
  constructor(message: string);
10
13
  }
@@ -1 +1 @@
1
- {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC;;GAEG;AACH,qBAAa,kBAAmB,SAAQ,SAAS;gBACnC,OAAO,EAAE,MAAM;CAG5B;AAED,qBAAa,qBAAsB,SAAQ,SAAS;gBACtC,OAAO,EAAE,MAAM;CAG5B;AAED;;GAEG;AACH,qBAAa,oBAAqB,SAAQ,SAAS;gBACrC,OAAO,EAAE,MAAM;CAG5B;AAED;;GAEG;AACH,qBAAa,mBAAoB,SAAQ,SAAS;gBACpC,OAAO,SAA4C;CAGhE"}
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC;;GAEG;AACH,qBAAa,kBAAmB,SAAQ,SAAS;gBACnC,OAAO,EAAE,MAAM;CAG5B;AAED;;GAEG;AACH,qBAAa,qBAAsB,SAAQ,SAAS;gBACtC,OAAO,EAAE,MAAM;CAG5B;AAED;;GAEG;AACH,qBAAa,oBAAqB,SAAQ,SAAS;gBACrC,OAAO,EAAE,MAAM;CAG5B;AAED;;GAEG;AACH,qBAAa,mBAAoB,SAAQ,SAAS;gBACpC,OAAO,SAA4C;CAGhE"}
package/dist/errors.js CHANGED
@@ -10,6 +10,10 @@ export class RouteConflictError extends FluoError {
10
10
  });
11
11
  }
12
12
  }
13
+
14
+ /**
15
+ * Represents the invalid route path error.
16
+ */
13
17
  export class InvalidRoutePathError extends FluoError {
14
18
  constructor(message) {
15
19
  super(message, {
package/dist/guards.d.ts CHANGED
@@ -1,3 +1,10 @@
1
1
  import type { GuardContext, GuardLike } from './types.js';
2
+ /**
3
+ * Run guard chain.
4
+ *
5
+ * @param definitions The definitions.
6
+ * @param context The context.
7
+ * @returns The run guard chain result.
8
+ */
2
9
  export declare function runGuardChain(definitions: GuardLike[], context: GuardContext): Promise<void>;
3
10
  //# sourceMappingURL=guards.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"guards.d.ts","sourceRoot":"","sources":["../src/guards.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAS,YAAY,EAAE,SAAS,EAAkB,MAAM,YAAY,CAAC;AAcjF,wBAAsB,aAAa,CAAC,WAAW,EAAE,SAAS,EAAE,EAAE,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CASlG"}
1
+ {"version":3,"file":"guards.d.ts","sourceRoot":"","sources":["../src/guards.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAS,YAAY,EAAE,SAAS,EAAkB,MAAM,YAAY,CAAC;AAcjF;;;;;;GAMG;AACH,wBAAsB,aAAa,CAAC,WAAW,EAAE,SAAS,EAAE,EAAE,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAalG"}
package/dist/guards.js CHANGED
@@ -8,7 +8,18 @@ async function resolveGuard(definition, requestContext) {
8
8
  }
9
9
  return requestContext.container.resolve(definition);
10
10
  }
11
+
12
+ /**
13
+ * Run guard chain.
14
+ *
15
+ * @param definitions The definitions.
16
+ * @param context The context.
17
+ * @returns The run guard chain result.
18
+ */
11
19
  export async function runGuardChain(definitions, context) {
20
+ if (definitions.length === 0) {
21
+ return;
22
+ }
12
23
  for (const definition of definitions) {
13
24
  const guard = await resolveGuard(definition, context.requestContext);
14
25
  const result = await guard.canActivate(context);
package/dist/index.d.ts CHANGED
@@ -3,6 +3,8 @@ export * from './middleware/correlation.js';
3
3
  export * from './middleware/cors.js';
4
4
  export { All, Controller, Convert, Delete, FromBody, FromCookie, FromHeader, FromPath, FromQuery, Get, Head, Header, HttpCode, Optional, Options, Patch, Post, Produces, Put, Redirect, RequestDto, UseGuards, UseInterceptors, Version, } from './decorators.js';
5
5
  export * from './dispatch/dispatcher.js';
6
+ export type { FastPathEligibility, FastPathStats } from './dispatch/fast-path/index.js';
7
+ export { FAST_PATH_ELIGIBILITY_SYMBOL, FAST_PATH_STATS_SYMBOL, formatFastPathStats, getDispatcherFastPathStats, } from './dispatch/dispatcher.js';
6
8
  export * from './errors.js';
7
9
  export * from './exceptions.js';
8
10
  export * from './mapping.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,6BAA6B,CAAC;AAC5C,cAAc,sBAAsB,CAAC;AACrC,OAAO,EACL,GAAG,EACH,UAAU,EACV,OAAO,EACP,MAAM,EACN,QAAQ,EACR,UAAU,EACV,UAAU,EACV,QAAQ,EACR,SAAS,EACT,GAAG,EACH,IAAI,EACJ,MAAM,EACN,QAAQ,EACR,QAAQ,EACR,OAAO,EACP,KAAK,EACL,IAAI,EACJ,QAAQ,EACR,GAAG,EACH,QAAQ,EACR,UAAU,EACV,SAAS,EACT,eAAe,EACf,OAAO,GACR,MAAM,iBAAiB,CAAC;AACzB,cAAc,0BAA0B,CAAC;AACzC,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,OAAO,EACL,SAAS,EACT,uBAAuB,EACvB,iBAAiB,EACjB,qBAAqB,GACtB,MAAM,4BAA4B,CAAC;AACpC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,kCAAkC,CAAC;AACjD,cAAc,kBAAkB,CAAC;AACjC,cAAc,YAAY,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,6BAA6B,CAAC;AAC5C,cAAc,sBAAsB,CAAC;AACrC,OAAO,EACL,GAAG,EACH,UAAU,EACV,OAAO,EACP,MAAM,EACN,QAAQ,EACR,UAAU,EACV,UAAU,EACV,QAAQ,EACR,SAAS,EACT,GAAG,EACH,IAAI,EACJ,MAAM,EACN,QAAQ,EACR,QAAQ,EACR,OAAO,EACP,KAAK,EACL,IAAI,EACJ,QAAQ,EACR,GAAG,EACH,QAAQ,EACR,UAAU,EACV,SAAS,EACT,eAAe,EACf,OAAO,GACR,MAAM,iBAAiB,CAAC;AACzB,cAAc,0BAA0B,CAAC;AACzC,YAAY,EAAE,mBAAmB,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AACxF,OAAO,EACL,4BAA4B,EAC5B,sBAAsB,EACtB,mBAAmB,EACnB,0BAA0B,GAC3B,MAAM,0BAA0B,CAAC;AAClC,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,OAAO,EACL,SAAS,EACT,uBAAuB,EACvB,iBAAiB,EACjB,qBAAqB,GACtB,MAAM,4BAA4B,CAAC;AACpC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,kCAAkC,CAAC;AACjD,cAAc,kBAAkB,CAAC;AACjC,cAAc,YAAY,CAAC"}
package/dist/index.js CHANGED
@@ -3,6 +3,7 @@ export * from './middleware/correlation.js';
3
3
  export * from './middleware/cors.js';
4
4
  export { All, Controller, Convert, Delete, FromBody, FromCookie, FromHeader, FromPath, FromQuery, Get, Head, Header, HttpCode, Optional, Options, Patch, Post, Produces, Put, Redirect, RequestDto, UseGuards, UseInterceptors, Version } from './decorators.js';
5
5
  export * from './dispatch/dispatcher.js';
6
+ export { FAST_PATH_ELIGIBILITY_SYMBOL, FAST_PATH_STATS_SYMBOL, formatFastPathStats, getDispatcherFastPathStats } from './dispatch/dispatcher.js';
6
7
  export * from './errors.js';
7
8
  export * from './exceptions.js';
8
9
  export * from './mapping.js';
@@ -1,10 +1,19 @@
1
1
  import type { MetadataSource } from '@fluojs/core';
2
2
  import type { HttpExceptionDetail } from './exceptions.js';
3
+ /**
4
+ * Describes the input error detail contract.
5
+ */
3
6
  export interface InputErrorDetail {
4
7
  code: string;
5
8
  field?: string;
6
9
  message: string;
7
10
  source?: MetadataSource;
8
11
  }
12
+ /**
13
+ * To input error detail.
14
+ *
15
+ * @param detail The detail.
16
+ * @returns The to input error detail result.
17
+ */
9
18
  export declare function toInputErrorDetail(detail: InputErrorDetail): HttpExceptionDetail;
10
19
  //# sourceMappingURL=input-error-detail.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"input-error-detail.d.ts","sourceRoot":"","sources":["../src/input-error-detail.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAEnD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAE3D,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,cAAc,CAAC;CACzB;AAED,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,gBAAgB,GAAG,mBAAmB,CAOhF"}
1
+ {"version":3,"file":"input-error-detail.d.ts","sourceRoot":"","sources":["../src/input-error-detail.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAEnD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAE3D;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,cAAc,CAAC;CACzB;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,gBAAgB,GAAG,mBAAmB,CAOhF"}
@@ -1,3 +1,13 @@
1
+ /**
2
+ * Describes the input error detail contract.
3
+ */
4
+
5
+ /**
6
+ * To input error detail.
7
+ *
8
+ * @param detail The detail.
9
+ * @returns The to input error detail result.
10
+ */
1
11
  export function toInputErrorDetail(detail) {
2
12
  return {
3
13
  code: detail.code,
@@ -1,3 +1,11 @@
1
1
  import type { InterceptorContext, InterceptorLike } from './types.js';
2
+ /**
3
+ * Run interceptor chain.
4
+ *
5
+ * @param definitions The definitions.
6
+ * @param context The context.
7
+ * @param terminal The terminal.
8
+ * @returns The run interceptor chain result.
9
+ */
2
10
  export declare function runInterceptorChain(definitions: InterceptorLike[], context: InterceptorContext, terminal: () => Promise<unknown>): Promise<unknown>;
3
11
  //# sourceMappingURL=interceptors.d.ts.map