WIP BroadCast working on console... needs more work

This commit is contained in:
NigeParis 2025-11-19 18:46:43 +01:00 committed by Maix0
parent d89c21dd2c
commit 98631be918
13 changed files with 467 additions and 871 deletions

184
frontend/pnpm-lock.yaml generated
View file

@ -211,113 +211,113 @@ packages:
'@jridgewell/trace-mapping@0.3.31':
resolution: {integrity: sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==}
'@rollup/rollup-android-arm-eabi@4.53.2':
resolution: {integrity: sha512-yDPzwsgiFO26RJA4nZo8I+xqzh7sJTZIWQOxn+/XOdPE31lAvLIYCKqjV+lNH/vxE2L2iH3plKxDCRK6i+CwhA==}
'@rollup/rollup-android-arm-eabi@4.53.3':
resolution: {integrity: sha512-mRSi+4cBjrRLoaal2PnqH82Wqyb+d3HsPUN/W+WslCXsZsyHa9ZeQQX/pQsZaVIWDkPcpV6jJ+3KLbTbgnwv8w==}
cpu: [arm]
os: [android]
'@rollup/rollup-android-arm64@4.53.2':
resolution: {integrity: sha512-k8FontTxIE7b0/OGKeSN5B6j25EuppBcWM33Z19JoVT7UTXFSo3D9CdU39wGTeb29NO3XxpMNauh09B+Ibw+9g==}
'@rollup/rollup-android-arm64@4.53.3':
resolution: {integrity: sha512-CbDGaMpdE9sh7sCmTrTUyllhrg65t6SwhjlMJsLr+J8YjFuPmCEjbBSx4Z/e4SmDyH3aB5hGaJUP2ltV/vcs4w==}
cpu: [arm64]
os: [android]
'@rollup/rollup-darwin-arm64@4.53.2':
resolution: {integrity: sha512-A6s4gJpomNBtJ2yioj8bflM2oogDwzUiMl2yNJ2v9E7++sHrSrsQ29fOfn5DM/iCzpWcebNYEdXpaK4tr2RhfQ==}
'@rollup/rollup-darwin-arm64@4.53.3':
resolution: {integrity: sha512-Nr7SlQeqIBpOV6BHHGZgYBuSdanCXuw09hon14MGOLGmXAFYjx1wNvquVPmpZnl0tLjg25dEdr4IQ6GgyToCUA==}
cpu: [arm64]
os: [darwin]
'@rollup/rollup-darwin-x64@4.53.2':
resolution: {integrity: sha512-e6XqVmXlHrBlG56obu9gDRPW3O3hLxpwHpLsBJvuI8qqnsrtSZ9ERoWUXtPOkY8c78WghyPHZdmPhHLWNdAGEw==}
'@rollup/rollup-darwin-x64@4.53.3':
resolution: {integrity: sha512-DZ8N4CSNfl965CmPktJ8oBnfYr3F8dTTNBQkRlffnUarJ2ohudQD17sZBa097J8xhQ26AwhHJ5mvUyQW8ddTsQ==}
cpu: [x64]
os: [darwin]
'@rollup/rollup-freebsd-arm64@4.53.2':
resolution: {integrity: sha512-v0E9lJW8VsrwPux5Qe5CwmH/CF/2mQs6xU1MF3nmUxmZUCHazCjLgYvToOk+YuuUqLQBio1qkkREhxhc656ViA==}
'@rollup/rollup-freebsd-arm64@4.53.3':
resolution: {integrity: sha512-yMTrCrK92aGyi7GuDNtGn2sNW+Gdb4vErx4t3Gv/Tr+1zRb8ax4z8GWVRfr3Jw8zJWvpGHNpss3vVlbF58DZ4w==}
cpu: [arm64]
os: [freebsd]
'@rollup/rollup-freebsd-x64@4.53.2':
resolution: {integrity: sha512-ClAmAPx3ZCHtp6ysl4XEhWU69GUB1D+s7G9YjHGhIGCSrsg00nEGRRZHmINYxkdoJehde8VIsDC5t9C0gb6yqA==}
'@rollup/rollup-freebsd-x64@4.53.3':
resolution: {integrity: sha512-lMfF8X7QhdQzseM6XaX0vbno2m3hlyZFhwcndRMw8fbAGUGL3WFMBdK0hbUBIUYcEcMhVLr1SIamDeuLBnXS+Q==}
cpu: [x64]
os: [freebsd]
'@rollup/rollup-linux-arm-gnueabihf@4.53.2':
resolution: {integrity: sha512-EPlb95nUsz6Dd9Qy13fI5kUPXNSljaG9FiJ4YUGU1O/Q77i5DYFW5KR8g1OzTcdZUqQQ1KdDqsTohdFVwCwjqg==}
'@rollup/rollup-linux-arm-gnueabihf@4.53.3':
resolution: {integrity: sha512-k9oD15soC/Ln6d2Wv/JOFPzZXIAIFLp6B+i14KhxAfnq76ajt0EhYc5YPeX6W1xJkAdItcVT+JhKl1QZh44/qw==}
cpu: [arm]
os: [linux]
'@rollup/rollup-linux-arm-musleabihf@4.53.2':
resolution: {integrity: sha512-BOmnVW+khAUX+YZvNfa0tGTEMVVEerOxN0pDk2E6N6DsEIa2Ctj48FOMfNDdrwinocKaC7YXUZ1pHlKpnkja/Q==}
'@rollup/rollup-linux-arm-musleabihf@4.53.3':
resolution: {integrity: sha512-vTNlKq+N6CK/8UktsrFuc+/7NlEYVxgaEgRXVUVK258Z5ymho29skzW1sutgYjqNnquGwVUObAaxae8rZ6YMhg==}
cpu: [arm]
os: [linux]
'@rollup/rollup-linux-arm64-gnu@4.53.2':
resolution: {integrity: sha512-Xt2byDZ+6OVNuREgBXr4+CZDJtrVso5woFtpKdGPhpTPHcNG7D8YXeQzpNbFRxzTVqJf7kvPMCub/pcGUWgBjA==}
'@rollup/rollup-linux-arm64-gnu@4.53.3':
resolution: {integrity: sha512-RGrFLWgMhSxRs/EWJMIFM1O5Mzuz3Xy3/mnxJp/5cVhZ2XoCAxJnmNsEyeMJtpK+wu0FJFWz+QF4mjCA7AUQ3w==}
cpu: [arm64]
os: [linux]
'@rollup/rollup-linux-arm64-musl@4.53.2':
resolution: {integrity: sha512-+LdZSldy/I9N8+klim/Y1HsKbJ3BbInHav5qE9Iy77dtHC/pibw1SR/fXlWyAk0ThnpRKoODwnAuSjqxFRDHUQ==}
'@rollup/rollup-linux-arm64-musl@4.53.3':
resolution: {integrity: sha512-kASyvfBEWYPEwe0Qv4nfu6pNkITLTb32p4yTgzFCocHnJLAHs+9LjUu9ONIhvfT/5lv4YS5muBHyuV84epBo/A==}
cpu: [arm64]
os: [linux]
'@rollup/rollup-linux-loong64-gnu@4.53.2':
resolution: {integrity: sha512-8ms8sjmyc1jWJS6WdNSA23rEfdjWB30LH8Wqj0Cqvv7qSHnvw6kgMMXRdop6hkmGPlyYBdRPkjJnj3KCUHV/uQ==}
'@rollup/rollup-linux-loong64-gnu@4.53.3':
resolution: {integrity: sha512-JiuKcp2teLJwQ7vkJ95EwESWkNRFJD7TQgYmCnrPtlu50b4XvT5MOmurWNrCj3IFdyjBQ5p9vnrX4JM6I8OE7g==}
cpu: [loong64]
os: [linux]
'@rollup/rollup-linux-ppc64-gnu@4.53.2':
resolution: {integrity: sha512-3HRQLUQbpBDMmzoxPJYd3W6vrVHOo2cVW8RUo87Xz0JPJcBLBr5kZ1pGcQAhdZgX9VV7NbGNipah1omKKe23/g==}
'@rollup/rollup-linux-ppc64-gnu@4.53.3':
resolution: {integrity: sha512-EoGSa8nd6d3T7zLuqdojxC20oBfNT8nexBbB/rkxgKj5T5vhpAQKKnD+h3UkoMuTyXkP5jTjK/ccNRmQrPNDuw==}
cpu: [ppc64]
os: [linux]
'@rollup/rollup-linux-riscv64-gnu@4.53.2':
resolution: {integrity: sha512-fMjKi+ojnmIvhk34gZP94vjogXNNUKMEYs+EDaB/5TG/wUkoeua7p7VCHnE6T2Tx+iaghAqQX8teQzcvrYpaQA==}
'@rollup/rollup-linux-riscv64-gnu@4.53.3':
resolution: {integrity: sha512-4s+Wped2IHXHPnAEbIB0YWBv7SDohqxobiiPA1FIWZpX+w9o2i4LezzH/NkFUl8LRci/8udci6cLq+jJQlh+0g==}
cpu: [riscv64]
os: [linux]
'@rollup/rollup-linux-riscv64-musl@4.53.2':
resolution: {integrity: sha512-XuGFGU+VwUUV5kLvoAdi0Wz5Xbh2SrjIxCtZj6Wq8MDp4bflb/+ThZsVxokM7n0pcbkEr2h5/pzqzDYI7cCgLQ==}
'@rollup/rollup-linux-riscv64-musl@4.53.3':
resolution: {integrity: sha512-68k2g7+0vs2u9CxDt5ktXTngsxOQkSEV/xBbwlqYcUrAVh6P9EgMZvFsnHy4SEiUl46Xf0IObWVbMvPrr2gw8A==}
cpu: [riscv64]
os: [linux]
'@rollup/rollup-linux-s390x-gnu@4.53.2':
resolution: {integrity: sha512-w6yjZF0P+NGzWR3AXWX9zc0DNEGdtvykB03uhonSHMRa+oWA6novflo2WaJr6JZakG2ucsyb+rvhrKac6NIy+w==}
'@rollup/rollup-linux-s390x-gnu@4.53.3':
resolution: {integrity: sha512-VYsFMpULAz87ZW6BVYw3I6sWesGpsP9OPcyKe8ofdg9LHxSbRMd7zrVrr5xi/3kMZtpWL/wC+UIJWJYVX5uTKg==}
cpu: [s390x]
os: [linux]
'@rollup/rollup-linux-x64-gnu@4.53.2':
resolution: {integrity: sha512-yo8d6tdfdeBArzC7T/PnHd7OypfI9cbuZzPnzLJIyKYFhAQ8SvlkKtKBMbXDxe1h03Rcr7u++nFS7tqXz87Gtw==}
'@rollup/rollup-linux-x64-gnu@4.53.3':
resolution: {integrity: sha512-3EhFi1FU6YL8HTUJZ51imGJWEX//ajQPfqWLI3BQq4TlvHy4X0MOr5q3D2Zof/ka0d5FNdPwZXm3Yyib/UEd+w==}
cpu: [x64]
os: [linux]
'@rollup/rollup-linux-x64-musl@4.53.2':
resolution: {integrity: sha512-ah59c1YkCxKExPP8O9PwOvs+XRLKwh/mV+3YdKqQ5AMQ0r4M4ZDuOrpWkUaqO7fzAHdINzV9tEVu8vNw48z0lA==}
'@rollup/rollup-linux-x64-musl@4.53.3':
resolution: {integrity: sha512-eoROhjcc6HbZCJr+tvVT8X4fW3/5g/WkGvvmwz/88sDtSJzO7r/blvoBDgISDiCjDRZmHpwud7h+6Q9JxFwq1Q==}
cpu: [x64]
os: [linux]
'@rollup/rollup-openharmony-arm64@4.53.2':
resolution: {integrity: sha512-4VEd19Wmhr+Zy7hbUsFZ6YXEiP48hE//KPLCSVNY5RMGX2/7HZ+QkN55a3atM1C/BZCGIgqN+xrVgtdak2S9+A==}
'@rollup/rollup-openharmony-arm64@4.53.3':
resolution: {integrity: sha512-OueLAWgrNSPGAdUdIjSWXw+u/02BRTcnfw9PN41D2vq/JSEPnJnVuBgw18VkN8wcd4fjUs+jFHVM4t9+kBSNLw==}
cpu: [arm64]
os: [openharmony]
'@rollup/rollup-win32-arm64-msvc@4.53.2':
resolution: {integrity: sha512-IlbHFYc/pQCgew/d5fslcy1KEaYVCJ44G8pajugd8VoOEI8ODhtb/j8XMhLpwHCMB3yk2J07ctup10gpw2nyMA==}
'@rollup/rollup-win32-arm64-msvc@4.53.3':
resolution: {integrity: sha512-GOFuKpsxR/whszbF/bzydebLiXIHSgsEUp6M0JI8dWvi+fFa1TD6YQa4aSZHtpmh2/uAlj/Dy+nmby3TJ3pkTw==}
cpu: [arm64]
os: [win32]
'@rollup/rollup-win32-ia32-msvc@4.53.2':
resolution: {integrity: sha512-lNlPEGgdUfSzdCWU176ku/dQRnA7W+Gp8d+cWv73jYrb8uT7HTVVxq62DUYxjbaByuf1Yk0RIIAbDzp+CnOTFg==}
'@rollup/rollup-win32-ia32-msvc@4.53.3':
resolution: {integrity: sha512-iah+THLcBJdpfZ1TstDFbKNznlzoxa8fmnFYK4V67HvmuNYkVdAywJSoteUszvBQ9/HqN2+9AZghbajMsFT+oA==}
cpu: [ia32]
os: [win32]
'@rollup/rollup-win32-x64-gnu@4.53.2':
resolution: {integrity: sha512-S6YojNVrHybQis2lYov1sd+uj7K0Q05NxHcGktuMMdIQ2VixGwAfbJ23NnlvvVV1bdpR2m5MsNBViHJKcA4ADw==}
'@rollup/rollup-win32-x64-gnu@4.53.3':
resolution: {integrity: sha512-J9QDiOIZlZLdcot5NXEepDkstocktoVjkaKUtqzgzpt2yWjGlbYiKyp05rWwk4nypbYUNoFAztEgixoLaSETkg==}
cpu: [x64]
os: [win32]
'@rollup/rollup-win32-x64-msvc@4.53.2':
resolution: {integrity: sha512-k+/Rkcyx//P6fetPoLMb8pBeqJBNGx81uuf7iljX9++yNBVRDQgD04L+SVXmXmh5ZP4/WOp4mWF0kmi06PW2tA==}
'@rollup/rollup-win32-x64-msvc@4.53.3':
resolution: {integrity: sha512-UhTd8u31dXadv0MopwGgNOBpUVROFKWVQgAg5N1ESyCz8AuBcMqm4AuTjrwgQKGDfoFuz02EuMRHQIw/frmYKQ==}
cpu: [x64]
os: [win32]
@ -584,8 +584,8 @@ packages:
resolution: {integrity: sha512-3Ybi1tAuwAP9s0r1UQ2J4n5Y0G05bJkpUIO0/bI9MhwmD70S5aTWbXGBwxHrelT+XM1k6dM0pk+SwNkpTRN7Pg==}
engines: {node: ^10 || ^12 || >=14}
rollup@4.53.2:
resolution: {integrity: sha512-MHngMYwGJVi6Fmnk6ISmnk7JAHRNF0UkuucA0CUW3N3a4KnONPEZz+vUanQP/ZC/iY1Qkf3bwPWzyY84wEks1g==}
rollup@4.53.3:
resolution: {integrity: sha512-w8GmOxZfBmKknvdXU1sdM9NHcoQejwF/4mNgj2JuEEdRaHwwF12K7e9eXn1nLZ07ad+du76mkVsyeb2rKGllsA==}
engines: {node: '>=18.0.0', npm: '>=8.0.0'}
hasBin: true
@ -790,70 +790,70 @@ snapshots:
'@jridgewell/resolve-uri': 3.1.2
'@jridgewell/sourcemap-codec': 1.5.5
'@rollup/rollup-android-arm-eabi@4.53.2':
'@rollup/rollup-android-arm-eabi@4.53.3':
optional: true
'@rollup/rollup-android-arm64@4.53.2':
'@rollup/rollup-android-arm64@4.53.3':
optional: true
'@rollup/rollup-darwin-arm64@4.53.2':
'@rollup/rollup-darwin-arm64@4.53.3':
optional: true
'@rollup/rollup-darwin-x64@4.53.2':
'@rollup/rollup-darwin-x64@4.53.3':
optional: true
'@rollup/rollup-freebsd-arm64@4.53.2':
'@rollup/rollup-freebsd-arm64@4.53.3':
optional: true
'@rollup/rollup-freebsd-x64@4.53.2':
'@rollup/rollup-freebsd-x64@4.53.3':
optional: true
'@rollup/rollup-linux-arm-gnueabihf@4.53.2':
'@rollup/rollup-linux-arm-gnueabihf@4.53.3':
optional: true
'@rollup/rollup-linux-arm-musleabihf@4.53.2':
'@rollup/rollup-linux-arm-musleabihf@4.53.3':
optional: true
'@rollup/rollup-linux-arm64-gnu@4.53.2':
'@rollup/rollup-linux-arm64-gnu@4.53.3':
optional: true
'@rollup/rollup-linux-arm64-musl@4.53.2':
'@rollup/rollup-linux-arm64-musl@4.53.3':
optional: true
'@rollup/rollup-linux-loong64-gnu@4.53.2':
'@rollup/rollup-linux-loong64-gnu@4.53.3':
optional: true
'@rollup/rollup-linux-ppc64-gnu@4.53.2':
'@rollup/rollup-linux-ppc64-gnu@4.53.3':
optional: true
'@rollup/rollup-linux-riscv64-gnu@4.53.2':
'@rollup/rollup-linux-riscv64-gnu@4.53.3':
optional: true
'@rollup/rollup-linux-riscv64-musl@4.53.2':
'@rollup/rollup-linux-riscv64-musl@4.53.3':
optional: true
'@rollup/rollup-linux-s390x-gnu@4.53.2':
'@rollup/rollup-linux-s390x-gnu@4.53.3':
optional: true
'@rollup/rollup-linux-x64-gnu@4.53.2':
'@rollup/rollup-linux-x64-gnu@4.53.3':
optional: true
'@rollup/rollup-linux-x64-musl@4.53.2':
'@rollup/rollup-linux-x64-musl@4.53.3':
optional: true
'@rollup/rollup-openharmony-arm64@4.53.2':
'@rollup/rollup-openharmony-arm64@4.53.3':
optional: true
'@rollup/rollup-win32-arm64-msvc@4.53.2':
'@rollup/rollup-win32-arm64-msvc@4.53.3':
optional: true
'@rollup/rollup-win32-ia32-msvc@4.53.2':
'@rollup/rollup-win32-ia32-msvc@4.53.3':
optional: true
'@rollup/rollup-win32-x64-gnu@4.53.2':
'@rollup/rollup-win32-x64-gnu@4.53.3':
optional: true
'@rollup/rollup-win32-x64-msvc@4.53.2':
'@rollup/rollup-win32-x64-msvc@4.53.3':
optional: true
'@socket.io/component-emitter@3.1.2': {}
@ -1076,32 +1076,32 @@ snapshots:
picocolors: 1.1.1
source-map-js: 1.2.1
rollup@4.53.2:
rollup@4.53.3:
dependencies:
'@types/estree': 1.0.8
optionalDependencies:
'@rollup/rollup-android-arm-eabi': 4.53.2
'@rollup/rollup-android-arm64': 4.53.2
'@rollup/rollup-darwin-arm64': 4.53.2
'@rollup/rollup-darwin-x64': 4.53.2
'@rollup/rollup-freebsd-arm64': 4.53.2
'@rollup/rollup-freebsd-x64': 4.53.2
'@rollup/rollup-linux-arm-gnueabihf': 4.53.2
'@rollup/rollup-linux-arm-musleabihf': 4.53.2
'@rollup/rollup-linux-arm64-gnu': 4.53.2
'@rollup/rollup-linux-arm64-musl': 4.53.2
'@rollup/rollup-linux-loong64-gnu': 4.53.2
'@rollup/rollup-linux-ppc64-gnu': 4.53.2
'@rollup/rollup-linux-riscv64-gnu': 4.53.2
'@rollup/rollup-linux-riscv64-musl': 4.53.2
'@rollup/rollup-linux-s390x-gnu': 4.53.2
'@rollup/rollup-linux-x64-gnu': 4.53.2
'@rollup/rollup-linux-x64-musl': 4.53.2
'@rollup/rollup-openharmony-arm64': 4.53.2
'@rollup/rollup-win32-arm64-msvc': 4.53.2
'@rollup/rollup-win32-ia32-msvc': 4.53.2
'@rollup/rollup-win32-x64-gnu': 4.53.2
'@rollup/rollup-win32-x64-msvc': 4.53.2
'@rollup/rollup-android-arm-eabi': 4.53.3
'@rollup/rollup-android-arm64': 4.53.3
'@rollup/rollup-darwin-arm64': 4.53.3
'@rollup/rollup-darwin-x64': 4.53.3
'@rollup/rollup-freebsd-arm64': 4.53.3
'@rollup/rollup-freebsd-x64': 4.53.3
'@rollup/rollup-linux-arm-gnueabihf': 4.53.3
'@rollup/rollup-linux-arm-musleabihf': 4.53.3
'@rollup/rollup-linux-arm64-gnu': 4.53.3
'@rollup/rollup-linux-arm64-musl': 4.53.3
'@rollup/rollup-linux-loong64-gnu': 4.53.3
'@rollup/rollup-linux-ppc64-gnu': 4.53.3
'@rollup/rollup-linux-riscv64-gnu': 4.53.3
'@rollup/rollup-linux-riscv64-musl': 4.53.3
'@rollup/rollup-linux-s390x-gnu': 4.53.3
'@rollup/rollup-linux-x64-gnu': 4.53.3
'@rollup/rollup-linux-x64-musl': 4.53.3
'@rollup/rollup-openharmony-arm64': 4.53.3
'@rollup/rollup-win32-arm64-msvc': 4.53.3
'@rollup/rollup-win32-ia32-msvc': 4.53.3
'@rollup/rollup-win32-x64-gnu': 4.53.3
'@rollup/rollup-win32-x64-msvc': 4.53.3
fsevents: 2.3.3
socket.io-client@4.8.1:
@ -1156,7 +1156,7 @@ snapshots:
fdir: 6.5.0(picomatch@4.0.3)
picomatch: 4.0.3
postcss: 8.5.6
rollup: 4.53.2
rollup: 4.53.3
tinyglobby: 0.2.15
optionalDependencies:
fsevents: 2.3.3

View file

@ -1,7 +1,6 @@
apis/OpenapiOtherApi.ts
apis/index.ts
index.ts
models/ChatTest200Response.ts
models/DisableOtp200Response.ts
models/DisableOtp401Response.ts
models/DisableOtp500Response.ts

View file

@ -15,7 +15,6 @@
import * as runtime from '../runtime';
import type {
ChatTest200Response,
DisableOtp200Response,
DisableOtp401Response,
DisableOtp500Response,
@ -47,8 +46,6 @@ import type {
StatusOtp500Response,
} from '../models/index';
import {
ChatTest200ResponseFromJSON,
ChatTest200ResponseToJSON,
DisableOtp200ResponseFromJSON,
DisableOtp200ResponseToJSON,
DisableOtp401ResponseFromJSON,
@ -130,85 +127,6 @@ export interface SigninRequest {
*/
export class OpenapiOtherApi extends runtime.BaseAPI {
/**
*/
async apiChatSocketIoGetRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
let urlPath = `/api/chat/socket.io`;
const response = await this.request({
path: urlPath,
method: 'GET',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
// CHANGED: Handle all status codes defined in the OpenAPI spec, not just 2xx responses
// This allows typed access to error responses (4xx, 5xx) and other status codes.
// The code routes responses based on the actual HTTP status code and returns
// appropriately typed ApiResponse wrappers for each status code.
if (response.status === 200) {
// No body response for status 200
return new runtime.VoidApiResponse(response);
}
// CHANGED: Throw error if status code is not handled by any of the defined responses
// This ensures all code paths return a value and provides clear error messages for unexpected status codes
// Only throw if responses were defined but none matched the actual status code
throw new runtime.ResponseError(response, `Unexpected status code: ${response.status}. Expected one of: 200`);
}
/**
*/
async apiChatSocketIoGet(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
await this.apiChatSocketIoGetRaw(initOverrides);
}
/**
*/
async chatTestRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ChatTest200Response | StatusOtp401Response>> {
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
let urlPath = `/api/chat/test`;
const response = await this.request({
path: urlPath,
method: 'GET',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
// CHANGED: Handle all status codes defined in the OpenAPI spec, not just 2xx responses
// This allows typed access to error responses (4xx, 5xx) and other status codes.
// The code routes responses based on the actual HTTP status code and returns
// appropriately typed ApiResponse wrappers for each status code.
if (response.status === 200) {
// Object response for status 200
return new runtime.JSONApiResponse(response, (jsonValue) => ChatTest200ResponseFromJSON(jsonValue));
}
if (response.status === 401) {
// Object response for status 401
return new runtime.JSONApiResponse(response, (jsonValue) => StatusOtp401ResponseFromJSON(jsonValue));
}
// CHANGED: Throw error if status code is not handled by any of the defined responses
// This ensures all code paths return a value and provides clear error messages for unexpected status codes
// Only throw if responses were defined but none matched the actual status code
throw new runtime.ResponseError(response, `Unexpected status code: ${response.status}. Expected one of: 200, 401`);
}
/**
*/
async chatTest(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ChatTest200Response | StatusOtp401Response> {
const response = await this.chatTestRaw(initOverrides);
return await response.value();
}
/**
*/
async disableOtpRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<DisableOtp200Response | DisableOtp401Response | DisableOtp500Response>> {

View file

@ -1,6 +1,5 @@
/* tslint:disable */
/* eslint-disable */
export * from './ChatTest200Response';
export * from './DisableOtp200Response';
export * from './DisableOtp401Response';
export * from './DisableOtp500Response';

View file

@ -6,7 +6,7 @@
<h1 class="text-3xl font-bold text-gray-800">
Chat Box <span id="t-username"></span>
</h1><br>
<button id="b-logout" class="btn-style absolute top-6 right-6">Kill Server</button>
<button id="b-logout" class="btn-style absolute top-6 right-6">Clear Text</button>

View file

@ -2,7 +2,7 @@ import { addRoute, setTitle, type RouteHandlerParams, type RouteHandlerReturn }
import { showError } from "@app/toast";
import authHtml from './chat.html?raw';
import client from '@app/api'
import { updateUser } from "@app/auth";
import { getUser, updateUser } from "@app/auth";
import io from "socket.io-client";
@ -18,10 +18,11 @@ const socket = io("wss://localhost:8888", {
socket.on("connect", async () => {
console.log("I AM Connected to the server: ", socket.id);
// Emit a custom event 'coucou' with some data
socket.emit("coucou", { message: "Hello Nigel from coucou!" });
//socket.emit("coucou", { message: " Nigel from coucou!" });
console.log('sent console.log coucou');
//socket.emit('testend', socket.id);
// Send a message to the server
socket.send("Hello from the client: " + `${socket.id}`);
//socket.send(" from the client: " + `${socket.id}`);
});
@ -53,39 +54,70 @@ function handleChat(_url: string, _args: RouteHandlerParams): RouteHandlerReturn
const sendButton = document.getElementById('b-send') as HTMLButtonElement;
const chatWindow = document.getElementById('t-chatbox') as HTMLDivElement;
const sendtextbox = document.getElementById('t-chat-window') as HTMLButtonElement;
const blogout = document.getElementById('b-logout') as HTMLButtonElement;
const clearText = document.getElementById('b-logout') as HTMLButtonElement;
const bwhoami = document.getElementById('b-whoami') as HTMLButtonElement;
const username = document.getElementById('username') as HTMLDivElement;
const value = await client.chatTest();
if (value.kind === "success") {
console.log(value.payload);
}
else if (value.kind === "notLoggedIn") {
// const value = await client.chatTest();
// if (value.kind === "success") {
// console.log(value.payload);
// }
// else if (value.kind === "notLoggedIn") {
} else {
console.log('unknown response: ', value);
}
// } else {
// console.log('unknown response: ', value);
// }
// Add a new message to the chat display
const addMessage = (text: any) => {
const messageElement = document.createElement('div');
messageElement.textContent = JSON.stringify(text, null, 2);
chatWindow.appendChild(messageElement);
chatWindow.scrollTop = chatWindow.scrollHeight; //puts scroll to the bottom
};
// Helper to add a message locally
sendButton!.addEventListener('click', async () => {
let msgtext: string = sendtextbox.value;
const addMessage = (text: string) => {
if (!chatWindow) return;
const messageElement = document.createElement("div");
messageElement.textContent = text;
chatWindow.appendChild(messageElement);
chatWindow.scrollTop = chatWindow.scrollHeight;
};
if (msgtext) {
addMessage(msgtext);
sendtextbox.value = "";
}
});
// Send button
sendButton?.addEventListener("click", () => {
if (sendtextbox && sendtextbox.value.trim()) {
const msgText = sendtextbox.value.trim();
addMessage(msgText);
chatWindow.textContent = "helloWorld";
const user = getUser();
if (user && socket?.connected) {
const message = {
type: "chat",
user: user.name,
id: document.cookie,
text: msgText,
timestamp: Date.now(),
userID: socket.id,
};
socket.send(JSON.stringify(message));
}
sendtextbox.value = "";
}
});
// Clear Text button
clearText?.addEventListener("click", () => {
if (chatWindow) {
chatWindow.innerHTML = '';
}
});
// Enter key to send message
sendtextbox!.addEventListener('keydown', (event) => {
if (event.key === 'Enter') {
sendButton?.click();
}
});
chatWindow.textContent = "World";
// Whoami button to display user name
bwhoami?.addEventListener('click', async () => {

View file

@ -1,48 +1,48 @@
////WORKING ON THE SEPARATE NONO FUCTIONNELING SOCKET CLIENT TO BE IMPORTED INTO CHAT.TS////
import io from "socket.io-client";
// import io from "socket.io-client";
// const socket = io("wss://localhost:8888");
// // const socket = io("wss://localhost:8888");
export const socket = io("wss://localhost:8888", {
path: "/api/chat/socket.io/",
secure: false,
transports: ["websocket"],
});
// export const socket = io("wss://localhost:8888", {
// path: "/api/chat/socket.io/",
// secure: false,
// transports: ["websocket"],
// });
// Listen for the 'connect' event
socket.on("connect", async () => {
console.log("I AM Connected to the server: ", socket.id);
// Emit a custom event 'coucou' with some data
socket.emit("MsgObjectClient", { message: "Hello Nigel from coucou!" });
console.log('sent console.log coucou');
// Send a message to the server
socket.send("Hello from the client: " + `${socket.id}`);
console.log("MESSAGE REPLY RETURNED FROM SERVER =====>: ", socket.emit("Hello", {hello: "Hello Nigel from coucou!"}).id);
});
// // Listen for the 'connect' event
// socket.on("connect", async () => {
// console.log("I AM Connected to the server: ", socket.id);
// // Emit a custom event 'coucou' with some data
// socket.emit("MsgObjectClient", { message: " Nigel from coucou!" });
// console.log('sent console.log coucou');
// // Send a message to the server
// socket.send(" from the client: " + `${socket.id}`);
// console.log("MESSAGE REPLY RETURNED FROM SERVER =====>: ", socket.emit("", {: " Nigel from coucou!"}).id);
// });
// Listen for messages from the server
socket.on("MsgObjectServer", (data) => {
console.log("Message from server:", data);
});
// // Listen for messages from the server
// socket.on("MsgObjectServer", (data) => {
// console.log("Message from server:", data);
// });
socket.on("Hello", (data) => {
console.log("MESSAGE REPLY RETURNED FROM SERVER =====>:", data);
});
// socket.on("", (data) => {
// console.log("MESSAGE REPLY RETURNED FROM SERVER =====>:", data);
// });
// Disconnected
socket.on("disconnect", (reason) => {
console.log("Socket disconnected:", reason);
});
// // Disconnected
// socket.on("disconnect", (reason) => {
// console.log("Socket disconnected:", reason);
// });
// Socket.IO connection errors
socket.on("connect_error", (err) => {
console.error("Connection error:", err.message);
});
// // Socket.IO connection errors
// socket.on("connect_error", (err) => {
// console.error("Connection error:", err.message);
// });
// Server-side errors
socket.on("error", (err) => {
console.error("Socket error:", err);
});
// // Server-side errors
// socket.on("error", (err) => {
// console.error("Socket error:", err);
// });