Skip to content

Exports

Every named export from @architectine/xil and its subpaths that the guide documents, grouped by area. Each subpath re-exports more low-level types than are listed here (compiled Lua scripts for the rate limiter, JSON Schema conversion internals, and similar) — those are implementation detail for advanced use, not part of the documented contract, and are best read from source if you need them.

Export What it is
createApp, AppOptions, App Build a wired Express app — createApp
HealthOptions, ShutdownOptions, BodyOptions, LifecycleHook createApp option and hook types
context, ContextOptions Install the context middleware on a bare Express app — Using an existing app
hooks, createAppHooks, AppHooks, HooksOptions, RequestLogOptions Install app-level hooks on a bare Express app — Hooks
Export What it is
Router, RouterCtx The chainable router — Router
RouteBuilder, RouteInfo, RouteState, RouteSchemas, RouteResponse, RouterOptions, RouterHooks, HttpMethod, BodylessMethod, Handler, HandlerCtx, HandlerReturn Route builder and metadata types
StaticInfo, StaticOptions, RedirectInfo Types for .static() and .redirect()
paramNames, ParamKeys, PathParams, joinPath Path-string parsing utilities behind .params() type inference
markHandled, ROUTER_HANDLED, wasHandledByRouter Marks used internally to prevent app hooks from double-observing an error already seen by a router — see Hooks: ordering
Export What it is
Middleware, CtxMiddleware, CtxMiddlewareFor, ExpressMiddleware, AnyMiddleware, Next, MiddlewareResult, AddsOf, AddsOfAll Middleware types and narrowing — Middleware
guard One-line check-or-throw middleware — Middleware: ctx middleware and narrowing
toExpress Convert a ctx middleware to a plain Express RequestHandler
isDescriptor, RouteSkip Internals behind response descriptors and the four things a middleware may do
Export What it is
Ctx, BaseCtx, TypedCtx, CtxKind, CtxCookies, CtxHeaders, CookieOptions, DefaultHeaders, DefaultQuery The per-request context type — Context
createCtx, CtxOptions, ctxOf, ensureCtx, RequestContext Constructing and reading a context, for bare-Express integration
currentCtx, requireCtx, currentBaseCtx, runWithCtx, RunWithCtxOptions Ambient context — Logging: ambient context
Export What it is
ResponseDescriptor, JsonResponse, TextResponse, RedirectResponse, FileResponse, DownloadResponse, StreamResponse, EmptyResponse, RawResponse, ResponseInit, ResponseHeaders, RESPONSE Response descriptor types — Responses
Export What it is
HttpError, isHttpError, defineError The base class and factory — Errors
BadRequest, Unauthorized, Forbidden, NotFound, MethodNotAllowed, Conflict, Gone, PayloadTooLarge, Unprocessable, TooManyRequests, Internal, ServiceUnavailable The built-in HttpError subclasses — full table in error codes
errorHandler, ErrorHandlerOptions, MappedError, notFound, classifyError, defaultEnvelope The error handler and its classification logic
Export What it is
RequestHook, ResponseHook, ErrorHook Hook function types — Hooks
Export What it is
defineConfig, Config, ConfigShape, DefineConfigOptions, InferConfig, InferConfigInput Boot-time config resolution — Config
ConfigError, ConfigIssue The error thrown when config is invalid
env, EnvSchema, LeafOptions, envName Environment-variable leaves and the path-to-variable-name converter
resolveConfig For writing your own module option fragment — Config: module fragments
Export What it is
log, Logger, LogFn, LogLevel The ambient logger proxy — Logging
configureLogger, createLogger, getRootLogger, PinoLogger, LoggerOptionsInput, DEFAULT_REDACT, LOG_LEVELS Building and reading the root logger outside createApp
Export What it is
createEvents, Events, EventsOptions, EventMap, EventSchemas, EventMeta, Listener, ListenerError, ErrorListener, MatchingNames, PayloadOf The in-process event bus — Events
Export What it is
createCache, redisStore, Cache, CacheOptions, CacheScope, TaggedCache, SetOptions The cache API — Cache
Export What it is
StandardSchemaV1, InferInput, InferOutput, StandardIssue, StandardFailure, StandardSuccess, StandardResult, StandardPathSegment, StandardSchemaProps, StandardTypes The Standard Schema types every .body()/.query()/etc. schema satisfies
runSchema, SchemaOutcome, toIssues, ValidationDetails, ValidationIssue, ValidationSection, validationError Internals behind route validation
parseDuration, parseBytes Duration and byte-size string parsing — reference
MaybePromise, Simplify, UnionToIntersection Generic TypeScript helper types used across the public API
UPLOAD_ISSUE_CODES, UploadedFile, UploadFieldSpec, UploadFieldsSpec, UploadIssueCode, UploadIssueMeta, UploadMessage, UploadMessages, UploadsOf Upload types available from the core package for typing .uploads(), even before installing @architectine/xil/upload
Export What it is
createAuth, Auth, CreateAuthConfig, IssueTokensResult Auth
AuthAdapter, checkAdapter, AdapterMethod, AdapterRequirement, CreateSessionInput, UpdateSessionInput, SessionRecord The adapter contract
cookieSession, CookieSessionOptions, jwt, JwtOptions, JwtKeyPair, JwtStrategy, opaque, OpaqueOptions, OpaqueStrategy, apiKey, ApiKeyOptions, custom, CustomOptions The five strategy factories
Strategy, StrategyDeps, AuthOutcome, authenticated, invalid, absent, HasId Writing a custom strategy
RequireOptions, OptionalOptions, AUTH_REQUIREMENT, AuthRequirement, getAuthRequirement require()/optional() and the marker the OpenAPI module reads
csrf, CsrfOptions Double-submit CSRF protection
scrypt, ScryptOptions, argon2, Argon2Options, PasswordHasher Password hashing
currentUser, requireUser Reading the current user via ambient context
hashToken, randomToken, initialExpiry, rollSession, ROLL_THROTTLE_MS Token internals, exposed for a custom adapter or strategy
Export What it is
uploads, UploadsOptions, uploadConfig Uploads
UploadedFileImpl The concrete class behind the UploadedFile interface
sanitizeFilename, detectType, matchesTypes, sweepTempDir, resolveMessage, createParser, ResolvedUploadOptions Internals, exposed for testing or a custom parser
Export What it is
rateLimit, RateLimitOptions, RateLimitInfo Rate limiting
MemoryStore, createConsumer, BackendOptions, Consume, Algorithm, ConsumeArgs, ConsumeResult, RedisLike The backend abstraction, for writing your own store
Export What it is
openapi, OpenApiBuilder, OpenApiSpec, RouteSource OpenAPI
buildDocument, OpenApiDocument, OpenApiOptions, OpenApiInfo, OpenApiServer, Contact, SecurityScheme The document builder, if you want the spec without the docs UI
createDocsRouter The Scalar UI router spec.docs() returns
convertSchema, SchemaConverters, JsonSchema, ComponentRegistry Standard Schema → JSON Schema conversion, for a custom schemaConverters entry
errorSchemaRef, errorStatusAndCode, getAuthRequirement, AuthRequirement, uploadsRequestSchema, toOpenApiPath Internals behind the generated document