mirror of
https://github.com/vercel/commerce.git
synced 2025-05-17 23:16:59 +00:00
24 lines
683 B
TypeScript
24 lines
683 B
TypeScript
import { GetAPISchema, createEndpoint } from '@vercel/commerce/api'
|
|
import checkoutEndpoint from '@vercel/commerce/api/endpoints/checkout'
|
|
import type { CheckoutSchema } from '@vercel/commerce/types/checkout'
|
|
import type { CommercejsAPI } from '../..'
|
|
|
|
import submitCheckout from './submit-checkout'
|
|
import getCheckout from './get-checkout'
|
|
|
|
export type CheckoutAPI = GetAPISchema<CommercejsAPI, CheckoutSchema>
|
|
|
|
export type CheckoutEndpoint = CheckoutAPI['endpoint']
|
|
|
|
export const handlers: CheckoutEndpoint['handlers'] = {
|
|
submitCheckout,
|
|
getCheckout,
|
|
}
|
|
|
|
const checkoutApi = createEndpoint<CheckoutAPI>({
|
|
handler: checkoutEndpoint,
|
|
handlers,
|
|
})
|
|
|
|
export default checkoutApi
|