@bool-ts/core 2.2.0 → 2.2.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.
package/package.json CHANGED
@@ -43,5 +43,5 @@
43
43
  "test": "bun --hot run __test/index.ts"
44
44
  },
45
45
  "types": "./dist/index.d.ts",
46
- "version": "2.2.0"
46
+ "version": "2.2.1"
47
47
  }
@@ -495,9 +495,25 @@ export class Application<TRootClass extends Object = Object> {
495
495
  }
496
496
  }
497
497
 
498
+ for (const availableModuleResolution of resolutedModules) {
499
+ const routeResult = availableModuleResolution.controllerRouterGroup.find({
500
+ pathname: url.pathname,
501
+ method: method
502
+ });
503
+
504
+ if (routeResult) {
505
+ collection = Object.freeze({
506
+ route: routeResult,
507
+ resolution: availableModuleResolution
508
+ });
509
+ break;
510
+ }
511
+ }
512
+
498
513
  if (resolutedContainer) {
499
514
  const { context: newContext } = await this.httpFetcher({
500
515
  context: context,
516
+ route: collection?.route,
501
517
  resolutedMap: {
502
518
  injector: resolutedContainer.injector,
503
519
  startMiddlewareGroup: resolutedContainer.startMiddlewareGroup,
@@ -511,21 +527,6 @@ export class Application<TRootClass extends Object = Object> {
511
527
  context = newContext;
512
528
  }
513
529
 
514
- for (const availableModuleResolution of resolutedModules) {
515
- const routeResult = availableModuleResolution.controllerRouterGroup.find({
516
- pathname: url.pathname,
517
- method: method
518
- });
519
-
520
- if (routeResult) {
521
- collection = Object.freeze({
522
- route: routeResult,
523
- resolution: availableModuleResolution
524
- });
525
- break;
526
- }
527
- }
528
-
529
530
  if (!collection) {
530
531
  context
531
532
  .setOptions({ isStatic: false })
@@ -574,14 +575,16 @@ export class Application<TRootClass extends Object = Object> {
574
575
  latestResponseStatus = context.get<unknown>(responseStatusArgsKey, {
575
576
  isStatic: false
576
577
  }),
577
- latestResponseStatusText = context.get<unknown>(responseStatusArgsKey, {
578
+ latestResponseStatusText = context.get<unknown>(responseStatusTextArgsKey, {
578
579
  isStatic: false
579
580
  });
580
581
 
581
582
  return this.serializeResponse({
582
583
  status:
583
584
  typeof latestResponseStatus !== "number"
584
- ? undefined
585
+ ? method === "POST"
586
+ ? 201
587
+ : undefined
585
588
  : latestResponseStatus,
586
589
  statusText:
587
590
  typeof latestResponseStatusText !== "string"
@@ -1579,7 +1582,7 @@ export class Application<TRootClass extends Object = Object> {
1579
1582
  }>;
1580
1583
  }>) {
1581
1584
  const contextOptions = { isStatic: true };
1582
- const context = (!outerContext ? new Context() : new Context(outerContext)).setOptions(
1585
+ const context = new Context(...(!outerContext ? [] : [outerContext])).setOptions(
1583
1586
  contextOptions
1584
1587
  );
1585
1588