Nigel/block user (#60)

* WIP block users

* Add test to check if the person for user X is blocked or not

* Added function isBlocked return true if user x is blocked by user y

* Added block ans un block messages

* Route / broadcast added ny Maix

* notification block and un block with icon now works, started clean up

* cleaning up the code

* cleaning up the code - WIP

* cleaning up the code - WIP

* clean up code - WIP

* clean up code - WIP

* WIP block users

* Add test to check if the person for user X is blocked or not

* Added function isBlocked return true if user x is blocked by user y

* Added block ans un block messages

* REBASE -trying

* REBASE trying

* REBASE problems

* REBASE problems

* REBASE problems

* MERGE problems

* REBASE problem

* REBASE problem

* clean up code - WIP

* MERGED master into nigel/blockUser

* linter OK

* TTT problem with package

* Deletes tic tac and icons
This commit is contained in:
Nigel 2025-12-16 15:21:07 +01:00 committed by GitHub
parent 64a820c0f0
commit 85eca5d301
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
60 changed files with 2613 additions and 1891 deletions

View file

@ -9,8 +9,6 @@ models/ChangePassword400Response.ts
models/ChangePassword401Response.ts
models/ChangePassword500Response.ts
models/ChangePasswordRequest.ts
models/ChatTest200Response.ts
models/ChatTest200ResponsePayload.ts
models/DisableOtp200Response.ts
models/DisableOtp400Response.ts
models/DisableOtp500Response.ts

View file

@ -23,7 +23,6 @@ import type {
ChangePassword401Response,
ChangePassword500Response,
ChangePasswordRequest,
ChatTest200Response,
DisableOtp200Response,
DisableOtp400Response,
DisableOtp500Response,
@ -74,8 +73,6 @@ import {
ChangePassword500ResponseToJSON,
ChangePasswordRequestFromJSON,
ChangePasswordRequestToJSON,
ChatTest200ResponseFromJSON,
ChatTest200ResponseToJSON,
DisableOtp200ResponseFromJSON,
DisableOtp200ResponseToJSON,
DisableOtp400ResponseFromJSON,
@ -291,48 +288,6 @@ export class OpenapiOtherApi extends runtime.BaseAPI {
return await response.value();
}
/**
*/
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 | DisableOtp400Response | ChangePassword401Response | DisableOtp500Response>> {

View file

@ -0,0 +1,66 @@
/* tslint:disable */
/* eslint-disable */
/**
* @fastify/swagger
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 9.6.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { mapValues } from '../runtime';
/**
*
* @export
* @interface ApiChatBroadcastPostRequest
*/
export interface ApiChatBroadcastPostRequest {
/**
*
* @type {string}
* @memberof ApiChatBroadcastPostRequest
*/
nextGame: string;
}
/**
* Check if a given object implements the ApiChatBroadcastPostRequest interface.
*/
export function instanceOfApiChatBroadcastPostRequest(value: object): value is ApiChatBroadcastPostRequest {
if (!('nextGame' in value) || value['nextGame'] === undefined) return false;
return true;
}
export function ApiChatBroadcastPostRequestFromJSON(json: any): ApiChatBroadcastPostRequest {
return ApiChatBroadcastPostRequestFromJSONTyped(json, false);
}
export function ApiChatBroadcastPostRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): ApiChatBroadcastPostRequest {
if (json == null) {
return json;
}
return {
'nextGame': json['nextGame'],
};
}
export function ApiChatBroadcastPostRequestToJSON(json: any): ApiChatBroadcastPostRequest {
return ApiChatBroadcastPostRequestToJSONTyped(json, false);
}
export function ApiChatBroadcastPostRequestToJSONTyped(value?: ApiChatBroadcastPostRequest | null, ignoreDiscriminator: boolean = false): any {
if (value == null) {
return value;
}
return {
'nextGame': value['nextGame'],
};
}

View file

@ -8,8 +8,6 @@ export * from './ChangePassword400Response';
export * from './ChangePassword401Response';
export * from './ChangePassword500Response';
export * from './ChangePasswordRequest';
export * from './ChatTest200Response';
export * from './ChatTest200ResponsePayload';
export * from './DisableOtp200Response';
export * from './DisableOtp400Response';
export * from './DisableOtp500Response';