@adonisjs/http-server 8.0.0-next.0 → 8.0.0-next.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/build/{chunk-VYBTM3NC.js → chunk-HMYAZG76.js} +127 -168
  2. package/build/factories/http_context.d.ts +3 -3
  3. package/build/factories/main.d.ts +6 -6
  4. package/build/factories/main.js +1 -1
  5. package/build/factories/qs_parser_factory.d.ts +2 -2
  6. package/build/factories/request.d.ts +2 -2
  7. package/build/factories/response.d.ts +3 -3
  8. package/build/factories/router.d.ts +1 -1
  9. package/build/factories/server_factory.d.ts +2 -2
  10. package/build/factories/url_builder_factory.d.ts +3 -3
  11. package/build/index.d.ts +16 -16
  12. package/build/index.js +1 -1
  13. package/build/src/cookies/serializer.d.ts +1 -1
  14. package/build/src/define_config.d.ts +1 -1
  15. package/build/src/define_middleware.d.ts +1 -1
  16. package/build/src/errors.d.ts +7 -5
  17. package/build/src/exception_handler.d.ts +2 -2
  18. package/build/src/helpers.d.ts +3 -4
  19. package/build/src/http_context/local_storage.d.ts +1 -1
  20. package/build/src/http_context/main.d.ts +3 -3
  21. package/build/src/qs.d.ts +1 -1
  22. package/build/src/redirect.d.ts +4 -5
  23. package/build/src/request.d.ts +3 -3
  24. package/build/src/response.d.ts +5 -5
  25. package/build/src/router/brisk.d.ts +4 -4
  26. package/build/src/router/executor.d.ts +3 -3
  27. package/build/src/router/factories/use_return_value.d.ts +1 -1
  28. package/build/src/router/group.d.ts +5 -5
  29. package/build/src/router/legacy/url_builder.d.ts +1 -1
  30. package/build/src/router/main.d.ts +73 -17
  31. package/build/src/router/resource.d.ts +3 -4
  32. package/build/src/router/route.d.ts +2 -3
  33. package/build/src/router/signed_url_builder.d.ts +4 -3
  34. package/build/src/router/store.d.ts +1 -2
  35. package/build/src/{client → router}/url_builder.d.ts +4 -3
  36. package/build/src/server/factories/middleware_handler.d.ts +2 -2
  37. package/build/src/server/factories/route_finder.d.ts +3 -3
  38. package/build/src/server/factories/write_response.d.ts +1 -1
  39. package/build/src/server/main.d.ts +6 -6
  40. package/build/src/tracing_channels.d.ts +1 -1
  41. package/build/src/types/main.d.ts +1 -1
  42. package/build/src/types/middleware.d.ts +1 -1
  43. package/build/src/types/route.d.ts +19 -17
  44. package/build/src/types/server.d.ts +4 -4
  45. package/build/src/types/tracing_channels.d.ts +3 -3
  46. package/build/src/{client/types.d.ts → types/url_builder.d.ts} +15 -49
  47. package/build/src/utils.d.ts +5 -5
  48. package/package.json +9 -14
  49. package/build/client.cjs +0 -232
  50. package/build/client.d.cts +0 -258
  51. package/build/client.d.ts +0 -258
  52. package/build/client.js +0 -229
  53. package/build/src/client/main.d.ts +0 -3
  54. package/build/src/client/router.d.ts +0 -68
@@ -3366,7 +3366,6 @@ var Response = class extends Macroable6 {
3366
3366
 
3367
3367
  // src/router/main.ts
3368
3368
  import is3 from "@sindresorhus/is";
3369
- import lodash2 from "@poppinss/utils/lodash";
3370
3369
  import { moduleImporter as moduleImporter3 } from "@adonisjs/fold";
3371
3370
  import { RuntimeException as RuntimeException5 } from "@poppinss/utils/exception";
3372
3371
 
@@ -3506,113 +3505,6 @@ var RoutesStore = class {
3506
3505
  }
3507
3506
  };
3508
3507
 
