openportal 0.1.0 → 0.1.2

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 (248) hide show
  1. package/package.json +10 -4
  2. package/web/.next/static/XI6khKkj1If5Kb4-eJQ2z/_buildManifest.js +27 -0
  3. package/web/.next/static/chunks/{d3520c0622de77ff.js → 35cc9dbdc670c73c.js} +4 -4
  4. package/web/.next/static/chunks/4147ffc67a7b837c.css +1 -0
  5. package/web/.next/static/chunks/{21ab2574b84ad2d1.js → 52b90bc1740162c2.js} +2 -2
  6. package/web/.next/static/chunks/{688448a61fbd7d50.js → 8644d68bf325ff24.js} +4 -4
  7. package/web/.next/static/chunks/{c2c14edbf40dd531.js → 8f80b41262ef70b6.js} +1 -1
  8. package/web/.next/static/chunks/{03e1846335a31354.js → 9865709466b09f79.js} +3 -3
  9. package/web/.next/static/chunks/{d091e73f46572c38.js → 9ba9a5774c9421bd.js} +3 -3
  10. package/web/.next/static/chunks/{c617a4c7a78d4946.js → aebf799dac29fe08.js} +2 -2
  11. package/web/.next/static/chunks/{6ed981794a42d949.js → b5caad256518cb33.js} +3 -3
  12. package/web/.next/static/chunks/{turbopack-bc49f2e78bf92fdb.js → turbopack-26af71e419c11487.js} +1 -1
  13. package/web/.next/static/chunks/{turbopack-b3b62a2520d01d7e.js → turbopack-4ad0df7330c00c8d.js} +1 -1
  14. package/web/.next/static/chunks/{turbopack-03c9848eaf268db1.js → turbopack-8e653f3ad3a8ed18.js} +1 -1
  15. package/web/.next/static/chunks/{turbopack-d90c5e114da5fc51.js → turbopack-92c911b9efda2756.js} +1 -1
  16. package/web/.next/static/chunks/{turbopack-ededbd49a3a234ea.js → turbopack-d5098189d63fd7b8.js} +1 -1
  17. package/web/apps/web/.next/BUILD_ID +1 -1
  18. package/web/apps/web/.next/build-manifest.json +18 -28
  19. package/web/apps/web/.next/required-server-files.json +1 -1
  20. package/web/apps/web/.next/routes-manifest.json +0 -12
  21. package/web/apps/web/.next/server/chunks/[root-of-the-server]__f366ca98._.js +358 -0
  22. package/web/apps/web/.next/server/chunks/ssr/{[root-of-the-server]__dfeaf8cf._.js → [root-of-the-server]__1a54ba1e._.js} +3 -3
  23. package/web/apps/web/.next/server/middleware-build-manifest.js +16 -26
  24. package/web/apps/web/.next/server/next-font-manifest.js +1 -1
  25. package/web/apps/web/.next/server/next-font-manifest.json +0 -4
  26. package/web/apps/web/.next/server/pages/404.html +1 -1
  27. package/web/apps/web/.next/server/pages/500.html +1 -1
  28. package/web/apps/web/.next/server/pages/_app/build-manifest.json +4 -4
  29. package/web/apps/web/.next/server/pages/_app/client-build-manifest.json +1 -1
  30. package/web/apps/web/.next/server/pages/_error/build-manifest.json +2 -2
  31. package/web/apps/web/.next/server/pages/_error/client-build-manifest.json +1 -1
  32. package/web/apps/web/.next/server/pages/api/[[...slugs]].js +1 -2
  33. package/web/apps/web/.next/server/pages/api/[[...slugs]].js.nft.json +1 -1
  34. package/web/apps/web/.next/server/pages/index/build-manifest.json +3 -3
  35. package/web/apps/web/.next/server/pages/index/client-build-manifest.json +1 -1
  36. package/web/apps/web/.next/server/pages/index.html +1 -1
  37. package/web/apps/web/.next/server/pages/index.js.nft.json +1 -1
  38. package/web/apps/web/.next/server/pages/session/[id]/build-manifest.json +4 -4
  39. package/web/apps/web/.next/server/pages/session/[id]/client-build-manifest.json +1 -1
  40. package/web/apps/web/.next/server/pages/session/[id].html +1 -1
  41. package/web/apps/web/.next/server/pages/session/[id].js.nft.json +1 -1
  42. package/web/apps/web/.next/server/pages/settings/build-manifest.json +3 -3
  43. package/web/apps/web/.next/server/pages/settings/client-build-manifest.json +1 -1
  44. package/web/apps/web/.next/server/pages/settings.html +1 -1
  45. package/web/apps/web/.next/server/pages/settings.js.nft.json +1 -1
  46. package/web/apps/web/.next/server/pages-manifest.json +0 -2
  47. package/web/apps/web/package.json +1 -9
  48. package/web/apps/web/server.js +1 -1
  49. package/web/.next/static/b-zSCTvx5IzLyCj7s91p4/_buildManifest.js +0 -32
  50. package/web/.next/static/chunks/04d4692d75696297.css +0 -1
  51. package/web/.next/static/chunks/553710f60e2f2b11.js +0 -1
  52. package/web/.next/static/chunks/58acbbb4090e3362.js +0 -3
  53. package/web/.next/static/chunks/6ce1e2f08f961db5.js +0 -2
  54. package/web/.next/static/chunks/e0c97552ba7a9e3d.js +0 -1
  55. package/web/.next/static/chunks/fc9c4f2dabfb4e0e.css +0 -1
  56. package/web/.next/static/chunks/fe47781ce8074a57.js +0 -10
  57. package/web/.next/static/chunks/turbopack-f44fd3803d0d6727.js +0 -3
  58. package/web/apps/web/.next/server/chunks/[root-of-the-server]__0f75905d._.js +0 -3
  59. package/web/apps/web/.next/server/chunks/[root-of-the-server]__89e85365._.js +0 -358
  60. package/web/apps/web/.next/server/chunks/[root-of-the-server]__ae1361d0._.js +0 -3
  61. package/web/apps/web/.next/server/pages/api/terminal/ws/pages-manifest.json +0 -3
  62. package/web/apps/web/.next/server/pages/api/terminal/ws.js +0 -5
  63. package/web/apps/web/.next/server/pages/api/terminal/ws.js.map +0 -5
  64. package/web/apps/web/.next/server/pages/api/terminal/ws.js.nft.json +0 -1
  65. package/web/apps/web/.next/server/pages/terminal/build-manifest.json +0 -20
  66. package/web/apps/web/.next/server/pages/terminal/client-build-manifest.json +0 -5
  67. package/web/apps/web/.next/server/pages/terminal/next-font-manifest.json +0 -11
  68. package/web/apps/web/.next/server/pages/terminal/pages-manifest.json +0 -3
  69. package/web/apps/web/.next/server/pages/terminal/react-loadable-manifest.json +0 -1
  70. package/web/apps/web/.next/server/pages/terminal.html +0 -1
  71. package/web/apps/web/.next/server/pages/terminal.js.map +0 -5
  72. package/web/apps/web/.next/server/pages/terminal.js.nft.json +0 -1
  73. package/web/node_modules/.bun/@img+colour@1.0.0/node_modules/@img/colour/color.cjs +0 -1594
  74. package/web/node_modules/.bun/@img+colour@1.0.0/node_modules/@img/colour/index.cjs +0 -1
  75. package/web/node_modules/.bun/@img+colour@1.0.0/node_modules/@img/colour/package.json +0 -45
  76. package/web/node_modules/.bun/@img+sharp-darwin-arm64@0.34.5/node_modules/@img/sharp-darwin-arm64/lib/sharp-darwin-arm64.node +0 -0
  77. package/web/node_modules/.bun/@img+sharp-darwin-arm64@0.34.5/node_modules/@img/sharp-darwin-arm64/package.json +0 -40
  78. package/web/node_modules/.bun/@img+sharp-libvips-darwin-arm64@1.2.4/node_modules/@img/sharp-libvips-darwin-arm64/README.md +0 -46
  79. package/web/node_modules/.bun/@img+sharp-libvips-darwin-arm64@1.2.4/node_modules/@img/sharp-libvips-darwin-arm64/lib/glib-2.0/include/glibconfig.h +0 -220
  80. package/web/node_modules/.bun/@img+sharp-libvips-darwin-arm64@1.2.4/node_modules/@img/sharp-libvips-darwin-arm64/lib/index.js +0 -1
  81. package/web/node_modules/.bun/@img+sharp-libvips-darwin-arm64@1.2.4/node_modules/@img/sharp-libvips-darwin-arm64/lib/libvips-cpp.8.17.3.dylib +0 -0
  82. package/web/node_modules/.bun/@img+sharp-libvips-darwin-arm64@1.2.4/node_modules/@img/sharp-libvips-darwin-arm64/package.json +0 -36
  83. package/web/node_modules/.bun/@img+sharp-libvips-darwin-arm64@1.2.4/node_modules/@img/sharp-libvips-darwin-arm64/versions.json +0 -30
  84. package/web/node_modules/.bun/@socket.io+component-emitter@3.1.2/node_modules/@socket.io/component-emitter/lib/cjs/index.js +0 -176
  85. package/web/node_modules/.bun/@socket.io+component-emitter@3.1.2/node_modules/@socket.io/component-emitter/lib/cjs/package.json +0 -4
  86. package/web/node_modules/.bun/@socket.io+component-emitter@3.1.2/node_modules/@socket.io/component-emitter/package.json +0 -28
  87. package/web/node_modules/.bun/@swc+helpers@0.5.15/node_modules/@swc/helpers/cjs/_interop_require_default.cjs +0 -6
  88. package/web/node_modules/.bun/@swc+helpers@0.5.15/node_modules/@swc/helpers/cjs/_interop_require_wildcard.cjs +0 -38
  89. package/web/node_modules/.bun/@swc+helpers@0.5.15/node_modules/@swc/helpers/esm/_check_private_redeclaration.js +0 -6
  90. package/web/node_modules/.bun/@swc+helpers@0.5.15/node_modules/@swc/helpers/esm/_class_apply_descriptor_get.js +0 -6
  91. package/web/node_modules/.bun/@swc+helpers@0.5.15/node_modules/@swc/helpers/esm/_class_apply_descriptor_set.js +0 -13
  92. package/web/node_modules/.bun/@swc+helpers@0.5.15/node_modules/@swc/helpers/esm/_class_extract_field_descriptor.js +0 -6
  93. package/web/node_modules/.bun/@swc+helpers@0.5.15/node_modules/@swc/helpers/esm/_class_private_field_get.js +0 -8
  94. package/web/node_modules/.bun/@swc+helpers@0.5.15/node_modules/@swc/helpers/esm/_class_private_field_init.js +0 -7
  95. package/web/node_modules/.bun/@swc+helpers@0.5.15/node_modules/@swc/helpers/esm/_class_private_field_set.js +0 -9
  96. package/web/node_modules/.bun/@swc+helpers@0.5.15/node_modules/@swc/helpers/package.json +0 -471
  97. package/web/node_modules/.bun/accepts@1.3.8/node_modules/accepts/index.js +0 -238
  98. package/web/node_modules/.bun/accepts@1.3.8/node_modules/accepts/package.json +0 -47
  99. package/web/node_modules/.bun/base64id@2.0.0/node_modules/base64id/lib/base64id.js +0 -103
  100. package/web/node_modules/.bun/base64id@2.0.0/node_modules/base64id/package.json +0 -13
  101. package/web/node_modules/.bun/cookie@0.7.2/node_modules/cookie/index.js +0 -335
  102. package/web/node_modules/.bun/cookie@0.7.2/node_modules/cookie/package.json +0 -44
  103. package/web/node_modules/.bun/cookie@1.1.1/node_modules/cookie/package.json +0 -47
  104. package/web/node_modules/.bun/cors@2.8.5/node_modules/cors/lib/index.js +0 -238
  105. package/web/node_modules/.bun/cors@2.8.5/node_modules/cors/package.json +0 -41
  106. package/web/node_modules/.bun/debug@4.3.7/node_modules/debug/package.json +0 -60
  107. package/web/node_modules/.bun/debug@4.3.7/node_modules/debug/src/browser.js +0 -271
  108. package/web/node_modules/.bun/debug@4.3.7/node_modules/debug/src/common.js +0 -274
  109. package/web/node_modules/.bun/debug@4.3.7/node_modules/debug/src/index.js +0 -10
  110. package/web/node_modules/.bun/debug@4.3.7/node_modules/debug/src/node.js +0 -263
  111. package/web/node_modules/.bun/engine.io-parser@5.2.3/node_modules/engine.io-parser/build/cjs/commons.js +0 -19
  112. package/web/node_modules/.bun/engine.io-parser@5.2.3/node_modules/engine.io-parser/build/cjs/decodePacket.js +0 -59
  113. package/web/node_modules/.bun/engine.io-parser@5.2.3/node_modules/engine.io-parser/build/cjs/encodePacket.js +0 -38
  114. package/web/node_modules/.bun/engine.io-parser@5.2.3/node_modules/engine.io-parser/build/cjs/index.js +0 -164
  115. package/web/node_modules/.bun/engine.io-parser@5.2.3/node_modules/engine.io-parser/build/cjs/package.json +0 -8
  116. package/web/node_modules/.bun/engine.io-parser@5.2.3/node_modules/engine.io-parser/package.json +0 -46
  117. package/web/node_modules/.bun/engine.io@6.6.4/node_modules/engine.io/build/engine.io.js +0 -54
  118. package/web/node_modules/.bun/engine.io@6.6.4/node_modules/engine.io/build/parser-v3/index.js +0 -424
  119. package/web/node_modules/.bun/engine.io@6.6.4/node_modules/engine.io/build/parser-v3/utf8.js +0 -187
  120. package/web/node_modules/.bun/engine.io@6.6.4/node_modules/engine.io/build/server.js +0 -786
  121. package/web/node_modules/.bun/engine.io@6.6.4/node_modules/engine.io/build/socket.js +0 -460
  122. package/web/node_modules/.bun/engine.io@6.6.4/node_modules/engine.io/build/transport.js +0 -117
  123. package/web/node_modules/.bun/engine.io@6.6.4/node_modules/engine.io/build/transports/index.js +0 -23
  124. package/web/node_modules/.bun/engine.io@6.6.4/node_modules/engine.io/build/transports/polling-jsonp.js +0 -41
  125. package/web/node_modules/.bun/engine.io@6.6.4/node_modules/engine.io/build/transports/polling.js +0 -332
  126. package/web/node_modules/.bun/engine.io@6.6.4/node_modules/engine.io/build/transports/websocket.js +0 -94
  127. package/web/node_modules/.bun/engine.io@6.6.4/node_modules/engine.io/build/transports/webtransport.js +0 -63
  128. package/web/node_modules/.bun/engine.io@6.6.4/node_modules/engine.io/build/transports-uws/index.js +0 -8
  129. package/web/node_modules/.bun/engine.io@6.6.4/node_modules/engine.io/build/transports-uws/polling.js +0 -364
  130. package/web/node_modules/.bun/engine.io@6.6.4/node_modules/engine.io/build/transports-uws/websocket.js +0 -73
  131. package/web/node_modules/.bun/engine.io@6.6.4/node_modules/engine.io/build/userver.js +0 -279
  132. package/web/node_modules/.bun/engine.io@6.6.4/node_modules/engine.io/package.json +0 -70
  133. package/web/node_modules/.bun/has-flag@4.0.0/node_modules/has-flag/index.js +0 -8
  134. package/web/node_modules/.bun/has-flag@4.0.0/node_modules/has-flag/package.json +0 -46
  135. package/web/node_modules/.bun/mime-db@1.52.0/node_modules/mime-db/db.json +0 -8519
  136. package/web/node_modules/.bun/mime-db@1.52.0/node_modules/mime-db/index.js +0 -12
  137. package/web/node_modules/.bun/mime-db@1.52.0/node_modules/mime-db/package.json +0 -60
  138. package/web/node_modules/.bun/mime-types@2.1.35/node_modules/mime-types/index.js +0 -188
  139. package/web/node_modules/.bun/mime-types@2.1.35/node_modules/mime-types/package.json +0 -44
  140. package/web/node_modules/.bun/ms@2.1.3/node_modules/ms/index.js +0 -162
  141. package/web/node_modules/.bun/ms@2.1.3/node_modules/ms/package.json +0 -38
  142. package/web/node_modules/.bun/negotiator@0.6.3/node_modules/negotiator/index.js +0 -82
  143. package/web/node_modules/.bun/negotiator@0.6.3/node_modules/negotiator/lib/charset.js +0 -169
  144. package/web/node_modules/.bun/negotiator@0.6.3/node_modules/negotiator/lib/encoding.js +0 -184
  145. package/web/node_modules/.bun/negotiator@0.6.3/node_modules/negotiator/lib/language.js +0 -179
  146. package/web/node_modules/.bun/negotiator@0.6.3/node_modules/negotiator/lib/mediaType.js +0 -294
  147. package/web/node_modules/.bun/negotiator@0.6.3/node_modules/negotiator/package.json +0 -42
  148. package/web/node_modules/.bun/object-assign@4.1.1/node_modules/object-assign/index.js +0 -90
  149. package/web/node_modules/.bun/object-assign@4.1.1/node_modules/object-assign/package.json +0 -42
  150. package/web/node_modules/.bun/sharp@0.34.5/node_modules/sharp/lib/channel.js +0 -177
  151. package/web/node_modules/.bun/sharp@0.34.5/node_modules/sharp/lib/colour.js +0 -195
  152. package/web/node_modules/.bun/sharp@0.34.5/node_modules/sharp/lib/composite.js +0 -212
  153. package/web/node_modules/.bun/sharp@0.34.5/node_modules/sharp/lib/constructor.js +0 -499
  154. package/web/node_modules/.bun/sharp@0.34.5/node_modules/sharp/lib/index.js +0 -16
  155. package/web/node_modules/.bun/sharp@0.34.5/node_modules/sharp/lib/input.js +0 -809
  156. package/web/node_modules/.bun/sharp@0.34.5/node_modules/sharp/lib/is.js +0 -143
  157. package/web/node_modules/.bun/sharp@0.34.5/node_modules/sharp/lib/libvips.js +0 -207
  158. package/web/node_modules/.bun/sharp@0.34.5/node_modules/sharp/lib/operation.js +0 -1016
  159. package/web/node_modules/.bun/sharp@0.34.5/node_modules/sharp/lib/output.js +0 -1666
  160. package/web/node_modules/.bun/sharp@0.34.5/node_modules/sharp/lib/resize.js +0 -595
  161. package/web/node_modules/.bun/sharp@0.34.5/node_modules/sharp/lib/sharp.js +0 -121
  162. package/web/node_modules/.bun/sharp@0.34.5/node_modules/sharp/lib/utility.js +0 -291
  163. package/web/node_modules/.bun/sharp@0.34.5/node_modules/sharp/package.json +0 -202
  164. package/web/node_modules/.bun/socket.io-adapter@2.5.5/node_modules/socket.io-adapter/dist/cluster-adapter.js +0 -674
  165. package/web/node_modules/.bun/socket.io-adapter@2.5.5/node_modules/socket.io-adapter/dist/contrib/yeast.js +0 -55
  166. package/web/node_modules/.bun/socket.io-adapter@2.5.5/node_modules/socket.io-adapter/dist/in-memory-adapter.js +0 -394
  167. package/web/node_modules/.bun/socket.io-adapter@2.5.5/node_modules/socket.io-adapter/dist/index.js +0 -10
  168. package/web/node_modules/.bun/socket.io-adapter@2.5.5/node_modules/socket.io-adapter/package.json +0 -39
  169. package/web/node_modules/.bun/socket.io-parser@4.2.4/node_modules/socket.io-parser/build/cjs/binary.js +0 -88
  170. package/web/node_modules/.bun/socket.io-parser@4.2.4/node_modules/socket.io-parser/build/cjs/index.js +0 -321
  171. package/web/node_modules/.bun/socket.io-parser@4.2.4/node_modules/socket.io-parser/build/cjs/is-binary.js +0 -55
  172. package/web/node_modules/.bun/socket.io-parser@4.2.4/node_modules/socket.io-parser/build/cjs/package.json +0 -3
  173. package/web/node_modules/.bun/socket.io-parser@4.2.4/node_modules/socket.io-parser/package.json +0 -58
  174. package/web/node_modules/.bun/socket.io@4.8.1/node_modules/socket.io/client-dist/socket.io.esm.min.js +0 -7
  175. package/web/node_modules/.bun/socket.io@4.8.1/node_modules/socket.io/client-dist/socket.io.js +0 -4908
  176. package/web/node_modules/.bun/socket.io@4.8.1/node_modules/socket.io/client-dist/socket.io.min.js +0 -7
  177. package/web/node_modules/.bun/socket.io@4.8.1/node_modules/socket.io/client-dist/socket.io.msgpack.min.js +0 -7
  178. package/web/node_modules/.bun/socket.io@4.8.1/node_modules/socket.io/dist/broadcast-operator.js +0 -436
  179. package/web/node_modules/.bun/socket.io@4.8.1/node_modules/socket.io/dist/client.js +0 -268
  180. package/web/node_modules/.bun/socket.io@4.8.1/node_modules/socket.io/dist/index.js +0 -804
  181. package/web/node_modules/.bun/socket.io@4.8.1/node_modules/socket.io/dist/namespace.js +0 -581
  182. package/web/node_modules/.bun/socket.io@4.8.1/node_modules/socket.io/dist/parent-namespace.js +0 -88
  183. package/web/node_modules/.bun/socket.io@4.8.1/node_modules/socket.io/dist/socket-types.js +0 -11
  184. package/web/node_modules/.bun/socket.io@4.8.1/node_modules/socket.io/dist/socket.js +0 -977
  185. package/web/node_modules/.bun/socket.io@4.8.1/node_modules/socket.io/dist/typed-events.js +0 -81
  186. package/web/node_modules/.bun/socket.io@4.8.1/node_modules/socket.io/dist/uws.js +0 -136
  187. package/web/node_modules/.bun/socket.io@4.8.1/node_modules/socket.io/package.json +0 -85
  188. package/web/node_modules/.bun/socket.io@4.8.1/node_modules/socket.io/wrapper.mjs +0 -3
  189. package/web/node_modules/.bun/supports-color@7.2.0/node_modules/supports-color/index.js +0 -135
  190. package/web/node_modules/.bun/supports-color@7.2.0/node_modules/supports-color/package.json +0 -53
  191. package/web/node_modules/.bun/typescript@5.9.3/node_modules/typescript/lib/_tsc.js +0 -133818
  192. package/web/node_modules/.bun/typescript@5.9.3/node_modules/typescript/lib/_tsserver.js +0 -659
  193. package/web/node_modules/.bun/typescript@5.9.3/node_modules/typescript/lib/_typingsInstaller.js +0 -222
  194. package/web/node_modules/.bun/typescript@5.9.3/node_modules/typescript/lib/cs/diagnosticMessages.generated.json +0 -2122
  195. package/web/node_modules/.bun/typescript@5.9.3/node_modules/typescript/lib/de/diagnosticMessages.generated.json +0 -2122
  196. package/web/node_modules/.bun/typescript@5.9.3/node_modules/typescript/lib/es/diagnosticMessages.generated.json +0 -2122
  197. package/web/node_modules/.bun/typescript@5.9.3/node_modules/typescript/lib/fr/diagnosticMessages.generated.json +0 -2122
  198. package/web/node_modules/.bun/typescript@5.9.3/node_modules/typescript/lib/it/diagnosticMessages.generated.json +0 -2122
  199. package/web/node_modules/.bun/typescript@5.9.3/node_modules/typescript/lib/ja/diagnosticMessages.generated.json +0 -2122
  200. package/web/node_modules/.bun/typescript@5.9.3/node_modules/typescript/lib/ko/diagnosticMessages.generated.json +0 -2122
  201. package/web/node_modules/.bun/typescript@5.9.3/node_modules/typescript/lib/pl/diagnosticMessages.generated.json +0 -2122
  202. package/web/node_modules/.bun/typescript@5.9.3/node_modules/typescript/lib/pt-br/diagnosticMessages.generated.json +0 -2122
  203. package/web/node_modules/.bun/typescript@5.9.3/node_modules/typescript/lib/ru/diagnosticMessages.generated.json +0 -2122
  204. package/web/node_modules/.bun/typescript@5.9.3/node_modules/typescript/lib/tr/diagnosticMessages.generated.json +0 -2122
  205. package/web/node_modules/.bun/typescript@5.9.3/node_modules/typescript/lib/tsc.js +0 -8
  206. package/web/node_modules/.bun/typescript@5.9.3/node_modules/typescript/lib/tsserver.js +0 -8
  207. package/web/node_modules/.bun/typescript@5.9.3/node_modules/typescript/lib/tsserverlibrary.js +0 -21
  208. package/web/node_modules/.bun/typescript@5.9.3/node_modules/typescript/lib/typesMap.json +0 -497
  209. package/web/node_modules/.bun/typescript@5.9.3/node_modules/typescript/lib/typescript.js +0 -200276
  210. package/web/node_modules/.bun/typescript@5.9.3/node_modules/typescript/lib/typingsInstaller.js +0 -8
  211. package/web/node_modules/.bun/typescript@5.9.3/node_modules/typescript/lib/watchGuard.js +0 -53
  212. package/web/node_modules/.bun/typescript@5.9.3/node_modules/typescript/lib/zh-cn/diagnosticMessages.generated.json +0 -2122
  213. package/web/node_modules/.bun/typescript@5.9.3/node_modules/typescript/lib/zh-tw/diagnosticMessages.generated.json +0 -2122
  214. package/web/node_modules/.bun/typescript@5.9.3/node_modules/typescript/package.json +0 -120
  215. package/web/node_modules/.bun/vary@1.1.2/node_modules/vary/index.js +0 -149
  216. package/web/node_modules/.bun/vary@1.1.2/node_modules/vary/package.json +0 -43
  217. package/web/node_modules/.bun/ws@8.17.1/node_modules/ws/index.js +0 -13
  218. package/web/node_modules/.bun/ws@8.17.1/node_modules/ws/lib/buffer-util.js +0 -131
  219. package/web/node_modules/.bun/ws@8.17.1/node_modules/ws/lib/constants.js +0 -12
  220. package/web/node_modules/.bun/ws@8.17.1/node_modules/ws/lib/event-target.js +0 -292
  221. package/web/node_modules/.bun/ws@8.17.1/node_modules/ws/lib/extension.js +0 -203
  222. package/web/node_modules/.bun/ws@8.17.1/node_modules/ws/lib/limiter.js +0 -55
  223. package/web/node_modules/.bun/ws@8.17.1/node_modules/ws/lib/permessage-deflate.js +0 -514
  224. package/web/node_modules/.bun/ws@8.17.1/node_modules/ws/lib/receiver.js +0 -704
  225. package/web/node_modules/.bun/ws@8.17.1/node_modules/ws/lib/sender.js +0 -497
  226. package/web/node_modules/.bun/ws@8.17.1/node_modules/ws/lib/stream.js +0 -159
  227. package/web/node_modules/.bun/ws@8.17.1/node_modules/ws/lib/subprotocol.js +0 -62
  228. package/web/node_modules/.bun/ws@8.17.1/node_modules/ws/lib/validation.js +0 -130
  229. package/web/node_modules/.bun/ws@8.17.1/node_modules/ws/lib/websocket-server.js +0 -540
  230. package/web/node_modules/.bun/ws@8.17.1/node_modules/ws/lib/websocket.js +0 -1338
  231. package/web/node_modules/.bun/ws@8.17.1/node_modules/ws/package.json +0 -69
  232. package/web/node_modules/.bun/ws@8.18.3/node_modules/ws/lib/buffer-util.js +0 -131
  233. package/web/node_modules/.bun/ws@8.18.3/node_modules/ws/lib/constants.js +0 -18
  234. package/web/node_modules/.bun/ws@8.18.3/node_modules/ws/lib/event-target.js +0 -292
  235. package/web/node_modules/.bun/ws@8.18.3/node_modules/ws/lib/extension.js +0 -203
  236. package/web/node_modules/.bun/ws@8.18.3/node_modules/ws/lib/limiter.js +0 -55
  237. package/web/node_modules/.bun/ws@8.18.3/node_modules/ws/lib/permessage-deflate.js +0 -528
  238. package/web/node_modules/.bun/ws@8.18.3/node_modules/ws/lib/receiver.js +0 -706
  239. package/web/node_modules/.bun/ws@8.18.3/node_modules/ws/lib/sender.js +0 -602
  240. package/web/node_modules/.bun/ws@8.18.3/node_modules/ws/lib/stream.js +0 -161
  241. package/web/node_modules/.bun/ws@8.18.3/node_modules/ws/lib/subprotocol.js +0 -62
  242. package/web/node_modules/.bun/ws@8.18.3/node_modules/ws/lib/validation.js +0 -152
  243. package/web/node_modules/.bun/ws@8.18.3/node_modules/ws/lib/websocket-server.js +0 -550
  244. package/web/node_modules/.bun/ws@8.18.3/node_modules/ws/lib/websocket.js +0 -1388
  245. package/web/node_modules/.bun/ws@8.18.3/node_modules/ws/package.json +0 -69
  246. package/web/node_modules/.bun/ws@8.18.3/node_modules/ws/wrapper.mjs +0 -8
  247. /package/web/.next/static/{b-zSCTvx5IzLyCj7s91p4 → XI6khKkj1If5Kb4-eJQ2z}/_clientMiddlewareManifest.json +0 -0
  248. /package/web/.next/static/{b-zSCTvx5IzLyCj7s91p4 → XI6khKkj1If5Kb4-eJQ2z}/_ssgManifest.js +0 -0
