@webiny/handler 6.4.5-beta.0 → 6.6.0-alpha.0

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 (82) hide show
  1. package/exports/api.d.ts +0 -1
  2. package/exports/api.js +0 -1
  3. package/index.d.ts +4 -17
  4. package/index.js +3 -17
  5. package/package.json +6 -11
  6. package/plugins/RegisterExtensionPlugin.d.ts +10 -0
  7. package/plugins/RegisterExtensionPlugin.js +9 -1
  8. package/plugins/RegisterExtensionPlugin.js.map +1 -1
  9. package/types.d.ts +21 -43
  10. package/types.js +0 -1
  11. package/Context.d.ts +0 -22
  12. package/Context.js +0 -13
  13. package/Context.js.map +0 -1
  14. package/PreHandler/IPreHandler.d.ts +0 -9
  15. package/PreHandler/IPreHandler.js +0 -8
  16. package/PreHandler/IPreHandler.js.map +0 -1
  17. package/PreHandler/IfNotOptionsRequest.d.ts +0 -9
  18. package/PreHandler/IfNotOptionsRequest.js +0 -18
  19. package/PreHandler/IfNotOptionsRequest.js.map +0 -1
  20. package/PreHandler/IfOptionsRequest.d.ts +0 -9
  21. package/PreHandler/IfOptionsRequest.js +0 -18
  22. package/PreHandler/IfOptionsRequest.js.map +0 -1
  23. package/PreHandler/PreHandler.d.ts +0 -9
  24. package/PreHandler/PreHandler.js +0 -16
  25. package/PreHandler/PreHandler.js.map +0 -1
  26. package/PreHandler/ProcessBeforeHandlerPlugins.d.ts +0 -10
  27. package/PreHandler/ProcessBeforeHandlerPlugins.js +0 -25
  28. package/PreHandler/ProcessBeforeHandlerPlugins.js.map +0 -1
  29. package/PreHandler/ProcessContextPlugins.d.ts +0 -10
  30. package/PreHandler/ProcessContextPlugins.js +0 -25
  31. package/PreHandler/ProcessContextPlugins.js.map +0 -1
  32. package/PreHandler/ProcessHandlerOnRequestPlugins.d.ts +0 -10
  33. package/PreHandler/ProcessHandlerOnRequestPlugins.js +0 -25
  34. package/PreHandler/ProcessHandlerOnRequestPlugins.js.map +0 -1
  35. package/PreHandler/RegisterExtensions.d.ts +0 -10
  36. package/PreHandler/RegisterExtensions.js +0 -13
  37. package/PreHandler/RegisterExtensions.js.map +0 -1
  38. package/PreHandler/SendEarlyOptionsResponse.d.ts +0 -9
  39. package/PreHandler/SendEarlyOptionsResponse.js +0 -26
  40. package/PreHandler/SendEarlyOptionsResponse.js.map +0 -1
  41. package/PreHandler/SetDefaultHeaders.d.ts +0 -9
  42. package/PreHandler/SetDefaultHeaders.js +0 -46
  43. package/PreHandler/SetDefaultHeaders.js.map +0 -1
  44. package/abstractions/Route.d.ts +0 -25
  45. package/abstractions/Route.js +0 -30
  46. package/abstractions/Route.js.map +0 -1
  47. package/fastify.d.ts +0 -11
  48. package/fastify.js +0 -321
  49. package/fastify.js.map +0 -1
  50. package/plugins/BeforeHandlerPlugin.d.ts +0 -12
  51. package/plugins/BeforeHandlerPlugin.js +0 -18
  52. package/plugins/BeforeHandlerPlugin.js.map +0 -1
  53. package/plugins/EventPlugin.d.ts +0 -25
  54. package/plugins/EventPlugin.js +0 -14
  55. package/plugins/EventPlugin.js.map +0 -1
  56. package/plugins/HandlerErrorPlugin.d.ts +0 -15
  57. package/plugins/HandlerErrorPlugin.js +0 -17
  58. package/plugins/HandlerErrorPlugin.js.map +0 -1
  59. package/plugins/HandlerOnRequestPlugin.d.ts +0 -21
  60. package/plugins/HandlerOnRequestPlugin.js +0 -17
  61. package/plugins/HandlerOnRequestPlugin.js.map +0 -1
  62. package/plugins/HandlerResultPlugin.d.ts +0 -12
  63. package/plugins/HandlerResultPlugin.js +0 -17
  64. package/plugins/HandlerResultPlugin.js.map +0 -1
  65. package/plugins/ModifyFastifyPlugin.d.ts +0 -13
  66. package/plugins/ModifyFastifyPlugin.js +0 -17
  67. package/plugins/ModifyFastifyPlugin.js.map +0 -1
  68. package/plugins/ModifyResponseHeadersPlugin.d.ts +0 -14
  69. package/plugins/ModifyResponseHeadersPlugin.js +0 -19
  70. package/plugins/ModifyResponseHeadersPlugin.js.map +0 -1
  71. package/plugins/OnRequestResponseSendPlugin.d.ts +0 -26
  72. package/plugins/OnRequestResponseSendPlugin.js +0 -17
  73. package/plugins/OnRequestResponseSendPlugin.js.map +0 -1
  74. package/plugins/OnRequestTimeoutPlugin.d.ts +0 -12
  75. package/plugins/OnRequestTimeoutPlugin.js +0 -17
  76. package/plugins/OnRequestTimeoutPlugin.js.map +0 -1
  77. package/plugins/RoutePlugin.d.ts +0 -23
  78. package/plugins/RoutePlugin.js +0 -14
  79. package/plugins/RoutePlugin.js.map +0 -1
  80. package/suppressPunycodeWarnings.d.ts +0 -1
  81. package/suppressPunycodeWarnings.js +0 -7
  82. package/suppressPunycodeWarnings.js.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"plugins/HandlerErrorPlugin.js","sources":["../../src/plugins/HandlerErrorPlugin.ts"],"sourcesContent":["import { Plugin } from \"@webiny/plugins\";\nimport type { Context } from \"~/types.js\";\n\nexport interface NextCallable {\n (): Promise<any>;\n}\n\nexport interface HandlerErrorCallable<T extends Context = Context> {\n (context: T, error: Error, next: NextCallable): Promise<any>;\n}\n\nexport class HandlerErrorPlugin<T extends Context = Context> extends Plugin {\n public static override readonly type: string = \"handler-error\";\n\n private readonly _callable: HandlerErrorCallable<T>;\n\n public constructor(callable: HandlerErrorCallable<T>) {\n super();\n this._callable = callable;\n }\n\n public async handle(context: T, error: Error, next: NextCallable): Promise<any> {\n return this._callable(context, error, next);\n }\n}\n\nexport const createHandlerErrorPlugin = <T extends Context = Context>(\n callable: HandlerErrorCallable<T>\n): HandlerErrorPlugin<T> => {\n return new HandlerErrorPlugin<T>(callable);\n};\n"],"names":["HandlerErrorPlugin","Plugin","callable","context","error","next","createHandlerErrorPlugin"],"mappings":";AAWO,MAAMA,2BAAwDC;;aACjC,IAAI,GAAW;;IAI/C,YAAmBC,QAAiC,CAAE;QAClD,KAAK;QACL,IAAI,CAAC,SAAS,GAAGA;IACrB;IAEA,MAAa,OAAOC,OAAU,EAAEC,KAAY,EAAEC,IAAkB,EAAgB;QAC5E,OAAO,IAAI,CAAC,SAAS,CAACF,SAASC,OAAOC;IAC1C;AACJ;AAEO,MAAMC,2BAA2B,CACpCJ,WAEO,IAAIF,mBAAsBE"}
