MCPcopy Create free account

hub / github.com/TangSY/edge-next-starter / functions

Functions438 in github.com/TangSY/edge-next-starter

↓ 64 callersMethodget
* Get file
lib/r2/client.ts:40
↓ 54 callersMethodtrackDatabaseQuery
* Track database query event
lib/analytics/index.ts:249
↓ 50 callersMethoderror
* ERROR level log
lib/logger/index.ts:210
↓ 34 callersFunctionPOST
(request: NextRequest)
app/api/users/route.ts:28
↓ 30 callersMethodset
* Set cache
lib/cache/client.ts:77
↓ 28 callersMethodinfo
* INFO level log
lib/logger/index.ts:190
↓ 23 callersMethodcreate
* Create user
repositories/user.repository.ts:90
↓ 22 callersFunctionsuccessResponse
( data: T, message?: string, statusCode = 200, meta?: ApiSuccessResponse<T>['meta'] )
lib/api/response.ts:92
↓ 20 callersFunctionwithRepositories
( request: NextRequest, handler: (repos: RepositoryFactory) => Promise<NextResponse<T>> )
lib/api/database.ts:23
↓ 17 callersFunctioncn
(...inputs: ClassValue[])
lib/utils/index.ts:8
↓ 16 callersMethoddelete
* Delete file
lib/r2/client.ts:52
↓ 16 callersMethodtrackBusinessEvent
* Track business event
lib/analytics/index.ts:344
↓ 16 callersMethodwarn
* WARN level log
lib/logger/index.ts:200
↓ 14 callersFunctioncreateRequest
(body: unknown, origin = 'http://localhost:3000')
__tests__/api/stripe/subscription-checkout.route.test.ts:126
↓ 13 callersFunctionGET
(request: NextRequest)
app/api/auth/route.ts:21
↓ 13 callersFunctioncreateCacheClient
()
lib/cache/client.ts:154
↓ 13 callersMethoddelete
* Delete cache
lib/cache/client.ts:128
↓ 12 callersMethodcount
* Count posts (supports filters)
repositories/post.repository.ts:84
↓ 11 callersMethodfindAll
* Query all users
repositories/user.repository.ts:15
↓ 11 callersFunctionlog
* Print colored message
scripts/validate-migrations.js:35
↓ 11 callersMethodupdate
* Update user
repositories/user.repository.ts:110
↓ 10 callersFunctionerrorResponse
( error: Error | AppError | unknown, statusCode?: number )
lib/api/response.ts:105
↓ 10 callersMethodexists
* Check if user exists
repositories/user.repository.ts:164
↓ 10 callersFunctionwithRateLimit
( request: NextRequest, handler: () => Promise<NextResponse<T>>, customConfig?: Partial<RateLimitConfig>
lib/api/rate-limit.ts:192
↓ 9 callersMethodfindById
* Find user by ID
repositories/user.repository.ts:31
↓ 9 callersMethodfindByUserId
* Find posts by user ID
repositories/post.repository.ts:136
↓ 9 callersMethodgetLogger
* Get or create logger
lib/logger/index.ts:318
↓ 8 callersFunctioncreateRequest
(body: unknown)
__tests__/api/register.route.test.ts:90
↓ 8 callersFunctiongetCloudflareEnv
()
lib/db/client.ts:28
↓ 7 callersFunctioncheckRateLimit
( identifier: string, config: RateLimitConfig )
lib/rate-limiter/index.ts:74
↓ 7 callersMethodcreateLogEntry
* Create log entry
lib/logger/index.ts:122
↓ 7 callersFunctioncreateStripeErrorFromSDK
(error: unknown)
lib/stripe/errors.ts:175
↓ 7 callersFunctionerror
* Print error and exit
scripts/validate-migrations.js:42
↓ 7 callersFunctionfetch
(request: Request, env: Record<string, unknown>, ctx: ExecutionContext)
worker/index.ts:11
↓ 7 callersMethodmapToInvoiceData
* Map Prisma invoice to InvoiceData
repositories/invoice.repository.ts:201
↓ 7 callersMethodmapToPaymentData
* Map Prisma payment to PaymentData
repositories/payment.repository.ts:210
↓ 7 callersMethodmapToSubscriptionData
* Map Prisma subscription to SubscriptionData
repositories/subscription.repository.ts:287
↓ 7 callersFunctionshouldLog
* Check whether this log level should be recorded
lib/logger/index.ts:69
↓ 7 callersMethodtrackEvent
* Record event * Note: Cloudflare Analytics Engine is available via binding
lib/analytics/index.ts:86
↓ 7 callersMethodwrite
* Write log
lib/logger/index.ts:156
↓ 6 callersFunctioncreateUploadRequest
* Helper function to create a request with mocked formData
__tests__/api/upload.route.test.ts:134
↓ 6 callersMethodexistsByEmail
* Check if email already exists
repositories/user.repository.ts:146
↓ 6 callersFunctiongetSessionSafe
()
lib/auth/session.ts:16
↓ 6 callersFunctiongetStripeClient
()
lib/stripe/client.ts:18
↓ 6 callersMethodtrackError
* Track error event with enhanced context * Writes stack trace, URL, and user info to Analytics Engine blobs
lib/analytics/index.ts:294
↓ 6 callersMethodupdateByStripeSubscriptionId
* Update subscription by Stripe subscription ID
repositories/subscription.repository.ts:192
↓ 5 callersFunctionapplyCorsHeaders
(request: NextRequest, response: NextResponse)
lib/security/cors.ts:34
↓ 5 callersFunctioncreateMockFile
* Helper function to create a mock File object
__tests__/api/upload.route.test.ts:121
↓ 5 callersFunctioncreateRequest
(url: string, headers?: Record<string, string>)
__tests__/api/auth.route.test.ts:4
↓ 5 callersFunctiondispatch
(action: Action)
hooks/use-toast.ts:127
↓ 5 callersMethodfindByCustomerId
* Find payments by customer ID
repositories/payment.repository.ts:82
↓ 5 callersFunctioninfo
* Print info
scripts/validate-migrations.js:64
↓ 5 callersMethodmapToCustomerData
* Map Prisma customer to CustomerData
repositories/customer.repository.ts:166
↓ 5 callersMethodput
* Upload file
lib/r2/client.ts:24
↓ 5 callersFunctionrequest
* Generic HTTP request wrapper * Extracts data from unified API response format
lib/http/client.ts:107
↓ 5 callersFunctionsuccess
* Print success message
scripts/validate-migrations.js:57
↓ 5 callersFunctionwithMiddleware
( request: NextRequest, handler: () => Promise<NextResponse<T>> )
lib/api/middleware.ts:168
↓ 4 callersFunctioncreateRequest
(body: unknown, origin = 'http://localhost:3000')
__tests__/api/stripe/checkout.route.test.ts:76
↓ 4 callersFunctionensureCsrfToken
(request: NextRequest, response: NextResponse)
lib/security/csrf.ts:83
↓ 4 callersMethodfindActiveByCustomerId
* Find active subscription by customer ID
repositories/subscription.repository.ts:91
↓ 4 callersMethodfindByStripeCustomerId
* Find customer by Stripe customer ID
repositories/customer.repository.ts:52
↓ 4 callersFunctiongetEnvVar
* 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 callersFunctionhandleCheckoutSessionCompleted
( event: Stripe.CheckoutSessionCompletedEvent, repos: RepositoryFactory )
lib/stripe/webhook-handlers.ts:12
↓ 4 callersFunctionhandleInvoicePaid
( event: Stripe.InvoicePaidEvent, repos: RepositoryFactory )
lib/stripe/webhook-handlers.ts:246
↓ 4 callersFunctionhandleSubscriptionCreated
( event: Stripe.CustomerSubscriptionCreatedEvent, repos: RepositoryFactory )
lib/stripe/webhook-handlers.ts:93
↓ 3 callersFunctioncreatePrismaClient
()
lib/db/client.ts:60
↓ 3 callersFunctioncreateR2Client
()
lib/r2/client.ts:95
↓ 3 callersFunctioncreatedResponse
( data: T, message?: string )
lib/api/response.ts:157
↓ 3 callersMethoddebug
* DEBUG level log
lib/logger/index.ts:180
↓ 3 callersFunctionfetchSubscription
()
app/[locale]/billing/subscription-card.tsx:51
↓ 3 callersMethodfindByIdWithPosts
* Find user by ID (including related posts)
repositories/user.repository.ts:47
↓ 3 callersMethodfindByStripeSubscriptionId
* Find subscription by Stripe subscription ID
repositories/subscription.repository.ts:42
↓ 3 callersFunctiongetDatabase
()
lib/db/client.ts:44
↓ 3 callersFunctiongetKVNamespace
()
lib/cache/client.ts:59
↓ 3 callersFunctiongetPlanByPriceId
(priceId: string)
lib/stripe/config.ts:209
↓ 3 callersFunctionhandleCustomerCreated
( event: Stripe.CustomerCreatedEvent, repos: RepositoryFactory )
lib/stripe/webhook-handlers.ts:63
↓ 3 callersFunctionhandleInvoicePaymentFailed
( event: Stripe.InvoicePaymentFailedEvent, repos: RepositoryFactory )
lib/stripe/webhook-handlers.ts:326
↓ 3 callersFunctionhandlePaymentIntentFailed
( event: Stripe.PaymentIntentPaymentFailedEvent, repos: RepositoryFactory )
lib/stripe/webhook-handlers.ts:425
↓ 3 callersFunctionhandlePaymentIntentSucceeded
( event: Stripe.PaymentIntentSucceededEvent, repos: RepositoryFactory )
lib/stripe/webhook-handlers.ts:394
↓ 3 callersFunctionhandleSubscriptionDeleted
( event: Stripe.CustomerSubscriptionDeletedEvent, repos: RepositoryFactory )
lib/stripe/webhook-handlers.ts:215
↓ 3 callersFunctionhandleSubscriptionUpdated
( event: Stripe.CustomerSubscriptionUpdatedEvent, repos: RepositoryFactory )
lib/stripe/webhook-handlers.ts:170
↓ 3 callersFunctionparseAndValidateBody
( request: NextRequest, schema: T )
lib/validators/index.ts:130
↓ 3 callersFunctionsaveCookiePreferences
( preferences: Omit<CookiePreferences, 'necessary' | 'updatedAt'> )
lib/gdpr/cookie-preferences.ts:44
↓ 3 callersFunctionvalidateIntegerId
(id: unknown, fieldName = 'ID')
lib/validators/index.ts:64
↓ 3 callersFunctionvalidationErrorResponse
( message: string, details?: unknown )
lib/api/response.ts:181
↓ 3 callersFunctionwithApiHandler
( handler: () => Promise<T> )
lib/api/response.ts:126
↓ 2 callersFunctionaddRateLimitHeaders
* Add rate limit headers to response
lib/api/rate-limit.ts:152
↓ 2 callersFunctionaddToRemoveQueue
(toastId: string)
hooks/use-toast.ts:56
↓ 2 callersFunctionbaseEmailTemplate
(content: string, title: string)
lib/email/templates/base.ts:5
↓ 2 callersMethodchild
* Create child logger (inherits parent context and metadata)
lib/logger/index.ts:220
↓ 2 callersFunctionconvertOutputDates
Convert Unix timestamps back to Date objects for known date fields
lib/db/auth-prisma-proxy.ts:79
↓ 2 callersFunctioncreateAppErrorFromNative
(error: unknown)
lib/errors/index.ts:391
↓ 2 callersFunctioncreateRepositories
(prisma: PrismaClient)
repositories/index.ts:111
↓ 2 callersFunctioncsrfErrorResponse
()
lib/security/csrf.ts:103
↓ 2 callersMethodfindByEmail
* Find user by email
repositories/user.repository.ts:72
↓ 2 callersMethodfindByPaymentIntentId
* Find payment by Stripe Payment Intent ID
repositories/payment.repository.ts:34
↓ 2 callersMethodfindByStripeInvoiceId
* Find invoice by Stripe invoice ID
repositories/invoice.repository.ts:39
↓ 2 callersFunctionformatPrice
(amount: number, currency: string = 'usd')
lib/stripe/config.ts:247
↓ 2 callersFunctiongenerateSignedUrl
( key: string, expiresInSeconds: number = 3600 )
lib/signed-url/index.ts:12
↓ 2 callersFunctiongetAllowedOrigins
* 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