import { introspectionResponseSchema, sqlConnectionBodySchema, sqlDeleteBodySchema, sqlInsertBodySchema, sqlQueryBodySchema, sqlRowsResponseSchema, sqlUpdateBodySchema, } from '@/lib/api/contracts/tools/databases/shared' import { type ContractBodyInput, type ContractJsonResponse, defineRouteContract, } from '@/lib/api/contracts/types' export const mysqlQueryBodySchema = sqlQueryBodySchema export const mysqlExecuteBodySchema = sqlQueryBodySchema export const mysqlInsertBodySchema = sqlInsertBodySchema export const mysqlUpdateBodySchema = sqlUpdateBodySchema export const mysqlDeleteBodySchema = sqlDeleteBodySchema export const mysqlIntrospectBodySchema = sqlConnectionBodySchema export const mysqlQueryContract = defineRouteContract({ method: 'POST', path: '/api/tools/mysql/query', body: mysqlQueryBodySchema, response: { mode: 'json', schema: sqlRowsResponseSchema }, }) export const mysqlExecuteContract = defineRouteContract({ method: 'POST', path: '/api/tools/mysql/execute', body: mysqlExecuteBodySchema, response: { mode: 'json', schema: sqlRowsResponseSchema }, }) export const mysqlInsertContract = defineRouteContract({ method: 'POST', path: '/api/tools/mysql/insert', body: mysqlInsertBodySchema, response: { mode: 'json', schema: sqlRowsResponseSchema }, }) export const mysqlUpdateContract = defineRouteContract({ method: 'POST', path: '/api/tools/mysql/update', body: mysqlUpdateBodySchema, response: { mode: 'json', schema: sqlRowsResponseSchema }, }) export const mysqlDeleteContract = defineRouteContract({ method: 'POST', path: '/api/tools/mysql/delete', body: mysqlDeleteBodySchema, response: { mode: 'json', schema: sqlRowsResponseSchema }, }) export const mysqlIntrospectContract = defineRouteContract({ method: 'POST', path: '/api/tools/mysql/introspect', body: mysqlIntrospectBodySchema, response: { mode: 'json', schema: introspectionResponseSchema }, }) export type MySQLQueryRequest = ContractBodyInput export type MySQLQueryResponse = ContractJsonResponse export type MySQLExecuteRequest = ContractBodyInput export type MySQLExecuteResponse = ContractJsonResponse export type MySQLInsertRequest = ContractBodyInput export type MySQLInsertResponse = ContractJsonResponse export type MySQLUpdateRequest = ContractBodyInput export type MySQLUpdateResponse = ContractJsonResponse export type MySQLDeleteRequest = ContractBodyInput export type MySQLDeleteResponse = ContractJsonResponse export type MySQLIntrospectRequest = ContractBodyInput export type MySQLIntrospectResponse = ContractJsonResponse