@webiny/handler 0.0.0-unstable.ecd8734205 → 0.0.0-unstable.f6dc066313

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 (89) hide show
  1. package/Context.d.ts +18 -10
  2. package/Context.js +17 -22
  3. package/Context.js.map +1 -1
  4. package/PreHandler/IPreHandler.d.ts +9 -0
  5. package/PreHandler/IPreHandler.js +7 -0
  6. package/PreHandler/IPreHandler.js.map +1 -0
  7. package/PreHandler/IfNotOptionsRequest.d.ts +9 -0
  8. package/PreHandler/IfNotOptionsRequest.js +21 -0
  9. package/PreHandler/IfNotOptionsRequest.js.map +1 -0
  10. package/PreHandler/IfOptionsRequest.d.ts +9 -0
  11. package/PreHandler/IfOptionsRequest.js +21 -0
  12. package/PreHandler/IfOptionsRequest.js.map +1 -0
  13. package/PreHandler/PreHandler.d.ts +9 -0
  14. package/PreHandler/PreHandler.js +17 -0
  15. package/PreHandler/PreHandler.js.map +1 -0
  16. package/PreHandler/ProcessBeforeHandlerPlugins.d.ts +10 -0
  17. package/PreHandler/ProcessBeforeHandlerPlugins.js +24 -0
  18. package/PreHandler/ProcessBeforeHandlerPlugins.js.map +1 -0
  19. package/PreHandler/ProcessContextPlugins.d.ts +10 -0
  20. package/PreHandler/ProcessContextPlugins.js +24 -0
  21. package/PreHandler/ProcessContextPlugins.js.map +1 -0
  22. package/PreHandler/ProcessHandlerOnRequestPlugins.d.ts +10 -0
  23. package/PreHandler/ProcessHandlerOnRequestPlugins.js +26 -0
  24. package/PreHandler/ProcessHandlerOnRequestPlugins.js.map +1 -0
  25. package/PreHandler/SendEarlyOptionsResponse.d.ts +9 -0
  26. package/PreHandler/SendEarlyOptionsResponse.js +31 -0
  27. package/PreHandler/SendEarlyOptionsResponse.js.map +1 -0
  28. package/PreHandler/SetDefaultHeaders.d.ts +9 -0
  29. package/PreHandler/SetDefaultHeaders.js +57 -0
  30. package/PreHandler/SetDefaultHeaders.js.map +1 -0
  31. package/README.md +10 -14
  32. package/ResponseHeaders.d.ts +24 -0
  33. package/ResponseHeaders.js +39 -0
  34. package/ResponseHeaders.js.map +1 -0
  35. package/abstractions/Reply.d.ts +5 -0
  36. package/abstractions/Reply.js +4 -0
  37. package/abstractions/Reply.js.map +1 -0
  38. package/abstractions/Request.d.ts +5 -0
  39. package/abstractions/Request.js +4 -0
  40. package/abstractions/Request.js.map +1 -0
  41. package/fastify.d.ts +8 -5
  42. package/fastify.js +238 -278
  43. package/fastify.js.map +1 -1
  44. package/index.d.ts +17 -10
  45. package/index.js +20 -135
  46. package/index.js.map +1 -1
  47. package/package.json +16 -26
  48. package/plugins/BeforeHandlerPlugin.d.ts +1 -1
  49. package/plugins/BeforeHandlerPlugin.js +5 -24
  50. package/plugins/BeforeHandlerPlugin.js.map +1 -1
  51. package/plugins/EventPlugin.d.ts +3 -3
  52. package/plugins/EventPlugin.js +5 -22
  53. package/plugins/EventPlugin.js.map +1 -1
  54. package/plugins/HandlerErrorPlugin.d.ts +6 -3
  55. package/plugins/HandlerErrorPlugin.js +5 -23
  56. package/plugins/HandlerErrorPlugin.js.map +1 -1
  57. package/plugins/HandlerOnRequestPlugin.d.ts +9 -8
  58. package/plugins/HandlerOnRequestPlugin.js +13 -23
  59. package/plugins/HandlerOnRequestPlugin.js.map +1 -1
  60. package/plugins/HandlerResultPlugin.d.ts +1 -1
  61. package/plugins/HandlerResultPlugin.js +5 -23
  62. package/plugins/HandlerResultPlugin.js.map +1 -1
  63. package/plugins/ModifyFastifyPlugin.d.ts +2 -2
  64. package/plugins/ModifyFastifyPlugin.js +5 -23
  65. package/plugins/ModifyFastifyPlugin.js.map +1 -1
  66. package/plugins/ModifyResponseHeadersPlugin.d.ts +14 -0
  67. package/plugins/ModifyResponseHeadersPlugin.js +16 -0
  68. package/plugins/ModifyResponseHeadersPlugin.js.map +1 -0
  69. package/plugins/OnRequestResponseSendPlugin.d.ts +26 -0
  70. package/plugins/OnRequestResponseSendPlugin.js +31 -0
  71. package/plugins/OnRequestResponseSendPlugin.js.map +1 -0
  72. package/plugins/OnRequestTimeoutPlugin.d.ts +12 -0
  73. package/plugins/OnRequestTimeoutPlugin.js +16 -0
  74. package/plugins/OnRequestTimeoutPlugin.js.map +1 -0
  75. package/plugins/RoutePlugin.d.ts +2 -2
  76. package/plugins/RoutePlugin.js +5 -22
  77. package/plugins/RoutePlugin.js.map +1 -1
  78. package/stringifyError.d.ts +5 -0
  79. package/stringifyError.js +20 -0
  80. package/stringifyError.js.map +1 -0
  81. package/suppressPunycodeWarnings.d.ts +1 -0
  82. package/suppressPunycodeWarnings.js +10 -0
  83. package/suppressPunycodeWarnings.js.map +1 -0
  84. package/types.d.ts +10 -13
  85. package/types.js +2 -18
  86. package/types.js.map +1 -1
  87. package/middleware.d.ts +0 -4
  88. package/middleware.js +0 -51
  89. package/middleware.js.map +0 -1
