import { queryParams, type RouteQueryOptions, type RouteDefinition, type RouteFormDefinition } from './../../wayfinder'
/**
* @see routes/health.php:16
* @route '/health'
*/
export const check = (options?: RouteQueryOptions): RouteDefinition<'get'> => ({
    url: check.url(options),
    method: 'get',
})

check.definition = {
    methods: ["get","head"],
    url: '/health',
} satisfies RouteDefinition<["get","head"]>

/**
* @see routes/health.php:16
* @route '/health'
*/
check.url = (options?: RouteQueryOptions) => {
    return check.definition.url + queryParams(options)
}

/**
* @see routes/health.php:16
* @route '/health'
*/
check.get = (options?: RouteQueryOptions): RouteDefinition<'get'> => ({
    url: check.url(options),
    method: 'get',
})

/**
* @see routes/health.php:16
* @route '/health'
*/
check.head = (options?: RouteQueryOptions): RouteDefinition<'head'> => ({
    url: check.url(options),
    method: 'head',
})

/**
* @see routes/health.php:16
* @route '/health'
*/
const checkForm = (options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: check.url(options),
    method: 'get',
})

/**
* @see routes/health.php:16
* @route '/health'
*/
checkForm.get = (options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: check.url(options),
    method: 'get',
})

/**
* @see routes/health.php:16
* @route '/health'
*/
checkForm.head = (options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: check.url({
        [options?.mergeQuery ? 'mergeQuery' : 'query']: {
            _method: 'HEAD',
            ...(options?.query ?? options?.mergeQuery ?? {}),
        }
    }),
    method: 'get',
})

check.form = checkForm

/**
* @see routes/health.php:25
* @route '/nginx-health'
*/
export const nginx = (options?: RouteQueryOptions): RouteDefinition<'get'> => ({
    url: nginx.url(options),
    method: 'get',
})

nginx.definition = {
    methods: ["get","head"],
    url: '/nginx-health',
} satisfies RouteDefinition<["get","head"]>

/**
* @see routes/health.php:25
* @route '/nginx-health'
*/
nginx.url = (options?: RouteQueryOptions) => {
    return nginx.definition.url + queryParams(options)
}

/**
* @see routes/health.php:25
* @route '/nginx-health'
*/
nginx.get = (options?: RouteQueryOptions): RouteDefinition<'get'> => ({
    url: nginx.url(options),
    method: 'get',
})

/**
* @see routes/health.php:25
* @route '/nginx-health'
*/
nginx.head = (options?: RouteQueryOptions): RouteDefinition<'head'> => ({
    url: nginx.url(options),
    method: 'head',
})

/**
* @see routes/health.php:25
* @route '/nginx-health'
*/
const nginxForm = (options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: nginx.url(options),
    method: 'get',
})

/**
* @see routes/health.php:25
* @route '/nginx-health'
*/
nginxForm.get = (options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: nginx.url(options),
    method: 'get',
})

/**
* @see routes/health.php:25
* @route '/nginx-health'
*/
nginxForm.head = (options?: RouteQueryOptions): RouteFormDefinition<'get'> => ({
    action: nginx.url({
        [options?.mergeQuery ? 'mergeQuery' : 'query']: {
            _method: 'HEAD',
            ...(options?.query ?? options?.mergeQuery ?? {}),
        }
    }),
    method: 'get',
})

nginx.form = nginxForm

const health = {
    check: Object.assign(check, check),
    nginx: Object.assign(nginx, nginx),
}

export default health