Edge Functions
818 symbols · Browse by module or type
Generated 2026-03-04 20:43 EET
f addTaskComment Add task comment
f analyzeCashFlow Analyze cash flow patterns
f analyzeWithAI Analyze extracted document content using Claude AI
f assertValidEnvironment Validate environment and throw if invalid
f assignTask Assign task
f autoDetectColumnMapping Auto-detect column mapping from CSV headers
f buildAnthropicAttributes Build attributes for Anthropic API calls
f buildClerkAttributes Build attributes for Clerk API calls
f buildDbAttributes Build attributes for database operations
f buildEmailAnalysisPrompt Build the user prompt for email analysis.
f buildExtractionSummary
f buildSwanAttributes Build attributes for Swan API calls
f buildWebhookIngestionUrl Build full webhook ingestion URL from URL path
f calculateConfidence Calculate confidence score for analysis results
f calculateCost Calculate estimated API cost in USD.
f calculateTypedConfidence Calculate confidence score for type-specific extraction results
f categorizeTransactions Categorize uncategorized transactions
f checkAvailability Check if the Anthropic API key is configured.
f checkAvailability Check if Claude API key is configured.
f checkWorkspaceAccess Check workspace access using in-memory workspace memberships.
f classifyDocument Classify a document using AI
f clerkAuthMiddleware Unified Clerk authentication middleware
f countAttachments Count attachments in raw payload without processing
f createAccount Create a new account
f createAiService Create an AI Service instance that wraps the Anthropic client
f createBudgetAnalysis Create budget analysis comparing actual spending to budgets
f createHttpSpan Create a span for an external HTTP API call
f createLogger Factory function to create a logger instance
f createMessage Send a single-message request to the Anthropic Messages API.
f createPostHogLogsExporter Factory function to create a new PostHog logs exporter instance
f createPostHogService Factory function to create a PostHog service instance
f createServiceSpan Create a span for a service operation
f createSwanAuthService Create a Swan auth service instance from environment variables
f createSwanClient Create a Swan client instance
f createTask Create a new task
f createTransaction Create a new transaction
f decodeAttachmentContent Decode base64 attachment content
f decryptToken Decrypt a string using AES-GCM
f deleteAccount Delete an account
f deleteTask Delete a task
f deleteTransaction Delete a transaction
f detectTokenType Detect the token type from its format.
f emitWorkspaceEvent Emit a workspace event. Non-blocking -- failure logs a warning, never throws.
f encryptToken Encrypt a string using AES-GCM
f endSpan End a span safely (handles null)
f extractAttachmentsFromPayload Extract attachment metadata from webhook raw_payload
f extractBearerToken Extract Bearer token from an Authorization header value.
f extractByType Extract structured data based on document subtype
f extractContent Extract content from a file based on its MIME type
f extractCsvContent Extract content from CSV/TSV files
f extractEmailAddress Extract a bare email address from a string that may be in
f extractEmailContent Extract email text content from raw webhook payload.
f extractEmailIdFromPayload Extract email_id from webhook raw payload
f extractExcelContent Extract content from Excel files
f extractImageContent Extract content from image files
f extractMarkdownContent Extract content from Markdown files
f extractPdfContent Extract content from PDF files with memory-safe streaming
f extractStructuredData Extract structured data from document text
f extractTaxAmount Extract tax amount from text
f extractTextContent Extract content from plain text files
f extractToken Extract token from Authorization header
f extractToken Extract token from a Request — Authorization header first, `?token=` fallback.
f extractWordContent Extract content from Word documents
f fallbackAnalysis Fallback analysis using pattern matching when AI is unavailable
f fallbackClassification Classify a document using keyword/regex heuristics
f fallbackEmailAnalysis Fallback email analysis when AI is unavailable or parsing fails.
f fetchAttachmentContent Fetch attachment content from a download URL
f findPrimaryPhone Find the primary phone number from a Clerk user payload
f findVerifiedEmail Find the first verified email address from a Clerk user payload
f formatValidationErrors Format validation errors for readable output
f generateFinancialReport Generate financial report (P&L, balance sheet, cash flow statement, tax summary)
f generateLLMMarkdown Generate LLM-friendly markdown from OpenAPI spec
f generateProposals Generate AI proposals for what actions to take on a processed document.
f getAccount Get a single account by ID
f getAllEnvVars Get all environment variable names in the registry
f getApiKey Read the Anthropic API key from the environment.
f getAttachmentDownloadUrls Get attachment download URLs from Resend API
f getAuthenticatedSupabaseClient Get authenticated Supabase client for user-context requests.
f getConfidenceLevel Get confidence level description for UI display
f getCorsHeaders
f getCurrentDatetime Get current datetime in various formats
f getDefaultExporter Get or create the default PostHog logs exporter
f getDocumentPrompt Get the system prompt for a document type
f getEnvironment Get the current environment name
f getEnvValue Get an environment variable value, falling back to registry default
f getEnvVarDefault Get the default value for an environment variable
f getEnvVarMetadata Get metadata for an environment variable
f getEnvVarsByCategory Get environment variables filtered by category
f getErrorMessage Extract error message from any error type.
f getExtensionFromMimeType Get file extension from MIME type
f getExtractor Get extractor for a given MIME type
f getFinancialInsights Get financial insights for a workspace
f getPendingDocuments Get pending documents for processing
f getReceivedEmails Get emails with 'received' status ready for AI analysis.
f getRequiredVarsForFunction Get all environment variables required by a specific function
f getServiceRoleSupabaseClient Get service-role Supabase client for system operations.
f getSubtypeExtractionPrompt Get the extraction prompt for a specific document subtype
f getSupportedMimeTypes Get list of all supported MIME types
f getTask Get single task by ID
f getTaskComments Get task comments
f getTasks Get tasks for a workspace with filters
f getTaskStats Get task statistics for a workspace
f getTracer
f getTransaction Get a single transaction by ID
f getValidatedBody Get validated JSON body from request.
f getValidatedParams Get validated path parameters from request.
f getValidatedQuery Get validated query parameters from request.
f getWorkspace Get a specific workspace by ID.
f getWorkspaceContext Get workspace context for classification and extraction
f handleAcceptAllProposals Handle POST /documents/:id/proposals/accept-all - Accept all pending proposals
f handleAcceptProposal Handle POST /documents/:id/proposals/:proposalId/accept - Accept a proposal
f handleAddCard Handle POST /workspaces/:id/swan/cards - Add virtual card
f handleAddMember Handle POST /workspaces/:id/members - Add member
f handleAddTaskComment Handle POST /workspaces/:id/tasks/:taskId/comments - Add task comment
f handleApproveDocument Handle POST /documents/:id/approve - Approve document
f handleArchiveDocument Handle POST /documents/:id/archive - Archive a document
f handleAssignTask Handle POST /workspaces/:id/tasks/:taskId/assign - Assign task
f handleCancelCard Handle DELETE /workspaces/:id/swan/cards/:cardId - Cancel card
f handleClerkWebhook Handle POST /infra/clerk webhook requests
f handleCreateAccount Handle POST /workspaces/:id/accounts - Create account
f handleCreateTask Handle POST /workspaces/:id/tasks - Create task
f handleCreateWebhook Handle POST /workspaces/:workspaceId/webhooks - Create webhook
f handleCreateWebhook Handle POST /workspaces/:workspaceId/webhooks - Create webhook
f handleCreateWorkspace Handle POST /workspaces - Create workspace
f handleDeleteAccount Handle DELETE /accounts/:id - Delete account
f handleDeleteDocument Handle DELETE /documents/:id - Delete document
f handleDeleteIntegration Handle DELETE /workspaces/:id/integrations/:connectionId - Disconnect
f handleDeleteTask Handle DELETE /workspaces/:id/tasks/:taskId - Delete task
f handleDeleteWebhook Handle DELETE /webhooks/:id - Delete webhook
f handleDeleteWebhook Handle DELETE /webhooks/:id - Delete webhook
f handleDeleteWorkspace Handle DELETE /workspaces/:id - Delete workspace
f handleGetAccount Handle GET /accounts/:id - Get account
f handleGetCurrentOnboarding Handle GET /workspaces/:id/swan/onboarding - Get current onboarding for workspace
f handleGetDocument Handle GET /documents/:id - Get document
f handleGetEmail Handle GET /emails/:id - Get email details with linked documents
f handleGetMember Handle GET /workspaces/:id/members/:userId - Get member
f handleGetOnboarding Handle GET /workspaces/:id/swan/onboarding/:onboardingId - Get onboarding status
f handleGetSwanAccount Handle GET /workspaces/:id/swan/accounts/:accountId - Get account
f handleGetTask Handle GET /workspaces/:id/tasks/:taskId - Get task
f handleGetTaskStats Handle GET /workspaces/:id/tasks/stats - Get task statistics
f handleGetWebhook Handle GET /webhooks/:id - Get webhook
f handleGetWebhook Handle GET /webhooks/:id - Get webhook
f handleGetWebhookEvent Handle GET /webhooks/:id/events/:eventId - Get webhook event
f handleGetWebhookEvent Handle GET /webhooks/:id/events/:eventId - Get webhook event
f handleGetWorkspace Handle GET /workspaces/:id - Get workspace
f handleGetWorkspaceAuditLogs Handle GET /workspaces/:id/audit-logs - Get workspace audit logs
f handleGetWorkspaceDailyUsage Handle GET /workspaces/:id/usage/daily - Get daily/hourly usage breakdown
f handleGetWorkspaceUsage Handle GET /workspaces/:id/usage - Get usage summary
f handleHealth Health check endpoint handler
f handleInitiatePayment Handle POST /workspaces/:id/swan/payments - Initiate SEPA payment
f handleListAccounts Handle GET /workspaces/:id/accounts - List accounts
f handleListCards Handle GET /workspaces/:id/swan/cards - List cards
f handleListDocumentEvents Handle GET /documents/:id/events - List document lifecycle events
f handleListDocuments Handle GET /workspaces/:id/documents - List documents
f handleListEmails Handle GET /workspaces/:id/emails - List emails
f handleListIntegrations Handle GET /workspaces/:id/integrations - List integrations
f handleListMembers Handle GET /workspaces/:id/members - List members
f handleListPayments Handle GET /workspaces/:id/swan/payments - List payments
f handleListProposals Handle GET /documents/:id/proposals - List proposals
f handleListSwanAccounts Handle GET /workspaces/:id/swan/accounts - List accounts
f handleListTaskComments Handle GET /workspaces/:id/tasks/:taskId/comments - List task comments
f handleListTasks Handle GET /workspaces/:id/tasks - List tasks
f handleListWebhookEvents Handle GET /webhooks/:id/events - List webhook events
f handleListWebhookEvents Handle GET /webhooks/:id/events - List webhook events
f handleListWebhooks Handle GET /workspaces/:workspaceId/webhooks - List webhooks
f handleListWebhooks Handle GET /workspaces/:workspaceId/webhooks - List webhooks
f handleListWorkspaceEvents Handle GET /workspaces/:id/events - List workspace events
f handleListWorkspaces Handle GET /workspaces - List workspaces
f handleListWorkspaceWebhookEvents Handle GET /workspaces/:workspaceId/webhooks/events - List all workspace webhook events
f handleListWorkspaceWebhookEvents Handle GET /workspaces/:workspaceId/webhooks/events - List all workspace webhook events
f handleOidcConfig Handle GET /.well-known/openid-configuration (and /mcp/.well-known/...)
f handleProtectedResource Handle GET /.well-known/oauth-protected-resource (and /mcp/.well-known/...)
f handleRegenerateProposals Handle POST /documents/:id/proposals/regenerate - Regenerate proposals
f handleRegenerateWebhookUrl Handle POST /webhooks/:id/regenerate-url - Regenerate webhook URL
f handleRegenerateWebhookUrl Handle POST /webhooks/:id/regenerate-url - Regenerate webhook URL
f handleRejectDocument Handle POST /documents/:id/reject - Reject document
f handleRejectProposal Handle POST /documents/:id/proposals/:proposalId/reject - Reject a proposal
f handleRemoveMember Handle DELETE /workspaces/:id/members/:userId - Remove member
f handleReprocessDocument Handle POST /documents/:id/reprocess - Reprocess document
f handleResendWebhook Handle POST /infra/resend webhook requests
f handleResolveTask Handle POST /workspaces/:id/tasks/:taskId/resolve - Resolve task
f handleStartOnboarding Handle POST /workspaces/:id/swan/onboarding - Start onboarding
f handleSwanWebhook Handle POST /infra/swan - Swan webhook handler
f handleSyncTransactions Handle POST /workspaces/:id/swan/accounts/:accountId/sync - Sync transactions
f handleTestWebhook Handle POST /webhooks/:id/test - Test webhook
f handleTestWebhook Handle POST /webhooks/:id/test - Test webhook
f handleUpdateAccount Handle PUT /accounts/:id - Update account
f handleUpdateCard Handle PATCH /workspaces/:id/swan/cards/:cardId - Update card settings
f handleUpdateDocument Handle PUT /documents/:id - Update document
f handleUpdateMember Handle PUT /workspaces/:id/members/:userId - Update member
f handleUpdateTask Handle PUT /workspaces/:id/tasks/:taskId - Update task
f handleUpdateWebhook Handle PATCH /webhooks/:id - Update webhook
f handleUpdateWebhook Handle PATCH /webhooks/:id - Update webhook
f handleUpdateWorkspace Handle PUT /workspaces/:id - Update workspace
f handleUploadDocument Handle POST /workspaces/:id/documents - Upload document
f handleWebhookIngestion Handle POST /inbox/:urlPath - Receive webhook payload
f handleWebhookIngestion Handle POST /inbox/:urlPath - Receive webhook payload
f hasRole Check if the user has the required role for a workspace.
f hasScope Check if auth context has required OAuth scope
f importTransactionsCsv Import transactions from CSV data
f isApiKey True if token is a Clerk API key (ak_ prefix).
f isOAuthToken True if token is a Clerk OAuth access token (oat_ prefix).
f isOtelEnabled Check if OTEL is enabled
f isSensitiveEnvVar Check if an environment variable is sensitive (should be masked in logs)
f isSensitiveKey Check if a key contains sensitive information
f isSupported Check if a MIME type is supported
f isSupportedMimeType Check if a MIME type is supported
f isValidCategory Type guard: checks if a string is a valid DocumentCategory
f isValidEnvVar Check if a string is a valid environment variable name in the registry
f isValidSubtypeForCategory Type guard: checks if a subtype is valid for the given category
f isValidWebhookEvent Check if a string is a supported webhook event type
f listAccounts List accounts in a workspace
f listCategories List transaction categories for a workspace
f listFinancialAnomalies Detect financial anomalies in workspace transactions
f listTransactions List transactions with filters
f listWorkspaces List workspaces accessible to the authenticated user.
f logDocumentEvent Log document processing event
f logEmailEvent Log email processing event to audit trail.
f mapClerkRole Map Clerk role to internal role.
f mapCsvToTransactions Map parsed CSV table data to the AccountTransactionsExtraction schema.
f mapTypedToLegacyAnalysis Map typed extraction to legacy AnalysisResult for backward compatibility
f markSpanError Mark a span as failed with error details
f markSpanSuccess Mark a span as successful with optional final attributes
f maskSensitiveData Mask sensitive data in objects
f maskValue Mask a sensitive value
f maskValue Mask a value for safe logging
f meetsAutoApprovalThreshold Check if a confidence score meets auto-approval threshold
f meetsMinimumThreshold Check if a confidence score meets minimum threshold
f mintSupabaseJwt Mint a Supabase-compatible JWT from verified Clerk auth context.
f parseAIResponse Parse AI response JSON into structured analysis.
f parseAmount Parse a CSV amount value, handling various formats
f parseAmount Parse a number string in various European and US formats.
f parseAnalysisResponse Parse Claude's analysis response into structured data
f parseDate Parse a date string into YYYY-MM-DD format
f parseInboxAddress Parse an inbox email address into workspace slug, descriptor, and tags.
f parseProposals
f processDocument Process a single document through the extraction, classification, and analysis pipeline
f processEmail Process a single email through the AI analysis pipeline.
f processEmailAttachments Process attachments from an email webhook event
f provisionFromJwt Provision user, workspace, and membership from JWT claims
f queryDatabase Execute a workspace-scoped SQL query
f requireScope Scope enforcement middleware factory
f resolveInternalUser Resolve a Clerk user ID to the full internal user record (id, name, email).
f resolveTask Resolve task
f sanitizeFilename Sanitize filename for storage
f sanitizeInstructions Sanitize user-supplied instructions before interpolating into AI prompts.
f sanitizeSearchInput Sanitize search input for safe use in SQL ILIKE patterns
f sanitizeSearchInput Sanitize search input for safe use in SQL ILIKE patterns
f shouldLog Check if a log level should be logged based on current level
f toPublicStorageUrl Rewrite a Supabase Storage signed URL to use the public-facing base URL.
f toPublicStorageUrl Rewrite a Supabase Storage signed URL to use the public-facing base URL.
f updateAccount Update an existing account
f updateTask Update a task
f updateTransaction Update an existing transaction
f validateEnvironment Validate all environment variables against the registry
f validateIBAN Validate IBAN using mod-97 algorithm (ISO 13616)
f validateIBAN Validate IBAN using mod-97 algorithm (ISO 13616)
f verifyApiKey Verify a Clerk API key via Clerk REST API.
f verifyBearerToken Detect token type and dispatch to the correct verifier.
f verifyOAuthToken Verify an OAuth access token via Clerk REST API.
f verifySessionToken Verify a session JWT via `@clerk/backend` verifyToken().
f withServiceSpan Wrap an async function with a span
f zodToJsonSchema Convert Zod schema to JSON Schema for MCP tools/list and Anthropic tool definitions.
I Account Account record from database
I AccountBalanceExtraction Account balance extraction result
I AccountFilters Filters for listing accounts
I AccountListItem Account list item (summary)
I AccountMapping Account mapping for categorization
I AccountServiceResult
I AccountTransactionsExtraction Account transactions extraction result
I AddCardResult Result of card add operation
I AddVirtualCardParams Parameters for adding a virtual card
I AiCallContext Tracking context passed with every AI call.
I AiService Public interface returned by createAiService().
I AnalysisResult Result of AI analysis on extracted document data
I AnalyticsServiceResult
I AnnualReportExtraction Annual report extraction result
I AnthropicHealthCheck Anthropic health check result
I AttachmentProcessResult Result of processing a single attachment
I AuthContext Full authentication context including internal DB identity.
I AuthLogger Minimal logger interface accepted by auth functions.
I BalanceSheetExtraction Balance sheet extraction result
I BearerTokenResult Result from verifyBearerToken — includes raw JWT claims for session tokens.
I BudgetAnalysis Budget analysis result
I BufferedLogRecord Log record structure for buffering
I BulkTransactionItem Bulk transaction creation item
I CashFlowAnalysis Cash flow analysis result
I CategorizationSuggestion Transaction categorization suggestion
I CategoryListItem Category list item (summary)
I ClassificationResult Result of AI classification
I ClaudeOptions Options for Claude API calls
I ClaudeResponse Response from Claude API
I ClerkApiKeyVerifyResponse Response from Clerk's API key verification endpoint.
I ClerkJWTClaims Clerk JWT claims structure
I ClerkMembershipPayload Clerk organization membership webhook payload
I ClerkOAuthTokenVerifyResponse Response from Clerk's OAuth access token verification API.
I ClerkOrganizationPayload Clerk organization webhook payload
I ClerkUserPayload Clerk user webhook payload
I CompanyOnboardingInfo Company information for onboarding
I CreateAccountDto DTO for creating an account
I CreateMessageOptions Options for a single message request.
I CreateTransactionDto DTO for creating a transaction
I CreditCardExtraction Credit card agreement extraction result
I CreditLineExtraction Credit line extraction result
I CsvColumnMapping Column mapping for CSV import
I CsvImportResult CSV import result
I DeploymentEnvVar Deployment-injected environment variable - set by CI/CD
I DeprecationInfo Deprecation information for phasing out environment variables
I DocumentProposal Document proposal record from the database
I DocumentRecord Document record from the database
I EmailAnalysisResult Result of email AI analysis
I EmailAttachmentProcessResult Result of processing all attachments for an email
I EmitEventParams
I EmploymentContractExtraction Employment contract extraction result
I ErrorResponse Error response structure
I ExtractedData Extracted data from document content parsing
I ExtractorEntry Extractor registry entry
I FinancialAnomaly Financial anomaly
I FinancialInsights Financial insights result
I FinancialReport Financial report result
I GetWorkspaceResult Result of get workspace operation
I HealthChecks Health checks container
I HealthResponse Health check response structure
I HttpSpanAttributes HTTP request span attributes (OpenTelemetry semantic conventions)
I IncomeStatementExtraction Income statement extraction result
I InitiateCreditTransferParams Parameters for initiating a SEPA credit transfer
I InitiateCreditTransferResult Result of a payment initiation
I InternalUser Internal user record from the users table.
I JitProvisioningClaims Claims extracted from Clerk JWT for provisioning
I JitProvisioningResult Result of JIT provisioning — just success/error, user resolution happens separately
I JitRequestContext Request context passed from auth middleware for event logging
I LineItem Line item from an invoice or receipt
I LinkAccountOptions Link account options
I ListAccountsOptions Account listing options
I ListWorkspacesResult Result of workspace list operation
I LoanExtraction Loan extraction result (for loan_given and loan_received subtypes)
I LoggerContext Logger context containing user, organization, and request information
I MessageResponse Parsed response from the Anthropic Messages API.
I OnboardingRecord Stored onboarding record
I OpenAPIDocument OpenAPI Document (3.1.0)
I OptionalEnvVar Optional environment variable - has a default, can be overridden
I ParsedInboxAddress Parsed inbox address with workspace slug, descriptor, and tags
I PartyAddress Structured postal address
I PartyDetails Full details of a party (vendor, client, seller, customer) on an invoice
I PostHogLogsConfig Configuration for PostHog Logs Exporter
I ProcessingResult Processing result returned by the document processor
I ProcessingResult Processing result returned after document processing
I RateLimitInfo
I RequiredEnvVar Required environment variable - must be set, no default allowed
I ResendAttachment Resend attachment metadata from webhook payload
I ResendAttachmentWithUrl Resend attachment with download URL from API response
I ResolveUserResult Result of resolving an internal user — distinguishes "not found" from DB errors.
I SalesInvoiceExtraction Sales invoice extraction result
I SecurityValidation
I ServiceAgreementExtraction Service agreement extraction result
I ServiceLogger Platform-agnostic logger interface for shared services.
I ServiceLoggerWithDb Extended logger interface with database operation logging.
I ServiceSpanAttributes Common span attributes for external service calls
I SwanAccount Swan account from API
I SwanAccountRecord Stored Swan account record
I SwanAuthConfig Swan auth service configuration
I SwanClientConfig Swan client configuration
I SwanCredentials Stored Swan credentials (decrypted)
I SwanGraphQLResponse Swan GraphQL response structure
I SwanWebhookPayload Swan webhook payload structure
I TableData Table structure detected in document
I Task
I TaskComment
I TaskFilters
I TaskStats
I Transaction Transaction record from database
I TransactionCategory Transaction category record
I TransactionFilters Filters for listing transactions
I TransactionListItem Transaction list item (summary)
I TransactionServiceResult
I TransactionWithCategory Transaction with category name joined
I TypedExtractionResult Result of type-specific extraction with reasoning and metadata
I UpdateAccountDto DTO for updating an account
I UpdateCardParams Parameters for updating a card
I UpdateCardResult Result of card update operation
I UpdateTransactionDto DTO for updating a transaction
I UserInfo
I ValidationError Represents a validation error for an environment variable
I ValidationResult Result of environment validation
I ValidationWarning Represents a validation warning (non-fatal)
I VendorBillExtraction Vendor bill extraction result
I VerifiedToken Result of token verification — contains Clerk-level identity info.
I VerifyConfig Configuration passed to verification functions.
I WebhookRequest
I WebhookResponse
I WorkspaceContext Workspace context for document processing pipeline
I WorkspaceDetails Workspace details with full information
I WorkspaceListItem Workspace list item with membership info
I WorkspaceMembership Workspace membership entry resolved during auth.
I WorkspaceResponse Workspace response structure
T AccountDetail
T AccountListQuery
T AccountStatus Account status enumeration
T AccountType Account type enumeration
T AddCard
T AddMember
T AllowedMimeType
T AnalysisGranularity Granularity for cash flow analysis
T AnalysisPeriod Period for financial analysis
T AnomalySensitivity Sensitivity level for anomaly detection
T AnomalyType Types of anomalies to detect
T AnthropicHealthCheckSchemaType Inferred TypeScript types from Zod schemas
T ApproveDocument
T AppVariables Hono context variables available throughout request lifecycle
T AssignTaskRequest
T AuditLogEntry
T BudgetPeriod Budget analysis period
T ClerkWebhookEventSchemaType
T ClerkWebhookEventType Clerk webhook event types
T CompanyOnboardingInfo
T CreateAccount
T CreateCommentRequest
T CreateTaskRequest
T CreateWebhook
T CreateWorkspace
T DailyUsageEntry
T DateTimeFormat Date/time output format
T DocumentCategory Document categories for classification
T DocumentDetail
T DocumentListItem
T DocumentListQuery
T DocumentSubtype Document subtypes for fine-grained classification
T DocumentType Document types supported by the system
T EmailAnalysis
T EmailDetail
T EmailDetailResponse
T EmailIdParam
T EmailsListResponse
T EmailSummary
T EnvCategory Environment variable category determining validation behavior
T EnvRegistry Type for the environment registry object
T EnvVarDefinition Union type for all environment variable definitions
T EnvVarName Type representing valid environment variable names
T ErrorResponseSchemaType
T EventFilters
T ExtractorFunction Extractor function signature
T HealthChecksSchemaType
T HealthResponseSchemaType
T InitiatePayment
T InternalRole Internal role mapping from Clerk roles
T JsonRpcRequestParsed
T LinkedDocument
T ListEmailsQuery
T ListTasksQuery
T LogLevel Log level enumeration
T McpErrorType
T McpToolCallRequestType
T McpToolCallResponseType
T McpWorkspaceResourceType
T OnboardingRecord
T OnboardingStatus Onboarding status
T ProcessingStatus Processing status for documents
T ProposalStatus Proposal status
T ProposalType Proposal types that AI can suggest for a document
T ProtectedResourceMetadataType
T RejectDocument
T ReportType Report types
T ReprocessDocument
T ResolveTaskRequest
T ResourceType
T StartOnboarding
T SupportedMimeType
T SwanAccountDetail
T SwanAccountStatus Swan account status
T SwanCardRecord
T SwanCompanyType Swan company types
T SwanConsentRecord
T SwanEnvironment Swan API environment
T SwanPaymentRecord
T SwanWebhookEventType Swan webhook event types (from Swan docs)
T SwanWebhookPayload
T TransactionType Transaction type enumeration
T TypedExtraction Union of all type-specific extraction results
T UnifiedApiEvent PostHog event types for the Unified API
T UpdateAccount
T UpdateCard
T UpdateDocument
T UpdateMember
T UpdateTaskRequest
T UpdateWebhook
T UpdateWorkspace
T ValidationErrorType Validation error types
T WebhookDetail
T WebhookEventDetail
T WebhookProcessingStatus Processing status for webhook events
T WebhookReceivedResponseSchemaType
T WebhookSettings
T WorkspaceDetail
T WorkspaceEmailParam
T WorkspaceEvent
T WorkspaceEventType Event type union for autocomplete (not runtime enforcement)
T WorkspaceMember
T WorkspaceSchemaType
T WorkspacesResponseSchemaType
T WorkspaceUsageSummary
c DatabaseError Database operation error with context.
c Logger Logger class for structured logging with request ID correlation
c PostHogLogsExporter PostHog OTLP Logs Exporter
c PostHogService PostHog service for backend analytics
c SwanAccountService Swan account management service
c SwanApiError Swan API error
c SwanAuthService Swan OAuth 2.0 authentication service
c SwanCardService Swan card service
c SwanClient Swan GraphQL API client
c SwanOnboardingService Swan company onboarding service
c SwanPaymentService Swan payment service
c SwanWebhookService Swan webhook service
c WebhookProcessorService WebhookProcessorService - Processes incoming webhook requests
c WebhookService WebhookService - CRUD operations for webhooks
v acceptAllProposalsRoute POST /documents/:id/proposals/accept-all - Accept all pending proposals
v acceptProposalRoute POST /documents/:id/proposals/:proposalId/accept - Accept a proposal
v AcceptProposalSchema Accept proposal request schema
v AccountDetailSchema Full account entity schema (for GET responses)
v AccountIdParamSchema Account ID path parameter
v AccountListQuerySchema Account list query parameters
v AccountResponseSchema Account response (single)
v AccountsListResponseSchema Accounts list response
v AccountStatusSchema Account status enum
v AccountTypeSchema Account type enum
v AddCardResponseSchema
v addCardRoute POST /workspaces/:id/swan/cards - Add a virtual card
v AddCardSchema
v addMemberRoute POST /workspaces/:id/members - Add a member
v AddMemberSchema Add member request schema
v addTaskCommentRoute POST /workspaces/:id/tasks/:taskId/comments - Add task comment
v ALLOWED_MIME_TYPES Allowed MIME types for document uploads.
v ANTHROPIC_DOCUMENT_TYPES MIME types accepted by Anthropic as document content blocks (only PDF)
v ANTHROPIC_IMAGE_TYPES MIME types accepted by Anthropic as image content blocks
v AnthropicHealthCheckSchema Anthropic health check details schema
v approveDocumentRoute POST /documents/:id/approve - Approve a document
v ApproveDocumentSchema Approve document request schema
v archiveDocumentRoute POST /documents/:id/archive - Manually archive a completed document
v AssignTaskRequestSchema Assign task request schema
v assignTaskRoute POST /workspaces/:id/tasks/:taskId/assign - Assign task
v AuditLogEntrySchema Audit log entry schema
v AuditLogsQuerySchema Audit logs query parameters schema
v AuditLogsResponseSchema Audit logs response schema with pagination
v AUTO_APPROVAL_THRESHOLD Confidence threshold for auto-approval
v BJK_API_URL Full unified-api endpoint URL - read from environment at startup
v BJK_API_VERSION API version - read from environment at startup
v BJK_BACKEND_URL Backend server root URL - read from environment at startup
v BJK_BRANCH_NAME Git branch name - read from environment at startup
v BJK_DEPLOY_TIMESTAMP Deployment timestamp - read from environment at startup
v BJK_DEPLOYMENT_ID Deployment ID - read from environment at startup
v BJK_ENVIRONMENT Environment name - read from environment at startup
v CancelCardResponseSchema
v cancelCardRoute DELETE /workspaces/:id/swan/cards/:cardId - Cancel a card
v CardIdParamSchema Card ID parameter (workspace + card)
v CATEGORY_SUBTYPES Valid category-subtype pairs for validation
v CHAT_ATTACHMENT_TYPES Chat attachment types (no application/csv — Safari compat is for uploads/email only).
v CLASSIFICATION_PROMPT System prompt for document classification
v ClerkWebhookEventSchema Clerk webhook event schema
v ClerkWebhookEventTypeSchema Clerk webhook event types
v clerkWebhookRoute OpenAPI route definition for Clerk webhook endpoint
v CompanyAddressSchema Company address schema
v CompanyOnboardingInfoSchema Company onboarding information
v ConsentResponseSchema
v corsHeaders
v createAccountRoute POST /workspaces/:id/accounts - Create account in workspace
v CreateAccountSchema Create account request schema
v createApplicationLogger Alias for createLogger for application-level naming
v CreateCommentRequestSchema Create task comment request schema
v CreateTaskRequestSchema Create task request schema
v createTaskRoute POST /workspaces/:id/tasks - Create task
v createWebhookRoute POST /workspaces/:workspaceId/webhooks - Create webhook
v createWebhookRoute POST /workspaces/:workspaceId/webhooks - Create webhook
v CreateWebhookSchema
v createWorkspaceRoute POST /workspaces - Create a new workspace
v CreateWorkspaceSchema Create workspace request schema
v CurrencySchema Currency code (ISO 4217)
v CurrentOnboardingResponseSchema Current onboarding response (nullable - null when no onboarding exists)
v DailyUsageEntrySchema Daily usage entry schema
v DECISION_PROMPT System prompt for AI-powered proposal generation.
v deleteAccountRoute DELETE /accounts/:id - Delete an account
v deleteDocumentRoute DELETE /documents/:id - Delete a document
v deleteIntegrationRoute DELETE /workspaces/:id/integrations/:connectionId - Disconnect an integration
v deleteTaskRoute DELETE /workspaces/:id/tasks/:taskId - Delete task
v deleteWebhookRoute DELETE /webhooks/:id - Delete webhook
v deleteWebhookRoute DELETE /webhooks/:id - Delete webhook
v deleteWorkspaceRoute DELETE /workspaces/:id - Delete a workspace
v DOCUMENT_PROMPTS System prompts for each document type
v DocumentActionResponseSchema Document action response (approve/reject/reprocess)
v DocumentApprovalSchema Document approval schema
v DocumentCategorySchema Document category enum
v DocumentDetailSchema Full document entity schema (for GET responses)
v DocumentEventSchema Document event schema (lifecycle events)
v DocumentExtractionSchema Document extraction schema
v DocumentIdParamSchema Document ID path parameter
v DocumentListItemSchema Document list item schema (subset for list views)
v DocumentListQuerySchema Document list query parameters
v DocumentModelSchema Allowed AI model identifiers for document processing overrides.
v DocumentProposalSchema Document proposal schema
v DocumentResponseSchema Document response (single)
v DocumentsListResponseSchema Documents list response
v DocumentSourceSchema Document source enum
v DocumentStatusSchema Document status enum
v DocumentSubtypeSchema Document subtype enum
v DocumentTypeSchema Document type enum
v DocumentWorkspaceSchema Workspace reference schema
v EMAIL_ANALYSIS_SYSTEM_PROMPT System prompt for email analysis.
v EmailAnalysisSchema Email AI analysis results
v EmailDetailResponseSchema Response schema for getting email details
v EmailDetailSchema Full email details with linked documents (attachments)
v EmailIdParamSchema Path parameter schema for email detail endpoint
v EmailsListResponseSchema Response schema for listing workspace emails
v EmailSummarySchema Email summary for list view (minimal fields for performance)
v ENV_REGISTRY Complete registry of all environment variables used by Banker Jack
v ErrorResponseSchema Error response schema
v EventFiltersSchema
v EventsListResponseSchema Events list response
v FailureReasonEnum
v FeatureUsageBreakdownSchema Feature usage breakdown schema
v getAccountRoute GET /accounts/:id - Get a single account
v getCurrentOnboardingRoute GET /workspaces/:id/swan/onboarding - Get current onboarding for workspace
v getDocumentRoute GET /documents/:id - Get a single document
v getEmailRoute GET /emails/:id - Get a single email with linked documents
v getMemberRoute GET /workspaces/:id/members/:userId - Get a member
v getOnboardingRoute GET /workspaces/:id/swan/onboarding/:onboardingId - Get onboarding status
v getSwanAccountRoute GET /workspaces/:id/swan/accounts/:accountId - Get account details
v getTaskRoute GET /workspaces/:id/tasks/:taskId - Get task
v getTaskStatsRoute GET /workspaces/:id/tasks/stats - Get task statistics
v getWebhookEventRoute GET /webhooks/:id/events/:eventId - Get specific webhook event
v getWebhookEventRoute GET /webhooks/:id/events/:eventId - Get specific webhook event
v getWebhookRoute GET /webhooks/:id - Get webhook
v getWebhookRoute GET /webhooks/:id - Get webhook
v getWorkspaceAuditLogsRoute GET /workspaces/:id/audit-logs - Get workspace audit logs
v getWorkspaceDailyUsageRoute GET /workspaces/:id/usage/daily - Get workspace daily usage breakdown
v getWorkspaceRoute GET /workspaces/:id - Get a single workspace
v getWorkspaceUsageRoute GET /workspaces/:id/usage - Get workspace usage summary
v handleWorkspaces
v HealthChecksSchema Health checks container schema
v HealthResponseSchema
v healthRoute OpenAPI route definition for health endpoint
v InitiatePaymentResponseSchema
v initiatePaymentRoute POST /workspaces/:id/swan/payments - Initiate a SEPA payment
v InitiatePaymentSchema
v JSON_OUTPUT_INSTRUCTION JSON output schema instruction appended to all prompts
v JsonRpcRequestSchema
v LinkedDocumentSchema Document linked to an email (attachment)
v listAccountsRoute GET /workspaces/:id/accounts - List accounts for a workspace
v ListCardsQuerySchema
v ListCardsResponseSchema
v listCardsRoute GET /workspaces/:id/swan/cards - List cards
v listDocumentEventsRoute GET /documents/:id/events - List document lifecycle events
v listDocumentsRoute GET /workspaces/:id/documents - List documents for a workspace
v ListEmailsQuerySchema Query parameter schema for listing emails with pagination
v listEmailsRoute GET /workspaces/:id/emails - List emails for a workspace
v listIntegrationsRoute GET /workspaces/:id/integrations - List integrations for a workspace
v listMembersRoute GET /workspaces/:id/members - List workspace members
v ListPaymentsQuerySchema
v ListPaymentsResponseSchema
v listPaymentsRoute GET /workspaces/:id/swan/payments - List payments
v listProposalsRoute GET /documents/:id/proposals - List proposals for a document
v listSwanAccountsRoute GET /workspaces/:id/swan/accounts - List Swan accounts
v listTaskCommentsRoute GET /workspaces/:id/tasks/:taskId/comments - List task comments
v ListTasksQuerySchema List tasks query parameters
v listTasksRoute GET /workspaces/:id/tasks - List tasks
v listWebhookEventsRoute GET /webhooks/:id/events - List webhook events
v listWebhookEventsRoute GET /webhooks/:id/events - List webhook events
v listWebhooksRoute GET /workspaces/:workspaceId/webhooks - List webhooks
v listWebhooksRoute GET /workspaces/:workspaceId/webhooks - List webhooks
v listWorkspaceEventsRoute GET /workspaces/:id/events - Get workspace events
v listWorkspacesRoute GET /workspaces - List all workspaces
v listWorkspaceWebhookEventsRoute GET /workspaces/:workspaceId/webhooks/events - List all webhook events in workspace
v listWorkspaceWebhookEventsRoute GET /workspaces/:workspaceId/webhooks/events - List all webhook events in workspace
v LOG_LEVELS Log level numeric values for comparison
v MAX_ATTACHMENT_SIZE Maximum attachment size in bytes (25MB).
v MAX_ATTACHMENT_SIZE Maximum attachment size in bytes (25MB)
v MAX_FILE_SIZE Maximum file size for uploads (25MB)
v McpErrorSchema MCP Error response
v McpToolCallRequestSchema MCP Tool Call request body
v McpToolCallResponseSchema MCP Tool Call response
v McpWorkspaceResourceSchema MCP Workspace Resource response
v MemberResponseSchema Member response (single)
v MemberRoleSchema Member role enum
v MembersListResponseSchema Members list response
v MemberUserIdParamSchema Member user ID path parameter (nested under workspace)
v MIN_PDF_SIZE Minimum file size for PDFs (1KB)
v MINIMUM_CONFIDENCE_THRESHOLD Minimum confidence for accepting analysis results
v MODEL_PRICING Model pricing per million tokens (USD)
v ModelUsageBreakdownSchema Model usage breakdown schema
v noopLogger No-op logger for cases where logging is optional.
v oidcConfigRoute OpenAPI route definition for OIDC discovery endpoint
v OnboardingIdParamSchema Onboarding ID parameter
v OnboardingRecordSchema Onboarding record (full details)
v OnboardingResponseSchema Onboarding response (single)
v OnboardingStatusSchema Onboarding status
v ProcessingStatusEnum
v ProposalIdParamSchema Proposal ID + Document ID path parameters
v ProposalsListResponseSchema Proposals list response
v ProposalStatusSchema Proposal status enum
v ProposalTypeSchema Proposal type enum
v ProtectedResourceMetadataSchema OAuth Protected Resource Metadata (RFC 9728)
v protectedResourceRoute OpenAPI route definition for protected resource metadata endpoint
v regenerateProposalsRoute POST /documents/:id/proposals/regenerate - Regenerate proposals with feedback
v RegenerateProposalsSchema Regenerate proposals request schema
v RegenerateUrlResponseSchema
v regenerateWebhookUrlRoute POST /webhooks/:id/regenerate-url - Regenerate webhook URL
v regenerateWebhookUrlRoute POST /webhooks/:id/regenerate-url - Regenerate webhook URL
v rejectDocumentRoute POST /documents/:id/reject - Reject a document
v RejectDocumentSchema Reject document request schema
v rejectProposalRoute POST /documents/:id/proposals/:proposalId/reject - Reject a proposal
v RejectProposalSchema Reject proposal request schema
v removeMemberRoute DELETE /workspaces/:id/members/:userId - Remove a member
v reprocessDocumentRoute POST /documents/:id/reprocess - Reprocess a document
v ReprocessDocumentSchema Reprocess document request schema (instructions required)
v resendWebhookRoute OpenAPI route definition for Resend webhook endpoint
v ResolveTaskRequestSchema Resolve task request schema
v resolveTaskRoute POST /workspaces/:id/tasks/:taskId/resolve - Resolve task
v SENSITIVE_PATTERNS Sensitive field patterns to mask
v SpendingLimitPeriodSchema
v startOnboardingRoute POST /workspaces/:id/swan/onboarding - Start company onboarding
v StartOnboardingSchema Start onboarding request
v SUBTYPE_EXTRACTION_PROMPTS Type-specific extraction prompts keyed by DocumentSubtype
v SUPPORTED_MIME_TYPES MIME types we support for attachments.
v SUPPORTED_MIME_TYPES All supported MIME types across document upload, email, and chat paths.
v SUPPORTED_WEBHOOK_EVENTS Supported Clerk webhook event types
v SvixHeadersSchema Svix webhook signature headers schema
v SWAN_DEFAULT_ACCOUNT_COUNTRY Default account country for unsupported residency countries.
v SWAN_SUPPORTED_ACCOUNT_COUNTRIES Swan-supported account countries.
v SwanAccountDetailSchema Swan account details
v SwanAccountIdParamSchema Swan account ID parameter
v SwanAccountResponseSchema Swan account response (single)
v SwanAccountsListResponseSchema Swan accounts list response
v SwanAccountStatusSchema Swan account status
v SwanCardRecordSchema
v SwanCardStatusSchema
v SwanCardTypeSchema
v SwanCompanyTypeSchema Swan company types
v SwanConsentPurposeSchema
v SwanConsentRecordSchema
v SwanConsentStatusSchema
v SwanPaymentRecordSchema
v SwanPaymentStatusSchema
v SwanPaymentTypeSchema
v SwanWebhookPayloadSchema Swan webhook payload
v swanWebhookRoute POST /infra/swan - Receive Swan webhooks
v SyncTransactionsResponseSchema Sync transactions response
v syncTransactionsRoute POST /workspaces/:id/swan/accounts/:accountId/sync - Sync transactions
v TaskCommentResponseSchema Task comment response (single)
v TaskCommentSchema Task comment schema
v TaskCommentsListResponseSchema Task comments list response
v TaskDetailSchema Task detail schema
v TaskIdParamSchema Task ID path parameters
v TaskPrioritySchema Task priority enum
v TaskResponseSchema Task response (single)
v TasksListResponseSchema Tasks list response
v TaskStatsResponseSchema Task stats response
v TaskStatsSchema Task statistics schema
v TaskStatusSchema Task status enum
v TaskSuccessResponseSchema Task success response
v TaskWorkspaceIdParamSchema Workspace ID path parameter
v TestWebhookResponseSchema
v testWebhookRoute POST /webhooks/:id/test - Test webhook
v testWebhookRoute POST /webhooks/:id/test - Test webhook
v TEXT_REMAPPABLE_TYPES Text-based types remapped to text/plain for Anthropic API compatibility.
v updateAccountRoute PUT /accounts/:id - Update an account
v UpdateAccountSchema Update account request schema
v updateCardRoute PATCH /workspaces/:id/swan/cards/:cardId - Update card settings
v UpdateCardSchema
v updateDocumentRoute PUT /documents/:id - Update a document
v UpdateDocumentSchema Update document request schema
v updateMemberRoute PUT /workspaces/:id/members/:userId - Update member role
v UpdateMemberSchema Update member request schema
v UpdateTaskRequestSchema Update task request schema
v updateTaskRoute PUT /workspaces/:id/tasks/:taskId - Update task
v updateWebhookRoute PATCH /webhooks/:id - Update webhook
v updateWebhookRoute PATCH /webhooks/:id - Update webhook
v UpdateWebhookSchema
v updateWorkspaceRoute PUT /workspaces/:id - Update a workspace
v UpdateWorkspaceSchema Update workspace request schema
v UploadDocumentResponseSchema Upload document response schema
v uploadDocumentRoute POST /workspaces/:id/documents - Upload a document
v UploadDocumentSchema Upload document request schema (for OpenAPI documentation)
v UsageIntervalSchema Usage interval enum
v UsageQueryParamsSchema Usage query parameters schema
v UserInfoSchema User info schema for creator/assignee
v WebhookDetailSchema
v WebhookEventDetailSchema
v WebhookEventIdParamSchema
v WebhookEventResponseSchema
v WebhookEventsListResponseSchema
v WebhookIdParamSchema
v WebhookIngestionResponseSchema
v webhookIngestionRoute POST /inbox/:urlPath - Receive external webhook
v webhookIngestionRoute POST /inbox/:urlPath - Receive external webhook
v WebhookReceivedResponseSchema Webhook received response schema
v WebhookResponseSchema Webhook response
v WebhookResponseSchema
v WebhookSettingsSchema
v WebhooksListResponseSchema
v WebhookStatusEnum
v WorkspaceAccountParamSchema Workspace ID with account creation
v WorkspaceDailyUsageResponseSchema Workspace daily usage response schema
v WorkspaceDetailSchema Full workspace entity schema (for GET responses)
v WorkspaceDocumentParamSchema Workspace ID for document operations
v WorkspaceEmailParamSchema Path parameter schema for workspace email endpoints
v WorkspaceEventSchema
v WorkspaceEventsListResponseSchema
v WorkspaceEventsQuerySchema
v WorkspaceIdParamSchema Workspace ID path parameter
v WorkspaceMemberSchema Workspace member schema
v WorkspaceResponseSchema Workspace response (single)
v WorkspaceSchema Workspace entity schema
v WorkspaceSettingsSchema Workspace settings schema
v WorkspacesListResponseSchema Workspaces list response
v WorkspacesResponseSchema Workspaces list response schema
v workspacesRoute
v WorkspaceStatusSchema Workspace status enum
v WorkspaceSwanParamSchema Workspace ID parameter
v WorkspaceTypeSchema Workspace type enum
v WorkspaceUsageResponseSchema Workspace usage response schema
v WorkspaceUsageSummarySchema Workspace usage summary schema

Module

View Source