@webiny/handler 5.41.4 → 5.42.0-beta.1

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/fastify.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"names":["_types","require","_fastify","_interopRequireDefault","_utils","_Context","_error","_RoutePlugin","_handlerClient","_cookie","_compress","_api","_BeforeHandlerPlugin","_HandlerResultPlugin","_HandlerErrorPlugin","_ModifyFastifyPlugin","_HandlerOnRequestPlugin","_ResponseHeaders","_ModifyResponseHeadersPlugin","createDefaultHeaders","ResponseHeaders","create","getWebinyVersionHeaders","getDefaultOptionsHeaders","getDefaultHeaders","routes","headers","keys","Object","all","every","key","length","set","allowedMethods","filter","type","Array","isArray","sort","join","stringifyError","error","name","message","code","stack","data","JSON","stringify","constructorName","constructor","process","env","DEBUG","modifyResponseHeaders","app","request","reply","modifyHeaders","webiny","plugins","byType","ModifyResponseHeadersPlugin","getHeaders","forEach","plugin","modify","createHandler","params","definedRoutes","POST","GET","OPTIONS","DELETE","PATCH","PUT","HEAD","COPY","LOCK","MKCOL","MOVE","PROPFIND","PROPPATCH","SEARCH","TRACE","UNLOCK","throwOnDefinedRoute","path","options","find","includes","console","WebinyError","override","addDefinedRoute","push","fastify","bodyLimit","disableRequestLogging","addHook","route","method","m","register","fastifyCookie","parseOptions","fastifyCompress","global","threshold","onUnsupportedEncoding","encoding","_","inflateIfDeflated","defined","onPost","handler","post","onGet","get","onOptions","onDelete","delete","onPatch","patch","onPut","put","onAll","onHead","head","context","PluginsContainer","createHandlerClient","merge","Context","WEBINY_VERSION","ex","decorate","isOptionsRequest","defaultHeaders","initialHeaders","HandlerOnRequestPlugin","result","exec","sent","explanation","send","hijack","ContextPlugin","apply","BeforeHandlerPlugin","preSerialization","__","payload","HandlerResultPlugin","handle","setErrorHandler","status","HandlerErrorPlugin","middleware","map","pl","next","benchmark","output","modifyPlugins","ModifyFastifyPlugin","modifyFastifyPluginName","routePlugins","RoutePlugin","routePluginName","cb","exports"],"sources":["fastify.ts"],"sourcesContent":["import { PluginCollection, PluginsContainer } from \"@webiny/plugins/types\";\nimport fastify, {\n FastifyInstance,\n FastifyServerOptions as ServerOptions,\n preSerializationAsyncHookHandler\n} from \"fastify\";\nimport { getWebinyVersionHeaders, middleware, MiddlewareCallable } from \"@webiny/utils\";\nimport {\n ContextRoutes,\n DefinedContextRoutes,\n HTTPMethods,\n Reply,\n Request,\n RouteMethodOptions\n} from \"~/types\";\nimport { Context } from \"~/Context\";\nimport WebinyError from \"@webiny/error\";\nimport { RoutePlugin } from \"./plugins/RoutePlugin\";\nimport { createHandlerClient } from \"@webiny/handler-client\";\nimport fastifyCookie from \"@fastify/cookie\";\nimport fastifyCompress from \"@fastify/compress\";\nimport { ContextPlugin } from \"@webiny/api\";\nimport { BeforeHandlerPlugin } from \"./plugins/BeforeHandlerPlugin\";\nimport { HandlerResultPlugin } from \"./plugins/HandlerResultPlugin\";\nimport { HandlerErrorPlugin } from \"./plugins/HandlerErrorPlugin\";\nimport { ModifyFastifyPlugin } from \"~/plugins/ModifyFastifyPlugin\";\nimport { HandlerOnRequestPlugin } from \"~/plugins/HandlerOnRequestPlugin\";\nimport { ResponseHeaders } from \"~/ResponseHeaders\";\nimport { ModifyResponseHeadersPlugin } from \"~/plugins/ModifyResponseHeadersPlugin\";\n\nfunction createDefaultHeaders() {\n return ResponseHeaders.create({\n \"content-type\": \"application/json; charset=utf-8\",\n \"cache-control\": \"no-store\",\n \"access-control-allow-origin\": \"*\",\n \"access-control-allow-headers\": \"*\",\n \"access-control-allow-methods\": \"OPTIONS,POST,GET,DELETE,PUT,PATCH\",\n ...getWebinyVersionHeaders()\n });\n}\n\nconst getDefaultOptionsHeaders = () => {\n return ResponseHeaders.create({\n \"access-control-max-age\": \"86400\",\n \"cache-control\": \"public, max-age=86400\"\n });\n};\n\nconst getDefaultHeaders = (routes: DefinedContextRoutes): ResponseHeaders => {\n const headers = createDefaultHeaders();\n\n /**\n * If we are accepting all headers, just output that one.\n */\n const keys = Object.keys(routes) as HTTPMethods[];\n const all = keys.every(key => routes[key].length > 0);\n if (all) {\n headers.set(\"access-control-allow-methods\", \"*\");\n } else {\n const allowedMethods = keys\n .filter(type => {\n if (!routes[type] || !Array.isArray(routes[type])) {\n return false;\n }\n return routes[type].length > 0;\n })\n .sort()\n .join(\",\");\n\n headers.set(\"access-control-allow-methods\", allowedMethods);\n }\n\n return headers;\n};\n\ninterface CustomError extends Error {\n code?: string;\n data?: Record<string, any>;\n}\n\nconst stringifyError = (error: CustomError) => {\n const { name, message, code, stack, data } = error;\n return JSON.stringify({\n ...error,\n constructorName: error.constructor?.name || \"UnknownError\",\n name: name || \"No error name\",\n message: message || \"No error message\",\n code: code || \"NO_CODE\",\n data,\n stack: process.env.DEBUG === \"true\" ? stack : \"Turn on the debug flag to see the stack.\"\n });\n};\n\nconst modifyResponseHeaders = (app: FastifyInstance, request: Request, reply: Reply) => {\n const modifyHeaders = app.webiny.plugins.byType<ModifyResponseHeadersPlugin>(\n ModifyResponseHeadersPlugin.type\n );\n\n const headers = ResponseHeaders.create(reply.getHeaders());\n\n modifyHeaders.forEach(plugin => {\n plugin.modify(request, headers);\n });\n\n reply.headers(headers.getHeaders());\n};\n\nexport interface CreateHandlerParams {\n plugins: PluginCollection | PluginsContainer;\n options?: ServerOptions;\n debug?: boolean;\n}\n\nexport const createHandler = (params: CreateHandlerParams) => {\n const definedRoutes: DefinedContextRoutes = {\n POST: [],\n GET: [],\n OPTIONS: [],\n DELETE: [],\n PATCH: [],\n PUT: [],\n HEAD: [],\n COPY: [],\n LOCK: [],\n MKCOL: [],\n MOVE: [],\n PROPFIND: [],\n PROPPATCH: [],\n SEARCH: [],\n TRACE: [],\n UNLOCK: []\n };\n\n const throwOnDefinedRoute = (\n type: HTTPMethods | \"ALL\",\n path: string,\n options?: RouteMethodOptions\n ): void => {\n if (type === \"ALL\") {\n const all = Object.keys(definedRoutes).find(key => {\n const routes = definedRoutes[key as HTTPMethods];\n return routes.includes(path);\n });\n if (!all) {\n return;\n }\n console.error(\n `Error while registering onAll route. One of the routes is already defined.`\n );\n console.error(JSON.stringify(all));\n throw new WebinyError(\n `You cannot override a route with onAll() method, please remove unnecessary route from the system.`,\n \"OVERRIDE_ROUTE_ERROR\",\n {\n type,\n path\n }\n );\n } else if (definedRoutes[type].includes(path) === false) {\n return;\n } else if (options?.override === true) {\n return;\n }\n console.error(`Error while trying to override route: [${type}] ${path}`);\n throw new WebinyError(\n `When you are trying to override existing route, you must send \"override\" parameter when adding that route.`,\n \"OVERRIDE_ROUTE_ERROR\",\n {\n type,\n path\n }\n );\n };\n\n const addDefinedRoute = (type: HTTPMethods, path: string): void => {\n if (!definedRoutes[type]) {\n return;\n } else if (definedRoutes[type].includes(path)) {\n return;\n }\n definedRoutes[type].push(path);\n };\n\n /**\n * We must attach the server to our internal context if we want to have it accessible.\n */\n const app = fastify({\n bodyLimit: 536870912, // 512MB\n disableRequestLogging: true,\n ...(params.options || {})\n });\n\n /**\n * We need to register routes in our system so we can output headers later on and dissallow overriding routes.\n */\n app.addHook(\"onRoute\", route => {\n const method = route.method;\n if (Array.isArray(method)) {\n for (const m of method) {\n addDefinedRoute(m, route.path);\n }\n return;\n }\n addDefinedRoute(method, route.path);\n });\n /**\n * ############################\n * Register the Fastify plugins.\n */\n /**\n * Package @fastify/cookie\n *\n * https://github.com/fastify/fastify-cookie\n */\n app.register(fastifyCookie, {\n parseOptions: {} // options for parsing cookies\n });\n /**\n * Package @fastify/compress\n *\n * https://github.com/fastify/fastify-compress\n */\n app.register(fastifyCompress, {\n global: true,\n threshold: 1024,\n onUnsupportedEncoding: (encoding, _, reply) => {\n reply.code(406);\n return `We do not support the ${encoding} encoding.`;\n },\n inflateIfDeflated: true\n });\n /**\n * Route helpers - mostly for users.\n */\n const routes: ContextRoutes = {\n defined: definedRoutes,\n onPost: (path, handler, options) => {\n throwOnDefinedRoute(\"POST\", path, options);\n app.post(path, handler);\n },\n onGet: (path, handler, options) => {\n throwOnDefinedRoute(\"GET\", path, options);\n app.get(path, handler);\n },\n onOptions: (path, handler, options) => {\n throwOnDefinedRoute(\"OPTIONS\", path, options);\n app.options(path, handler);\n },\n onDelete: (path, handler, options) => {\n throwOnDefinedRoute(\"DELETE\", path, options);\n app.delete(path, handler);\n },\n onPatch: (path, handler, options) => {\n throwOnDefinedRoute(\"PATCH\", path, options);\n app.patch(path, handler);\n },\n onPut: (path, handler, options) => {\n throwOnDefinedRoute(\"PUT\", path, options);\n app.put(path, handler);\n },\n onAll: (path, handler, options) => {\n throwOnDefinedRoute(\"ALL\", path, options);\n app.all(path, handler);\n },\n onHead: (path, handler, options) => {\n throwOnDefinedRoute(\"HEAD\", path, options);\n app.head(path, handler);\n }\n };\n let context: Context;\n\n const plugins = new PluginsContainer([\n /**\n * We must have handlerClient by default.\n * And it must be one of the first context plugins applied.\n */\n createHandlerClient()\n ]);\n plugins.merge(params.plugins || []);\n\n try {\n context = new Context({\n plugins,\n /**\n * Inserted via webpack at build time.\n */\n WEBINY_VERSION: process.env.WEBINY_VERSION as string,\n routes\n });\n } catch (ex) {\n console.error(`Error while constructing the Context.`);\n console.error(stringifyError(ex));\n throw ex;\n }\n\n /**\n * We are attaching our custom context to webiny variable on the fastify app, so it is accessible everywhere.\n */\n app.decorate(\"webiny\", context);\n\n /**\n * On every request we add default headers, which can be changed later.\n * Also, if it is an options request, we skip everything after this hook and output options headers.\n */\n app.addHook(\"onRequest\", async (request, reply) => {\n const isOptionsRequest = request.method === \"OPTIONS\";\n /**\n * Our default headers are always set. Users can override them.\n */\n const defaultHeaders = getDefaultHeaders(definedRoutes);\n\n const initialHeaders = isOptionsRequest\n ? defaultHeaders.merge(getDefaultOptionsHeaders())\n : defaultHeaders;\n\n reply.headers(initialHeaders.getHeaders());\n /**\n * Users can define their own custom handlers for the onRequest event - so let's run them first.\n */\n const plugins = app.webiny.plugins.byType<HandlerOnRequestPlugin>(\n HandlerOnRequestPlugin.type\n );\n\n let name: string | undefined;\n try {\n for (const plugin of plugins) {\n name = plugin.name;\n const result = await plugin.exec(request, reply);\n if (result === false) {\n return;\n }\n }\n } catch (ex) {\n console.error(\n `Error while running the \"HandlerOnRequestPlugin\" ${\n name ? `(${name})` : \"\"\n } plugin in the onRequest hook.`\n );\n console.error(stringifyError(ex));\n throw ex;\n }\n /**\n * When we receive the OPTIONS request, we end it before it goes any further as there is no need for anything to run after this - at least for our use cases.\n *\n * Users can prevent this by creating their own HandlerOnRequestPlugin and returning false as the result of the callable.\n */\n if (!isOptionsRequest) {\n return;\n }\n\n if (reply.sent) {\n /**\n * At this point throwing an exception will not do anything with the response. So just log it.\n */\n console.error(\n JSON.stringify({\n message: `Output was already sent. Please check custom plugins of type \"HandlerOnRequestPlugin\".`,\n explanation:\n \"This error can happen if the user plugin ended the reply, but did not return false as response.\"\n })\n );\n return;\n }\n\n modifyResponseHeaders(app, request, reply);\n\n reply.code(204).send(\"\").hijack();\n });\n\n app.addHook(\"preParsing\", async (request, reply) => {\n app.webiny.request = request;\n app.webiny.reply = reply;\n const plugins = app.webiny.plugins.byType<ContextPlugin>(ContextPlugin.type);\n let name: string | undefined;\n try {\n for (const plugin of plugins) {\n name = plugin.name;\n await plugin.apply(app.webiny);\n }\n } catch (ex) {\n console.error(\n `Error while running the \"ContextPlugin\" ${\n name ? `(${name})` : \"\"\n } plugin in the preParsing hook.`\n );\n console.error(stringifyError(ex));\n throw ex;\n }\n });\n /**\n *\n */\n app.addHook(\"preHandler\", async () => {\n const plugins = app.webiny.plugins.byType<BeforeHandlerPlugin>(BeforeHandlerPlugin.type);\n let name: string | undefined;\n try {\n for (const plugin of plugins) {\n name = plugin.name;\n await plugin.apply(app.webiny);\n }\n } catch (ex) {\n console.error(\n `Error while running the \"BeforeHandlerPlugin\" ${\n name ? `(${name})` : \"\"\n } plugin in the preHandler hook.`\n );\n console.error(stringifyError(ex));\n throw ex;\n }\n });\n\n /**\n *\n */\n const preSerialization: preSerializationAsyncHookHandler<any> = async (_, __, payload) => {\n const plugins = app.webiny.plugins.byType<HandlerResultPlugin>(HandlerResultPlugin.type);\n let name: string | undefined;\n try {\n for (const plugin of plugins) {\n name = plugin.name;\n await plugin.handle(app.webiny, payload);\n }\n } catch (ex) {\n console.error(\n `Error while running the \"HandlerResultPlugin\" ${\n name ? `(${name})` : \"\"\n } plugin in the preSerialization hook.`\n );\n console.error(stringifyError(ex));\n throw ex;\n }\n return payload;\n };\n\n app.addHook(\"preSerialization\", preSerialization);\n\n app.setErrorHandler<WebinyError>(async (error, request, reply) => {\n return reply\n .status(500)\n .headers({\n \"Cache-Control\": \"no-store\"\n })\n .send(\n /**\n * When we are sending the error in the response, we cannot send the whole error object, as it might contain some sensitive data.\n */\n JSON.stringify({\n message: error.message,\n code: error.code,\n data: error.data\n })\n );\n });\n\n app.addHook(\"onError\", async (_, reply, error: any) => {\n const plugins = app.webiny.plugins.byType<HandlerErrorPlugin>(HandlerErrorPlugin.type);\n /**\n * Log error to cloud, as these can be extremely annoying to debug!\n */\n console.error(\"@webiny/handler\");\n console.error(stringifyError(error));\n\n reply\n .status(500)\n .headers({\n \"Cache-Control\": \"no-store\"\n })\n .send(\n /**\n * When we are sending the error in the response, we cannot send the whole error object, as it might contain some sensitive data.\n */\n JSON.stringify({\n message: error.message,\n code: error.code,\n data: error.data\n })\n );\n\n const handler = middleware(\n plugins.map(pl => {\n return (context: Context, error: Error, next: MiddlewareCallable) => {\n return pl.handle(context, error, next);\n };\n })\n );\n await handler(app.webiny, error);\n\n return reply;\n });\n\n /**\n * Apply response headers modifier plugins.\n */\n app.addHook(\"onSend\", async (request, reply, payload) => {\n modifyResponseHeaders(app, request, reply);\n\n return payload;\n });\n\n /**\n * We need to output the benchmark results at the end of the request in both response and timeout cases\n */\n app.addHook(\"onResponse\", async () => {\n await context.benchmark.output();\n });\n\n app.addHook(\"onTimeout\", async () => {\n await context.benchmark.output();\n });\n\n /**\n * With these plugins we give users possibility to do anything they want on our fastify instance.\n */\n const modifyPlugins = app.webiny.plugins.byType<ModifyFastifyPlugin>(ModifyFastifyPlugin.type);\n\n let modifyFastifyPluginName: string | undefined;\n try {\n for (const plugin of modifyPlugins) {\n modifyFastifyPluginName = plugin.name;\n plugin.modify(app);\n }\n } catch (ex) {\n console.error(\n `Error while running the \"ModifyFastifyPlugin\" ${\n modifyFastifyPluginName ? `(${modifyFastifyPluginName})` : \"\"\n } plugin in the end of the \"createHandler\" callable.`\n );\n console.error(stringifyError(ex));\n throw ex;\n }\n\n /**\n * We have few types of triggers:\n * * Events - EventPlugin\n * * Routes - RoutePlugin\n *\n * Routes are registered in fastify but events must be handled in package which implements cloud specific methods.\n */\n const routePlugins = app.webiny.plugins.byType<RoutePlugin>(RoutePlugin.type);\n\n /**\n * Add routes to the system.\n */\n let routePluginName: string | undefined;\n try {\n for (const plugin of routePlugins) {\n routePluginName = plugin.name;\n plugin.cb({\n ...app.webiny.routes,\n context: app.webiny\n });\n }\n } catch (ex) {\n console.error(\n `Error while running the \"RoutePlugin\" ${\n routePluginName ? `(${routePluginName})` : \"\"\n } plugin in the beginning of the \"createHandler\" callable.`\n );\n console.error(stringifyError(ex));\n throw ex;\n }\n\n return app;\n};\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAC,sBAAA,CAAAF,OAAA;AAKA,IAAAG,MAAA,GAAAH,OAAA;AASA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAH,sBAAA,CAAAF,OAAA;AACA,IAAAM,YAAA,GAAAN,OAAA;AACA,IAAAO,cAAA,GAAAP,OAAA;AACA,IAAAQ,OAAA,GAAAN,sBAAA,CAAAF,OAAA;AACA,IAAAS,SAAA,GAAAP,sBAAA,CAAAF,OAAA;AACA,IAAAU,IAAA,GAAAV,OAAA;AACA,IAAAW,oBAAA,GAAAX,OAAA;AACA,IAAAY,oBAAA,GAAAZ,OAAA;AACA,IAAAa,mBAAA,GAAAb,OAAA;AACA,IAAAc,oBAAA,G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AmC;EACvC,IAAI;IACA,KAAK,MAAMxG,MAAM,IAAIsG,YAAY,EAAE;MAC/BE,eAAe,GAAGxG,MAAM,CAACvB,IAAI;MAC7BuB,MAAM,CAACyG,EAAE,CAAC;QACN,GAAGnH,GAAG,CAACI,MAAM,CAACnC,MAAM;QACpByG,OAAO,EAAE1E,GAAG,CAACI;MACjB,CAAC,CAAC;IACN;EACJ,CAAC,CAAC,OAAO4E,EAAE,EAAE;IACT5C,OAAO,CAAClD,KAAK,CACR,yCACGgI,eAAe,GAAI,IAAGA,eAAgB,GAAE,GAAG,EAC9C,2DACL,CAAC;IACD9E,OAAO,CAAClD,KAAK,CAACD,cAAc,CAAC+F,EAAE,CAAC,CAAC;IACjC,MAAMA,EAAE;EACZ;EAEA,OAAOhF,GAAG;AACd,CAAC;AAACoH,OAAA,CAAAxG,aAAA,GAAAA,aAAA","ignoreList":[]}
1
+ {"version":3,"names":["_types","require","_fastify","_interopRequireDefault","_utils","_Context","_error","_RoutePlugin","_handlerClient","_cookie","_compress","_api","_BeforeHandlerPlugin","_HandlerResultPlugin","_HandlerErrorPlugin","_ModifyFastifyPlugin","_HandlerOnRequestPlugin","_ResponseHeaders","_ModifyResponseHeadersPlugin","createDefaultHeaders","ResponseHeaders","create","getWebinyVersionHeaders","getDefaultOptionsHeaders","getDefaultHeaders","routes","headers","keys","Object","all","every","key","length","set","allowedMethods","filter","type","Array","isArray","sort","join","stringifyError","error","name","message","code","stack","data","JSON","stringify","constructorName","constructor","process","env","DEBUG","modifyResponseHeaders","app","request","reply","modifyHeaders","webiny","plugins","byType","ModifyResponseHeadersPlugin","getHeaders","forEach","plugin","modify","createHandler","params","definedRoutes","POST","GET","OPTIONS","DELETE","PATCH","PUT","HEAD","COPY","LOCK","MKCOL","MOVE","PROPFIND","PROPPATCH","SEARCH","TRACE","UNLOCK","throwOnDefinedRoute","path","options","find","includes","console","WebinyError","override","addDefinedRoute","push","fastify","bodyLimit","disableRequestLogging","addHook","route","method","m","register","fastifyCookie","parseOptions","fastifyCompress","global","threshold","onUnsupportedEncoding","encoding","_","inflateIfDeflated","defined","onPost","handler","post","onGet","get","onOptions","onDelete","delete","onPatch","patch","onPut","put","onAll","onHead","head","context","PluginsContainer","createHandlerClient","merge","Context","WEBINY_VERSION","ex","decorate","isOptionsRequest","defaultHeaders","initialHeaders","HandlerOnRequestPlugin","result","exec","sent","explanation","send","hijack","ContextPlugin","apply","BeforeHandlerPlugin","preSerialization","__","payload","HandlerResultPlugin","handle","setErrorHandler","status","HandlerErrorPlugin","middleware","map","pl","next","benchmark","output","modifyPlugins","ModifyFastifyPlugin","modifyFastifyPluginName","routePlugins","RoutePlugin","routePluginName","cb","exports"],"sources":["fastify.ts"],"sourcesContent":["import { PluginCollection, PluginsContainer } from \"@webiny/plugins/types\";\nimport fastify, {\n FastifyInstance,\n FastifyServerOptions as ServerOptions,\n preSerializationAsyncHookHandler\n} from \"fastify\";\nimport { getWebinyVersionHeaders, middleware, MiddlewareCallable } from \"@webiny/utils\";\nimport {\n ContextRoutes,\n DefinedContextRoutes,\n HTTPMethods,\n Reply,\n Request,\n RouteMethodOptions\n} from \"~/types\";\nimport { Context } from \"~/Context\";\nimport WebinyError from \"@webiny/error\";\nimport { RoutePlugin } from \"./plugins/RoutePlugin\";\nimport { createHandlerClient } from \"@webiny/handler-client\";\nimport fastifyCookie from \"@fastify/cookie\";\nimport fastifyCompress from \"@fastify/compress\";\nimport { ContextPlugin } from \"@webiny/api\";\nimport { BeforeHandlerPlugin } from \"./plugins/BeforeHandlerPlugin\";\nimport { HandlerResultPlugin } from \"./plugins/HandlerResultPlugin\";\nimport { HandlerErrorPlugin } from \"./plugins/HandlerErrorPlugin\";\nimport { ModifyFastifyPlugin } from \"~/plugins/ModifyFastifyPlugin\";\nimport { HandlerOnRequestPlugin } from \"~/plugins/HandlerOnRequestPlugin\";\nimport { ResponseHeaders } from \"~/ResponseHeaders\";\nimport { ModifyResponseHeadersPlugin } from \"~/plugins/ModifyResponseHeadersPlugin\";\n\nfunction createDefaultHeaders() {\n return ResponseHeaders.create({\n \"content-type\": \"application/json; charset=utf-8\",\n \"cache-control\": \"no-store\",\n \"access-control-allow-origin\": \"*\",\n \"access-control-allow-headers\": \"*\",\n \"access-control-allow-methods\": \"OPTIONS,POST,GET,DELETE,PUT,PATCH\",\n ...getWebinyVersionHeaders()\n });\n}\n\nconst getDefaultOptionsHeaders = () => {\n return ResponseHeaders.create({\n \"access-control-max-age\": \"86400\",\n \"cache-control\": \"public, max-age=86400\"\n });\n};\n\nconst getDefaultHeaders = (routes: DefinedContextRoutes): ResponseHeaders => {\n const headers = createDefaultHeaders();\n\n /**\n * If we are accepting all headers, just output that one.\n */\n const keys = Object.keys(routes) as HTTPMethods[];\n const all = keys.every(key => routes[key].length > 0);\n if (all) {\n headers.set(\"access-control-allow-methods\", \"*\");\n } else {\n const allowedMethods = keys\n .filter(type => {\n if (!routes[type] || !Array.isArray(routes[type])) {\n return false;\n }\n return routes[type].length > 0;\n })\n .sort()\n .join(\",\");\n\n headers.set(\"access-control-allow-methods\", allowedMethods);\n }\n\n return headers;\n};\n\ninterface CustomError extends Error {\n code?: string;\n data?: Record<string, any>;\n}\n\nconst stringifyError = (error: CustomError) => {\n const { name, message, code, stack, data } = error;\n return JSON.stringify({\n ...error,\n constructorName: error.constructor?.name || \"UnknownError\",\n name: name || \"No error name\",\n message: message || \"No error message\",\n code: code || \"NO_CODE\",\n data,\n stack: process.env.DEBUG === \"true\" ? stack : \"Turn on the debug flag to see the stack.\"\n });\n};\n\nconst modifyResponseHeaders = (app: FastifyInstance, request: Request, reply: Reply) => {\n const modifyHeaders = app.webiny.plugins.byType<ModifyResponseHeadersPlugin>(\n ModifyResponseHeadersPlugin.type\n );\n\n const headers = ResponseHeaders.create(reply.getHeaders());\n\n modifyHeaders.forEach(plugin => {\n plugin.modify(request, headers);\n });\n\n reply.headers(headers.getHeaders());\n};\n\nexport interface CreateHandlerParams {\n plugins: PluginCollection | PluginsContainer;\n options?: ServerOptions;\n debug?: boolean;\n}\n\nexport const createHandler = (params: CreateHandlerParams) => {\n const definedRoutes: DefinedContextRoutes = {\n POST: [],\n GET: [],\n OPTIONS: [],\n DELETE: [],\n PATCH: [],\n PUT: [],\n HEAD: [],\n COPY: [],\n LOCK: [],\n MKCOL: [],\n MOVE: [],\n PROPFIND: [],\n PROPPATCH: [],\n SEARCH: [],\n TRACE: [],\n UNLOCK: []\n };\n\n const throwOnDefinedRoute = (\n type: HTTPMethods | \"ALL\",\n path: string,\n options?: RouteMethodOptions\n ): void => {\n if (type === \"ALL\") {\n const all = Object.keys(definedRoutes).find(key => {\n const routes = definedRoutes[key as HTTPMethods];\n return routes.includes(path);\n });\n if (!all) {\n return;\n }\n console.error(\n `Error while registering onAll route. One of the routes is already defined.`\n );\n console.error(JSON.stringify(all));\n throw new WebinyError(\n `You cannot override a route with onAll() method, please remove unnecessary route from the system.`,\n \"OVERRIDE_ROUTE_ERROR\",\n {\n type,\n path\n }\n );\n } else if (definedRoutes[type].includes(path) === false) {\n return;\n } else if (options?.override === true) {\n return;\n }\n console.error(`Error while trying to override route: [${type}] ${path}`);\n throw new WebinyError(\n `When you are trying to override existing route, you must send \"override\" parameter when adding that route.`,\n \"OVERRIDE_ROUTE_ERROR\",\n {\n type,\n path\n }\n );\n };\n\n const addDefinedRoute = (type: HTTPMethods, path: string): void => {\n if (!definedRoutes[type]) {\n return;\n } else if (definedRoutes[type].includes(path)) {\n return;\n }\n definedRoutes[type].push(path);\n };\n\n /**\n * We must attach the server to our internal context if we want to have it accessible.\n */\n const app = fastify({\n bodyLimit: 536870912, // 512MB\n disableRequestLogging: true,\n ...(params.options || {})\n });\n\n /**\n * We need to register routes in our system so we can output headers later on and dissallow overriding routes.\n */\n app.addHook(\"onRoute\", route => {\n const method = route.method;\n if (Array.isArray(method)) {\n for (const m of method) {\n addDefinedRoute(m, route.path);\n }\n return;\n }\n addDefinedRoute(method, route.path);\n });\n /**\n * ############################\n * Register the Fastify plugins.\n */\n /**\n * Package @fastify/cookie\n *\n * https://github.com/fastify/fastify-cookie\n */\n app.register(fastifyCookie, {\n parseOptions: {} // options for parsing cookies\n });\n /**\n * Package @fastify/compress\n *\n * https://github.com/fastify/fastify-compress\n */\n app.register(fastifyCompress, {\n global: true,\n threshold: 1024,\n onUnsupportedEncoding: (encoding, _, reply) => {\n reply.code(406);\n return `We do not support the ${encoding} encoding.`;\n },\n inflateIfDeflated: true\n });\n /**\n * Route helpers - mostly for users.\n */\n const routes: ContextRoutes = {\n defined: definedRoutes,\n onPost: (path, handler, options) => {\n throwOnDefinedRoute(\"POST\", path, options);\n app.post(path, handler);\n },\n onGet: (path, handler, options) => {\n throwOnDefinedRoute(\"GET\", path, options);\n app.get(path, handler);\n },\n onOptions: (path, handler, options) => {\n throwOnDefinedRoute(\"OPTIONS\", path, options);\n app.options(path, handler);\n },\n onDelete: (path, handler, options) => {\n throwOnDefinedRoute(\"DELETE\", path, options);\n app.delete(path, handler);\n },\n onPatch: (path, handler, options) => {\n throwOnDefinedRoute(\"PATCH\", path, options);\n app.patch(path, handler);\n },\n onPut: (path, handler, options) => {\n throwOnDefinedRoute(\"PUT\", path, options);\n app.put(path, handler);\n },\n onAll: (path, handler, options) => {\n throwOnDefinedRoute(\"ALL\", path, options);\n app.all(path, handler);\n },\n onHead: (path, handler, options) => {\n throwOnDefinedRoute(\"HEAD\", path, options);\n app.head(path, handler);\n }\n };\n let context: Context;\n\n const plugins = new PluginsContainer([\n /**\n * We must have handlerClient by default.\n * And it must be one of the first context plugins applied.\n */\n createHandlerClient()\n ]);\n plugins.merge(params.plugins || []);\n\n try {\n context = new Context({\n plugins,\n /**\n * Inserted via webpack at build time.\n */\n WEBINY_VERSION: process.env.WEBINY_VERSION as string,\n routes\n });\n } catch (ex) {\n console.error(`Error while constructing the Context.`);\n console.error(stringifyError(ex));\n throw ex;\n }\n\n /**\n * We are attaching our custom context to webiny variable on the fastify app, so it is accessible everywhere.\n */\n app.decorate(\"webiny\", context);\n\n /**\n * On every request we add default headers, which can be changed later.\n * Also, if it is an options request, we skip everything after this hook and output options headers.\n */\n app.addHook(\"onRequest\", async (request, reply) => {\n const isOptionsRequest = request.method === \"OPTIONS\";\n /**\n * Our default headers are always set. Users can override them.\n */\n const defaultHeaders = getDefaultHeaders(definedRoutes);\n\n const initialHeaders = isOptionsRequest\n ? defaultHeaders.merge(getDefaultOptionsHeaders())\n : defaultHeaders;\n\n reply.headers(initialHeaders.getHeaders());\n /**\n * Users can define their own custom handlers for the onRequest event - so let's run them first.\n */\n const plugins = app.webiny.plugins.byType<HandlerOnRequestPlugin>(\n HandlerOnRequestPlugin.type\n );\n\n let name: string | undefined;\n try {\n for (const plugin of plugins) {\n name = plugin.name;\n const result = await plugin.exec(request, reply);\n if (result === false) {\n return;\n }\n }\n } catch (ex) {\n console.error(\n `Error while running the \"HandlerOnRequestPlugin\" ${\n name ? `(${name})` : \"\"\n } plugin in the onRequest hook.`\n );\n console.error(stringifyError(ex));\n throw ex;\n }\n /**\n * When we receive the OPTIONS request, we end it before it goes any further as there is no need for anything to run after this - at least for our use cases.\n *\n * Users can prevent this by creating their own HandlerOnRequestPlugin and returning false as the result of the callable.\n */\n if (!isOptionsRequest) {\n return;\n }\n\n if (reply.sent) {\n /**\n * At this point throwing an exception will not do anything with the response. So just log it.\n */\n console.error(\n JSON.stringify({\n message: `Output was already sent. Please check custom plugins of type \"HandlerOnRequestPlugin\".`,\n explanation:\n \"This error can happen if the user plugin ended the reply, but did not return false as response.\"\n })\n );\n return;\n }\n\n modifyResponseHeaders(app, request, reply);\n\n reply.code(204).send(\"\").hijack();\n });\n\n app.addHook(\"preParsing\", async (request, reply) => {\n app.webiny.request = request;\n app.webiny.reply = reply;\n const plugins = app.webiny.plugins.byType<ContextPlugin>(ContextPlugin.type);\n let name: string | undefined;\n try {\n for (const plugin of plugins) {\n name = plugin.name;\n await plugin.apply(app.webiny);\n }\n } catch (ex) {\n console.error(\n `Error while running the \"ContextPlugin\" ${\n name ? `(${name})` : \"\"\n } plugin in the preParsing hook.`\n );\n console.error(stringifyError(ex));\n throw ex;\n }\n });\n /**\n *\n */\n app.addHook(\"preHandler\", async () => {\n const plugins = app.webiny.plugins.byType<BeforeHandlerPlugin>(BeforeHandlerPlugin.type);\n let name: string | undefined;\n try {\n for (const plugin of plugins) {\n name = plugin.name;\n await plugin.apply(app.webiny);\n }\n } catch (ex) {\n console.error(\n `Error while running the \"BeforeHandlerPlugin\" ${\n name ? `(${name})` : \"\"\n } plugin in the preHandler hook.`\n );\n console.error(stringifyError(ex));\n throw ex;\n }\n });\n\n /**\n *\n */\n const preSerialization: preSerializationAsyncHookHandler<any> = async (_, __, payload) => {\n const plugins = app.webiny.plugins.byType<HandlerResultPlugin>(HandlerResultPlugin.type);\n let name: string | undefined;\n try {\n for (const plugin of plugins) {\n name = plugin.name;\n await plugin.handle(app.webiny, payload);\n }\n } catch (ex) {\n console.error(\n `Error while running the \"HandlerResultPlugin\" ${\n name ? `(${name})` : \"\"\n } plugin in the preSerialization hook.`\n );\n console.error(stringifyError(ex));\n throw ex;\n }\n return payload;\n };\n\n app.addHook(\"preSerialization\", preSerialization);\n\n app.setErrorHandler<WebinyError>(async (error, request, reply) => {\n return reply\n .status(500)\n .headers({\n \"Cache-Control\": \"no-store\"\n })\n .send(\n /**\n * When we are sending the error in the response, we cannot send the whole error object, as it might contain some sensitive data.\n */\n JSON.stringify({\n message: error.message,\n code: error.code,\n data: error.data\n })\n );\n });\n\n app.addHook(\"onError\", async (_, reply, error: any) => {\n const plugins = app.webiny.plugins.byType<HandlerErrorPlugin>(HandlerErrorPlugin.type);\n /**\n * Log error to cloud, as these can be extremely annoying to debug!\n */\n console.error(\"@webiny/handler\");\n console.error(stringifyError(error));\n\n reply\n .status(500)\n .headers({\n \"Cache-Control\": \"no-store\"\n })\n .send(\n /**\n * When we are sending the error in the response, we cannot send the whole error object, as it might contain some sensitive data.\n */\n JSON.stringify({\n message: error.message,\n code: error.code,\n data: error.data\n })\n );\n\n const handler = middleware(\n plugins.map(pl => {\n return (context: Context, error: Error, next: MiddlewareCallable) => {\n return pl.handle(context, error, next);\n };\n })\n );\n await handler(app.webiny, error);\n\n return reply;\n });\n\n /**\n * Apply response headers modifier plugins.\n */\n app.addHook(\"onSend\", async (request, reply, payload) => {\n modifyResponseHeaders(app, request, reply);\n\n return payload;\n });\n\n /**\n * We need to output the benchmark results at the end of the request in both response and timeout cases\n */\n app.addHook(\"onResponse\", async () => {\n await context.benchmark.output();\n });\n\n app.addHook(\"onTimeout\", async () => {\n await context.benchmark.output();\n });\n\n /**\n * With these plugins we give users possibility to do anything they want on our fastify instance.\n */\n const modifyPlugins = app.webiny.plugins.byType<ModifyFastifyPlugin>(ModifyFastifyPlugin.type);\n\n let modifyFastifyPluginName: string | undefined;\n try {\n for (const plugin of modifyPlugins) {\n modifyFastifyPluginName = plugin.name;\n plugin.modify(app);\n }\n } catch (ex) {\n console.error(\n `Error while running the \"ModifyFastifyPlugin\" ${\n modifyFastifyPluginName ? `(${modifyFastifyPluginName})` : \"\"\n } plugin in the end of the \"createHandler\" callable.`\n );\n console.error(stringifyError(ex));\n throw ex;\n }\n\n /**\n * We have few types of triggers:\n * * Events - EventPlugin\n * * Routes - RoutePlugin\n *\n * Routes are registered in fastify but events must be handled in package which implements cloud specific methods.\n */\n const routePlugins = app.webiny.plugins.byType<RoutePlugin>(RoutePlugin.type);\n\n /**\n * Add routes to the system.\n */\n let routePluginName: string | undefined;\n try {\n for (const plugin of routePlugins) {\n routePluginName = plugin.name;\n plugin.cb({\n ...app.webiny.routes,\n context: app.webiny\n });\n }\n } catch (ex) {\n console.error(\n `Error while running the \"RoutePlugin\" ${\n routePluginName ? `(${routePluginName})` : \"\"\n } plugin in the beginning of the \"createHandler\" callable.`\n );\n console.error(stringifyError(ex));\n throw ex;\n }\n\n return app;\n};\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAC,sBAAA,CAAAF,OAAA;AAKA,IAAAG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C;IACtB;EACJ,CAAC,CAAC,OAAOgF,EAAE,EAAE;IACT5C,OAAO,CAAClD,KAAK,CACT,iDACI6H,uBAAuB,GAAG,IAAIA,uBAAuB,GAAG,GAAG,EAAE,qDAErE,CAAC;IACD3E,OAAO,CAAClD,KAAK,CAACD,cAAc,CAAC+F,EAAE,CAAC,CAAC;IACjC,MAAMA,EAAE;EACZ;;EAEA;AACJ;AACA;AACA;AACA;AACA;AACA;EACI,MAAMgC,YAAY,GAAGhH,GAAG,CAACI,MAAM,CAACC,OAAO,CAACC,MAAM,CAAc2G,wBAAW,CAACrI,IAAI,CAAC;;EAE7E;AACJ;AACA;EACI,IAAIsI,eAAmC;EACvC,IAAI;IACA,KAAK,MAAMxG,MAAM,IAAIsG,YAAY,EAAE;MAC/BE,eAAe,GAAGxG,MAAM,CAACvB,IAAI;MAC7BuB,MAAM,CAACyG,EAAE,CAAC;QACN,GAAGnH,GAAG,CAACI,MAAM,CAACnC,MAAM;QACpByG,OAAO,EAAE1E,GAAG,CAACI;MACjB,CAAC,CAAC;IACN;EACJ,CAAC,CAAC,OAAO4E,EAAE,EAAE;IACT5C,OAAO,CAAClD,KAAK,CACT,yCACIgI,eAAe,GAAG,IAAIA,eAAe,GAAG,GAAG,EAAE,2DAErD,CAAC;IACD9E,OAAO,CAAClD,KAAK,CAACD,cAAc,CAAC+F,EAAE,CAAC,CAAC;IACjC,MAAMA,EAAE;EACZ;EAEA,OAAOhF,GAAG;AACd,CAAC;AAACoH,OAAA,CAAAxG,aAAA,GAAAA,aAAA","ignoreList":[]}
package/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import "./suppressPunycodeWarnings";
1
2
  export * from "./fastify";
2
3
  export * from "./Context";
3
4
  export * from "./ResponseHeaders";
package/index.js CHANGED
@@ -3,6 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
+ require("./suppressPunycodeWarnings");
6
7
  var _fastify = require("./fastify");
7
8
  Object.keys(_fastify).forEach(function (key) {
8
9
  if (key === "default" || key === "__esModule") return;
package/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"names":["_fastify","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get","_Context","_ResponseHeaders","_EventPlugin","_RoutePlugin","_BeforeHandlerPlugin","_HandlerErrorPlugin","_HandlerResultPlugin","_HandlerOnRequestPlugin","_ModifyFastifyPlugin","_ModifyResponseHeadersPlugin"],"sources":["index.ts"],"sourcesContent":["export * from \"~/fastify\";\nexport * from \"~/Context\";\nexport * from \"~/ResponseHeaders\";\nexport * from \"~/plugins/EventPlugin\";\nexport * from \"~/plugins/RoutePlugin\";\nexport * from \"~/plugins/BeforeHandlerPlugin\";\nexport * from \"~/plugins/HandlerErrorPlugin\";\nexport * from \"~/plugins/HandlerResultPlugin\";\nexport * from \"~/plugins/HandlerOnRequestPlugin\";\nexport * from \"~/plugins/ModifyFastifyPlugin\";\nexport * from \"~/plugins/ModifyResponseHeadersPlugin\";\nexport * from \"./ResponseHeaders\";\n"],"mappings":";;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,QAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,QAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAT,QAAA,CAAAK,GAAA;IAAA;EAAA;AAAA;AACA,IAAAK,QAAA,GAAAT,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAO,QAAA,EAAAN,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAK,QAAA,CAAAL,GAAA;EAAAH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AA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAY,uBAAA,CAAAZ,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAQ,uBAAA,CAAAZ,GAAA;IAAA;EAAA;AAAA;AACA,IAAAa,oBAAA,GAAAjB,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAe,oBAAA,EAAAd,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAa,oBAAA,CAAAb,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAS,oBAAA,CAAAb,GAAA;IAAA;EAAA;AAAA;AACA,IAAAc,4BAAA,GAAAlB,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAgB,4BAAA,EAAAf,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAc,4BAAA,CAAAd,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAU,4BAAA,CAAAd,GAAA;IAAA;EAAA;AAAA","ignoreList":[]}
1
+ {"version":3,"names":["require","_fastify","Object","keys","forEach","key","exports","defineProperty","enumerable","get","_Context","_ResponseHeaders","_EventPlugin","_RoutePlugin","_BeforeHandlerPlugin","_HandlerErrorPlugin","_HandlerResultPlugin","_HandlerOnRequestPlugin","_ModifyFastifyPlugin","_ModifyResponseHeadersPlugin"],"sources":["index.ts"],"sourcesContent":["// Suppress punycode warnings. This is a known issue which we can't fix.\nimport \"./suppressPunycodeWarnings\";\n\nexport * from \"~/fastify\";\nexport * from \"~/Context\";\nexport * from \"~/ResponseHeaders\";\nexport * from \"~/plugins/EventPlugin\";\nexport * from \"~/plugins/RoutePlugin\";\nexport * from \"~/plugins/BeforeHandlerPlugin\";\nexport * from \"~/plugins/HandlerErrorPlugin\";\nexport * from \"~/plugins/HandlerResultPlugin\";\nexport * from \"~/plugins/HandlerOnRequestPlugin\";\nexport * from \"~/plugins/ModifyFastifyPlugin\";\nexport * from \"~/plugins/ModifyResponseHeadersPlugin\";\nexport * from \"./ResponseHeaders\";\n"],"mappings":";;;;;AACAA,OAAA;AAEA,IAAAC,QAAA,GAAAD,OAAA;AAAAE,MAAA,CAAAC,IAAA,CAAAF,QAAA,EAAAG,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAJ,QAAA,CAAAI,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAR,QAAA,CAAAI,GAAA;IAAA;EAAA;AAAA;AACA,IAAAK,QAAA,GAAAV,OAAA;AAAAE,MAAA,CAAAC,IAAA,CAAAO,QAAA,EAAAN,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAK,QAAA,CAAAL,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAC,QAAA,CAAAL,GAAA;IAAA;EAAA;AAAA;AACA,IAAAM,gBAAA,GAAAX,OAAA;AASAE,MAAA,CAAAC,IAAA,CAAAQ,gBAAA,EAAAP,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBA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AAAAE,MAAA,CAAAC,IAAA,CAAAe,oBAAA,EAAAd,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAa,oBAAA,CAAAb,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAS,oBAAA,CAAAb,GAAA;IAAA;EAAA;AAAA;AACA,IAAAc,4BAAA,GAAAnB,OAAA;AAAAE,MAAA,CAAAC,IAAA,CAAAgB,4BAAA,EAAAf,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAc,4BAAA,CAAAd,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAU,4BAAA,CAAAd,GAAA;IAAA;EAAA;AAAA","ignoreList":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webiny/handler",
3
- "version": "5.41.4",
3
+ "version": "5.42.0-beta.1",
4
4
  "main": "index.js",
5
5
  "repository": {
6
6
  "type": "git",
@@ -12,24 +12,19 @@
12
12
  ],
13
13
  "license": "MIT",
14
14
  "dependencies": {
15
- "@babel/runtime": "7.24.1",
16
15
  "@fastify/compress": "6.2.0",
17
16
  "@fastify/cookie": "8.3.0",
18
- "@webiny/api": "5.41.4",
19
- "@webiny/error": "5.41.4",
20
- "@webiny/handler-client": "5.41.4",
21
- "@webiny/plugins": "5.41.4",
22
- "@webiny/utils": "5.41.4",
23
- "fastify": "4.11.0"
17
+ "@webiny/api": "5.42.0-beta.1",
18
+ "@webiny/error": "5.42.0-beta.1",
19
+ "@webiny/handler-client": "5.42.0-beta.1",
20
+ "@webiny/plugins": "5.42.0-beta.1",
21
+ "@webiny/utils": "5.42.0-beta.1",
22
+ "fastify": "4.15.0"
24
23
  },
25
24
  "devDependencies": {
26
- "@babel/cli": "7.24.1",
27
- "@babel/core": "7.24.3",
28
- "@babel/preset-env": "7.24.3",
29
- "@babel/preset-typescript": "7.24.1",
30
- "@webiny/cli": "5.41.4",
31
- "@webiny/project-utils": "5.41.4",
32
- "rimraf": "5.0.5",
25
+ "@webiny/cli": "5.42.0-beta.1",
26
+ "@webiny/project-utils": "5.42.0-beta.1",
27
+ "rimraf": "6.0.1",
33
28
  "ttypescript": "1.5.15",
34
29
  "typescript": "4.9.5"
35
30
  },
@@ -41,5 +36,5 @@
41
36
  "build": "yarn webiny run build",
42
37
  "watch": "yarn webiny run watch"
43
38
  },
44
- "gitHead": "94922b33af59db5afe75127bb07443ce7f1448c4"
39
+ "gitHead": "5e69da579efa4f2c8268e0c97ac6407ddc3f5f07"
45
40
  }
@@ -1 +1 @@
1
- {"version":3,"names":["_plugins","require","BeforeHandlerPlugin","Plugin","type","constructor","callable","_callable","apply","context","Error","exports","createBeforeHandlerPlugin"],"sources":["BeforeHandlerPlugin.ts"],"sourcesContent":["import { Plugin } from \"@webiny/plugins\";\nimport { Context } from \"~/types\";\n\nexport interface BeforeHandlerCallable<T extends Context = Context> {\n (context: T): void | Promise<void>;\n}\n\nexport class BeforeHandlerPlugin<T extends Context = Context> extends Plugin {\n public static override readonly type: string = \"before-handler\";\n private readonly _callable: BeforeHandlerCallable<T>;\n\n constructor(callable: BeforeHandlerCallable<T>) {\n super();\n this._callable = callable;\n }\n\n public async apply(context: T): Promise<void> {\n if (typeof this._callable !== \"function\") {\n throw Error(\n `Missing callable in BeforeHandlerPlugin! Either pass a callable to plugin constructor or extend the plugin and override the \"apply\" method.`\n );\n }\n\n return this._callable(context);\n }\n}\n\nexport const createBeforeHandlerPlugin = <T extends Context = Context>(\n callable: BeforeHandlerCallable<T>\n): BeforeHandlerPlugin<T> => {\n return new BeforeHandlerPlugin<T>(callable);\n};\n"],"mappings":";;;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AAOO,MAAMC,mBAAmB,SAAsCC,eAAM,CAAC;EACzE,OAAgCC,IAAI,GAAW,gBAAgB;EAG/DC,WAAWA,CAACC,QAAkC,EAAE;IAC5C,KAAK,CAAC,CAAC;IACP,IAAI,CAACC,SAAS,GAAGD,QAAQ;EAC7B;EAEA,MAAaE,KAAKA,CAACC,OAAU,EAAiB;IAC1C,IAAI,OAAO,IAAI,CAACF,SAAS,KAAK,UAAU,EAAE;MACtC,MAAMG,KAAK,CACN,6IACL,CAAC;IACL;IAEA,OAAO,IAAI,CAACH,SAAS,CAACE,OAAO,CAAC;EAClC;AACJ;AAACE,OAAA,CAAAT,mBAAA,GAAAA,mBAAA;AAEM,MAAMU,yBAAyB,GAClCN,QAAkC,IACT;EACzB,OAAO,IAAIJ,mBAAmB,CAAII,QAAQ,CAAC;AAC/C,CAAC;AAACK,OAAA,CAAAC,yBAAA,GAAAA,yBAAA","ignoreList":[]}
1
+ {"version":3,"names":["_plugins","require","BeforeHandlerPlugin","Plugin","type","constructor","callable","_callable","apply","context","Error","exports","createBeforeHandlerPlugin"],"sources":["BeforeHandlerPlugin.ts"],"sourcesContent":["import { Plugin } from \"@webiny/plugins\";\nimport { Context } from \"~/types\";\n\nexport interface BeforeHandlerCallable<T extends Context = Context> {\n (context: T): void | Promise<void>;\n}\n\nexport class BeforeHandlerPlugin<T extends Context = Context> extends Plugin {\n public static override readonly type: string = \"before-handler\";\n private readonly _callable: BeforeHandlerCallable<T>;\n\n constructor(callable: BeforeHandlerCallable<T>) {\n super();\n this._callable = callable;\n }\n\n public async apply(context: T): Promise<void> {\n if (typeof this._callable !== \"function\") {\n throw Error(\n `Missing callable in BeforeHandlerPlugin! Either pass a callable to plugin constructor or extend the plugin and override the \"apply\" method.`\n );\n }\n\n return this._callable(context);\n }\n}\n\nexport const createBeforeHandlerPlugin = <T extends Context = Context>(\n callable: BeforeHandlerCallable<T>\n): BeforeHandlerPlugin<T> => {\n return new BeforeHandlerPlugin<T>(callable);\n};\n"],"mappings":";;;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AAOO,MAAMC,mBAAmB,SAAsCC,eAAM,CAAC;EACzE,OAAgCC,IAAI,GAAW,gBAAgB;EAG/DC,WAAWA,CAACC,QAAkC,EAAE;IAC5C,KAAK,CAAC,CAAC;IACP,IAAI,CAACC,SAAS,GAAGD,QAAQ;EAC7B;EAEA,MAAaE,KAAKA,CAACC,OAAU,EAAiB;IAC1C,IAAI,OAAO,IAAI,CAACF,SAAS,KAAK,UAAU,EAAE;MACtC,MAAMG,KAAK,CACP,6IACJ,CAAC;IACL;IAEA,OAAO,IAAI,CAACH,SAAS,CAACE,OAAO,CAAC;EAClC;AACJ;AAACE,OAAA,CAAAT,mBAAA,GAAAA,mBAAA;AAEM,MAAMU,yBAAyB,GAClCN,QAAkC,IACT;EACzB,OAAO,IAAIJ,mBAAmB,CAAII,QAAQ,CAAC;AAC/C,CAAC;AAACK,OAAA,CAAAC,yBAAA,GAAAA,yBAAA","ignoreList":[]}
@@ -0,0 +1,4 @@
1
+ declare const originalConsoleError: {
2
+ (...data: any[]): void;
3
+ (message?: any, ...optionalParams: any[]): void;
4
+ };
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+
3
+ const originalConsoleError = console.error;
4
+ console.error = (message, ...args) => {
5
+ if (typeof message === "string" && message.includes("punycode")) {
6
+ return;
7
+ }
8
+ originalConsoleError.call(console, message, ...args);
9
+ };
10
+
11
+ //# sourceMappingURL=suppressPunycodeWarnings.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["originalConsoleError","console","error","message","args","includes","call"],"sources":["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"],"mappings":";;AAAA,MAAMA,oBAAoB,GAAGC,OAAO,CAACC,KAAK;AAC1CD,OAAO,CAACC,KAAK,GAAG,CAACC,OAAO,EAAE,GAAGC,IAAI,KAAK;EAClC,IAAI,OAAOD,OAAO,KAAK,QAAQ,IAAIA,OAAO,CAACE,QAAQ,CAAC,UAAU,CAAC,EAAE;IAC7D;EACJ;EACAL,oBAAoB,CAACM,IAAI,CAACL,OAAO,EAAEE,OAAO,EAAE,GAAGC,IAAI,CAAC;AACxD,CAAC","ignoreList":[]}