/** * Generated by orval 🍺 * Do not edit manually. * API * API documentation for the starter-kit project in NestJS by BinarApps. The API allows management of users, sessions and offers various functions for logged in users. Contains examples of authentication, authorization, and CRUD for selected resources. * OpenAPI spec version: 1.0 */ import { faker } from '@faker-js/faker' import { HttpResponse, delay, http } from 'msw' import type { HealthEntity } from '../../types' export const getHealthControllerCheckResponseMock = ( overrideResponse: Partial = {} ): HealthEntity => ({ status: faker.string.alpha(20), info: { db: { status: faker.string.alpha(20) }, domain: { status: faker.string.alpha(20) }, cache: { status: faker.string.alpha(20) }, }, error: {}, details: { db: { status: faker.string.alpha(20) }, domain: { status: faker.string.alpha(20) }, cache: { status: faker.string.alpha(20) }, }, ...overrideResponse, }) export const getHealthControllerCheckMockHandler = ( overrideResponse?: | HealthEntity | (( info: Parameters[1]>[0] ) => Promise | HealthEntity) ) => { return http.get('*/api/v1/health', async (info) => { await delay(1000) return new HttpResponse( JSON.stringify( overrideResponse !== undefined ? typeof overrideResponse === 'function' ? await overrideResponse(info) : overrideResponse : getHealthControllerCheckResponseMock() ), { status: 200, headers: { 'Content-Type': 'application/json' } } ) }) } export const getHealthMock = () => [getHealthControllerCheckMockHandler()]