feat(user): added description and global guest user mute

This commit is contained in:
Maieul BOYER 2025-12-18 14:46:02 +01:00 committed by Maix0
parent bcba86ed8a
commit 556138d624
24 changed files with 1856 additions and 1460 deletions

View file

@ -1,6 +1,12 @@
apis/OpenapiOtherApi.ts
apis/index.ts
index.ts
models/AllowGuestMessage200Response.ts
models/AllowGuestMessage403Response.ts
models/ChangeDesc200Response.ts
models/ChangeDesc400Response.ts
models/ChangeDesc403Response.ts
models/ChangeDescRequest.ts
models/ChangeDisplayName200Response.ts
models/ChangeDisplayName400Response.ts
models/ChangeDisplayNameRequest.ts

View file

@ -15,6 +15,12 @@
import * as runtime from '../runtime';
import type {
AllowGuestMessage200Response,
AllowGuestMessage403Response,
ChangeDesc200Response,
ChangeDesc400Response,
ChangeDesc403Response,
ChangeDescRequest,
ChangeDisplayName200Response,
ChangeDisplayName400Response,
ChangeDisplayNameRequest,
@ -57,6 +63,18 @@ import type {
StatusOtp500Response,
} from '../models/index';
import {
AllowGuestMessage200ResponseFromJSON,
AllowGuestMessage200ResponseToJSON,
AllowGuestMessage403ResponseFromJSON,
AllowGuestMessage403ResponseToJSON,
ChangeDesc200ResponseFromJSON,
ChangeDesc200ResponseToJSON,
ChangeDesc400ResponseFromJSON,
ChangeDesc400ResponseToJSON,
ChangeDesc403ResponseFromJSON,
ChangeDesc403ResponseToJSON,
ChangeDescRequestFromJSON,
ChangeDescRequestToJSON,
ChangeDisplayName200ResponseFromJSON,
ChangeDisplayName200ResponseToJSON,
ChangeDisplayName400ResponseFromJSON,
@ -139,6 +157,10 @@ import {
StatusOtp500ResponseToJSON,
} from '../models/index';
export interface ChangeDescOperationRequest {
changeDescRequest: ChangeDescRequest;
}
export interface ChangeDisplayNameOperationRequest {
changeDisplayNameRequest: ChangeDisplayNameRequest;
}
@ -172,6 +194,112 @@ export interface SigninRequest {
*/
export class OpenapiOtherApi extends runtime.BaseAPI {
/**
*/
async allowGuestMessageRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AllowGuestMessage200Response | StatusOtp401Response | AllowGuestMessage403Response>> {
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
let urlPath = `/api/user/allowGuestMessage`;
const response = await this.request({
path: urlPath,
method: 'POST',
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) => AllowGuestMessage200ResponseFromJSON(jsonValue));
}
if (response.status === 401) {
// Object response for status 401
return new runtime.JSONApiResponse(response, (jsonValue) => StatusOtp401ResponseFromJSON(jsonValue));
}
if (response.status === 403) {
// Object response for status 403
return new runtime.JSONApiResponse(response, (jsonValue) => AllowGuestMessage403ResponseFromJSON(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, 403`);
}
/**
*/
async allowGuestMessage(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AllowGuestMessage200Response | StatusOtp401Response | AllowGuestMessage403Response> {
const response = await this.allowGuestMessageRaw(initOverrides);
return await response.value();
}
/**
*/
async changeDescRaw(requestParameters: ChangeDescOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ChangeDesc200Response | ChangeDesc400Response | ChangePassword401Response | ChangeDesc403Response>> {
if (requestParameters['changeDescRequest'] == null) {
throw new runtime.RequiredError(
'changeDescRequest',
'Required parameter "changeDescRequest" was null or undefined when calling changeDesc().'
);
}
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
headerParameters['Content-Type'] = 'application/json';
let urlPath = `/api/user/changeDesc`;
const response = await this.request({
path: urlPath,
method: 'POST',
headers: headerParameters,
query: queryParameters,
body: ChangeDescRequestToJSON(requestParameters['changeDescRequest']),
}, 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) => ChangeDesc200ResponseFromJSON(jsonValue));
}
if (response.status === 400) {
// Object response for status 400
return new runtime.JSONApiResponse(response, (jsonValue) => ChangeDesc400ResponseFromJSON(jsonValue));
}
if (response.status === 401) {
// Object response for status 401
return new runtime.JSONApiResponse(response, (jsonValue) => ChangePassword401ResponseFromJSON(jsonValue));
}
if (response.status === 403) {
// Object response for status 403
return new runtime.JSONApiResponse(response, (jsonValue) => ChangeDesc403ResponseFromJSON(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, 400, 401, 403`);
}
/**
*/
async changeDesc(requestParameters: ChangeDescOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ChangeDesc200Response | ChangeDesc400Response | ChangePassword401Response | ChangeDesc403Response> {
const response = await this.changeDescRaw(requestParameters, initOverrides);
return await response.value();
}
/**
*/
async changeDisplayNameRaw(requestParameters: ChangeDisplayNameOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ChangeDisplayName200Response | ChangeDisplayName400Response | ChangePassword401Response>> {
@ -288,6 +416,52 @@ export class OpenapiOtherApi extends runtime.BaseAPI {
return await response.value();
}
/**
*/
async denyGuestMessageRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AllowGuestMessage200Response | StatusOtp401Response | AllowGuestMessage403Response>> {
const queryParameters: any = {};
const headerParameters: runtime.HTTPHeaders = {};
let urlPath = `/api/user/denyGuestMessage`;
const response = await this.request({
path: urlPath,
method: 'POST',
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) => AllowGuestMessage200ResponseFromJSON(jsonValue));
}
if (response.status === 401) {
// Object response for status 401
return new runtime.JSONApiResponse(response, (jsonValue) => StatusOtp401ResponseFromJSON(jsonValue));
}
if (response.status === 403) {
// Object response for status 403
return new runtime.JSONApiResponse(response, (jsonValue) => AllowGuestMessage403ResponseFromJSON(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, 403`);
}
/**
*/
async denyGuestMessage(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AllowGuestMessage200Response | StatusOtp401Response | AllowGuestMessage403Response> {
const response = await this.denyGuestMessageRaw(initOverrides);
return await response.value();
}
/**
*/
async disableOtpRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<DisableOtp200Response | DisableOtp400Response | ChangePassword401Response | DisableOtp500Response>> {

View file

@ -0,0 +1,93 @@
/* 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 AllowGuestMessage200Response
*/
export interface AllowGuestMessage200Response {
/**
*
* @type {string}
* @memberof AllowGuestMessage200Response
*/
kind: AllowGuestMessage200ResponseKindEnum;
/**
*
* @type {string}
* @memberof AllowGuestMessage200Response
*/
msg: AllowGuestMessage200ResponseMsgEnum;
}
/**
* @export
*/
export const AllowGuestMessage200ResponseKindEnum = {
Success: 'success'
} as const;
export type AllowGuestMessage200ResponseKindEnum = typeof AllowGuestMessage200ResponseKindEnum[keyof typeof AllowGuestMessage200ResponseKindEnum];
/**
* @export
*/
export const AllowGuestMessage200ResponseMsgEnum = {
GuestMessageSuccess: 'guestMessage.success'
} as const;
export type AllowGuestMessage200ResponseMsgEnum = typeof AllowGuestMessage200ResponseMsgEnum[keyof typeof AllowGuestMessage200ResponseMsgEnum];
/**
* Check if a given object implements the AllowGuestMessage200Response interface.
*/
export function instanceOfAllowGuestMessage200Response(value: object): value is AllowGuestMessage200Response {
if (!('kind' in value) || value['kind'] === undefined) return false;
if (!('msg' in value) || value['msg'] === undefined) return false;
return true;
}
export function AllowGuestMessage200ResponseFromJSON(json: any): AllowGuestMessage200Response {
return AllowGuestMessage200ResponseFromJSONTyped(json, false);
}
export function AllowGuestMessage200ResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): AllowGuestMessage200Response {
if (json == null) {
return json;
}
return {
'kind': json['kind'],
'msg': json['msg'],
};
}
export function AllowGuestMessage200ResponseToJSON(json: any): AllowGuestMessage200Response {
return AllowGuestMessage200ResponseToJSONTyped(json, false);
}
export function AllowGuestMessage200ResponseToJSONTyped(value?: AllowGuestMessage200Response | null, ignoreDiscriminator: boolean = false): any {
if (value == null) {
return value;
}
return {
'kind': value['kind'],
'msg': value['msg'],
};
}

View file

@ -0,0 +1,93 @@
/* 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 AllowGuestMessage403Response
*/
export interface AllowGuestMessage403Response {
/**
*
* @type {string}
* @memberof AllowGuestMessage403Response
*/
kind: AllowGuestMessage403ResponseKindEnum;
/**
*
* @type {string}
* @memberof AllowGuestMessage403Response
*/
msg: AllowGuestMessage403ResponseMsgEnum;
}
/**
* @export
*/
export const AllowGuestMessage403ResponseKindEnum = {
Failure: 'failure'
} as const;
export type AllowGuestMessage403ResponseKindEnum = typeof AllowGuestMessage403ResponseKindEnum[keyof typeof AllowGuestMessage403ResponseKindEnum];
/**
* @export
*/
export const AllowGuestMessage403ResponseMsgEnum = {
GuestMessageFailureNotLoggedIn: 'guestMessage.failure.notLoggedIn'
} as const;
export type AllowGuestMessage403ResponseMsgEnum = typeof AllowGuestMessage403ResponseMsgEnum[keyof typeof AllowGuestMessage403ResponseMsgEnum];
/**
* Check if a given object implements the AllowGuestMessage403Response interface.
*/
export function instanceOfAllowGuestMessage403Response(value: object): value is AllowGuestMessage403Response {
if (!('kind' in value) || value['kind'] === undefined) return false;
if (!('msg' in value) || value['msg'] === undefined) return false;
return true;
}
export function AllowGuestMessage403ResponseFromJSON(json: any): AllowGuestMessage403Response {
return AllowGuestMessage403ResponseFromJSONTyped(json, false);
}
export function AllowGuestMessage403ResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): AllowGuestMessage403Response {
if (json == null) {
return json;
}
return {
'kind': json['kind'],
'msg': json['msg'],
};
}
export function AllowGuestMessage403ResponseToJSON(json: any): AllowGuestMessage403Response {
return AllowGuestMessage403ResponseToJSONTyped(json, false);
}
export function AllowGuestMessage403ResponseToJSONTyped(value?: AllowGuestMessage403Response | null, ignoreDiscriminator: boolean = false): any {
if (value == null) {
return value;
}
return {
'kind': value['kind'],
'msg': value['msg'],
};
}

View file

@ -0,0 +1,93 @@
/* 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 ChangeDesc200Response
*/
export interface ChangeDesc200Response {
/**
*
* @type {string}
* @memberof ChangeDesc200Response
*/
kind: ChangeDesc200ResponseKindEnum;
/**
*
* @type {string}
* @memberof ChangeDesc200Response
*/
msg: ChangeDesc200ResponseMsgEnum;
}
/**
* @export
*/
export const ChangeDesc200ResponseKindEnum = {
Success: 'success'
} as const;
export type ChangeDesc200ResponseKindEnum = typeof ChangeDesc200ResponseKindEnum[keyof typeof ChangeDesc200ResponseKindEnum];
/**
* @export
*/
export const ChangeDesc200ResponseMsgEnum = {
ChangedescSuccess: 'changedesc.success'
} as const;
export type ChangeDesc200ResponseMsgEnum = typeof ChangeDesc200ResponseMsgEnum[keyof typeof ChangeDesc200ResponseMsgEnum];
/**
* Check if a given object implements the ChangeDesc200Response interface.
*/
export function instanceOfChangeDesc200Response(value: object): value is ChangeDesc200Response {
if (!('kind' in value) || value['kind'] === undefined) return false;
if (!('msg' in value) || value['msg'] === undefined) return false;
return true;
}
export function ChangeDesc200ResponseFromJSON(json: any): ChangeDesc200Response {
return ChangeDesc200ResponseFromJSONTyped(json, false);
}
export function ChangeDesc200ResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): ChangeDesc200Response {
if (json == null) {
return json;
}
return {
'kind': json['kind'],
'msg': json['msg'],
};
}
export function ChangeDesc200ResponseToJSON(json: any): ChangeDesc200Response {
return ChangeDesc200ResponseToJSONTyped(json, false);
}
export function ChangeDesc200ResponseToJSONTyped(value?: ChangeDesc200Response | null, ignoreDiscriminator: boolean = false): any {
if (value == null) {
return value;
}
return {
'kind': value['kind'],
'msg': value['msg'],
};
}

View file

@ -0,0 +1,93 @@
/* 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 ChangeDesc400Response
*/
export interface ChangeDesc400Response {
/**
*
* @type {string}
* @memberof ChangeDesc400Response
*/
kind: ChangeDesc400ResponseKindEnum;
/**
*
* @type {string}
* @memberof ChangeDesc400Response
*/
msg: ChangeDesc400ResponseMsgEnum;
}
/**
* @export
*/
export const ChangeDesc400ResponseKindEnum = {
Failure: 'failure'
} as const;
export type ChangeDesc400ResponseKindEnum = typeof ChangeDesc400ResponseKindEnum[keyof typeof ChangeDesc400ResponseKindEnum];
/**
* @export
*/
export const ChangeDesc400ResponseMsgEnum = {
ChangedescFailureDescTooLong: 'changedesc.failure.descTooLong'
} as const;
export type ChangeDesc400ResponseMsgEnum = typeof ChangeDesc400ResponseMsgEnum[keyof typeof ChangeDesc400ResponseMsgEnum];
/**
* Check if a given object implements the ChangeDesc400Response interface.
*/
export function instanceOfChangeDesc400Response(value: object): value is ChangeDesc400Response {
if (!('kind' in value) || value['kind'] === undefined) return false;
if (!('msg' in value) || value['msg'] === undefined) return false;
return true;
}
export function ChangeDesc400ResponseFromJSON(json: any): ChangeDesc400Response {
return ChangeDesc400ResponseFromJSONTyped(json, false);
}
export function ChangeDesc400ResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): ChangeDesc400Response {
if (json == null) {
return json;
}
return {
'kind': json['kind'],
'msg': json['msg'],
};
}
export function ChangeDesc400ResponseToJSON(json: any): ChangeDesc400Response {
return ChangeDesc400ResponseToJSONTyped(json, false);
}
export function ChangeDesc400ResponseToJSONTyped(value?: ChangeDesc400Response | null, ignoreDiscriminator: boolean = false): any {
if (value == null) {
return value;
}
return {
'kind': value['kind'],
'msg': value['msg'],
};
}

View file

@ -0,0 +1,93 @@
/* 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 ChangeDesc403Response
*/
export interface ChangeDesc403Response {
/**
*
* @type {string}
* @memberof ChangeDesc403Response
*/
kind: ChangeDesc403ResponseKindEnum;
/**
*
* @type {string}
* @memberof ChangeDesc403Response
*/
msg: ChangeDesc403ResponseMsgEnum;
}
/**
* @export
*/
export const ChangeDesc403ResponseKindEnum = {
Failure: 'failure'
} as const;
export type ChangeDesc403ResponseKindEnum = typeof ChangeDesc403ResponseKindEnum[keyof typeof ChangeDesc403ResponseKindEnum];
/**
* @export
*/
export const ChangeDesc403ResponseMsgEnum = {
ChangedescFailureNotLoggedIn: 'changedesc.failure.notLoggedIn'
} as const;
export type ChangeDesc403ResponseMsgEnum = typeof ChangeDesc403ResponseMsgEnum[keyof typeof ChangeDesc403ResponseMsgEnum];
/**
* Check if a given object implements the ChangeDesc403Response interface.
*/
export function instanceOfChangeDesc403Response(value: object): value is ChangeDesc403Response {
if (!('kind' in value) || value['kind'] === undefined) return false;
if (!('msg' in value) || value['msg'] === undefined) return false;
return true;
}
export function ChangeDesc403ResponseFromJSON(json: any): ChangeDesc403Response {
return ChangeDesc403ResponseFromJSONTyped(json, false);
}
export function ChangeDesc403ResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): ChangeDesc403Response {
if (json == null) {
return json;
}
return {
'kind': json['kind'],
'msg': json['msg'],
};
}
export function ChangeDesc403ResponseToJSON(json: any): ChangeDesc403Response {
return ChangeDesc403ResponseToJSONTyped(json, false);
}
export function ChangeDesc403ResponseToJSONTyped(value?: ChangeDesc403Response | null, ignoreDiscriminator: boolean = false): any {
if (value == null) {
return value;
}
return {
'kind': value['kind'],
'msg': value['msg'],
};
}

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 ChangeDescRequest
*/
export interface ChangeDescRequest {
/**
*
* @type {string}
* @memberof ChangeDescRequest
*/
desc: string;
}
/**
* Check if a given object implements the ChangeDescRequest interface.
*/
export function instanceOfChangeDescRequest(value: object): value is ChangeDescRequest {
if (!('desc' in value) || value['desc'] === undefined) return false;
return true;
}
export function ChangeDescRequestFromJSON(json: any): ChangeDescRequest {
return ChangeDescRequestFromJSONTyped(json, false);
}
export function ChangeDescRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): ChangeDescRequest {
if (json == null) {
return json;
}
return {
'desc': json['desc'],
};
}
export function ChangeDescRequestToJSON(json: any): ChangeDescRequest {
return ChangeDescRequestToJSONTyped(json, false);
}
export function ChangeDescRequestToJSONTyped(value?: ChangeDescRequest | null, ignoreDiscriminator: boolean = false): any {
if (value == null) {
return value;
}
return {
'desc': value['desc'],
};
}

View file

@ -1,5 +1,11 @@
/* tslint:disable */
/* eslint-disable */
export * from './AllowGuestMessage200Response';
export * from './AllowGuestMessage403Response';
export * from './ChangeDesc200Response';
export * from './ChangeDesc400Response';
export * from './ChangeDesc403Response';
export * from './ChangeDescRequest';
export * from './ChangeDisplayName200Response';
export * from './ChangeDisplayName400Response';
export * from './ChangeDisplayNameRequest';