import { queryParams, type RouteQueryOptions, type RouteDefinition, type RouteFormDefinition } from './../../wayfinder'
import posts from './posts'
import products from './products'
import coupons from './coupons'
/**
* @see \App\Http\Controllers\Wp\HandshakeController::__invoke
* @see app/Http/Controllers/Wp/HandshakeController.php:26
* @route '/api/v1/wp/handshake'
*/
export const handshake = (options?: RouteQueryOptions): RouteDefinition<'post'> => ({
    url: handshake.url(options),
    method: 'post',
})

handshake.definition = {
    methods: ["post"],
    url: '/api/v1/wp/handshake',
} satisfies RouteDefinition<["post"]>

/**
* @see \App\Http\Controllers\Wp\HandshakeController::__invoke
* @see app/Http/Controllers/Wp/HandshakeController.php:26
* @route '/api/v1/wp/handshake'
*/
handshake.url = (options?: RouteQueryOptions) => {
    return handshake.definition.url + queryParams(options)
}

/**
* @see \App\Http\Controllers\Wp\HandshakeController::__invoke
* @see app/Http/Controllers/Wp/HandshakeController.php:26
* @route '/api/v1/wp/handshake'
*/
handshake.post = (options?: RouteQueryOptions): RouteDefinition<'post'> => ({
    url: handshake.url(options),
    method: 'post',
})

/**
* @see \App\Http\Controllers\Wp\HandshakeController::__invoke
* @see app/Http/Controllers/Wp/HandshakeController.php:26
* @route '/api/v1/wp/handshake'
*/
const handshakeForm = (options?: RouteQueryOptions): RouteFormDefinition<'post'> => ({
    action: handshake.url(options),
    method: 'post',
})

/**
* @see \App\Http\Controllers\Wp\HandshakeController::__invoke
* @see app/Http/Controllers/Wp/HandshakeController.php:26
* @route '/api/v1/wp/handshake'
*/
handshakeForm.post = (options?: RouteQueryOptions): RouteFormDefinition<'post'> => ({
    action: handshake.url(options),
    method: 'post',
})

handshake.form = handshakeForm

const wp = {
    handshake: Object.assign(handshake, handshake),
    posts: Object.assign(posts, posts),
    products: Object.assign(products, products),
    coupons: Object.assign(coupons, coupons),
}

export default wp