MCPcopy Create free account

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

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

↓ 2 callersFunctiongetClientIdentifier
* Get client identifier * Prefer Cloudflare-provided real IP
lib/api/rate-limit.ts:47
↓ 2 callersFunctiongetCookiePreferences
()
lib/gdpr/cookie-preferences.ts:29
↓ 2 callersFunctiongetMigrationFiles
* Get all migration files
scripts/validate-migrations.js:71
↓ 2 callersFunctiongetR2Bucket
()
lib/r2/client.ts:6
↓ 2 callersFunctiongetRateLimitConfig
* Read rate limit configuration from environment variables
lib/api/rate-limit.ts:19
↓ 2 callersFunctionhandlePreflight
(request: NextRequest)
lib/security/cors.ts:57
↓ 2 callersFunctionhashPassword
(password: string, iterations = 100000)
lib/auth/password.ts:12
↓ 2 callersFunctionheaders
()
next.config.ts:12
↓ 2 callersFunctionisPreflightRequest
(request: NextRequest)
lib/security/cors.ts:65
↓ 2 callersFunctionnoContentResponse
()
lib/api/response.ts:167
↓ 2 callersMethodpublish
* Publish post
repositories/post.repository.ts:265
↓ 2 callersMethodtrackCacheAccess
* Track cache hit/miss event
lib/analytics/index.ts:274
↓ 2 callersMethodtrackPerformance
* Track performance metric
lib/analytics/index.ts:321
↓ 2 callersMethodunpublish
* Unpublish post
repositories/post.repository.ts:282
↓ 2 callersMethodupdate
* Update post * @param id - Post ID * @param data - Update data * @param includeUser - Set to true to include user data in response (default:
repositories/post.repository.ts:201
↓ 2 callersMethodupdateByPaymentIntentId
* Update payment by Payment Intent ID
repositories/payment.repository.ts:154
↓ 2 callersMethodupdateByStripeInvoiceId
* Update invoice by Stripe invoice ID
repositories/invoice.repository.ts:169
↓ 2 callersMethoduploadFile
* Upload a file to R2 storage * @param file - File to upload * @returns Upload result with file metadata
services/upload.service.ts:30
↓ 2 callersFunctionvalidateCsrfToken
(request: NextRequest)
lib/security/csrf.ts:49
↓ 2 callersFunctionwarn
* Print warning
scripts/validate-migrations.js:50
↓ 2 callersFunctionwithCache
( key: string, fn: () => Promise<T>, ttl: number = 3600 // Default: 1 hour )
lib/cache/client.ts:165
↓ 1 callersFunctionacceptAllCookies
()
lib/gdpr/cookie-preferences.ts:65
↓ 1 callersFunctionacceptNecessaryCookies
()
lib/gdpr/cookie-preferences.ts:75
↓ 1 callersFunctionarchiveOldData
()
scripts/archive-old-data.ts:12
↓ 1 callersMethodbatch
* Execute batch operations
lib/db/client.ts:179
↓ 1 callersFunctioncheckErrorRateThreshold
(params: { errorCount: number; totalRequests: number; thresholdPercent: number; })
lib/monitoring/alerting.ts:98
↓ 1 callersFunctioncheckRateLimit
* Check rate limit * Uses sliding window algorithm
lib/api/rate-limit.ts:72
↓ 1 callersFunctioncheckUploadRateLimit
(userId: string)
lib/rate-limiter/index.ts:163
↓ 1 callersFunctioncreateAuthPrismaProxy
(prisma: T)
lib/db/auth-prisma-proxy.ts:127
↓ 1 callersFunctioncreateAxiosInstance
()
lib/http/client.ts:13
↓ 1 callersFunctioncreateDatabaseClient
()
lib/db/client.ts:198
↓ 1 callersFunctioncreateErrorResponse
(error: Error | AppError | unknown)
lib/api/response.ts:65
↓ 1 callersFunctioncreateSignedDownloadUrl
( baseUrl: string, key: string, expiresInSeconds: number = 3600 )
lib/signed-url/index.ts:82
↓ 1 callersFunctioncreateSuccessResponse
( data: T, message?: string, meta?: ApiSuccessResponse<T>['meta'] )
lib/api/response.ts:41
↓ 1 callersFunctiondateToUnix
(date: Date)
lib/db/auth-prisma-proxy.ts:36
↓ 1 callersFunctiondeepConvertInputs
* Recursively convert incompatible types in the entire args tree: * - Date objects → Unix timestamps (seconds) * - Boolean `true` on known fields →
lib/db/auth-prisma-proxy.ts:57
↓ 1 callersFunctiondismiss
()
hooks/use-toast.ts:144
↓ 1 callersFunctiondownloadFile
(key: string)
lib/r2/client.ts:128
↓ 1 callersMethodexecute
* Execute insert/update/delete operations
lib/db/client.ts:169
↓ 1 callersFunctionexportUserData
( userId: number, repos: RepositoryFactory )
lib/gdpr/data-exporter.ts:36
↓ 1 callersFunctionextractModelsFromSchema
* Extract model definitions from Prisma schema
scripts/validate-migrations.js:149
↓ 1 callersFunctionextractTablesFromMigrations
* Extract table definitions from SQL migrations
scripts/validate-migrations.js:187
↓ 1 callersFunctionformatLogEntry
* Format log output
lib/logger/index.ts:77
↓ 1 callersFunctionformatTimestamp
* Format timestamp
lib/logger/index.ts:62
↓ 1 callersFunctiongenId
()
hooks/use-toast.ts:25
↓ 1 callersFunctiongenerateClientFingerprint
(request: NextRequest)
lib/utils/client-identifier.ts:42
↓ 1 callersFunctiongenerateRequestId
* Generate request ID
lib/api/middleware.ts:10
↓ 1 callersFunctiongenerateSpanId
* Generate Span ID (for specific operation tracing) * Supports inheriting parent span ID from request headers
lib/api/middleware.ts:30
↓ 1 callersFunctiongenerateToken
* Generate a random CSRF token using Web Crypto API (Edge-compatible)
lib/security/csrf.ts:15
↓ 1 callersFunctiongenerateTraceId
* Generate Trace ID (for distributed tracing) * Supports inheriting parent trace ID from request headers
lib/api/middleware.ts:18
↓ 1 callersMethodget
( key: string, type: 'text' | 'arrayBuffer' | 'stream' = 'text' )
lib/cache/client.ts:106
↓ 1 callersFunctiongetAdjustedRateLimit
( identifier: string, defaultLimit: number )
lib/utils/client-identifier.ts:92
↓ 1 callersFunctiongetAnalyticsEngine
()
lib/analytics/index.ts:400
↓ 1 callersFunctiongetAuthSecret
()
lib/auth/index.ts:30
↓ 1 callersFunctiongetClientIdentifier
(request: NextRequest)
lib/utils/client-identifier.ts:68
↓ 1 callersFunctiongetClientIp
(request: NextRequest)
lib/utils/client-identifier.ts:12
↓ 1 callersFunctiongetClientIp
* Extract client IP from request
lib/api/middleware.ts:37
↓ 1 callersFunctiongetCpuCount
()
vitest.config.ts:7
↓ 1 callersFunctiongetFromEmail
* Get the configured "from" email address
lib/email/client.ts:32
↓ 1 callersFunctiongetKvForAnalytics
()
lib/analytics/index.ts:450
↓ 1 callersFunctiongetProductByPriceId
(priceId: string)
lib/stripe/config.ts:221
↓ 1 callersFunctiongetRateLimitStatus
( request: NextRequest, customConfig?: Partial<RateLimitConfig> )
lib/api/rate-limit.ts:256
↓ 1 callersFunctiongetResendClient
* Get or create Resend client instance
lib/email/client.ts:16
↓ 1 callersFunctiongetSubscriptionPlans
()
lib/stripe/config.ts:233
↓ 1 callersFunctiongetWebhookSecret
()
lib/stripe/client.ts:64
↓ 1 callersFunctionhandleI18nRouting
* Simple i18n routing handler (replaces next-intl createIntlMiddleware) * * next-intl's createIntlMiddleware mutates NextURL.port which throws in *
proxy.ts:25
↓ 1 callersFunctionhandleOAuthSignIn
(provider: 'google')
app/[locale]/login/page.tsx:57
↓ 1 callersFunctionhasUserConsented
()
lib/gdpr/cookie-preferences.ts:85
↓ 1 callersMethodhttp
* Record HTTP request
lib/logger/index.ts:258
↓ 1 callersFunctionisDevelopment
()
lib/config/env.ts:205
↓ 1 callersFunctionisExemptPath
* Check if path is exempt from CSRF validation
lib/security/csrf.ts:34
↓ 1 callersFunctionisIpBasedIdentifier
(identifier: string)
lib/utils/client-identifier.ts:84
↓ 1 callersFunctionisOriginAllowed
* Check if origin is allowed
lib/security/cors.ts:24
↓ 1 callersMethodisProcessed
* Check if webhook event has been processed
repositories/webhook-event.repository.ts:40
↓ 1 callersFunctionisRateLimitEnabled
* Check whether rate limiting is enabled
lib/api/rate-limit.ts:37
↓ 1 callersFunctionisSubscriptionActive
(status: SubscriptionStatus)
lib/stripe/types.ts:278
↓ 1 callersFunctionisUnsafeMethod
* Check if request method requires CSRF validation
lib/security/csrf.ts:41
↓ 1 callersFunctionisValidEmail
(email: string)
lib/validators/index.ts:26
↓ 1 callersMethodlist
* List files
lib/r2/client.ts:63
↓ 1 callersMethodlogEventToConsole
* Log event to console (dev/debug)
lib/analytics/index.ts:379
↓ 1 callersFunctionmain
* Main function
scripts/validate-migrations.js:339
↓ 1 callersMethodmarkProcessed
* Mark webhook event as processed
repositories/webhook-event.repository.ts:64
↓ 1 callersFunctionnotFoundResponse
(message = 'Resource not found')
lib/api/response.ts:174
↓ 1 callersFunctionpaginatedResponse
( data: T[], page: number, limit: number, total: number, message?: string )
lib/api/response.ts:137
↓ 1 callersFunctionparseJsonBody
(request: NextRequest)
lib/validators/index.ts:114
↓ 1 callersMethodperformance
* Record performance metric
lib/logger/index.ts:236
↓ 1 callersFunctionprismaClientResolve
* Vite plugin to resolve `.prisma/client/*` bare module specifiers. * * Prisma generates `.prisma/client/default` which is a bare specifier * (star
vite.config.ts:19
↓ 1 callersMethodput
* Set cache (alias, KV API compatible)
lib/cache/client.ts:92
↓ 1 callersMethodquery
* Record database query
lib/logger/index.ts:287
↓ 1 callersMethodqueryOne
* Execute query and return first result
lib/db/client.ts:158
↓ 1 callersFunctionreadPrismaSchema
* Read Prisma schema file
scripts/validate-migrations.js:138
↓ 1 callersFunctionreducer
(state: State, action: Action)
hooks/use-toast.ts:72
↓ 1 callersMethodregister
* Register a new user * @param data - Registration data (email, password, name) * @returns Registered user information
services/auth.service.ts:36
↓ 1 callersFunctionresetPrismaClient
()
lib/db/client.ts:122
↓ 1 callersFunctionresolveModelKey
Resolve model accessor key (handles both 'user' and 'User' access patterns)
lib/db/auth-prisma-proxy.ts:98
↓ 1 callersFunctionsendAlert
(alert: AlertPayload)
lib/monitoring/alerting.ts:28
↓ 1 callersFunctionsimpleHash
* Simple deterministic hash function (djb2 algorithm) * Produces consistent results for the same input
lib/feature-flags/index.ts:68
↓ 1 callersFunctionstripLocale
* Strip locale prefix from pathname to get the actual route
proxy.ts:77
↓ 1 callersFunctiontimingSafeEqual
* Timing-safe string comparison (Edge-compatible)
lib/security/csrf.ts:71
↓ 1 callersMethodtrackHttpRequest
* Track HTTP request event
lib/analytics/index.ts:225
← previousnext →101–200 of 438, ranked by callers