-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathapi.ts
61 lines (52 loc) · 3.36 KB
/
api.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
import { route } from '@stacksjs/router'
/**
* This file is the entry point for your application's API routes.
* The routes defined here are automatically registered. Last but
* not least, you may also create any other `routes/*.ts` files.
*
* @see https://docs.stacksjs.org/routing
*/
route.get('/foo/bar/{id}', () => 'hello world, foo bar') // $API_URL/hello/world
route.get('/', () => 'hello world') // $API_URL
route.get('/hello/world', () => 'hello world, buddy') // $API_URL/hello/world
route.post('/email/subscribe', 'Actions/SubscriberEmailAction')
route.post('/login', 'Actions/LoginAction')
route.get('/generate-registration-options', 'Actions/Auth/GenerateRegistrationAction')
route.post('/verify-registration', 'Actions/Auth/VerifyRegistrationAction')
route.get('/generate-authentication-options', 'Actions/Auth/GenerateAuthenticationAction')
route.post('/verify-authentication', 'Actions/Auth/VerifyAuthenticationAction')
// route.email('/welcome')
route.health() // adds a GET `/health` route
route.get('/install', 'Actions/InstallAction')
route.post('/ai/ask', 'Actions/AI/AskAction')
route.post('/ai/summary', 'Actions/AI/SummaryAction')
route.group({ prefix: '/payments' }, async () => {
route.get('/fetch-customer/{id}', 'Actions/Payment/FetchPaymentCustomerAction')
route.get('/fetch-transaction-history/{id}', 'Actions/Payment/FetchTransactionHistoryAction')
route.get('/fetch-user-subscriptions/{id}', 'Actions/Payment/FetchUserSubscriptionsAction')
route.get('/fetch-active-subscription/{id}', 'Actions/Payment/FetchActiveSubscriptionAction')
route.get('/default-payment-method/{id}', 'Actions/Payment/FetchDefaultPaymentMethodAction')
route.get('/payment-methods/{id}', 'Actions/Payment/FetchPaymentMethodsAction')
route.get('/create-setup-intent/{id}', 'Actions/Payment/CreateSetupIntentAction')
route.delete('/delete-payment-method/{id}', 'Actions/Payment/DeleteDefaultPaymentAction')
route.put('/update-default-payment-method/{id}', 'Actions/Payment/UpdateDefaultPaymentMethodAction')
route.post('/set-default-payment-method/{id}', 'Actions/Payment/SetDefaultPaymentAction')
route.post('/user-default-payment-method/{id}', 'Actions/Payment/SetUserDefaultPaymentAction')
route.post('/payment-method/{id}', 'Actions/Payment/StorePaymentMethodAction')
route.post('/create-payment-intent/{id}', 'Actions/Payment/CreatePaymentIntentAction')
route.post('/create-subscription/{id}', 'Actions/Payment/CreateSubscriptionAction')
route.post('/update-subscription/{id}', 'Actions/Payment/UpdateSubscriptionAction')
route.post('/cancel-subscription/{id}', 'Actions/Payment/CancelSubscriptionAction')
route.post('/create-invoice-subscription/{id}', 'Actions/Payment/CreateInvoiceSubscription')
route.patch('/update-customer/{id}', 'Actions/Payment/UpdateCustomerAction')
route.post('/checkout/{id}', 'Actions/Payment/CreateCheckoutAction')
route.get('/fetch-product/{id}', 'Actions/Payment/FetchProductAction')
route.post('/store-transaction/{id}', 'Actions/Payment/StoreTransactionAction')
})
route.group({ prefix: '/queues' }, async () => {
route.get('/', 'Actions/Queue/FetchQueuesAction')
})
// route.action('/example') // equivalent to `route.get('/example', 'ExampleAction')`
// route.action('Dashboard/GetProjects')
// route.action('Dashboard/Settings/UpdateAiConfig')
// route.job('/example-two') // equivalent to `route.get('/example-two', 'ExampleTwoJob')`