@3sixty/api-server-fastify 0.20.0-next.0 → 0.20.0-next.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/dist/es/fastifySocketIo.js.map +1 -1
- package/dist/es/fastifyWebServer.js +67 -580
- package/dist/es/fastifyWebServer.js.map +1 -1
- package/dist/es/index.js.map +1 -1
- package/dist/es/models/IFastifyWebServerConfig.js.map +1 -1
- package/dist/es/models/IFastifyWebServerConstructorOptions.js.map +1 -1
- package/dist/types/fastifyWebServer.d.ts +31 -16
- package/dist/types/models/IFastifyWebServerConfig.d.ts +5 -2
- package/docs/changelog.md +21 -0
- package/docs/reference/classes/FastifyWebServer.md +671 -40
- package/docs/reference/interfaces/IFastifyWebServerConfig.md +8 -2
- package/locales/.validate-ignore +1 -3
- package/locales/en.json +1 -22
- package/package.json +9 -10
- package/dist/es/models/IRestProcessorChains.js +0 -2
- package/dist/es/models/IRestProcessorChains.js.map +0 -1
- package/dist/es/models/ISocketProcessorChains.js +0 -2
- package/dist/es/models/ISocketProcessorChains.js.map +0 -1
- package/dist/types/models/IRestProcessorChains.d.ts +0 -18
- package/dist/types/models/ISocketProcessorChains.d.ts +0 -26
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fastifySocketIo.js","
|
|
1
|
+
{"version":3,"file":"fastifySocketIo.js","sources":["../../src/fastifySocketIo.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAChC,OAAO,EAAE,MAAM,EAAsB,MAAM,WAAW,CAAC;AAEvD;;;GAGG;AACH,MAAM,eAAe,GAA+C,EAAE,CACrE,KAAK,EAAE,OAAwB,EAAE,IAA4B,EAAE,EAAE;IAChE,MAAM,QAAQ,GAAG,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;IAElD,OAAO,CAAC,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;IACjC,OAAO,CAAC,OAAO,CAAC,UAAU,EAAE,KAAK,IAAI,EAAE;QACtC,QAAQ,CAAC,iBAAiB,EAAE,CAAC;QAE7B,MAAM,QAAQ,CAAC,KAAK,EAAE,CAAC;IACxB,CAAC,CAAC,CAAC;AACJ,CAAC,EACD,EAAE,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,WAAW,EAAE,CACzC,CAAC;AAEF,eAAe,eAAe,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { FastifyInstance, FastifyPluginAsync } from \"fastify\";\nimport fp from \"fastify-plugin\";\nimport { Server, type ServerOptions } from \"socket.io\";\n\n/**\n * Fastify plugin that attaches a Socket.IO server to the Fastify HTTP server.\n * Cloned from fastify-socket.io to support recent Fastify versions.\n */\nconst fastifySocketIO: FastifyPluginAsync<Partial<ServerOptions>> = fp(\n\tasync (fastify: FastifyInstance, opts: Partial<ServerOptions>) => {\n\t\tconst ioServer = new Server(fastify.server, opts);\n\n\t\tfastify.decorate(\"io\", ioServer);\n\t\tfastify.addHook(\"preClose\", async () => {\n\t\t\tioServer.disconnectSockets();\n\n\t\t\tawait ioServer.close();\n\t\t});\n\t},\n\t{ fastify: \">=5.x.x\", name: \"socket.io\" }\n);\n\nexport default fastifySocketIO;\n"]}
|