@@ -0,0 +1,5 @@
1
+ import type { Request as IRequest } from "../types.js";
2
+ export declare const Request: import("@webiny/di").Abstraction<IRequest>;
3
+ export declare namespace Request {
4
+ type Interface = IRequest;
5
+ }
@@ -0,0 +1,4 @@
1
+ import { createAbstraction } from "@webiny/feature/api";
2
+ export const Request = createAbstraction("Request");
3
+
4
+ //# sourceMappingURL=Request.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["createAbstraction","Request"],"sources":["Request.ts"],"sourcesContent":["import { createAbstraction } from \"@webiny/feature/api\";\nimport type { Request as IRequest } from \"~/types.js\";\n\nexport const Request = createAbstraction<IRequest>(\"Request\");\n\nexport namespace Request {\n export type Interface = IRequest;\n}\n"],"mappings":"AAAA,SAASA,iBAAiB,QAAQ,qBAAqB;AAGvD,OAAO,MAAMC,OAAO,GAAGD,iBAAiB,CAAW,SAAS,CAAC","ignoreList":[]}
package/fastify.d.ts CHANGED
@@ -1,8 +1,11 @@
1
- /// <reference types="node" />
2
- import { PluginCollection } from "@webiny/plugins/types";
3
- import { FastifyServerOptions as ServerOptions } from "fastify";
1
+ import type { PluginCollection } from "@webiny/plugins/types.js";
2
+ import { PluginsContainer } from "@webiny/plugins/types.js";
3
+ import type { FastifyInstance, FastifyServerOptions as ServerOptions } from "fastify";
4
4
  export interface CreateHandlerParams {
5
- plugins: PluginCollection;
5
+ plugins: PluginCollection | PluginsContainer;
6
6
  options?: ServerOptions;
7
+ debug?: boolean;
7
8
  }
8
- export declare const createHandler: (params: CreateHandlerParams) => import("fastify").FastifyInstance<import("fastify").RawServerDefault, import("http").IncomingMessage, import("http").ServerResponse<import("http").IncomingMessage>, import("fastify").FastifyBaseLogger, import("fastify").FastifyTypeProviderDefault> & PromiseLike<import("fastify").FastifyInstance<import("fastify").RawServerDefault, import("http").IncomingMessage, import("http").ServerResponse<import("http").IncomingMessage>, import("fastify").FastifyBaseLogger, import("fastify").FastifyTypeProviderDefault>>;
9
+ export declare const createHandler: (params: CreateHandlerParams) => FastifyInstance<import("fastify").RawServerDefault, import("http").IncomingMessage, import("http").ServerResponse<import("http").IncomingMessage>, import("fastify").FastifyBaseLogger, import("fastify").FastifyTypeProviderDefault> & PromiseLike<FastifyInstance<import("fastify").RawServerDefault, import("http").IncomingMessage, import("http").ServerResponse<import("http").IncomingMessage>, import("fastify").FastifyBaseLogger, import("fastify").FastifyTypeProviderDefault>> & {
10
+ __linterBrands: "SafePromiseLike";
11
+ };