@@ -1,21 +0,0 @@
1
- import type { Context } from "../types.js";
2
- import { Plugin } from "@webiny/plugins";
3
- import type { FastifyReply, FastifyRequest } from "fastify";
4
- /**
5
- * If the execution of the callable returns false, no more plugins will be executed after the given one.
6
- * Nor it will execute our default OPTIONS code.
7
- *
8
- * This way users can prevent stopping of the request on our built-in OPTIONS request.
9
- */
10
- export type HandlerOnRequestPluginCallableResponse = false | undefined | null | void;
11
- interface HandlerOnRequestPluginCallable<C extends Context = Context> {
12
- (request: FastifyRequest, reply: FastifyReply, context: C): Promise<HandlerOnRequestPluginCallableResponse>;
13
- }
14
- export declare class HandlerOnRequestPlugin<C extends Context = Context> extends Plugin {
15
- static type: string;
16
- private readonly cb;
17
- constructor(cb: HandlerOnRequestPluginCallable<C>);
18
- exec(request: FastifyRequest, reply: FastifyReply, context: C): Promise<HandlerOnRequestPluginCallableResponse>;
19
- }
20
- export declare const createHandlerOnRequest: <C extends Context = Context>(cb: HandlerOnRequestPluginCallable<C>) => HandlerOnRequestPlugin<C>;
21
- export {};
@@ -1,17 +0,0 @@
1
- import { Plugin } from "@webiny/plugins";
2
- class HandlerOnRequestPlugin extends Plugin {
3
- static{
4
- this.type = "handler.event.onRequest";
5
- }
6
- constructor(cb){
7
- super();
8
- this.cb = cb;
9
- }
10
- async exec(request, reply, context) {
11
- return this.cb(request, reply, context);
12
- }
13
- }
14
- const createHandlerOnRequest = (cb)=>new HandlerOnRequestPlugin(cb);
15
- export { HandlerOnRequestPlugin, createHandlerOnRequest };
16
-
17
- //# sourceMappingURL=HandlerOnRequestPlugin.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"plugins/HandlerOnRequestPlugin.js","sources":["../../src/plugins/HandlerOnRequestPlugin.ts"],"sourcesContent":["import type { Context } from \"~/types.js\";\nimport { Plugin } from \"@webiny/plugins\";\nimport type { FastifyReply, FastifyRequest } from \"fastify\";\n\n/**\n * If the execution of the callable returns false, no more plugins will be executed after the given one.\n * Nor it will execute our default OPTIONS code.\n *\n * This way users can prevent stopping of the request on our built-in OPTIONS request.\n */\nexport type HandlerOnRequestPluginCallableResponse = false | undefined | null | void;\ninterface HandlerOnRequestPluginCallable<C extends Context = Context> {\n (\n request: FastifyRequest,\n reply: FastifyReply,\n context: C\n ): Promise<HandlerOnRequestPluginCallableResponse>;\n}\n\nexport class HandlerOnRequestPlugin<C extends Context = Context> extends Plugin {\n public static override type = \"handler.event.onRequest\";\n\n private readonly cb: HandlerOnRequestPluginCallable<C>;\n\n public constructor(cb: HandlerOnRequestPluginCallable<C>) {\n super();\n this.cb = cb;\n }\n\n public async exec(\n request: FastifyRequest,\n reply: FastifyReply,\n context: C\n ): Promise<HandlerOnRequestPluginCallableResponse> {\n return this.cb(request, reply, context);\n }\n}\n\nexport const createHandlerOnRequest = <C extends Context = Context>(\n cb: HandlerOnRequestPluginCallable<C>\n) => {\n return new HandlerOnRequestPlugin<C>(cb);\n};\n"],"names":["HandlerOnRequestPlugin","Plugin","cb","request","reply","context","createHandlerOnRequest"],"mappings":";AAmBO,MAAMA,+BAA4DC;;aAC9C,IAAI,GAAG;;IAI9B,YAAmBC,EAAqC,CAAE;QACtD,KAAK;QACL,IAAI,CAAC,EAAE,GAAGA;IACd;IAEA,MAAa,KACTC,OAAuB,EACvBC,KAAmB,EACnBC,OAAU,EACqC;QAC/C,OAAO,IAAI,CAAC,EAAE,CAACF,SAASC,OAAOC;IACnC;AACJ;AAEO,MAAMC,yBAAyB,CAClCJ,KAEO,IAAIF,uBAA0BE"}
@@ -1,12 +0,0 @@
1
- import { Plugin } from "@webiny/plugins";
2
- import type { Context } from "../types.js";
3
- export interface HandlerResultCallable<T extends Context = Context> {
4
- (context: T, result: any): Promise<any>;
5
- }
6
- export declare class HandlerResultPlugin<T extends Context = Context> extends Plugin {
7
- static readonly type: string;
8
- private readonly _callable;
9
- constructor(callable: HandlerResultCallable<T>);
10
- handle(context: T, result: any): Promise<any>;
11
- }
12
- export declare const createHandlerResultPlugin: <T extends Context = Context>(callable: HandlerResultCallable<T>) => HandlerResultPlugin<T>;
@@ -1,17 +0,0 @@
1
- import { Plugin } from "@webiny/plugins";
2
- class HandlerResultPlugin extends Plugin {
3
- static{
4
- this.type = "handler-result";
5
- }
6
- constructor(callable){
7
- super();
8
- this._callable = callable;
9
- }
10
- async handle(context, result) {
11
- return this._callable(context, result);
12
- }
13
- }
14
- const createHandlerResultPlugin = (callable)=>new HandlerResultPlugin(callable);
15
- export { HandlerResultPlugin, createHandlerResultPlugin };
16
-
17
- //# sourceMappingURL=HandlerResultPlugin.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"plugins/HandlerResultPlugin.js","sources":["../../src/plugins/HandlerResultPlugin.ts"],"sourcesContent":["import { Plugin } from \"@webiny/plugins\";\nimport type { Context } from \"~/types.js\";\n\nexport interface HandlerResultCallable<T extends Context = Context> {\n (context: T, result: any): Promise<any>;\n}\n\nexport class HandlerResultPlugin<T extends Context = Context> extends Plugin {\n public static override readonly type: string = \"handler-result\";\n\n private readonly _callable: HandlerResultCallable<T>;\n\n public constructor(callable: HandlerResultCallable<T>) {\n super();\n this._callable = callable;\n }\n\n public async handle(context: T, result: any): Promise<any> {\n return this._callable(context, result);\n }\n}\n\nexport const createHandlerResultPlugin = <T extends Context = Context>(\n callable: HandlerResultCallable<T>\n): HandlerResultPlugin<T> => {\n return new HandlerResultPlugin<T>(callable);\n};\n"],"names":["HandlerResultPlugin","Plugin","callable","context","result","createHandlerResultPlugin"],"mappings":";AAOO,MAAMA,4BAAyDC;;aAClC,IAAI,GAAW;;IAI/C,YAAmBC,QAAkC,CAAE;QACnD,KAAK;QACL,IAAI,CAAC,SAAS,GAAGA;IACrB;IAEA,MAAa,OAAOC,OAAU,EAAEC,MAAW,EAAgB;QACvD,OAAO,IAAI,CAAC,SAAS,CAACD,SAASC;IACnC;AACJ;AAEO,MAAMC,4BAA4B,CACrCH,WAEO,IAAIF,oBAAuBE"}
@@ -1,13 +0,0 @@
1
- import { Plugin } from "@webiny/plugins/Plugin.js";
2
- import type { FastifyInstance } from "fastify";
3
- interface ModifyFastifyPluginCallable {
4
- (app: FastifyInstance): void;
5
- }
6
- export declare class ModifyFastifyPlugin extends Plugin {
7
- static type: string;
8
- private readonly cb;
9
- constructor(cb: ModifyFastifyPluginCallable);
10
- modify(app: FastifyInstance): void;
11
- }
12
- export declare const createModifyFastifyPlugin: (cb: ModifyFastifyPluginCallable) => ModifyFastifyPlugin;
13
- export {};
@@ -1,17 +0,0 @@
1
- import { Plugin } from "@webiny/plugins/Plugin.js";
2
- class ModifyFastifyPlugin extends Plugin {
3
- static{
4
- this.type = "handler.fastify.modify";
5
- }
6
- constructor(cb){
7
- super();
8
- this.cb = cb;
9
- }
10
- modify(app) {
11
- this.cb(app);
12
- }
13
- }
14
- const createModifyFastifyPlugin = (cb)=>new ModifyFastifyPlugin(cb);
15
- export { ModifyFastifyPlugin, createModifyFastifyPlugin };
16
-
17
- //# sourceMappingURL=ModifyFastifyPlugin.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"plugins/ModifyFastifyPlugin.js","sources":["../../src/plugins/ModifyFastifyPlugin.ts"],"sourcesContent":["import { Plugin } from \"@webiny/plugins/Plugin.js\";\nimport type { FastifyInstance } from \"fastify\";\n\ninterface ModifyFastifyPluginCallable {\n (app: FastifyInstance): void;\n}\n\nexport class ModifyFastifyPlugin extends Plugin {\n public static override type = \"handler.fastify.modify\";\n\n private readonly cb: ModifyFastifyPluginCallable;\n\n public constructor(cb: ModifyFastifyPluginCallable) {\n super();\n this.cb = cb;\n }\n\n public modify(app: FastifyInstance): void {\n this.cb(app);\n }\n}\n\nexport const createModifyFastifyPlugin = (cb: ModifyFastifyPluginCallable) => {\n return new ModifyFastifyPlugin(cb);\n};\n"],"names":["ModifyFastifyPlugin","Plugin","cb","app","createModifyFastifyPlugin"],"mappings":";AAOO,MAAMA,4BAA4BC;;aACd,IAAI,GAAG;;IAI9B,YAAmBC,EAA+B,CAAE;QAChD,KAAK;QACL,IAAI,CAAC,EAAE,GAAGA;IACd;IAEO,OAAOC,GAAoB,EAAQ;QACtC,IAAI,CAAC,EAAE,CAACA;IACZ;AACJ;AAEO,MAAMC,4BAA4B,CAACF,KAC/B,IAAIF,oBAAoBE"}
@@ -1,14 +0,0 @@
1
- import { Plugin } from "@webiny/plugins/Plugin.js";
2
- import type { ResponseHeaders } from "../ResponseHeaders.js";
3
- import type { Request } from "../types.js";
4
- interface ModifyResponseHeadersCallable {
5
- (request: Request, headers: ResponseHeaders): void;
6
- }
7
- export declare class ModifyResponseHeadersPlugin extends Plugin {
8
- static type: string;
9
- private readonly cb;
10
- constructor(cb: ModifyResponseHeadersCallable);
11
- modify(request: Request, headers: ResponseHeaders): void;
12
- }
13
- export declare function createModifyResponseHeaders(cb: ModifyResponseHeadersCallable): ModifyResponseHeadersPlugin;
14
- export {};
@@ -1,19 +0,0 @@
1
- import { Plugin } from "@webiny/plugins/Plugin.js";
2
- class ModifyResponseHeadersPlugin extends Plugin {
3
- static{
4
- this.type = "handler.response.modifyHeaders";
5
- }
6
- constructor(cb){
7
- super();
8
- this.cb = cb;
9
- }
10
- modify(request, headers) {
11
- this.cb(request, headers);
12
- }
13
- }
14
- function createModifyResponseHeaders(cb) {
15
- return new ModifyResponseHeadersPlugin(cb);
16
- }
17
- export { ModifyResponseHeadersPlugin, createModifyResponseHeaders };
18
-
19
- //# sourceMappingURL=ModifyResponseHeadersPlugin.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"plugins/ModifyResponseHeadersPlugin.js","sources":["../../src/plugins/ModifyResponseHeadersPlugin.ts"],"sourcesContent":["import { Plugin } from \"@webiny/plugins/Plugin.js\";\nimport type { ResponseHeaders } from \"~/ResponseHeaders.js\";\nimport type { Request } from \"~/types.js\";\n\ninterface ModifyResponseHeadersCallable {\n (request: Request, headers: ResponseHeaders): void;\n}\n\nexport class ModifyResponseHeadersPlugin extends Plugin {\n public static override type = \"handler.response.modifyHeaders\";\n private readonly cb: ModifyResponseHeadersCallable;\n\n constructor(cb: ModifyResponseHeadersCallable) {\n super();\n this.cb = cb;\n }\n\n modify(request: Request, headers: ResponseHeaders) {\n this.cb(request, headers);\n }\n}\n\nexport function createModifyResponseHeaders(cb: ModifyResponseHeadersCallable) {\n return new ModifyResponseHeadersPlugin(cb);\n}\n"],"names":["ModifyResponseHeadersPlugin","Plugin","cb","request","headers","createModifyResponseHeaders"],"mappings":";AAQO,MAAMA,oCAAoCC;;aACtB,IAAI,GAAG;;IAG9B,YAAYC,EAAiC,CAAE;QAC3C,KAAK;QACL,IAAI,CAAC,EAAE,GAAGA;IACd;IAEA,OAAOC,OAAgB,EAAEC,OAAwB,EAAE;QAC/C,IAAI,CAAC,EAAE,CAACD,SAASC;IACrB;AACJ;AAEO,SAASC,4BAA4BH,EAAiC;IACzE,OAAO,IAAIF,4BAA4BE;AAC3C"}
@@ -1,26 +0,0 @@
1
- /**
2
- * !!!!!!!!!!!!!!
3
- * !!! DANGER !!!
4
- * !!!!!!!!!!!!!!
5
- *
6
- * Using this plugin can cause slowdowns in your application response times.
7
- * Also, if you do not return payload from the plugin callback, there will be nothing to send in the response.
8
- */
9
- import { Plugin } from "@webiny/plugins";
10
- import type { Reply as FastifyReply, Request as FastifyRequest } from "../types.js";
11
- export interface IOnResponseSendPluginCallable {
12
- <T = unknown>(request: FastifyRequest, reply: FastifyReply, payload: T): Promise<T>;
13
- }
14
- /**
15
- * @description Read info in the class file.
16
- */
17
- export declare class OnRequestResponseSendPlugin extends Plugin {
18
- static type: string;
19
- private readonly cb;
20
- constructor(cb: IOnResponseSendPluginCallable);
21
- exec<T = unknown>(request: FastifyRequest, reply: FastifyReply, payload: T): Promise<unknown>;
22
- }
23
- /**
24
- * @description Read info in the class file.
25
- */
26
- export declare const createOnRequestResponseSend: (cb: IOnResponseSendPluginCallable) => OnRequestResponseSendPlugin;
@@ -1,17 +0,0 @@
1
- import { Plugin } from "@webiny/plugins";
2
- class OnRequestResponseSendPlugin extends Plugin {
3
- static{
4
- this.type = "handler.onRequestResponseSend";
5
- }
6
- constructor(cb){
7
- super();
8
- this.cb = cb;
9
- }
10
- async exec(request, reply, payload) {
11
- return await this.cb(request, reply, payload);
12
- }
13
- }
14
- const createOnRequestResponseSend = (cb)=>new OnRequestResponseSendPlugin(cb);
15
- export { OnRequestResponseSendPlugin, createOnRequestResponseSend };
16
-
17
- //# sourceMappingURL=OnRequestResponseSendPlugin.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"plugins/OnRequestResponseSendPlugin.js","sources":["../../src/plugins/OnRequestResponseSendPlugin.ts"],"sourcesContent":["/**\n * !!!!!!!!!!!!!!\n * !!! DANGER !!!\n * !!!!!!!!!!!!!!\n *\n * Using this plugin can cause slowdowns in your application response times.\n * Also, if you do not return payload from the plugin callback, there will be nothing to send in the response.\n */\nimport { Plugin } from \"@webiny/plugins\";\nimport type { Reply as FastifyReply, Request as FastifyRequest } from \"~/types.js\";\n\nexport interface IOnResponseSendPluginCallable {\n <T = unknown>(request: FastifyRequest, reply: FastifyReply, payload: T): Promise<T>;\n}\n\n/**\n * @description Read info in the class file.\n */\nexport class OnRequestResponseSendPlugin extends Plugin {\n public static override type: string = \"handler.onRequestResponseSend\";\n\n private readonly cb: IOnResponseSendPluginCallable;\n\n public constructor(cb: IOnResponseSendPluginCallable) {\n super();\n this.cb = cb;\n }\n\n public async exec<T = unknown>(\n request: FastifyRequest,\n reply: FastifyReply,\n payload: T\n ): Promise<unknown> {\n return await this.cb<T>(request, reply, payload);\n }\n}\n\n/**\n * @description Read info in the class file.\n */\nexport const createOnRequestResponseSend = (cb: IOnResponseSendPluginCallable) => {\n return new OnRequestResponseSendPlugin(cb);\n};\n"],"names":["OnRequestResponseSendPlugin","Plugin","cb","request","reply","payload","createOnRequestResponseSend"],"mappings":";AAkBO,MAAMA,oCAAoCC;;aACtB,IAAI,GAAW;;IAItC,YAAmBC,EAAiC,CAAE;QAClD,KAAK;QACL,IAAI,CAAC,EAAE,GAAGA;IACd;IAEA,MAAa,KACTC,OAAuB,EACvBC,KAAmB,EACnBC,OAAU,EACM;QAChB,OAAO,MAAM,IAAI,CAAC,EAAE,CAAIF,SAASC,OAAOC;IAC5C;AACJ;AAKO,MAAMC,8BAA8B,CAACJ,KACjC,IAAIF,4BAA4BE"}
@@ -1,12 +0,0 @@
1
- import { Plugin } from "@webiny/plugins";
2
- import type { Reply as FastifyReply, Request as FastifyRequest } from "../types.js";
3
- export interface IOnRequestTimeoutPluginCallable {
4
- (request: FastifyRequest, reply: FastifyReply): Promise<unknown>;
5
- }
6
- export declare class OnRequestTimeoutPlugin extends Plugin {
7
- static type: string;
8
- private readonly cb;
9
- constructor(cb: IOnRequestTimeoutPluginCallable);
10
- exec(request: FastifyRequest, reply: FastifyReply): Promise<unknown>;
11
- }
12
- export declare const createOnRequestTimeout: (cb: IOnRequestTimeoutPluginCallable) => OnRequestTimeoutPlugin;
@@ -1,17 +0,0 @@
1
- import { Plugin } from "@webiny/plugins";
2
- class OnRequestTimeoutPlugin extends Plugin {
3
- static{
4
- this.type = "handler.onRequestTimeout";
5
- }
6
- constructor(cb){
7
- super();
8
- this.cb = cb;
9
- }
10
- async exec(request, reply) {
11
- return await this.cb(request, reply);
12
- }
13
- }
14
- const createOnRequestTimeout = (cb)=>new OnRequestTimeoutPlugin(cb);
15
- export { OnRequestTimeoutPlugin, createOnRequestTimeout };
16
-
17
- //# sourceMappingURL=OnRequestTimeoutPlugin.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"plugins/OnRequestTimeoutPlugin.js","sources":["../../src/plugins/OnRequestTimeoutPlugin.ts"],"sourcesContent":["import { Plugin } from \"@webiny/plugins\";\nimport type { Reply as FastifyReply, Request as FastifyRequest } from \"~/types.js\";\n\nexport interface IOnRequestTimeoutPluginCallable {\n (request: FastifyRequest, reply: FastifyReply): Promise<unknown>;\n}\n\nexport class OnRequestTimeoutPlugin extends Plugin {\n public static override type: string = \"handler.onRequestTimeout\";\n\n private readonly cb: IOnRequestTimeoutPluginCallable;\n\n public constructor(cb: IOnRequestTimeoutPluginCallable) {\n super();\n this.cb = cb;\n }\n\n public async exec(request: FastifyRequest, reply: FastifyReply): Promise<unknown> {\n return await this.cb(request, reply);\n }\n}\n\nexport const createOnRequestTimeout = (cb: IOnRequestTimeoutPluginCallable) => {\n return new OnRequestTimeoutPlugin(cb);\n};\n"],"names":["OnRequestTimeoutPlugin","Plugin","cb","request","reply","createOnRequestTimeout"],"mappings":";AAOO,MAAMA,+BAA+BC;;aACjB,IAAI,GAAW;;IAItC,YAAmBC,EAAmC,CAAE;QACpD,KAAK;QACL,IAAI,CAAC,EAAE,GAAGA;IACd;IAEA,MAAa,KAAKC,OAAuB,EAAEC,KAAmB,EAAoB;QAC9E,OAAO,MAAM,IAAI,CAAC,EAAE,CAACD,SAASC;IAClC;AACJ;AAEO,MAAMC,yBAAyB,CAACH,KAC5B,IAAIF,uBAAuBE"}
@@ -1,23 +0,0 @@
1
- import { Plugin } from "@webiny/plugins/Plugin.js";
2
- import type { Context, RouteMethod } from "../types.js";
3
- interface RoutePluginCbParams<T extends Context> {
4
- context: T;
5
- onGet: RouteMethod;
6
- onPost: RouteMethod;
7
- onPut: RouteMethod;
8
- onPatch: RouteMethod;
9
- onDelete: RouteMethod;
10
- onOptions: RouteMethod;
11
- onAll: RouteMethod;
12
- onHead: RouteMethod;
13
- }
14
- export interface RoutePluginCb<T extends Context> {
15
- (params: RoutePluginCbParams<T>): void;
16
- }
17
- export declare class RoutePlugin<T extends Context = Context> extends Plugin {
18
- static readonly type: string;
19
- readonly cb: RoutePluginCb<T>;
20
- constructor(cb: RoutePluginCb<T>);
21
- }
22
- export declare const createRoute: <T extends Context = Context>(cb: RoutePluginCb<T>) => RoutePlugin<T>;
23
- export {};
@@ -1,14 +0,0 @@
1
- import { Plugin } from "@webiny/plugins/Plugin.js";
2
- class RoutePlugin extends Plugin {
3
- static{
4
- this.type = "handler.fastify.route";
5
- }
6
- constructor(cb){
7
- super();
8
- this.cb = cb;
9
- }
10
- }
11
- const createRoute = (cb)=>new RoutePlugin(cb);
12
- export { RoutePlugin, createRoute };
13
-
14
- //# sourceMappingURL=RoutePlugin.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"plugins/RoutePlugin.js","sources":["../../src/plugins/RoutePlugin.ts"],"sourcesContent":["import { Plugin } from \"@webiny/plugins/Plugin.js\";\nimport type { Context, RouteMethod } from \"~/types.js\";\n\ninterface RoutePluginCbParams<T extends Context> {\n context: T;\n onGet: RouteMethod;\n onPost: RouteMethod;\n onPut: RouteMethod;\n onPatch: RouteMethod;\n onDelete: RouteMethod;\n onOptions: RouteMethod;\n onAll: RouteMethod;\n onHead: RouteMethod;\n}\nexport interface RoutePluginCb<T extends Context> {\n (params: RoutePluginCbParams<T>): void;\n}\n\nexport class RoutePlugin<T extends Context = Context> extends Plugin {\n public static override readonly type: string = \"handler.fastify.route\";\n\n public readonly cb: RoutePluginCb<T>;\n\n public constructor(cb: RoutePluginCb<T>) {\n super();\n this.cb = cb;\n }\n}\n\nexport const createRoute = <T extends Context = Context>(cb: RoutePluginCb<T>): RoutePlugin<T> => {\n return new RoutePlugin<T>(cb);\n};\n"],"names":["RoutePlugin","Plugin","cb","createRoute"],"mappings":";AAkBO,MAAMA,oBAAiDC;;aAC1B,IAAI,GAAW;;IAI/C,YAAmBC,EAAoB,CAAE;QACrC,KAAK;QACL,IAAI,CAAC,EAAE,GAAGA;IACd;AACJ;AAEO,MAAMC,cAAc,CAA8BD,KAC9C,IAAIF,YAAeE"}
@@ -1 +0,0 @@
1
- export {};
@@ -1,7 +0,0 @@
1
- const originalConsoleError = console.error;
2
- console.error = (message, ...args)=>{
3
- if ("string" == typeof message && message.includes("punycode")) return;
4
- originalConsoleError.call(console, message, ...args);
5
- };
6
-
7
- //# sourceMappingURL=suppressPunycodeWarnings.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"suppressPunycodeWarnings.js","sources":["../src/suppressPunycodeWarnings.ts"],"sourcesContent":["const originalConsoleError = console.error;\nconsole.error = (message, ...args) => {\n if (typeof message === \"string\" && message.includes(\"punycode\")) {\n return;\n }\n originalConsoleError.call(console, message, ...args);\n};\n\nexport {};\n"],"names":["originalConsoleError","console","message","args"],"mappings":"AAAA,MAAMA,uBAAuBC,QAAQ,KAAK;AAC1CA,QAAQ,KAAK,GAAG,CAACC,SAAS,GAAGC;IACzB,IAAI,AAAmB,YAAnB,OAAOD,WAAwBA,QAAQ,QAAQ,CAAC,aAChD;IAEJF,qBAAqB,IAAI,CAACC,SAASC,YAAYC;AACnD"}