Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/TangSY/edge-next-starter
/ functions
Functions
438 in github.com/TangSY/edge-next-starter
⨍
Functions
438
◇
Types & classes
172
↓ 64 callers
Method
get
* Get file
lib/r2/client.ts:40
↓ 54 callers
Method
trackDatabaseQuery
* Track database query event
lib/analytics/index.ts:249
↓ 50 callers
Method
error
* ERROR level log
lib/logger/index.ts:210
↓ 34 callers
Function
POST
(request: NextRequest)
app/api/users/route.ts:28
↓ 30 callers
Method
set
* Set cache
lib/cache/client.ts:77
↓ 28 callers
Method
info
* INFO level log
lib/logger/index.ts:190
↓ 23 callers
Method
create
* Create user
repositories/user.repository.ts:90
↓ 22 callers
Function
successResponse
( data: T, message?: string, statusCode = 200, meta?: ApiSuccessResponse<T>['meta'] )
lib/api/response.ts:92
↓ 20 callers
Function
withRepositories
( request: NextRequest, handler: (repos: RepositoryFactory) => Promise<NextResponse<T>> )
lib/api/database.ts:23
↓ 17 callers
Function
cn
(...inputs: ClassValue[])
lib/utils/index.ts:8
↓ 16 callers
Method
delete
* Delete file
lib/r2/client.ts:52
↓ 16 callers
Method
trackBusinessEvent
* Track business event
lib/analytics/index.ts:344
↓ 16 callers
Method
warn
* WARN level log
lib/logger/index.ts:200
↓ 14 callers
Function
createRequest
(body: unknown, origin = 'http://localhost:3000')
__tests__/api/stripe/subscription-checkout.route.test.ts:126
↓ 13 callers
Function
GET
(request: NextRequest)
app/api/auth/route.ts:21
↓ 13 callers
Function
createCacheClient
()
lib/cache/client.ts:154
↓ 13 callers
Method
delete
* Delete cache
lib/cache/client.ts:128
↓ 12 callers
Method
count
* Count posts (supports filters)
repositories/post.repository.ts:84
↓ 11 callers
Method
findAll
* Query all users
repositories/user.repository.ts:15
↓ 11 callers
Function
log
* Print colored message
scripts/validate-migrations.js:35
↓ 11 callers
Method
update
* Update user
repositories/user.repository.ts:110
↓ 10 callers
Function
errorResponse
( error: Error | AppError | unknown, statusCode?: number )
lib/api/response.ts:105
↓ 10 callers
Method
exists
* Check if user exists
repositories/user.repository.ts:164
↓ 10 callers
Function
withRateLimit
( request: NextRequest, handler: () => Promise<NextResponse<T>>, customConfig?: Partial<RateLimitConfig>
lib/api/rate-limit.ts:192
↓ 9 callers
Method
findById
* Find user by ID
repositories/user.repository.ts:31
↓ 9 callers
Method
findByUserId
* Find posts by user ID
repositories/post.repository.ts:136
↓ 9 callers
Method
getLogger
* Get or create logger
lib/logger/index.ts:318
↓ 8 callers
Function
createRequest
(body: unknown)
__tests__/api/register.route.test.ts:90
↓ 8 callers
Function
getCloudflareEnv
()
lib/db/client.ts:28
↓ 7 callers
Function
checkRateLimit
( identifier: string, config: RateLimitConfig )
lib/rate-limiter/index.ts:74
↓ 7 callers
Method
createLogEntry
* Create log entry
lib/logger/index.ts:122
↓ 7 callers
Function
createStripeErrorFromSDK
(error: unknown)
lib/stripe/errors.ts:175
↓ 7 callers
Function
error
* Print error and exit
scripts/validate-migrations.js:42
↓ 7 callers
Function
fetch
(request: Request, env: Record<string, unknown>, ctx: ExecutionContext)
worker/index.ts:11
↓ 7 callers
Method
mapToInvoiceData
* Map Prisma invoice to InvoiceData
repositories/invoice.repository.ts:201
↓ 7 callers
Method
mapToPaymentData
* Map Prisma payment to PaymentData
repositories/payment.repository.ts:210
↓ 7 callers
Method
mapToSubscriptionData
* Map Prisma subscription to SubscriptionData
repositories/subscription.repository.ts:287
↓ 7 callers
Function
shouldLog
* Check whether this log level should be recorded
lib/logger/index.ts:69
↓ 7 callers
Method
trackEvent
* Record event * Note: Cloudflare Analytics Engine is available via binding
lib/analytics/index.ts:86
↓ 7 callers
Method
write
* Write log
lib/logger/index.ts:156
↓ 6 callers
Function
createUploadRequest
* Helper function to create a request with mocked formData
__tests__/api/upload.route.test.ts:134
↓ 6 callers
Method
existsByEmail
* Check if email already exists
repositories/user.repository.ts:146
↓ 6 callers
Function
getSessionSafe
()
lib/auth/session.ts:16
↓ 6 callers
Function
getStripeClient
()
lib/stripe/client.ts:18
↓ 6 callers
Method
trackError
* Track error event with enhanced context * Writes stack trace, URL, and user info to Analytics Engine blobs
lib/analytics/index.ts:294
↓ 6 callers
Method
updateByStripeSubscriptionId
* Update subscription by Stripe subscription ID
repositories/subscription.repository.ts:192
↓ 5 callers
Function
applyCorsHeaders
(request: NextRequest, response: NextResponse)
lib/security/cors.ts:34
↓ 5 callers
Function
createMockFile
* Helper function to create a mock File object
__tests__/api/upload.route.test.ts:121
↓ 5 callers
Function
createRequest
(url: string, headers?: Record<string, string>)
__tests__/api/auth.route.test.ts:4
↓ 5 callers
Function
dispatch
(action: Action)
hooks/use-toast.ts:127
↓ 5 callers
Method
findByCustomerId
* Find payments by customer ID
repositories/payment.repository.ts:82
↓ 5 callers
Function
info
* Print info
scripts/validate-migrations.js:64
↓ 5 callers
Method
mapToCustomerData
* Map Prisma customer to CustomerData
repositories/customer.repository.ts:166
↓ 5 callers
Method
put
* Upload file
lib/r2/client.ts:24
↓ 5 callers
Function
request
* Generic HTTP request wrapper * Extracts data from unified API response format
lib/http/client.ts:107
↓ 5 callers
Function
success
* Print success message
scripts/validate-migrations.js:57
↓ 5 callers
Function
withMiddleware
( request: NextRequest, handler: () => Promise<NextResponse<T>> )
lib/api/middleware.ts:168
↓ 4 callers
Function
createRequest
(body: unknown, origin = 'http://localhost:3000')
__tests__/api/stripe/checkout.route.test.ts:76
↓ 4 callers
Function
ensureCsrfToken
(request: NextRequest, response: NextResponse)
lib/security/csrf.ts:83
↓ 4 callers
Method
findActiveByCustomerId
* Find active subscription by customer ID
repositories/subscription.repository.ts:91
↓ 4 callers
Method
findByStripeCustomerId
* Find customer by Stripe customer ID
repositories/customer.repository.ts:52
↓ 4 callers
Function
getEnvVar
* Resolve environment variable from Cloudflare env bindings or process.env fallback. * Secrets set via `wrangler secret put` are only accessible thro
lib/auth/index.ts:24
↓ 4 callers
Function
handleCheckoutSessionCompleted
( event: Stripe.CheckoutSessionCompletedEvent, repos: RepositoryFactory )
lib/stripe/webhook-handlers.ts:12
↓ 4 callers
Function
handleInvoicePaid
( event: Stripe.InvoicePaidEvent, repos: RepositoryFactory )
lib/stripe/webhook-handlers.ts:246
↓ 4 callers
Function
handleSubscriptionCreated
( event: Stripe.CustomerSubscriptionCreatedEvent, repos: RepositoryFactory )
lib/stripe/webhook-handlers.ts:93
↓ 3 callers
Function
createPrismaClient
()
lib/db/client.ts:60
↓ 3 callers
Function
createR2Client
()
lib/r2/client.ts:95
↓ 3 callers
Function
createdResponse
( data: T, message?: string )
lib/api/response.ts:157
↓ 3 callers
Method
debug
* DEBUG level log
lib/logger/index.ts:180
↓ 3 callers
Function
fetchSubscription
()
app/[locale]/billing/subscription-card.tsx:51
↓ 3 callers
Method
findByIdWithPosts
* Find user by ID (including related posts)
repositories/user.repository.ts:47
↓ 3 callers
Method
findByStripeSubscriptionId
* Find subscription by Stripe subscription ID
repositories/subscription.repository.ts:42
↓ 3 callers
Function
getDatabase
()
lib/db/client.ts:44
↓ 3 callers
Function
getKVNamespace
()
lib/cache/client.ts:59
↓ 3 callers
Function
getPlanByPriceId
(priceId: string)
lib/stripe/config.ts:209
↓ 3 callers
Function
handleCustomerCreated
( event: Stripe.CustomerCreatedEvent, repos: RepositoryFactory )
lib/stripe/webhook-handlers.ts:63
↓ 3 callers
Function
handleInvoicePaymentFailed
( event: Stripe.InvoicePaymentFailedEvent, repos: RepositoryFactory )
lib/stripe/webhook-handlers.ts:326
↓ 3 callers
Function
handlePaymentIntentFailed
( event: Stripe.PaymentIntentPaymentFailedEvent, repos: RepositoryFactory )
lib/stripe/webhook-handlers.ts:425
↓ 3 callers
Function
handlePaymentIntentSucceeded
( event: Stripe.PaymentIntentSucceededEvent, repos: RepositoryFactory )
lib/stripe/webhook-handlers.ts:394
↓ 3 callers
Function
handleSubscriptionDeleted
( event: Stripe.CustomerSubscriptionDeletedEvent, repos: RepositoryFactory )
lib/stripe/webhook-handlers.ts:215
↓ 3 callers
Function
handleSubscriptionUpdated
( event: Stripe.CustomerSubscriptionUpdatedEvent, repos: RepositoryFactory )
lib/stripe/webhook-handlers.ts:170
↓ 3 callers
Function
parseAndValidateBody
( request: NextRequest, schema: T )
lib/validators/index.ts:130
↓ 3 callers
Function
saveCookiePreferences
( preferences: Omit<CookiePreferences, 'necessary' | 'updatedAt'> )
lib/gdpr/cookie-preferences.ts:44
↓ 3 callers
Function
validateIntegerId
(id: unknown, fieldName = 'ID')
lib/validators/index.ts:64
↓ 3 callers
Function
validationErrorResponse
( message: string, details?: unknown )
lib/api/response.ts:181
↓ 3 callers
Function
withApiHandler
( handler: () => Promise<T> )
lib/api/response.ts:126
↓ 2 callers
Function
addRateLimitHeaders
* Add rate limit headers to response
lib/api/rate-limit.ts:152
↓ 2 callers
Function
addToRemoveQueue
(toastId: string)
hooks/use-toast.ts:56
↓ 2 callers
Function
baseEmailTemplate
(content: string, title: string)
lib/email/templates/base.ts:5
↓ 2 callers
Method
child
* Create child logger (inherits parent context and metadata)
lib/logger/index.ts:220
↓ 2 callers
Function
convertOutputDates
Convert Unix timestamps back to Date objects for known date fields
lib/db/auth-prisma-proxy.ts:79
↓ 2 callers
Function
createAppErrorFromNative
(error: unknown)
lib/errors/index.ts:391
↓ 2 callers
Function
createRepositories
(prisma: PrismaClient)
repositories/index.ts:111
↓ 2 callers
Function
csrfErrorResponse
()
lib/security/csrf.ts:103
↓ 2 callers
Method
findByEmail
* Find user by email
repositories/user.repository.ts:72
↓ 2 callers
Method
findByPaymentIntentId
* Find payment by Stripe Payment Intent ID
repositories/payment.repository.ts:34
↓ 2 callers
Method
findByStripeInvoiceId
* Find invoice by Stripe invoice ID
repositories/invoice.repository.ts:39
↓ 2 callers
Function
formatPrice
(amount: number, currency: string = 'usd')
lib/stripe/config.ts:247
↓ 2 callers
Function
generateSignedUrl
( key: string, expiresInSeconds: number = 3600 )
lib/signed-url/index.ts:12
↓ 2 callers
Function
getAllowedOrigins
* Get allowed origins from environment variable * Format: comma-separated list, "*" allows all origins
lib/security/cors.ts:12
next →
1–100 of 438, ranked by callers