@wooksjs/event-http 0.2.5 → 0.2.7

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
@@ -812,7 +812,7 @@ class WooksErrorRenderer extends BaseWooksResponseRenderer {
812
812
  `<head><title>${data.statusCode} ${httpStatusCodes[data.statusCode]}</title></head>` +
813
813
  `<body><center><h1>${data.statusCode} ${httpStatusCodes[data.statusCode]}</h1></center>` +
814
814
  `<center><h4>${data.message}</h1></center><hr color="#666">` +
815
- `<center style="color: #666;"> Wooks v${"0.2.5"} </center>` +
815
+ `<center style="color: #666;"> Wooks v${"0.2.7"} </center>` +
816
816
  `${keys.length ? `<pre style="${preStyles}">${JSON.stringify(Object.assign(Object.assign({}, data), { statusCode: undefined, message: undefined, error: undefined }), null, ' ')}</pre>` : ''}` +
817
817
  '</body></html>';
818
818
  }
package/dist/index.d.ts CHANGED
@@ -149,7 +149,7 @@ export declare class HttpError<T extends TWooksErrorBody = TWooksErrorBody> exte
149
149
 
150
150
  export declare function renderCacheControl(data: TCacheControl): string;
151
151
 
152
- declare type TAuthCache = {
152
+ export declare type TAuthCache = {
153
153
  type: string | null;
154
154
  credentials: string | null;
155
155
  basicCredentials: {
@@ -170,7 +170,7 @@ export declare type TCacheControl = {
170
170
  sMaxage?: number | TTimeMultiString;
171
171
  };
172
172
 
173
- declare interface TCookieAttributes {
173
+ export declare interface TCookieAttributes {
174
174
  expires: Date | string | number;
175
175
  maxAge: number | TTimeMultiString;
176
176
  domain: string;
@@ -180,13 +180,15 @@ declare interface TCookieAttributes {
180
180
  sameSite: boolean | 'Lax' | 'None' | 'Strict';
181
181
  }
182
182
 
183
+ export declare type TCookieAttributesInput = Partial<TCookieAttributes>;
184
+
183
185
  export declare type TCookieHook = ReturnType<typeof useSetCookie>;
184
186
 
185
187
  export declare type THeaderHook = ReturnType<typeof useSetHeader>;
186
188
 
187
189
  declare type THttpBadRequestCodes = 400 | 401 | 402 | 403 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 421 | 422 | 423 | 424 | 425 | 426 | 428 | 429 | 431 | 451;
188
190
 
189
- declare interface THttpContextStore extends TGenericContextStore<THttpEvent> {
191
+ export declare interface THttpContextStore extends TGenericContextStore<THttpEvent> {
190
192
  searchParams?: TSearchParamsCache;
191
193
  cookies?: {
192
194
  [name: string]: string | null;
@@ -212,18 +214,18 @@ declare interface THttpContextStore extends TGenericContextStore<THttpEvent> {
212
214
 
213
215
  declare type THttpErrorCodes = THttpBadRequestCodes | THttpServerErrorCodes;
214
216
 
215
- declare interface THttpEvent extends TGenericEvent, THttpEventData {
217
+ export declare interface THttpEvent extends TGenericEvent, THttpEventData {
216
218
  type: 'HTTP';
217
219
  }
218
220
 
219
- declare interface THttpEventData {
221
+ export declare interface THttpEventData {
220
222
  req: IncomingMessage;
221
223
  res: ServerResponse;
222
224
  }
223
225
 
224
226
  declare type THttpServerErrorCodes = 500 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 510 | 511;
225
227
 
226
- declare type TRequestCache = {
228
+ export declare type TRequestCache = {
227
229
  rawBody: Promise<Buffer>;
228
230
  parsed: unknown;
229
231
  forwardedIp?: string;
@@ -234,14 +236,14 @@ declare type TRequestCache = {
234
236
  };
235
237
  };
236
238
 
237
- declare type TSearchParamsCache = {
239
+ export declare type TSearchParamsCache = {
238
240
  raw?: string;
239
241
  urlSearchParams?: WooksURLSearchParams;
240
242
  };
241
243
 
242
- declare type TSetCookieData = {
244
+ export declare type TSetCookieData = {
243
245
  value: string;
244
- attrs: Partial<TCookieAttributes>;
246
+ attrs: TCookieAttributesInput;
245
247
  };
246
248
 
247
249
  export declare type TStatusHook = ReturnType<typeof useStatus>;
package/dist/index.mjs CHANGED
@@ -810,7 +810,7 @@ class WooksErrorRenderer extends BaseWooksResponseRenderer {
810
810
  `<head><title>${data.statusCode} ${httpStatusCodes[data.statusCode]}</title></head>` +
811
811
  `<body><center><h1>${data.statusCode} ${httpStatusCodes[data.statusCode]}</h1></center>` +
812
812
  `<center><h4>${data.message}</h1></center><hr color="#666">` +
813
- `<center style="color: #666;"> Wooks v${"0.2.5"} </center>` +
813
+ `<center style="color: #666;"> Wooks v${"0.2.7"} </center>` +
814
814
  `${keys.length ? `<pre style="${preStyles}">${JSON.stringify(Object.assign(Object.assign({}, data), { statusCode: undefined, message: undefined, error: undefined }), null, ' ')}</pre>` : ''}` +
815
815
  '</body></html>';
816
816
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wooksjs/event-http",
3
- "version": "0.2.5",
3
+ "version": "0.2.7",
4
4
  "description": "@wooksjs/event-http",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.mjs",
@@ -31,8 +31,8 @@
31
31
  "url": "https://github.com/wooksjs/wooksjs/issues"
32
32
  },
33
33
  "peerDependencies": {
34
- "wooks": "0.2.5",
35
- "@wooksjs/event-core": "0.2.5"
34
+ "wooks": "0.2.7",
35
+ "@wooksjs/event-core": "0.2.7"
36
36
  },
37
37
  "homepage": "https://github.com/wooksjs/wooksjs/tree/main/packages/event-http#readme"
38
38
  }