@adonisjs/http-server 6.8.2-8 → 7.0.0-0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (107) hide show
  1. package/build/chunk-XX72ATFY.js +4388 -0
  2. package/build/factories/main.d.ts +149 -6
  3. package/build/factories/main.js +331 -14
  4. package/build/index.d.ts +272 -14
  5. package/build/index.js +308 -22
  6. package/build/{src/server/main.d.ts → main-29eaaee4.d.ts} +12 -17
  7. package/build/main-e5b46c83.d.ts +2210 -0
  8. package/build/src/types/main.d.ts +14 -7
  9. package/build/src/types/main.js +0 -15
  10. package/package.json +65 -55
  11. package/build/factories/http_context.d.ts +0 -25
  12. package/build/factories/http_context.js +0 -51
  13. package/build/factories/http_server.d.ts +0 -8
  14. package/build/factories/http_server.js +0 -26
  15. package/build/factories/qs_parser_factory.d.ts +0 -20
  16. package/build/factories/qs_parser_factory.js +0 -44
  17. package/build/factories/request.d.ts +0 -29
  18. package/build/factories/request.js +0 -73
  19. package/build/factories/response.d.ts +0 -29
  20. package/build/factories/response.js +0 -77
  21. package/build/factories/router.d.ts +0 -23
  22. package/build/factories/router.js +0 -45
  23. package/build/factories/server_factory.d.ts +0 -29
  24. package/build/factories/server_factory.js +0 -65
  25. package/build/src/cookies/client.d.ts +0 -37
  26. package/build/src/cookies/client.js +0 -84
  27. package/build/src/cookies/drivers/encrypted.d.ts +0 -16
  28. package/build/src/cookies/drivers/encrypted.js +0 -36
  29. package/build/src/cookies/drivers/plain.d.ts +0 -15
  30. package/build/src/cookies/drivers/plain.js +0 -33
  31. package/build/src/cookies/drivers/signed.d.ts +0 -16
  32. package/build/src/cookies/drivers/signed.js +0 -36
  33. package/build/src/cookies/parser.d.ts +0 -37
  34. package/build/src/cookies/parser.js +0 -167
  35. package/build/src/cookies/serializer.d.ts +0 -33
  36. package/build/src/cookies/serializer.js +0 -79
  37. package/build/src/debug.d.ts +0 -3
  38. package/build/src/debug.js +0 -10
  39. package/build/src/define_config.d.ts +0 -5
  40. package/build/src/define_config.js +0 -51
  41. package/build/src/define_middleware.d.ts +0 -11
  42. package/build/src/define_middleware.js +0 -35
  43. package/build/src/exception_handler.d.ts +0 -90
  44. package/build/src/exception_handler.js +0 -239
  45. package/build/src/exceptions.d.ts +0 -84
  46. package/build/src/exceptions.js +0 -38
  47. package/build/src/helpers.d.ts +0 -23
  48. package/build/src/helpers.js +0 -84
  49. package/build/src/http_context/local_storage.d.ts +0 -12
  50. package/build/src/http_context/local_storage.js +0 -39
  51. package/build/src/http_context/main.d.ts +0 -58
  52. package/build/src/http_context/main.js +0 -105
  53. package/build/src/qs.d.ts +0 -11
  54. package/build/src/qs.js +0 -25
  55. package/build/src/redirect.d.ts +0 -42
  56. package/build/src/redirect.js +0 -140
  57. package/build/src/request.d.ts +0 -565
  58. package/build/src/request.js +0 -865
  59. package/build/src/response.d.ts +0 -540
  60. package/build/src/response.js +0 -1208
  61. package/build/src/router/brisk.d.ts +0 -42
  62. package/build/src/router/brisk.js +0 -85
  63. package/build/src/router/executor.d.ts +0 -8
  64. package/build/src/router/executor.js +0 -29
  65. package/build/src/router/factories/use_return_value.d.ts +0 -6
  66. package/build/src/router/factories/use_return_value.js +0 -22
  67. package/build/src/router/group.d.ts +0 -65
  68. package/build/src/router/group.js +0 -207
  69. package/build/src/router/lookup_store/main.d.ts +0 -49
  70. package/build/src/router/lookup_store/main.js +0 -86
  71. package/build/src/router/lookup_store/route_finder.d.ts +0 -21
  72. package/build/src/router/lookup_store/route_finder.js +0 -49
  73. package/build/src/router/lookup_store/url_builder.d.ts +0 -52
  74. package/build/src/router/lookup_store/url_builder.js +0 -209
  75. package/build/src/router/main.d.ts +0 -128
  76. package/build/src/router/main.js +0 -316
  77. package/build/src/router/matchers.d.ts +0 -27
  78. package/build/src/router/matchers.js +0 -36
  79. package/build/src/router/parser.d.ts +0 -5
  80. package/build/src/router/parser.js +0 -17
  81. package/build/src/router/resource.d.ts +0 -54
  82. package/build/src/router/resource.js +0 -216
  83. package/build/src/router/route.d.ts +0 -92
  84. package/build/src/router/route.js +0 -293
  85. package/build/src/router/store.d.ts +0 -66
  86. package/build/src/router/store.js +0 -195
  87. package/build/src/server/factories/final_handler.d.ts +0 -9
  88. package/build/src/server/factories/final_handler.js +0 -30
  89. package/build/src/server/factories/middleware_handler.d.ts +0 -8
  90. package/build/src/server/factories/middleware_handler.js +0 -16
  91. package/build/src/server/factories/write_response.d.ts +0 -6
  92. package/build/src/server/factories/write_response.js +0 -24
  93. package/build/src/server/main.js +0 -283
  94. package/build/src/types/base.d.ts +0 -19
  95. package/build/src/types/base.js +0 -9
  96. package/build/src/types/middleware.d.ts +0 -35
  97. package/build/src/types/middleware.js +0 -9
  98. package/build/src/types/qs.d.ts +0 -68
  99. package/build/src/types/qs.js +0 -9
  100. package/build/src/types/request.d.ts +0 -39
  101. package/build/src/types/request.js +0 -9
  102. package/build/src/types/response.d.ts +0 -45
  103. package/build/src/types/response.js +0 -9
  104. package/build/src/types/route.d.ts +0 -165
  105. package/build/src/types/route.js +0 -9
  106. package/build/src/types/server.d.ts +0 -72
  107. package/build/src/types/server.js +0 -9
