@moostjs/event-http 0.7.7 → 0.7.8

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
@@ -366,7 +366,7 @@ function createRef(getter, setter) {
366
366
  * @decorator
367
367
  * @paramType string
368
368
  */ function Ip(opts) {
369
- return (0, moost.Resolve)(() => (0, _wooksjs_event_http.useRequest)().getIp(opts), "ip");
369
+ return (0, moost.Resolve)(() => opts ? (0, _wooksjs_event_http.useRequest)().getIp(opts) : (0, _wooksjs_event_http.useRequest)().getIp(), "ip");
370
370
  }
371
371
  /**
372
372
  * Get the raw address list: the socket peer and every `X-Forwarded-For` entry, unvalidated
@@ -862,7 +862,7 @@ const LOGGER_TITLE = "moost-http";
862
862
  image: "https://moost.org/moost-full-logo.svg",
863
863
  link: "https://moost.org/",
864
864
  poweredBy: "moostjs",
865
- version: "0.7.7"
865
+ version: "0.7.8"
866
866
  });
867
867
  this.createdApp = !(httpApp instanceof _wooksjs_event_http.WooksHttp);
868
868
  if (httpApp && httpApp instanceof _wooksjs_event_http.WooksHttp) this.httpApp = httpApp;
@@ -947,6 +947,12 @@ exports.CompressedBodySizeLimit = CompressedBodySizeLimit;
947
947
  exports.Cookie = Cookie;
948
948
  exports.CookieAttrsRef = CookieAttrsRef;
949
949
  exports.CookieRef = CookieRef;
950
+ Object.defineProperty(exports, 'DEFAULT_FORWARD_HEADERS', {
951
+ enumerable: true,
952
+ get: function () {
953
+ return _wooksjs_event_http.DEFAULT_FORWARD_HEADERS;
954
+ }
955
+ });
950
956
  Object.defineProperty(exports, 'DEFAULT_HTTP_STATUS', {
951
957
  enumerable: true,
952
958
  get: function () {
@@ -1012,6 +1018,12 @@ Object.defineProperty(exports, 'prerenderJson', {
1012
1018
  return _wooksjs_event_http.prerenderJson;
1013
1019
  }
1014
1020
  });
1021
+ Object.defineProperty(exports, 'securityHeaders', {
1022
+ enumerable: true,
1023
+ get: function () {
1024
+ return _wooksjs_event_http.securityHeaders;
1025
+ }
1026
+ });
1015
1027
  Object.defineProperty(exports, 'useAcceptLanguage', {
1016
1028
  enumerable: true,
1017
1029
  get: function () {
package/dist/index.d.ts CHANGED
@@ -2,7 +2,7 @@ import * as moost from 'moost';
2
2
  import { TInterceptorPriority, TOvertakeFn, TInterceptorDef, TClassConstructor, TMoostAdapter, MOOST_ADAPTER_BRAND, TIsolatedSlot, EventContext, Moost, TConsoleBase, TMoostAdapterOptions } from 'moost';
3
3
  import * as _wooksjs_event_http from '@wooksjs/event-http';
4
4
  import { TCookieAttributes as TCookieAttributes$1, TCookieAttributesInput, THttpCompressionOptions, WooksHttp, TWooksHttpOptions, TFetchPeer } from '@wooksjs/event-http';
5
- export { DEFAULT_HTTP_STATUS, HttpError, TCacheControl, TCookieAttributesInput, TFetchPeer, TForwardedInfo, THttpCompressionEncoding, THttpCompressionOptions, THttpErrorBody, TPrerenderJsonOptions, TProxyHeaders, TSetCookieData, TTransformErrorBody, TTrustProxy, TTrustProxyCapped, TTrustProxyFn, getDefaultHttpStatus, httpKind, isCompressibleType, prerenderJson, useAcceptLanguage, useHttpContext } from '@wooksjs/event-http';
5
+ export { DEFAULT_FORWARD_HEADERS, DEFAULT_HTTP_STATUS, HttpError, SecurityHeadersOptions, TCacheControl, TCookieAttributesInput, TFetchPeer, TForwardedInfo, THttpCompressionEncoding, THttpCompressionOptions, THttpErrorBody, TPrerenderJsonOptions, TProxyHeaders, TSetCookieData, TTransformErrorBody, TTrustProxy, TTrustProxyCapped, TTrustProxyFn, getDefaultHttpStatus, httpKind, isCompressibleType, prerenderJson, securityHeaders, useAcceptLanguage, useHttpContext } from '@wooksjs/event-http';
6
6
  import { IncomingMessage, ServerResponse } from 'http';
7
7
  import { Buffer } from 'buffer';
8
8
  import { ListenOptions } from 'net';
package/dist/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  import { current, eventTypeKey, key } from "@wooksjs/event-core";
2
- import { DEFAULT_HTTP_STATUS, HttpError, HttpError as HttpError$1, WooksHttp, WooksHttpResponse, createHttpApp, getDefaultHttpStatus, httpKind, httpKind as httpKind$1, isCompressibleType, prerenderJson, useAcceptLanguage, useAcceptLanguage as useAcceptLanguage$1, useAuthorization, useCookies, useHeaders, useHttpContext, useRequest, useResponse, useUrlParams } from "@wooksjs/event-http";
2
+ import { DEFAULT_FORWARD_HEADERS, DEFAULT_HTTP_STATUS, HttpError, HttpError as HttpError$1, WooksHttp, WooksHttpResponse, createHttpApp, getDefaultHttpStatus, httpKind, httpKind as httpKind$1, isCompressibleType, prerenderJson, securityHeaders, useAcceptLanguage, useAcceptLanguage as useAcceptLanguage$1, useAuthorization, useCookies, useHeaders, useHttpContext, useRequest, useResponse, useUrlParams } from "@wooksjs/event-http";
3
3
  import { Before, Intercept, Interceptor, MOOST_ADAPTER_BRAND, Overtake, Resolve, TInterceptorPriority, claimWooks, current as current$1, defineBeforeInterceptor, defineMoostEventHandler, forkEventContext, getMoostMate, getTranslatorLocales, globalKey, run, translateErrorBody, useLogger } from "moost";
4
4
  import { seedBody, useBody } from "@wooksjs/http-body";
5
5
  import { createProvideRegistry } from "@prostojs/infact";
@@ -365,7 +365,7 @@ function createRef(getter, setter) {
365
365
  * @decorator
366
366
  * @paramType string
367
367
  */ function Ip(opts) {
368
- return Resolve(() => useRequest().getIp(opts), "ip");
368
+ return Resolve(() => opts ? useRequest().getIp(opts) : useRequest().getIp(), "ip");
369
369
  }
370
370
  /**
371
371
  * Get the raw address list: the socket peer and every `X-Forwarded-For` entry, unvalidated
@@ -861,7 +861,7 @@ const LOGGER_TITLE = "moost-http";
861
861
  image: "https://moost.org/moost-full-logo.svg",
862
862
  link: "https://moost.org/",
863
863
  poweredBy: "moostjs",
864
- version: "0.7.7"
864
+ version: "0.7.8"
865
865
  });
866
866
  this.createdApp = !(httpApp instanceof WooksHttp);
867
867
  if (httpApp && httpApp instanceof WooksHttp) this.httpApp = httpApp;
@@ -929,4 +929,4 @@ function isLocalOrigin(url) {
929
929
  }
930
930
 
931
931
  //#endregion
932
- export { All, AuthGuard, Authenticate, Authorization, Body, BodyReadTimeoutMs, BodySizeLimit, Compress, CompressedBodySizeLimit, Cookie, CookieAttrsRef, CookieRef, DEFAULT_HTTP_STATUS, Delete, Get, Header, HeaderRef, HttpError, HttpMethod, Ip, IpList, Method, MoostHttp, Patch, Post, Put, Query, RawBody, Req, ReqId, Res, SetCookie, SetHeader, SetStatus, StatusRef, Upgrade, Url, defineAuthGuard, enableLocalFetch, extractTransports, getDefaultHttpStatus, globalBodyReadTimeoutMs, globalBodySizeLimit, globalCompressedBodySizeLimit, httpKind, isCompressibleType, prerenderJson, useAcceptLanguage, useHttpContext };
932
+ export { All, AuthGuard, Authenticate, Authorization, Body, BodyReadTimeoutMs, BodySizeLimit, Compress, CompressedBodySizeLimit, Cookie, CookieAttrsRef, CookieRef, DEFAULT_FORWARD_HEADERS, DEFAULT_HTTP_STATUS, Delete, Get, Header, HeaderRef, HttpError, HttpMethod, Ip, IpList, Method, MoostHttp, Patch, Post, Put, Query, RawBody, Req, ReqId, Res, SetCookie, SetHeader, SetStatus, StatusRef, Upgrade, Url, defineAuthGuard, enableLocalFetch, extractTransports, getDefaultHttpStatus, globalBodyReadTimeoutMs, globalBodySizeLimit, globalCompressedBodySizeLimit, httpKind, isCompressibleType, prerenderJson, securityHeaders, useAcceptLanguage, useHttpContext };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moostjs/event-http",
3
- "version": "0.7.7",
3
+ "version": "0.7.8",
4
4
  "description": "@moostjs/event-http",
5
5
  "keywords": [
6
6
  "composables",
@@ -38,17 +38,17 @@
38
38
  }
39
39
  },
40
40
  "dependencies": {
41
- "@wooksjs/event-http": "^0.8.4",
42
- "@wooksjs/http-body": "^0.8.4"
41
+ "@wooksjs/event-http": "^0.8.5",
42
+ "@wooksjs/http-body": "^0.8.5"
43
43
  },
44
44
  "devDependencies": {
45
45
  "vitest": "4.1.12",
46
- "@moostjs/event-wf": "^0.7.7"
46
+ "@moostjs/event-wf": "^0.7.8"
47
47
  },
48
48
  "peerDependencies": {
49
49
  "@prostojs/infact": "^0.6.1",
50
- "@wooksjs/event-core": "^0.8.4",
51
- "moost": "^0.7.7"
50
+ "@wooksjs/event-core": "^0.8.5",
51
+ "moost": "^0.7.8"
52
52
  },
53
53
  "scripts": {
54
54
  "pub": "pnpm publish --access public",