@@ -1,977 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.Socket = void 0;
7
- const socket_io_parser_1 = require("socket.io-parser");
8
- const debug_1 = __importDefault(require("debug"));
9
- const typed_events_1 = require("./typed-events");
10
- const base64id_1 = __importDefault(require("base64id"));
11
- const broadcast_operator_1 = require("./broadcast-operator");
12
- const socket_types_1 = require("./socket-types");
13
- const debug = (0, debug_1.default)("socket.io:socket");
14
- const RECOVERABLE_DISCONNECT_REASONS = new Set([
15
- "transport error",
16
- "transport close",
17
- "forced close",
18
- "ping timeout",
19
- "server shutting down",
20
- "forced server close",
21
- ]);
22
- function noop() { }
23
- /**
24
- * This is the main object for interacting with a client.
25
- *
26
- * A Socket belongs to a given {@link Namespace} and uses an underlying {@link Client} to communicate.
27
- *
28
- * Within each {@link Namespace}, you can also define arbitrary channels (called "rooms") that the {@link Socket} can
29
- * join and leave. That provides a convenient way to broadcast to a group of socket instances.
30
- *
31
- * @example
32
- * io.on("connection", (socket) => {
33
- * console.log(`socket ${socket.id} connected`);
34
- *
35
- * // send an event to the client
36
- * socket.emit("foo", "bar");
37
- *
38
- * socket.on("foobar", () => {
39
- * // an event was received from the client
40
- * });
41
- *
42
- * // join the room named "room1"
43
- * socket.join("room1");
44
- *
45
- * // broadcast to everyone in the room named "room1"
46
- * io.to("room1").emit("hello");
47
- *
48
- * // upon disconnection
49
- * socket.on("disconnect", (reason) => {
50
- * console.log(`socket ${socket.id} disconnected due to ${reason}`);
51
- * });
52
- * });
53
- */
54
- class Socket extends typed_events_1.StrictEventEmitter {
55
- /**
56
- * Interface to a `Client` for a given `Namespace`.
57
- *
58
- * @param {Namespace} nsp
59
- * @param {Client} client
60
- * @param {Object} auth
61
- * @package
62
- */
63
- constructor(nsp, client, auth, previousSession) {
64
- super();
65
- this.nsp = nsp;
66
- this.client = client;
67
- /**
68
- * Whether the connection state was recovered after a temporary disconnection. In that case, any missed packets will
69
- * be transmitted to the client, the data attribute and the rooms will be restored.
70
- */
71
- this.recovered = false;
72
- /**
73
- * Additional information that can be attached to the Socket instance and which will be used in the
74
- * {@link Server.fetchSockets()} method.
75
- */
76
- this.data = {};
77
- /**
78
- * Whether the socket is currently connected or not.
79
- *
80
- * @example
81
- * io.use((socket, next) => {
82
- * console.log(socket.connected); // false
83
- * next();
84
- * });
85
- *
86
- * io.on("connection", (socket) => {
87
- * console.log(socket.connected); // true
88
- * });
89
- */
90
- this.connected = false;
91
- this.acks = new Map();
92
- this.fns = [];
93
- this.flags = {};
94
- this.server = nsp.server;
95
- this.adapter = this.nsp.adapter;
96
- if (previousSession) {
97
- this.id = previousSession.sid;
98
- this.pid = previousSession.pid;
99
- previousSession.rooms.forEach((room) => this.join(room));
100
- this.data = previousSession.data;
101
- previousSession.missedPackets.forEach((packet) => {
102
- this.packet({
103
- type: socket_io_parser_1.PacketType.EVENT,
104
- data: packet,
105
- });
106
- });
107
- this.recovered = true;
108
- }
109
- else {
110
- if (client.conn.protocol === 3) {
111
- // @ts-ignore
112
- this.id = nsp.name !== "/" ? nsp.name + "#" + client.id : client.id;
113
- }
114
- else {
115
- this.id = base64id_1.default.generateId(); // don't reuse the Engine.IO id because it's sensitive information
116
- }
117
- if (this.server._opts.connectionStateRecovery) {
118
- this.pid = base64id_1.default.generateId();
119
- }
120
- }
121
- this.handshake = this.buildHandshake(auth);
122
- // prevents crash when the socket receives an "error" event without listener
123
- this.on("error", noop);
124
- }
125
- /**
126
- * Builds the `handshake` BC object
127
- *
128
- * @private
129
- */
130
- buildHandshake(auth) {
131
- var _a, _b, _c, _d;
132
- return {
133
- headers: ((_a = this.request) === null || _a === void 0 ? void 0 : _a.headers) || {},
134
- time: new Date() + "",
135
- address: this.conn.remoteAddress,
136
- xdomain: !!((_b = this.request) === null || _b === void 0 ? void 0 : _b.headers.origin),
137
- // @ts-ignore
138
- secure: !this.request || !!this.request.connection.encrypted,
139
- issued: +new Date(),
140
- url: (_c = this.request) === null || _c === void 0 ? void 0 : _c.url,
141
- // @ts-ignore
142
- query: ((_d = this.request) === null || _d === void 0 ? void 0 : _d._query) || {},
143
- auth,
144
- };
145
- }
146
- /**
147
- * Emits to this client.
148
- *
149
- * @example
150
- * io.on("connection", (socket) => {
151
- * socket.emit("hello", "world");
152
- *
153
- * // all serializable datastructures are supported (no need to call JSON.stringify)
154
- * socket.emit("hello", 1, "2", { 3: ["4"], 5: Buffer.from([6]) });
155
- *
156
- * // with an acknowledgement from the client
157
- * socket.emit("hello", "world", (val) => {
158
- * // ...
159
- * });
160
- * });
161
- *
162
- * @return Always returns `true`.
163
- */
164
- emit(ev, ...args) {
165
- if (socket_types_1.RESERVED_EVENTS.has(ev)) {
166
- throw new Error(`"${String(ev)}" is a reserved event name`);
167
- }
168
- const data = [ev, ...args];
169
- const packet = {
170
- type: socket_io_parser_1.PacketType.EVENT,
171
- data: data,
172
- };
173
- // access last argument to see if it's an ACK callback
174
- if (typeof data[data.length - 1] === "function") {
175
- const id = this.nsp._ids++;
176
- debug("emitting packet with ack id %d", id);
177
- this.registerAckCallback(id, data.pop());
178
- packet.id = id;
179
- }
180
- const flags = Object.assign({}, this.flags);
181
- this.flags = {};
182
- // @ts-ignore
183
- if (this.nsp.server.opts.connectionStateRecovery) {
184
- // this ensures the packet is stored and can be transmitted upon reconnection
185
- this.adapter.broadcast(packet, {
186
- rooms: new Set([this.id]),
187
- except: new Set(),
188
- flags,
189
- });
190
- }
191
- else {
192
- this.notifyOutgoingListeners(packet);
193
- this.packet(packet, flags);
194
- }
195
- return true;
196
- }
197
- /**
198
- * Emits an event and waits for an acknowledgement
199
- *
200
- * @example
201
- * io.on("connection", async (socket) => {
202
- * // without timeout
203
- * const response = await socket.emitWithAck("hello", "world");
204
- *
205
- * // with a specific timeout
206
- * try {
207
- * const response = await socket.timeout(1000).emitWithAck("hello", "world");
208
- * } catch (err) {
209
- * // the client did not acknowledge the event in the given delay
210
- * }
211
- * });
212
- *
213
- * @return a Promise that will be fulfilled when the client acknowledges the event
214
- */
215
- emitWithAck(ev, ...args) {
216
- // the timeout flag is optional
217
- const withErr = this.flags.timeout !== undefined;
218
- return new Promise((resolve, reject) => {
219
- args.push((arg1, arg2) => {
220
- if (withErr) {
221
- return arg1 ? reject(arg1) : resolve(arg2);
222
- }
223
- else {
224
- return resolve(arg1);
225
- }
226
- });
227
- this.emit(ev, ...args);
228
- });
229
- }
230
- /**
231
- * @private
232
- */
233
- registerAckCallback(id, ack) {
234
- const timeout = this.flags.timeout;
235
- if (timeout === undefined) {
236
- this.acks.set(id, ack);
237
- return;
238
- }
239
- const timer = setTimeout(() => {
240
- debug("event with ack id %d has timed out after %d ms", id, timeout);
241
- this.acks.delete(id);
242
- ack.call(this, new Error("operation has timed out"));
243
- }, timeout);
244
- this.acks.set(id, (...args) => {
245
- clearTimeout(timer);
246
- ack.apply(this, [null, ...args]);
247
- });
248
- }
249
- /**
250
- * Targets a room when broadcasting.
251
- *
252
- * @example
253
- * io.on("connection", (socket) => {
254
- * // the “foo” event will be broadcast to all connected clients in the “room-101” room, except this socket
255
- * socket.to("room-101").emit("foo", "bar");
256
- *
257
- * // the code above is equivalent to:
258
- * io.to("room-101").except(socket.id).emit("foo", "bar");
259
- *
260
- * // with an array of rooms (a client will be notified at most once)
261
- * socket.to(["room-101", "room-102"]).emit("foo", "bar");
262
- *
263
- * // with multiple chained calls
264
- * socket.to("room-101").to("room-102").emit("foo", "bar");
265
- * });
266
- *
267
- * @param room - a room, or an array of rooms
268
- * @return a new {@link BroadcastOperator} instance for chaining
269
- */
270
- to(room) {
271
- return this.newBroadcastOperator().to(room);
272
- }
273
- /**
274
- * Targets a room when broadcasting. Similar to `to()`, but might feel clearer in some cases:
275
- *
276
- * @example
277
- * io.on("connection", (socket) => {
278
- * // disconnect all clients in the "room-101" room, except this socket
279
- * socket.in("room-101").disconnectSockets();
280
- * });
281
- *
282
- * @param room - a room, or an array of rooms
283
- * @return a new {@link BroadcastOperator} instance for chaining
284
- */
285
- in(room) {
286
- return this.newBroadcastOperator().in(room);
287
- }
288
- /**
289
- * Excludes a room when broadcasting.
290
- *
291
- * @example
292
- * io.on("connection", (socket) => {
293
- * // the "foo" event will be broadcast to all connected clients, except the ones that are in the "room-101" room
294
- * // and this socket
295
- * socket.except("room-101").emit("foo", "bar");
296
- *
297
- * // with an array of rooms
298
- * socket.except(["room-101", "room-102"]).emit("foo", "bar");
299
- *
300
- * // with multiple chained calls
301
- * socket.except("room-101").except("room-102").emit("foo", "bar");
302
- * });
303
- *
304
- * @param room - a room, or an array of rooms
305
- * @return a new {@link BroadcastOperator} instance for chaining
306
- */
307
- except(room) {
308
- return this.newBroadcastOperator().except(room);
309
- }
310
- /**
311
- * Sends a `message` event.
312
- *
313
- * This method mimics the WebSocket.send() method.
314
- *
315
- * @see https://developer.mozilla.org/en-US/docs/Web/API/WebSocket/send
316
- *
317
- * @example
318
- * io.on("connection", (socket) => {
319
- * socket.send("hello");
320
- *
321
- * // this is equivalent to
322
- * socket.emit("message", "hello");
323
- * });
324
- *
325
- * @return self
326
- */
327
- send(...args) {
328
- this.emit("message", ...args);
329
- return this;
330
- }
331
- /**
332
- * Sends a `message` event. Alias of {@link send}.
333
- *
334
- * @return self
335
- */
336
- write(...args) {
337
- this.emit("message", ...args);
338
- return this;
339
- }
340
- /**
341
- * Writes a packet.
342
- *
343
- * @param {Object} packet - packet object
344
- * @param {Object} opts - options
345
- * @private
346
- */
347
- packet(packet, opts = {}) {
348
- packet.nsp = this.nsp.name;
349
- opts.compress = false !== opts.compress;
350
- this.client._packet(packet, opts);
351
- }
352
- /**
353
- * Joins a room.
354
- *
355
- * @example
356
- * io.on("connection", (socket) => {
357
- * // join a single room
358
- * socket.join("room1");
359
- *
360
- * // join multiple rooms
361
- * socket.join(["room1", "room2"]);
362
- * });
363
- *
364
- * @param {String|Array} rooms - room or array of rooms
365
- * @return a Promise or nothing, depending on the adapter
366
- */
367
- join(rooms) {
368
- debug("join room %s", rooms);
369
- return this.adapter.addAll(this.id, new Set(Array.isArray(rooms) ? rooms : [rooms]));
370
- }
371
- /**
372
- * Leaves a room.
373
- *
374
- * @example
375
- * io.on("connection", (socket) => {
376
- * // leave a single room
377
- * socket.leave("room1");
378
- *
379
- * // leave multiple rooms
380
- * socket.leave("room1").leave("room2");
381
- * });
382
- *
383
- * @param {String} room
384
- * @return a Promise or nothing, depending on the adapter
385
- */
386
- leave(room) {
387
- debug("leave room %s", room);
388
- return this.adapter.del(this.id, room);
389
- }
390
- /**
391
- * Leave all rooms.
392
- *
393
- * @private
394
- */
395
- leaveAll() {
396
- this.adapter.delAll(this.id);
397
- }
398
- /**
399
- * Called by `Namespace` upon successful
400
- * middleware execution (ie: authorization).
401
- * Socket is added to namespace array before
402
- * call to join, so adapters can access it.
403
- *
404
- * @private
405
- */
406
- _onconnect() {
407
- debug("socket connected - writing packet");
408
- this.connected = true;
409
- this.join(this.id);
410
- if (this.conn.protocol === 3) {
411
- this.packet({ type: socket_io_parser_1.PacketType.CONNECT });
412
- }
413
- else {
414
- this.packet({
415
- type: socket_io_parser_1.PacketType.CONNECT,
416
- data: { sid: this.id, pid: this.pid },
417
- });
418
- }
419
- }
420
- /**
421
- * Called with each packet. Called by `Client`.
422
- *
423
- * @param {Object} packet
424
- * @private
425
- */
426
- _onpacket(packet) {
427
- debug("got packet %j", packet);
428
- switch (packet.type) {
429
- case socket_io_parser_1.PacketType.EVENT:
430
- this.onevent(packet);
431
- break;
432
- case socket_io_parser_1.PacketType.BINARY_EVENT:
433
- this.onevent(packet);
434
- break;
435
- case socket_io_parser_1.PacketType.ACK:
436
- this.onack(packet);
437
- break;
438
- case socket_io_parser_1.PacketType.BINARY_ACK:
439
- this.onack(packet);
440
- break;
441
- case socket_io_parser_1.PacketType.DISCONNECT:
442
- this.ondisconnect();
443
- break;
444
- }
445
- }
446
- /**
447
- * Called upon event packet.
448
- *
449
- * @param {Packet} packet - packet object
450
- * @private
451
- */
452
- onevent(packet) {
453
- const args = packet.data || [];
454
- debug("emitting event %j", args);
455
- if (null != packet.id) {
456
- debug("attaching ack callback to event");
457
- args.push(this.ack(packet.id));
458
- }
459
- if (this._anyListeners && this._anyListeners.length) {
460
- const listeners = this._anyListeners.slice();
461
- for (const listener of listeners) {
462
- listener.apply(this, args);
463
- }
464
- }
465
- this.dispatch(args);
466
- }
467
- /**
468
- * Produces an ack callback to emit with an event.
469
- *
470
- * @param {Number} id - packet id
471
- * @private
472
- */
473
- ack(id) {
474
- const self = this;
475
- let sent = false;
476
- return function () {
477
- // prevent double callbacks
478
- if (sent)
479
- return;
480
- const args = Array.prototype.slice.call(arguments);
481
- debug("sending ack %j", args);
482
- self.packet({
483
- id: id,
484
- type: socket_io_parser_1.PacketType.ACK,
485
- data: args,
486
- });
487
- sent = true;
488
- };
489
- }
490
- /**
491
- * Called upon ack packet.
492
- *
493
- * @private
494
- */
495
- onack(packet) {
496
- const ack = this.acks.get(packet.id);
497
- if ("function" == typeof ack) {
498
- debug("calling ack %s with %j", packet.id, packet.data);
499
- ack.apply(this, packet.data);
500
- this.acks.delete(packet.id);
501
- }
502
- else {
503
- debug("bad ack %s", packet.id);
504
- }
505
- }
506
- /**
507
- * Called upon client disconnect packet.
508
- *
509
- * @private
510
- */
511
- ondisconnect() {
512
- debug("got disconnect packet");
513
- this._onclose("client namespace disconnect");
514
- }
515
- /**
516
- * Handles a client error.
517
- *
518
- * @private
519
- */
520
- _onerror(err) {
521
- // FIXME the meaning of the "error" event is overloaded:
522
- // - it can be sent by the client (`socket.emit("error")`)
523
- // - it can be emitted when the connection encounters an error (an invalid packet for example)
524
- // - it can be emitted when a packet is rejected in a middleware (`socket.use()`)
525
- this.emitReserved("error", err);
526
- }
527
- /**
528
- * Called upon closing. Called by `Client`.
529
- *
530
- * @param {String} reason
531
- * @param description
532
- * @throw {Error} optional error object
533
- *
534
- * @private
535
- */
536
- _onclose(reason, description) {
537
- if (!this.connected)
538
- return this;
539
- debug("closing socket - reason %s", reason);
540
- this.emitReserved("disconnecting", reason, description);
541
- if (this.server._opts.connectionStateRecovery &&
542
- RECOVERABLE_DISCONNECT_REASONS.has(reason)) {
543
- debug("connection state recovery is enabled for sid %s", this.id);
544
- this.adapter.persistSession({
545
- sid: this.id,
546
- pid: this.pid,
547
- rooms: [...this.rooms],
548
- data: this.data,
549
- });
550
- }
551
- this._cleanup();
552
- this.client._remove(this);
553
- this.connected = false;
554
- this.emitReserved("disconnect", reason, description);
555
- return;
556
- }
557
- /**
558
- * Makes the socket leave all the rooms it was part of and prevents it from joining any other room
559
- *
560
- * @private
561
- */
562
- _cleanup() {
563
- this.leaveAll();
564
- this.nsp._remove(this);
565
- this.join = noop;
566
- }
567
- /**
568
- * Produces an `error` packet.
569
- *
570
- * @param {Object} err - error object
571
- *
572
- * @private
573
- */
574
- _error(err) {
575
- this.packet({ type: socket_io_parser_1.PacketType.CONNECT_ERROR, data: err });
576
- }
577
- /**
578
- * Disconnects this client.
579
- *
580
- * @example
581
- * io.on("connection", (socket) => {
582
- * // disconnect this socket (the connection might be kept alive for other namespaces)
583
- * socket.disconnect();
584
- *
585
- * // disconnect this socket and close the underlying connection
586
- * socket.disconnect(true);
587
- * })
588
- *
589
- * @param {Boolean} close - if `true`, closes the underlying connection
590
- * @return self
591
- */
592
- disconnect(close = false) {
593
- if (!this.connected)
594
- return this;
595
- if (close) {
596
- this.client._disconnect();
597
- }
598
- else {
599
- this.packet({ type: socket_io_parser_1.PacketType.DISCONNECT });
600
- this._onclose("server namespace disconnect");
601
- }
602
- return this;
603
- }
604
- /**
605
- * Sets the compress flag.
606
- *
607
- * @example
608
- * io.on("connection", (socket) => {
609
- * socket.compress(false).emit("hello");
610
- * });
611
- *
612
- * @param {Boolean} compress - if `true`, compresses the sending data
613
- * @return {Socket} self
614
- */
615
- compress(compress) {
616
- this.flags.compress = compress;
617
- return this;
618
- }
619
- /**
620
- * Sets a modifier for a subsequent event emission that the event data may be lost if the client is not ready to
621
- * receive messages (because of network slowness or other issues, or because they’re connected through long polling
622
- * and is in the middle of a request-response cycle).
623
- *
624
- * @example
625
- * io.on("connection", (socket) => {
626
- * socket.volatile.emit("hello"); // the client may or may not receive it
627
- * });
628
- *
629
- * @return {Socket} self
630
- */
631
- get volatile() {
632
- this.flags.volatile = true;
633
- return this;
634
- }
635
- /**
636
- * Sets a modifier for a subsequent event emission that the event data will only be broadcast to every sockets but the
637
- * sender.
638
- *
639
- * @example
640
- * io.on("connection", (socket) => {
641
- * // the “foo” event will be broadcast to all connected clients, except this socket
642
- * socket.broadcast.emit("foo", "bar");
643
- * });
644
- *
645
- * @return a new {@link BroadcastOperator} instance for chaining
646
- */
647
- get broadcast() {
648
- return this.newBroadcastOperator();
649
- }
650
- /**
651
- * Sets a modifier for a subsequent event emission that the event data will only be broadcast to the current node.
652
- *
653
- * @example
654
- * io.on("connection", (socket) => {
655
- * // the “foo” event will be broadcast to all connected clients on this node, except this socket
656
- * socket.local.emit("foo", "bar");
657
- * });
658
- *
659
- * @return a new {@link BroadcastOperator} instance for chaining
660
- */
661
- get local() {
662
- return this.newBroadcastOperator().local;
663
- }
664
- /**
665
- * Sets a modifier for a subsequent event emission that the callback will be called with an error when the
666
- * given number of milliseconds have elapsed without an acknowledgement from the client:
667
- *
668
- * @example
669
- * io.on("connection", (socket) => {
670
- * socket.timeout(5000).emit("my-event", (err) => {
671
- * if (err) {
672
- * // the client did not acknowledge the event in the given delay
673
- * }
674
- * });
675
- * });
676
- *
677
- * @returns self
678
- */
679
- timeout(timeout) {
680
- this.flags.timeout = timeout;
681
- return this;
682
- }
683
- /**
684
- * Dispatch incoming event to socket listeners.
685
- *
686
- * @param {Array} event - event that will get emitted
687
- * @private
688
- */
689
- dispatch(event) {
690
- debug("dispatching an event %j", event);
691
- this.run(event, (err) => {
692
- process.nextTick(() => {
693
- if (err) {
694
- return this._onerror(err);
695
- }
696
- if (this.connected) {
697
- super.emitUntyped.apply(this, event);
698
- }
699
- else {
700
- debug("ignore packet received after disconnection");
701
- }
702
- });
703
- });
704
- }
705
- /**
706
- * Sets up socket middleware.
707
- *
708
- * @example
709
- * io.on("connection", (socket) => {
710
- * socket.use(([event, ...args], next) => {
711
- * if (isUnauthorized(event)) {
712
- * return next(new Error("unauthorized event"));
713
- * }
714
- * // do not forget to call next
715
- * next();
716
- * });
717
- *
718
- * socket.on("error", (err) => {
719
- * if (err && err.message === "unauthorized event") {
720
- * socket.disconnect();
721
- * }
722
- * });
723
- * });
724
- *
725
- * @param {Function} fn - middleware function (event, next)
726
- * @return {Socket} self
727
- */
728
- use(fn) {
729
- this.fns.push(fn);
730
- return this;
731
- }
732
- /**
733
- * Executes the middleware for an incoming event.
734
- *
735
- * @param {Array} event - event that will get emitted
736
- * @param {Function} fn - last fn call in the middleware
737
- * @private
738
- */
739
- run(event, fn) {
740
- if (!this.fns.length)
741
- return fn();
742
- const fns = this.fns.slice(0);
743
- function run(i) {
744
- fns[i](event, (err) => {
745
- // upon error, short-circuit
746
- if (err)
747
- return fn(err);
748
- // if no middleware left, summon callback
749
- if (!fns[i + 1])
750
- return fn();
751
- // go on to next
752
- run(i + 1);
753
- });
754
- }
755
- run(0);
756
- }
757
- /**
758
- * Whether the socket is currently disconnected
759
- */
760
- get disconnected() {
761
- return !this.connected;
762
- }
763
- /**
764
- * A reference to the request that originated the underlying Engine.IO Socket.
765
- */
766
- get request() {
767
- return this.client.request;
768
- }
769
- /**
770
- * A reference to the underlying Client transport connection (Engine.IO Socket object).
771
- *
772
- * @example
773
- * io.on("connection", (socket) => {
774
- * console.log(socket.conn.transport.name); // prints "polling" or "websocket"
775
- *
776
- * socket.conn.once("upgrade", () => {
777
- * console.log(socket.conn.transport.name); // prints "websocket"
778
- * });
779
- * });
780
- */
781
- get conn() {
782
- return this.client.conn;
783
- }
784
- /**
785
- * Returns the rooms the socket is currently in.
786
- *
787
- * @example
788
- * io.on("connection", (socket) => {
789
- * console.log(socket.rooms); // Set { <socket.id> }
790
- *
791
- * socket.join("room1");
792
- *
793
- * console.log(socket.rooms); // Set { <socket.id>, "room1" }
794
- * });
795
- */
796
- get rooms() {
797
- return this.adapter.socketRooms(this.id) || new Set();
798
- }
799
- /**
800
- * Adds a listener that will be fired when any event is received. The event name is passed as the first argument to
801
- * the callback.
802
- *
803
- * @example
804
- * io.on("connection", (socket) => {
805
- * socket.onAny((event, ...args) => {
806
- * console.log(`got event ${event}`);
807
- * });
808
- * });
809
- *
810
- * @param listener
811
- */
812
- onAny(listener) {
813
- this._anyListeners = this._anyListeners || [];
814
- this._anyListeners.push(listener);
815
- return this;
816
- }
817
- /**
818
- * Adds a listener that will be fired when any event is received. The event name is passed as the first argument to
819
- * the callback. The listener is added to the beginning of the listeners array.
820
- *
821
- * @param listener
822
- */
823
- prependAny(listener) {
824
- this._anyListeners = this._anyListeners || [];
825
- this._anyListeners.unshift(listener);
826
- return this;
827
- }
828
- /**
829
- * Removes the listener that will be fired when any event is received.
830
- *
831
- * @example
832
- * io.on("connection", (socket) => {
833
- * const catchAllListener = (event, ...args) => {
834
- * console.log(`got event ${event}`);
835
- * }
836
- *
837
- * socket.onAny(catchAllListener);
838
- *
839
- * // remove a specific listener
840
- * socket.offAny(catchAllListener);
841
- *
842
- * // or remove all listeners
843
- * socket.offAny();
844
- * });
845
- *
846
- * @param listener
847
- */
848
- offAny(listener) {
849
- if (!this._anyListeners) {
850
- return this;
851
- }
852
- if (listener) {
853
- const listeners = this._anyListeners;
854
- for (let i = 0; i < listeners.length; i++) {
855
- if (listener === listeners[i]) {
856
- listeners.splice(i, 1);
857
- return this;
858
- }
859
- }
860
- }
861
- else {
862
- this._anyListeners = [];
863
- }
864
- return this;
865
- }
866
- /**
867
- * Returns an array of listeners that are listening for any event that is specified. This array can be manipulated,
868
- * e.g. to remove listeners.
869
- */
870
- listenersAny() {
871
- return this._anyListeners || [];
872
- }
873
- /**
874
- * Adds a listener that will be fired when any event is sent. The event name is passed as the first argument to
875
- * the callback.
876
- *
877
- * Note: acknowledgements sent to the client are not included.
878
- *
879
- * @example
880
- * io.on("connection", (socket) => {
881
- * socket.onAnyOutgoing((event, ...args) => {
882
- * console.log(`sent event ${event}`);
883
- * });
884
- * });
885
- *
886
- * @param listener
887
- */
888
- onAnyOutgoing(listener) {
889
- this._anyOutgoingListeners = this._anyOutgoingListeners || [];
890
- this._anyOutgoingListeners.push(listener);
891
- return this;
892
- }
893
- /**
894
- * Adds a listener that will be fired when any event is emitted. The event name is passed as the first argument to the
895
- * callback. The listener is added to the beginning of the listeners array.
896
- *
897
- * @example
898
- * io.on("connection", (socket) => {
899
- * socket.prependAnyOutgoing((event, ...args) => {
900
- * console.log(`sent event ${event}`);
901
- * });
902
- * });
903
- *
904
- * @param listener
905
- */
906
- prependAnyOutgoing(listener) {
907
- this._anyOutgoingListeners = this._anyOutgoingListeners || [];
908
- this._anyOutgoingListeners.unshift(listener);
909
- return this;
910
- }
911
- /**
912
- * Removes the listener that will be fired when any event is sent.
913
- *
914
- * @example
915
- * io.on("connection", (socket) => {
916
- * const catchAllListener = (event, ...args) => {
917
- * console.log(`sent event ${event}`);
918
- * }
919
- *
920
- * socket.onAnyOutgoing(catchAllListener);
921
- *
922
- * // remove a specific listener
923
- * socket.offAnyOutgoing(catchAllListener);
924
- *
925
- * // or remove all listeners
926
- * socket.offAnyOutgoing();
927
- * });
928
- *
929
- * @param listener - the catch-all listener
930
- */
931
- offAnyOutgoing(listener) {
932
- if (!this._anyOutgoingListeners) {
933
- return this;
934
- }
935
- if (listener) {
936
- const listeners = this._anyOutgoingListeners;
937
- for (let i = 0; i < listeners.length; i++) {
938
- if (listener === listeners[i]) {
939
- listeners.splice(i, 1);
940
- return this;
941
- }
942
- }
943
- }
944
- else {
945
- this._anyOutgoingListeners = [];
946
- }
947
- return this;
948
- }
949
- /**
950
- * Returns an array of listeners that are listening for any event that is specified. This array can be manipulated,
951
- * e.g. to remove listeners.
952
- */
953
- listenersAnyOutgoing() {
954
- return this._anyOutgoingListeners || [];
955
- }
956
- /**
957
- * Notify the listeners for each packet sent (emit or broadcast)
958
- *
959
- * @param packet
960
- *
961
- * @private
962
- */
963
- notifyOutgoingListeners(packet) {
964
- if (this._anyOutgoingListeners && this._anyOutgoingListeners.length) {
965
- const listeners = this._anyOutgoingListeners.slice();
966
- for (const listener of listeners) {
967
- listener.apply(this, packet.data);
968
- }
969
- }
970
- }
971
- newBroadcastOperator() {
972
- const flags = Object.assign({}, this.flags);
973
- this.flags = {};
974
- return new broadcast_operator_1.BroadcastOperator(this.adapter, new Set(), new Set([this.id]), flags);
975
- }
976
- }
977
- exports.Socket = Socket;