@@ -1,165 +0,0 @@
1
- import type Middleware from '@poppinss/middleware';
2
- import type { ContainerResolver } from '@adonisjs/fold';
3
- import type { Constructor, LazyImport } from './base.js';
4
- import type { HttpContext } from '../http_context/main.js';
5
- import type { MiddlewareFn, ParsedGlobalMiddleware } from './middleware.js';
6
- /**
7
- * Returns a union of methods from a controller that accepts
8
- * the context as the first argument.
9
- */
10
- export type GetControllerHandlers<Controller extends Constructor<any>> = {
11
- [K in keyof InstanceType<Controller>]: InstanceType<Controller>[K] extends (ctx: HttpContext, ...args: any[]) => any ? K : never;
12
- }[keyof InstanceType<Controller>];
13
- /**
14
- * Route token stored by matchit library
15
- */
16
- export type MatchItRouteToken = RouteMatcher & {
17
- old: string;
18
- type: 0 | 1 | 2 | 3;
19
- val: string;
20
- end: string;
21
- };
22
- /**
23
- * Route handler defined as a function
24
- */
25
- export type RouteFn = (ctx: HttpContext) => any;
26
- /**
27
- * Route handler persisted with the route store
28
- */
29
- export type StoreRouteHandler = RouteFn | {
30
- reference: string | [LazyImport<Constructor<any>> | Constructor<any>, any?];
31
- handle: (resolver: ContainerResolver<any>, ...args: [ctx: HttpContext, ...injections: any[]]) => any;
32
- };
33
- /**
34
- * The middleware persisted with the route store
35
- */
36
- export type StoreRouteMiddleware = MiddlewareFn | ({
37
- name?: string;
38
- args?: any[];
39
- } & ParsedGlobalMiddleware);
40
- /**
41
- * Route node persisted within the routes store
42
- */
43
- export type StoreRouteNode = {
44
- /**
45
- * The execute function to execute the route middleware
46
- * and the handler
47
- */
48
- execute: (route: StoreRouteNode, resolver: ContainerResolver<any>, ctx: HttpContext) => any;
49
- /**
50
- * A unique name for the route
51
- */
52
- name?: string;
53
- /**
54
- * Route URI pattern
55
- */
56
- pattern: string;
57
- /**
58
- * Route handler
59
- */
60
- handler: StoreRouteHandler;
61
- /**
62
- * Route middleware
63
- */
64
- middleware: Middleware<StoreRouteMiddleware>;
65
- /**
66
- * Additional metadata associated with the route
67
- */
68
- meta: Record<string, any>;
69
- };
70
- /**
71
- * An object of routes for a given HTTP method
72
- */
73
- export type StoreMethodNode = {
74
- tokens: MatchItRouteToken[][];
75
- routeKeys: {
76
- [pattern: string]: string;
77
- };
78
- routes: {
79
- [pattern: string]: StoreRouteNode;
80
- };
81
- };
82
- /**
83
- * Each domain node container an object of methods. Each method
84
- * object has nested routes.
85
- */
86
- export type StoreDomainNode = {
87
- [method: string]: StoreMethodNode;
88
- };
89
- /**
90
- * Routes tree stored within the routes store
91
- */
92
- export type StoreRoutesTree = {
93
- tokens: MatchItRouteToken[][];
94
- domains: {
95
- [domain: string]: StoreDomainNode;
96
- };
97
- };
98
- /**
99
- * Shape of the matched route for a pattern, method and domain.
100
- */
101
- export type MatchedRoute = {
102
- route: StoreRouteNode;
103
- /**
104
- * A unique key for the looked up route
105
- */
106
- routeKey: string;
107
- /**
108
- * Route params
109
- */
110
- params: Record<string, any>;
111
- /**
112
- * Route subdomains (if part of a subdomain)
113
- */
114
- subdomains: Record<string, any>;
115
- };
116
- /**
117
- * Shape of a route param matcher
118
- */
119
- export type RouteMatcher = {
120
- match?: RegExp;
121
- cast?: (value: string) => any;
122
- };
123
- /**
124
- * A collection of route matchers
125
- */
126
- export type RouteMatchers = {
127
- [param: string]: RouteMatcher;
128
- };
129
- /**
130
- * Representation of a route as JSON
131
- */
132
- export type RouteJSON = StoreRouteNode & {
133
- /**
134
- * HTTP methods, the route responds to.
135
- */
136
- methods: string[];
137
- /**
138
- * The domain for which the route is registered.
139
- */
140
- domain: string;
141
- /**
142
- * Matchers for route params.
143
- */
144
- matchers: RouteMatchers;
145
- };
146
- /**
147
- * Resource action names
148
- */
149
- export type ResourceActionNames = 'create' | 'index' | 'store' | 'show' | 'edit' | 'update' | 'destroy';
150
- /**
151
- * Options accepted by makeUrl method
152
- */
153
- export type MakeUrlOptions = {
154
- qs?: Record<string, any>;
155
- domain?: string;
156
- prefixUrl?: string;
157
- disableRouteLookup?: boolean;
158
- };
159
- /**
160
- * Options accepted by makeSignedUrl method
161
- */
162
- export type MakeSignedUrlOptions = MakeUrlOptions & {
163
- expiresIn?: string | number;
164
- purpose?: string;
165
- };
@@ -1,9 +0,0 @@
1
- /*
2
- * @adonisjs/http-server
3
- *
4
- * (c) AdonisJS
5
- *
6
- * For the full copyright and license information, please view the LICENSE
7
- * file that was distributed with this source code.
8
- */
9
- export {};
@@ -1,72 +0,0 @@
1
- import type { ErrorHandler, FinalHandler } from '@poppinss/middleware/types';
2
- import type { Constructor } from './base.js';
3
- import type { QSParserConfig } from './qs.js';
4
- import type { RequestConfig } from './request.js';
5
- import type { ResponseConfig } from './response.js';
6
- import type { HttpContext } from '../http_context/main.js';
7
- /**
8
- * Normalized HTTP error used by the exception
9
- * handler.
10
- */
11
- export type HttpError = {
12
- message: string;
13
- status: number;
14
- code?: string;
15
- stack?: string;
16
- cause?: any;
17
- messages?: any;
18
- errors?: any;
19
- handle?: (...args: any[]) => any;
20
- report?: (...args: any[]) => any;
21
- };
22
- /**
23
- * The pipeline for executing middleware during tests
24
- */
25
- export interface TestingMiddlewarePipeline {
26
- finalHandler(handler: FinalHandler): this;
27
- errorHandler(handler: ErrorHandler): this;
28
- run(ctx: HttpContext): Promise<any>;
29
- }
30
- /**
31
- * The expression to define a status page range
32
- */
33
- export type StatusPageRange = `${number}..${number}`;
34
- /**
35
- * The callback function to render status page for a given
36
- * error.
37
- */
38
- export type StatusPageRenderer = (error: HttpError, ctx: HttpContext) => any | Promise<any>;
39
- /**
40
- * Data type for the "http:request_finished" event
41
- */
42
- export type HttpRequestFinishedPayload = {
43
- ctx: HttpContext;
44
- duration: [number, number];
45
- };
46
- /**
47
- * Error handler to handle HTTP errors
48
- */
49
- export type ServerErrorHandler = {
50
- report: (error: any, ctx: HttpContext) => any;
51
- handle: (error: any, ctx: HttpContext) => any;
52
- };
53
- /**
54
- * Error handler represented as a class
55
- */
56
- export type ErrorHandlerAsAClass = Constructor<ServerErrorHandler>;
57
- /**
58
- * Config accepted by the HTTP server
59
- */
60
- export type ServerConfig = RequestConfig & ResponseConfig & {
61
- /**
62
- * Whether or not to create an async local storage store for
63
- * the HTTP context.
64
- *
65
- * Defaults to false
66
- */
67
- useAsyncLocalStorage: boolean;
68
- /**
69
- * Config for query string parser
70
- */
71
- qs: QSParserConfig;
72
- };
@@ -1,9 +0,0 @@
1
- /*
2
- * @adonisjs/http-server
3
- *
4
- * (c) AdonisJS
5
- *
6
- * For the full copyright and license information, please view the LICENSE
7
- * file that was distributed with this source code.
8
- */
9
- export {};