@moostjs/event-http 0.6.4 → 0.6.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.
package/dist/index.cjs CHANGED
@@ -694,7 +694,7 @@ const CONTEXT_TYPE = "HTTP";
694
694
  image: "https://moost.org/moost-full-logo.svg",
695
695
  link: "https://moost.org/",
696
696
  poweredBy: "moostjs",
697
- version: "0.6.3"
697
+ version: "0.6.4"
698
698
  });
699
699
  if (httpApp && httpApp instanceof __wooksjs_event_http.WooksHttp) this.httpApp = httpApp;
700
700
  else if (httpApp) this.httpApp = (0, __wooksjs_event_http.createHttpApp)({
package/dist/index.d.ts CHANGED
@@ -2,8 +2,7 @@ import * as moost from 'moost';
2
2
  import { TInterceptorPriority, TOvertakeFn, TInterceptorDef, TClassConstructor, TMoostAdapter, Moost, TConsoleBase, TMoostAdapterOptions } from 'moost';
3
3
  import { TCookieAttributes as TCookieAttributes$1, TCookieAttributesInput, WooksHttp, TWooksHttpOptions } from '@wooksjs/event-http';
4
4
  export { HttpError, TCacheControl, TCookieAttributesInput, TSetCookieData, httpKind, useHttpContext } from '@wooksjs/event-http';
5
- import * as http from 'http';
6
- import { TProstoRouterPathBuilder } from '@prostojs/router';
5
+ import { IncomingMessage, ServerResponse } from 'http';
7
6
  import { ListenOptions } from 'net';
8
7
 
9
8
  /** Bearer token transport configuration for auth guards. */
@@ -365,6 +364,7 @@ declare const CompressedBodySizeLimit: (n: number) => ClassDecorator & MethodDec
365
364
  */
366
365
  declare const BodyReadTimeoutMs: (n: number) => ClassDecorator & MethodDecorator;
367
366
 
367
+ type TPathBuilder<ParamsType = Record<string, string | string[]>> = (params?: ParamsType) => string;
368
368
  /** Handler metadata for HTTP events, carrying the HTTP method and route path. */
369
369
  interface THttpHandlerMeta {
370
370
  method: string;
@@ -400,7 +400,7 @@ declare class MoostHttp implements TMoostAdapter<THttpHandlerMeta> {
400
400
  protected httpApp: WooksHttp;
401
401
  constructor(httpApp?: WooksHttp | TWooksHttpOptions);
402
402
  getHttpApp(): WooksHttp;
403
- getServerCb(onNoMatch?: (req: http.IncomingMessage, res: http.ServerResponse) => void): (req: http.IncomingMessage, res: http.ServerResponse) => void;
403
+ getServerCb(onNoMatch?: (req: IncomingMessage, res: ServerResponse) => void): (req: IncomingMessage, res: ServerResponse) => void;
404
404
  /**
405
405
  * Programmatic route invocation using the Web Standard fetch API.
406
406
  * Goes through the full Moost pipeline: DI scoping, interceptors,
@@ -428,11 +428,11 @@ declare class MoostHttp implements TMoostAdapter<THttpHandlerMeta> {
428
428
  listen(handle: any, backlog?: number, listeningListener?: () => void): Promise<void>;
429
429
  listen(handle: any, listeningListener?: () => void): Promise<void>;
430
430
  readonly pathBuilders: Record<string, {
431
- GET?: TProstoRouterPathBuilder<Record<string, string | string[]>>;
432
- PUT?: TProstoRouterPathBuilder<Record<string, string | string[]>>;
433
- PATCH?: TProstoRouterPathBuilder<Record<string, string | string[]>>;
434
- POST?: TProstoRouterPathBuilder<Record<string, string | string[]>>;
435
- DELETE?: TProstoRouterPathBuilder<Record<string, string | string[]>>;
431
+ GET?: TPathBuilder;
432
+ PUT?: TPathBuilder;
433
+ PATCH?: TPathBuilder;
434
+ POST?: TPathBuilder;
435
+ DELETE?: TPathBuilder;
436
436
  }>;
437
437
  onNotFound(): Promise<unknown>;
438
438
  protected moost?: Moost;
package/dist/index.mjs CHANGED
@@ -671,7 +671,7 @@ const CONTEXT_TYPE = "HTTP";
671
671
  image: "https://moost.org/moost-full-logo.svg",
672
672
  link: "https://moost.org/",
673
673
  poweredBy: "moostjs",
674
- version: "0.6.3"
674
+ version: "0.6.4"
675
675
  });
676
676
  if (httpApp && httpApp instanceof WooksHttp) this.httpApp = httpApp;
677
677
  else if (httpApp) this.httpApp = createHttpApp({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moostjs/event-http",
3
- "version": "0.6.4",
3
+ "version": "0.6.5",
4
4
  "description": "@moostjs/event-http",
5
5
  "keywords": [
6
6
  "composables",
@@ -43,16 +43,16 @@
43
43
  }
44
44
  },
45
45
  "dependencies": {
46
- "@wooksjs/event-http": "^0.7.7",
47
- "@wooksjs/http-body": "^0.7.7"
46
+ "@wooksjs/event-http": "^0.7.8",
47
+ "@wooksjs/http-body": "^0.7.8"
48
48
  },
49
49
  "devDependencies": {
50
50
  "vitest": "3.2.4"
51
51
  },
52
52
  "peerDependencies": {
53
53
  "@prostojs/infact": "^0.4.1",
54
- "@wooksjs/event-core": "^0.7.7",
55
- "moost": "^0.6.4"
54
+ "@wooksjs/event-core": "^0.7.8",
55
+ "moost": "^0.6.5"
56
56
  },
57
57
  "scripts": {
58
58
  "pub": "pnpm publish --access public",