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

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';