3509
- // src/client/router.ts
3510
- var RouterClient = class {
3511
- /**
3512
- * List of route references kept for lookup.
3513
- */
3514
- routes;
3515
- /**
3516
- * The lookup strategies to follow when generating URL builder
3517
- * types and client
3518
- */
3519
- lookupStrategies = ["name", "pattern"];
3520
- constructor(routes) {
3521
- this.routes = routes ?? {};
3522
- }
3523
- /**
3524
- * Register route JSON payload
3525
- */
3526
- register(route) {
3527
- this.routes[route.domain] = this.routes[route.domain] || [];
3528
- this.routes[route.domain].push(route);
3529
- }
3530
- /**
3531
- * Define the lookup strategies to follow when generating URL builder
3532
- * types and client.
3533
- */
3534
- updateLookupStrategies(strategies) {
3535
- this.lookupStrategies = strategies;
3536
- return this;
3537
- }
3538
- /**
3539
- * Finds a route by its identifier. The identifier can be the
3540
- * route name, controller.method name or the route pattern
3541
- * itself.
3542
- *
3543
- * When "followLookupStrategy" is enabled, the lookup will be performed
3544
- * on the basis of the lookup strategy enabled via the "lookupStrategies"
3545
- * method. The default lookupStrategy is "name" and "pattern".
3546
- */
3547
- find(routeIdentifier, domain, method, followLookupStrategy) {
3548
- if (!domain) {
3549
- let route = null;
3550
- for (const routeDomain of Object.keys(this.routes)) {
3551
- route = this.find(routeIdentifier, routeDomain, method, followLookupStrategy);
3552
- if (route) {
3553
- break;
3554
- }
3555
- }
3556
- return route;
3557
- }
3558
- const routes = this.routes[domain];
3559
- if (!routes) {
3560
- return null;
3561
- }
3562
- const lookupByName = !followLookupStrategy || this.lookupStrategies.includes("name");
3563
- const lookupByPattern = !followLookupStrategy || this.lookupStrategies.includes("pattern");
3564
- const lookupByController = !followLookupStrategy || this.lookupStrategies.includes("controller");
3565
- return routes.find((route) => {
3566
- if (method && !route.methods.includes(method)) {
3567
- return false;
3568
- }
3569
- if (route.name === routeIdentifier && lookupByName || route.pattern === routeIdentifier && lookupByPattern) {
3570
- return true;
3571
- }
3572
- if (typeof route.handler === "function" || !lookupByController) {
3573
- return false;
3574
- }
3575
- return route.handler.reference === routeIdentifier;
3576
- }) || null;
3577
- }
3578
- /**
3579
- * Finds a route by its identifier. The identifier can be the
3580
- * route name, controller.method name or the route pattern
3581
- * itself.
3582
- *
3583
- * An error is raised when unable to find the route.
3584
- *
3585
- * When "followLookupStrategy" is enabled, the lookup will be performed
3586
- * on the basis of the lookup strategy enabled via the "lookupStrategies"
3587
- * method. The default lookupStrategy is "name" and "pattern".
3588
- */
3589
- findOrFail(routeIdentifier, domain, method, followLookupStrategy) {
3590
- const route = this.find(routeIdentifier, domain, method, followLookupStrategy);
3591
- if (!route) {
3592
- throw new Error(`Cannot lookup route "${routeIdentifier}"`);
3593
- }
3594
- return route;
3595
- }
3596
- /**
3597
- * Check if a route exists. The identifier can be the
3598
- * route name, controller.method name or the route pattern
3599
- * itself.
3600
- *
3601
- * When "followLookupStrategy" is enabled, the lookup will be performed
3602
- * on the basis of the lookup strategy enabled via the "lookupStrategies"
3603
- * method. The default lookupStrategy is "name" and "pattern".
3604
- */
3605
- has(routeIdentifier, domain, method, followLookupStrategy) {
3606
- return !!this.find(routeIdentifier, domain, method, followLookupStrategy);
3607
- }
3608
- /**
3609
- * Returns a list of routes grouped by their domain names
3610
- */
3611
- toJSON() {
3612
- return this.routes;
3613
- }
3614
- };
3615
-
3616
3508
  // src/router/legacy/url_builder.ts
3617
3509
  var UrlBuilder = class {
3618
3510
  /**
@@ -3747,30 +3639,7 @@ var RouteMatchers = class extends Macroable7 {
3747
3639
  }
3748
3640
  };
3749
3641
 
3750
- // src/define_middleware.ts
3751
- import { moduleImporter as moduleImporter2 } from "@adonisjs/fold";
3752
- function middlewareReferenceBuilder(name, middleware) {
3753
- const handler = moduleImporter2(middleware, "handle").toHandleMethod();
3754
- return function(...args) {
3755
- return {
3756
- ...handler,
3757
- name,
3758
- reference: middleware,
3759
- args: args[0]
3760
- };
3761
- };
3762
- }
3763
- function defineNamedMiddleware(collection) {
3764
- return Object.keys(collection).reduce(
3765
- (result, key) => {
3766
- result[key] = middlewareReferenceBuilder(key, collection[key]);
3767
- return result;
3768
- },
3769
- {}
3770
- );
3771
- }
3772
-
3773
- // src/client/url_builder.ts
3642
+ // src/router/url_builder.ts
3774
3643
  function createURL(identifier, tokens, searchParamsStringifier, params, options) {
3775
3644
  const uriSegments = [];
3776
3645
  const paramsArray = Array.isArray(params) ? params : null;
@@ -3891,6 +3760,29 @@ function createUrlBuilder(router, searchParamsStringifier) {
3891
3760
  return urlFor;
3892
3761
  }
3893
3762
 
3763
+ // src/define_middleware.ts
3764
+ import { moduleImporter as moduleImporter2 } from "@adonisjs/fold";
3765
+ function middlewareReferenceBuilder(name, middleware) {
3766
+ const handler = moduleImporter2(middleware, "handle").toHandleMethod();
3767
+ return function(...args) {
3768
+ return {
3769
+ ...handler,
3770
+ name,
3771
+ reference: middleware,
3772
+ args: args[0]
3773
+ };
3774
+ };
3775
+ }
3776
+ function defineNamedMiddleware(collection) {
3777
+ return Object.keys(collection).reduce(
3778
+ (result, key) => {
3779
+ result[key] = middlewareReferenceBuilder(key, collection[key]);
3780
+ return result;
3781
+ },
3782
+ {}
3783
+ );
3784
+ }
3785
+
3894
3786
  // src/router/signed_url_builder.ts
3895
3787
  function createSignedURL(identifier, tokens, searchParamsStringifier, encryption, params, options) {
3896
3788
  const signature = encryption.verifier.sign(
@@ -3985,7 +3877,7 @@ function createSignedUrlBuilder(router, encryption, searchParamsStringifier) {
3985
3877
  }
3986
3878
 
3987
3879
  // src/router/main.ts
3988
- var Router = class extends RouterClient {
3880
+ var Router = class {
3989
3881
  /**
3990
3882
  * Flag to avoid re-comitting routes to the store
3991
3883
  */
@@ -4049,8 +3941,11 @@ var Router = class extends RouterClient {
4049
3941
  * methods.
4050
3942
  */
4051
3943
  urlBuilder;
3944
+ /**
3945
+ * List of route references kept for lookup.
3946
+ */
3947
+ routes = {};
4052
3948
  constructor(app, encryption, qsParser) {
4053
- super();
4054
3949
  this.#app = app;
4055
3950
  this.#encryption = encryption;
4056
3951
  this.qs = qsParser;
@@ -4059,6 +3954,13 @@ var Router = class extends RouterClient {
4059
3954
  signedUrlFor: createSignedUrlBuilder(this, this.#encryption, this.qs.stringify)
4060
3955
  };
4061
3956
  }
3957
+ /**
3958
+ * Register route JSON payload
3959
+ */
3960
+ register(route) {
3961
+ this.routes[route.domain] = this.routes[route.domain] || [];
3962
+ this.routes[route.domain].push(route);
3963
+ }
4062
3964
  /**
4063
3965
  * Push a give router entity to the list of routes or the
4064
3966
  * recently opened group.
@@ -4249,6 +4151,95 @@ var Router = class extends RouterClient {
4249
4151
  this.#openedGroups = [];
4250
4152
  this.#commited = true;
4251
4153
  }
4154
+ /**
4155
+ * The lookup strategies to follow when generating URL builder
4156
+ * types and client
4157
+ */
4158
+ lookupStrategies = ["name", "pattern"];
4159
+ /**
4160
+ * Define the lookup strategies to follow when generating URL builder
4161
+ * types and client.
4162
+ */
4163
+ updateLookupStrategies(strategies) {
4164
+ this.lookupStrategies = strategies;
4165
+ return this;
4166
+ }
4167
+ /**
4168
+ * Finds a route by its identifier. The identifier can be the
4169
+ * route name, controller.method name or the route pattern
4170
+ * itself.
4171
+ *
4172
+ * When "followLookupStrategy" is enabled, the lookup will be performed
4173
+ * on the basis of the lookup strategy enabled via the "lookupStrategies"
4174
+ * method. The default lookupStrategy is "name" and "pattern".
4175
+ */
4176
+ find(routeIdentifier, domain, method, followLookupStrategy) {
4177
+ if (!domain) {
4178
+ let route = null;
4179
+ for (const routeDomain of Object.keys(this.routes)) {
4180
+ route = this.find(routeIdentifier, routeDomain, method, followLookupStrategy);
4181
+ if (route) {
4182
+ break;
4183
+ }
4184
+ }
4185
+ return route;
4186
+ }
4187
+ const routes = this.routes[domain];
4188
+ if (!routes) {
4189
+ return null;
4190
+ }
4191
+ const lookupByName = !followLookupStrategy || this.lookupStrategies.includes("name");
4192
+ const lookupByPattern = !followLookupStrategy || this.lookupStrategies.includes("pattern");
4193
+ const lookupByController = !followLookupStrategy || this.lookupStrategies.includes("controller");
4194
+ return routes.find((route) => {
4195
+ if (method && !route.methods.includes(method)) {
4196
+ return false;
4197
+ }
4198
+ if (route.name === routeIdentifier && lookupByName || route.pattern === routeIdentifier && lookupByPattern) {
4199
+ return true;
4200
+ }
4201
+ if (typeof route.handler === "function" || !lookupByController) {
4202
+ return false;
4203
+ }
4204
+ return route.handler.reference === routeIdentifier;
4205
+ }) || null;
4206
+ }
4207
+ /**
4208
+ * Finds a route by its identifier. The identifier can be the
4209
+ * route name, controller.method name or the route pattern
4210
+ * itself.
4211
+ *
4212
+ * An error is raised when unable to find the route.
4213
+ *
4214
+ * When "followLookupStrategy" is enabled, the lookup will be performed
4215
+ * on the basis of the lookup strategy enabled via the "lookupStrategies"
4216
+ * method. The default lookupStrategy is "name" and "pattern".
4217
+ */
4218
+ findOrFail(routeIdentifier, domain, method, followLookupStrategy) {
4219
+ const route = this.find(routeIdentifier, domain, method, followLookupStrategy);
4220
+ if (!route) {
4221
+ throw new Error(`Cannot lookup route "${routeIdentifier}"`);
4222
+ }
4223
+ return route;
4224
+ }
4225
+ /**
4226
+ * Check if a route exists. The identifier can be the
4227
+ * route name, controller.method name or the route pattern
4228
+ * itself.
4229
+ *
4230
+ * When "followLookupStrategy" is enabled, the lookup will be performed
4231
+ * on the basis of the lookup strategy enabled via the "lookupStrategies"
4232
+ * method. The default lookupStrategy is "name" and "pattern".
4233
+ */
4234
+ has(routeIdentifier, domain, method, followLookupStrategy) {
4235
+ return !!this.find(routeIdentifier, domain, method, followLookupStrategy);
4236
+ }
4237
+ /**
4238
+ * Returns a list of routes grouped by their domain names
4239
+ */
4240
+ toJSON() {
4241
+ return this.routes;
4242
+ }
4252
4243
  /**
4253
4244
  * Generates types for the URL builder. These types must
4254
4245
  * be written inside a file for the URL builder to
@@ -4329,38 +4320,6 @@ var Router = class extends RouterClient {
4329
4320
  return result;
4330
4321
  }, []).join("\n");
4331
4322
  }
4332
- generateClient() {
4333
- const routesForClient = Object.keys(this.routes).reduce(
4334
- (result, domain) => {
4335
- const routes = this.routes[domain];
4336
- result[domain] = routes.map((route) => {
4337
- const controller = "reference" in route.handler && typeof route.handler.reference === "string" ? route.handler.reference : void 0;
4338
- return {
4339
- pattern: route.pattern,
4340
- name: route.name,
4341
- handler: {
4342
- reference: controller
4343
- },
4344
- methods: route.methods,
4345
- domain: route.domain,
4346
- tokens: route.tokens.map((tokens) => {
4347
- return lodash2.pick(tokens, ["val", "type", "end"]);
4348
- })
4349
- };
4350
- });
4351
- return result;
4352
- },
4353
- {}
4354
- );
4355
- return `import type { RoutesList } from '@adonisjs/core/types/http'
4356
- import { RouterClient, createUrlBuilder, ClientRouteJSON } from 'adonisjs/core/http/client'
4357
-
4358
- const routes = ${JSON.stringify(routesForClient)} satisfies { [domain: string]: ClientRouteJSON[] }
4359
- const router = new RouterClient(routes)
4360
- export const urlFor = createUrlBuilder<RoutesList>(router, (qs) => {
4361
- return new URLSearchParams(qs).toString()
4362
- })`;
4363
- }
4364
4323
  /**
4365
4324
  * Find route for a given URL, method and optionally domain
4366
4325
  */
@@ -4913,7 +4872,7 @@ var Server = class {
4913
4872
  // src/define_config.ts
4914
4873
  import proxyAddr from "proxy-addr";
4915
4874
  import string2 from "@poppinss/utils/string";
4916
- import lodash3 from "@poppinss/utils/lodash";
4875
+ import lodash2 from "@poppinss/utils/lodash";
4917
4876
  function defineConfig(config) {
4918
4877
  const { trustProxy: trustProxy2, ...rest } = config;
4919
4878
  const defaults = {
@@ -4950,7 +4909,7 @@ function defineConfig(config) {
4950
4909
  }
4951
4910
  }
4952
4911
  };
4953
- const normalizedConfig = lodash3.merge({}, defaults, rest);
4912
+ const normalizedConfig = lodash2.merge({}, defaults, rest);
4954
4913
  if (normalizedConfig.cookie.maxAge) {
4955
4914
  normalizedConfig.cookie.maxAge = string2.seconds.parse(normalizedConfig.cookie.maxAge);
4956
4915
  }
@@ -1,7 +1,7 @@
1
1
  import type { Logger } from '@adonisjs/logger';
2
- import type { Request } from '../src/request.js';
3
- import type { Response } from '../src/response.js';
4
- import { HttpContext } from '../src/http_context/main.js';
2
+ import type { Request } from '../src/request.ts';
3
+ import type { Response } from '../src/response.ts';
4
+ import { HttpContext } from '../src/http_context/main.ts';
5
5
  type FactoryParameters = {
6
6
  request: Request;
7
7
  response: Response;
@@ -1,6 +1,6 @@
1
- export { RouterFactory } from './router.js';
2
- export { RequestFactory } from './request.js';
3
- export { ResponseFactory } from './response.js';
4
- export { ServerFactory } from './server_factory.js';
5
- export { HttpContextFactory } from './http_context.js';
6
- export { QsParserFactory } from './qs_parser_factory.js';
1
+ export { RouterFactory } from './router.ts';
2
+ export { RequestFactory } from './request.ts';
3
+ export { ResponseFactory } from './response.ts';
4
+ export { ServerFactory } from './server_factory.ts';
5
+ export { HttpContextFactory } from './http_context.ts';
6
+ export { QsParserFactory } from './qs_parser_factory.ts';
@@ -6,7 +6,7 @@ import {
6
6
  Router,
7
7
  Server,
8
8
  defineConfig
9
- } from "../chunk-VYBTM3NC.js";
9
+ } from "../chunk-HMYAZG76.js";
10
10
  import "../chunk-ASX56VAK.js";
11
11
 
12
12
  // factories/router.ts
@@ -1,5 +1,5 @@
1
- import { Qs } from '../src/qs.js';
2
- import type { QSParserConfig } from '../src/types/qs.js';
1
+ import { Qs } from '../src/qs.ts';
2
+ import type { QSParserConfig } from '../src/types/qs.ts';
3
3
  /**
4
4
  * QS Parser factory is used to generate the query string
5
5
  * parser for testing
@@ -1,7 +1,7 @@
1
1
  import type { Encryption } from '@adonisjs/encryption';
2
2
  import { IncomingMessage, ServerResponse } from 'node:http';
3
- import { Request } from '../src/request.js';
4
- import { type RequestConfig } from '../src/types/request.js';
3
+ import { Request } from '../src/request.ts';
4
+ import { type RequestConfig } from '../src/types/request.ts';
5
5
  type FactoryParameters = {
6
6
  url: string;
7
7
  method: string;
@@ -1,8 +1,8 @@
1
1
  import type { Encryption } from '@adonisjs/encryption';
2
2
  import { IncomingMessage, ServerResponse } from 'node:http';
3
- import { Response } from '../src/response.js';
4
- import { type Router } from '../src/router/main.js';
5
- import { type ResponseConfig } from '../src/types/response.js';
3
+ import { Response } from '../src/response.ts';
4
+ import { type Router } from '../src/router/main.ts';
5
+ import { type ResponseConfig } from '../src/types/response.ts';
6
6
  type FactoryParameters = {
7
7
  req: IncomingMessage;
8
8
  res: ServerResponse;
@@ -1,6 +1,6 @@
1
1
  import type { Encryption } from '@adonisjs/encryption';
2
2
  import type { Application } from '@adonisjs/application';
3
- import { Router } from '../src/router/main.js';
3
+ import { Router } from '../src/router/main.ts';
4
4
  type FactoryParameters = {
5
5
  app: Application<any>;
6
6
  encryption: Encryption;
@@ -2,8 +2,8 @@ import { Logger } from '@adonisjs/logger';
2
2
  import { Emitter } from '@adonisjs/events';
3
3
  import type { Encryption } from '@adonisjs/encryption';
4
4
  import type { Application } from '@adonisjs/application';
5
- import { Server } from '../src/server/main.js';
6
- import type { ServerConfig } from '../src/types/server.js';
5
+ import { Server } from '../src/server/main.ts';
6
+ import type { ServerConfig } from '../src/types/server.ts';
7
7
  type FactoryParameters = {
8
8
  app: Application<any>;
9
9
  logger: Logger;
@@ -1,6 +1,6 @@
1
1
  import type { Encryption } from '@adonisjs/encryption';
2
2
  import type { Router } from '../src/router/main.ts';
3
- import { type LookupList } from '../src/client/types.ts';
3
+ import { type LookupList } from '../src/types/url_builder.ts';
4
4
  type FactoryParameters = {
5
5
  router: Router;
6
6
  encryption: Encryption;
@@ -18,8 +18,8 @@ export declare class URLBuilderFactory<Routes extends LookupList> {
18
18
  * Create URL builder helpers
19
19
  */
20
20
  create(): {
21
- urlFor: import("../src/client/types.ts").UrlFor<Routes>;
22
- signedUrlFor: import("../src/client/types.ts").UrlFor<Routes, import("../src/client/types.ts").SignedURLOptions>;
21
+ urlFor: import("../src/types/url_builder.ts").UrlFor<Routes>;
22
+ signedUrlFor: import("../src/types/url_builder.ts").UrlFor<Routes, import("../src/types/url_builder.ts").SignedURLOptions>;
23
23
  };
24
24
  }
25
25
  export {};
package/build/index.d.ts CHANGED
@@ -1,16 +1,16 @@
1
- export * as errors from './src/errors.js';
2
- export { Request } from './src/request.js';
3
- export { Response } from './src/response.js';
4
- export { Redirect } from './src/redirect.js';
5
- export { Server } from './src/server/main.js';
6
- export { Router } from './src/router/main.js';
7
- export { Route } from './src/router/route.js';
8
- export { BriskRoute } from './src/router/brisk.js';
9
- export { RouteGroup } from './src/router/group.js';
10
- export { defineConfig } from './src/define_config.js';
11
- export { CookieClient } from './src/cookies/client.js';
12
- export { HttpContext } from './src/http_context/main.js';
13
- export { RouteResource } from './src/router/resource.js';
14
- export { ResponseStatus } from './src/response_status.js';
15
- export { ExceptionHandler } from './src/exception_handler.js';
16
- export * as tracingChannels from './src/tracing_channels.js';
1
+ export * as errors from './src/errors.ts';
2
+ export { Request } from './src/request.ts';
3
+ export { Response } from './src/response.ts';
4
+ export { Redirect } from './src/redirect.ts';
5
+ export { Server } from './src/server/main.ts';
6
+ export { Router } from './src/router/main.ts';
7
+ export { Route } from './src/router/route.ts';
8
+ export { BriskRoute } from './src/router/brisk.ts';
9
+ export { RouteGroup } from './src/router/group.ts';
10
+ export { defineConfig } from './src/define_config.ts';
11
+ export { CookieClient } from './src/cookies/client.ts';
12
+ export { HttpContext } from './src/http_context/main.ts';
13
+ export { RouteResource } from './src/router/resource.ts';
14
+ export { ResponseStatus } from './src/response_status.ts';
15
+ export { ExceptionHandler } from './src/exception_handler.ts';
16
+ export * as tracingChannels from './src/tracing_channels.ts';
package/build/index.js CHANGED
@@ -20,7 +20,7 @@ import {
20
20
  errors_exports,
21
21
  parseRange,
22
22
  tracing_channels_exports
23
- } from "./chunk-VYBTM3NC.js";
23
+ } from "./chunk-HMYAZG76.js";
24
24
  import "./chunk-ASX56VAK.js";
25
25
 
26
26
  // src/exception_handler.ts
@@ -1,5 +1,5 @@
1
1
  import type { Encryption } from '@adonisjs/encryption';
2
- import type { CookieOptions } from '../types/response.js';
2
+ import type { CookieOptions } from '../types/response.ts';
3
3
  /**
4
4
  * Cookies serializer is used to serialize a value to be set on the `Set-Cookie`
5
5
  * header. You can `encode`, `sign` on `encrypt` cookies using the serializer
@@ -1,4 +1,4 @@
1
- import type { ServerConfig } from './types/server.js';
1
+ import type { ServerConfig } from './types/server.ts';
2
2
  type DeepPartial<T> = {
3
3
  [P in keyof T]?: T[P] extends object ? DeepPartial<T[P]> : T[P];
4
4
  };
@@ -1,5 +1,5 @@
1
1
  import type { LazyImport, UnWrapLazyImport } from '@poppinss/utils/types';
2
- import type { GetMiddlewareArgs, MiddlewareAsClass, ParsedGlobalMiddleware } from './types/middleware.js';
2
+ import type { GetMiddlewareArgs, MiddlewareAsClass, ParsedGlobalMiddleware } from './types/middleware.ts';
3
3
  /**
4
4
  * Define an collection of named middleware. The collection gets converted
5
5
  * into a collection of factory functions. Calling the function returns
@@ -1,5 +1,5 @@
1
1
  import { Exception } from '@poppinss/utils/exception';
2
- import type { HttpContext } from './http_context/main.js';
2
+ import type { HttpContext } from './http_context/main.ts';
3
3
  /**
4
4
  * Thrown when unable to find a matching route for the given request
5
5
  */
@@ -22,7 +22,7 @@ export declare const E_HTTP_EXCEPTION: {
22
22
  code?: string;
23
23
  status: number;
24
24
  toString(): string;
25
- readonly [Symbol.toStringTag]: string;
25
+ get [Symbol.toStringTag](): string;
26
26
  message: string;
27
27
  stack?: string;
28
28
  cause?: unknown;
@@ -38,7 +38,7 @@ export declare const E_HTTP_EXCEPTION: {
38
38
  code?: string;
39
39
  status: number;
40
40
  toString(): string;
41
- readonly [Symbol.toStringTag]: string;
41
+ get [Symbol.toStringTag](): string;
42
42
  message: string;
43
43
  stack?: string;
44
44
  cause?: unknown;
@@ -46,6 +46,7 @@ export declare const E_HTTP_EXCEPTION: {
46
46
  help?: string;
47
47
  status?: number;
48
48
  message?: string;
49
+ isError(error: unknown): error is Error;
49
50
  captureStackTrace(targetObject: object, constructorOpt?: Function): void;
50
51
  prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
51
52
  stackTraceLimit: number;
@@ -65,7 +66,7 @@ export declare const E_HTTP_REQUEST_ABORTED: {
65
66
  code?: string;
66
67
  status: number;
67
68
  toString(): string;
68
- readonly [Symbol.toStringTag]: string;
69
+ get [Symbol.toStringTag](): string;
69
70
  message: string;
70
71
  stack?: string;
71
72
  cause?: unknown;
@@ -81,7 +82,7 @@ export declare const E_HTTP_REQUEST_ABORTED: {
81
82
  code?: string;
82
83
  status: number;
83
84
  toString(): string;
84
- readonly [Symbol.toStringTag]: string;
85
+ get [Symbol.toStringTag](): string;
85
86
  message: string;
86
87
  stack?: string;
87
88
  cause?: unknown;
@@ -89,6 +90,7 @@ export declare const E_HTTP_REQUEST_ABORTED: {
89
90
  help?: string;
90
91
  status?: number;
91
92
  message?: string;
93
+ isError(error: unknown): error is Error;
92
94
  captureStackTrace(targetObject: object, constructorOpt?: Function): void;
93
95
  prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
94
96
  stackTraceLimit: number;
@@ -1,7 +1,7 @@
1
1
  import Macroable from '@poppinss/macroable';
2
2
  import type { Level } from '@adonisjs/logger/types';
3
- import type { HttpContext } from './http_context/main.js';
4
- import type { HttpError, StatusPageRange, StatusPageRenderer } from './types/server.js';
3
+ import type { HttpContext } from './http_context/main.ts';
4
+ import type { HttpError, StatusPageRange, StatusPageRenderer } from './types/server.ts';
5
5
  /**
6
6
  * The base HTTP exception handler one can inherit from to handle
7
7
  * HTTP exceptions.
@@ -1,7 +1,6 @@
1
- import { type CookieOptions } from './types/response.js';
2
- import type { RouteMatchers, RouteJSON } from './types/route.js';
3
- import { type RouteHandlerInfo, type MiddlewareFn, type MiddlewareHandlerInfo, type ParsedGlobalMiddleware, type ParsedNamedMiddleware } from './types/middleware.ts';
4
- import { type MatchItRouteToken } from './client/types.ts';
1
+ import { type CookieOptions } from './types/response.ts';
2
+ import type { RouteMatchers, RouteJSON, MatchItRouteToken } from './types/route.ts';
3
+ import { type MiddlewareFn, type RouteHandlerInfo, type MiddlewareHandlerInfo, type ParsedGlobalMiddleware, type ParsedNamedMiddleware } from './types/middleware.ts';
5
4
  /**
6
5
  * This function is similar to the intrinsic function encodeURI. However, it will not encode:
7
6
  * - The \, ^, or | characters
@@ -1,5 +1,5 @@
1
1
  import { AsyncLocalStorage } from 'node:async_hooks';
2
- import type { HttpContext } from './main.js';
2
+ import type { HttpContext } from './main.ts';
3
3
  /**
4
4
  * Async local storage for HTTP context
5
5
  */
@@ -1,9 +1,9 @@
1
1
  import Macroable from '@poppinss/macroable';
2
2
  import type { Logger } from '@adonisjs/logger';
3
3
  import { type ContainerResolver } from '@adonisjs/fold';
4
- import type { Request } from '../request.js';
5
- import type { Response } from '../response.js';
6
- import type { RouteJSON } from '../types/route.js';
4
+ import type { Request } from '../request.ts';
5
+ import type { Response } from '../response.ts';
6
+ import type { RouteJSON } from '../types/route.ts';
7
7
  /**
8
8
  * Http context encapsulates properties for a given HTTP request. The
9
9
  * context class can be extended using macros and getters.
package/build/src/qs.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { type QSParserConfig } from './types/qs.js';
1
+ import { type QSParserConfig } from './types/qs.ts';
2
2
  /**
3
3
  * Query string parser used to parse and stringify query
4
4
  * strings.