tempest-express-sdk 0.22.0 → 0.23.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -4287,14 +4287,34 @@ declare function registerExceptionHandlers(app: Express, options?: RegisterExcep
4287
4287
  *
4288
4288
  * Swagger UI is served fully self-contained: its static assets ship with the
4289
4289
  * `swagger-ui-dist` dependency and are mounted locally (no CDN), with a small
4290
- * inline initializer pointing at the spec endpoint. Redoc is served as a single
4291
- * HTML page that loads the Redoc standalone bundle from a CDN (the renderer is
4292
- * ~1 MB and intentionally not vendored); override {@link RedocOptions.scriptUrl}
4293
- * to self-host it.
4290
+ * inline initializer pointing at the spec endpoint.
4291
+ *
4292
+ * Redoc's renderer is ~1 MB and is **not** vendored — the `redoc` package pulls
4293
+ * 22 dependencies and peers on `react`, `react-dom`, `styled-components`,
4294
+ * `mobx` and `core-js`, bounds no backend service should inherit just to render
4295
+ * a reference page. It is an **optional peer** instead: install `redoc` and
4296
+ * {@link mountRedoc} serves its standalone bundle from disk, so the page works
4297
+ * offline; without it the page falls back to the jsDelivr CDN and says so
4298
+ * out loud when the network blocks the bundle.
4299
+ *
4300
+ * Both pages declare an inline `<link rel="icon">`. Without one the browser
4301
+ * requests `/favicon.ico` at the origin root, which on an API-only service is a
4302
+ * 401, a 404 or an SPA catch-all — a red console error on every page load.
4294
4303
  */
4295
4304
 
4296
4305
  /** A JSON-serializable OpenAPI document. */
4297
4306
  type OpenApiDocument = Record<string, unknown>;
4307
+ /**
4308
+ * The bundled default favicon: a small SVG bolt as a `data:` URI.
4309
+ *
4310
+ * Inline on purpose — an asset route would be one more thing to mount, and the
4311
+ * whole point is to stop the browser from issuing a request the service cannot
4312
+ * answer. Pass {@link SwaggerOptions.favicon} to override it, or `false` to emit
4313
+ * no tag at all and let the browser fall back to `/favicon.ico`.
4314
+ */
4315
+ declare const DEFAULT_DOCS_FAVICON = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAzMiAzMiI+PHJlY3Qgd2lkdGg9IjMyIiBoZWlnaHQ9IjMyIiByeD0iNyIgZmlsbD0iIzRjNmVmNSIvPjxwYXRoIGQ9Ik0xNy45IDQuNSA4LjYgMTguNGg1LjJMMTMgMjcuNWw5LjQtMTMuOWgtNS4zeiIgZmlsbD0iI2ZmZiIvPjwvc3ZnPg==";
4316
+ /** The jsDelivr URL used when no local Redoc bundle is available. */
4317
+ declare const REDOC_CDN_URL = "https://cdn.jsdelivr.net/npm/redoc@2/bundles/redoc.standalone.js";
4298
4318
  /**
4299
4319
  * Mount the OpenAPI document as JSON at `path`.
4300
4320
  *
@@ -4307,6 +4327,29 @@ declare function mountOpenApiJson(app: Express, path: string, document: OpenApiD
4307
4327
  interface SwaggerOptions {
4308
4328
  /** Page title. Default `"API docs"`. */
4309
4329
  title?: string;
4330
+ /**
4331
+ * Favicon URL or `data:` URI. Default {@link DEFAULT_DOCS_FAVICON}. Pass
4332
+ * `false` to emit no tag, letting the browser request `/favicon.ico`.
4333
+ */
4334
+ favicon?: string | false;
4335
+ /**
4336
+ * Options merged into the `SwaggerUIBundle` constructor, after
4337
+ * {@link SWAGGER_UI_DEFAULTS} and before `presets`. Anything Swagger UI
4338
+ * accepts and JSON can carry.
4339
+ *
4340
+ * Two worth knowing:
4341
+ *
4342
+ * - `supportedSubmitMethods` — which verbs get a working **Try it out**.
4343
+ * Swagger UI enables all of them, so on an API with irreversible side
4344
+ * effects (sending, charging, dispatching) the docs page fires the real
4345
+ * thing. `["get"]` or `[]` narrows that.
4346
+ * - `layout: "StandaloneLayout"` — restores the Explore topbar, along with
4347
+ * the standalone preset script it needs.
4348
+ *
4349
+ * Function values throw at mount time rather than being dropped silently by
4350
+ * the JSON serialization.
4351
+ */
4352
+ ui?: Record<string, unknown>;
4310
4353
  }
4311
4354
  /**
4312
4355
  * Mount Swagger UI at `path`, reading the spec from `specUrl`.
@@ -4316,23 +4359,66 @@ interface SwaggerOptions {
4316
4359
  * @param app - The Express application.
4317
4360
  * @param path - Mount path for the UI (e.g. `/docs`).
4318
4361
  * @param specUrl - URL the UI fetches the OpenAPI document from.
4319
- * @param options - Page options.
4362
+ * @param options - Page and Swagger UI options.
4363
+ * @throws {Error} When `options.ui` carries a function value.
4320
4364
  */
4321
4365
  declare function mountSwaggerUi(app: Express, path: string, specUrl: string, options?: SwaggerOptions): void;
4366
+ /** Where {@link mountRedoc} takes the standalone renderer bundle from. */
4367
+ type RedocBundleSource = "auto" | "local" | "cdn";
4322
4368
  /** Options for {@link mountRedoc}. */
4323
4369
  interface RedocOptions {
4324
4370
  /** Page title. Default `"API reference"`. */
4325
4371
  title?: string;
4326
- /** URL of the Redoc standalone bundle. Defaults to the jsDelivr CDN. */
4372
+ /**
4373
+ * Favicon URL or `data:` URI. Default {@link DEFAULT_DOCS_FAVICON}. Pass
4374
+ * `false` to emit no tag, letting the browser request `/favicon.ico`.
4375
+ */
4376
+ favicon?: string | false;
4377
+ /**
4378
+ * Where the renderer comes from. Default `"auto"`.
4379
+ *
4380
+ * - `"auto"` — serve the `redoc` optional peer's bundle from disk when it is
4381
+ * installed, fall back to the CDN when it is not.
4382
+ * - `"local"` — serve it from disk, and **throw at mount time** when `redoc`
4383
+ * is not installed. Use this when an air-gapped deploy must not silently
4384
+ * degrade into a CDN request.
4385
+ * - `"cdn"` — always load from {@link REDOC_CDN_URL}.
4386
+ */
4387
+ bundle?: RedocBundleSource;
4388
+ /**
4389
+ * Absolute path to a Redoc standalone bundle to serve, instead of resolving
4390
+ * the `redoc` package. For a vendored copy, or a layout the resolver cannot
4391
+ * reach (the bundle is resolved from `process.cwd()`).
4392
+ */
4393
+ bundlePath?: string;
4394
+ /**
4395
+ * Explicit URL for the bundle. Wins over {@link RedocOptions.bundle} and
4396
+ * {@link RedocOptions.bundlePath} — use it to point at a copy you already
4397
+ * serve yourself.
4398
+ */
4327
4399
  scriptUrl?: string;
4328
4400
  }
4401
+ /**
4402
+ * Resolve the `redoc` package's standalone bundle from the application.
4403
+ *
4404
+ * Resolution starts at `process.cwd()`, not at this file: `redoc` is an
4405
+ * **optional peer**, so the copy that matters is the one the application
4406
+ * installed, and Node walks up from there to the project's `node_modules`.
4407
+ *
4408
+ * @returns The absolute path to the bundle, or `null` when `redoc` is absent.
4409
+ */
4410
+ declare function resolveRedocBundle(): string | null;
4329
4411
  /**
4330
4412
  * Mount Redoc at `path`, reading the spec from `specUrl`.
4331
4413
  *
4414
+ * By default the renderer is served from the `redoc` optional peer when it is
4415
+ * installed, so the page works offline; otherwise it falls back to the CDN.
4416
+ *
4332
4417
  * @param app - The Express application.
4333
4418
  * @param path - Mount path for Redoc (e.g. `/redoc`).
4334
4419
  * @param specUrl - URL Redoc fetches the OpenAPI document from.
4335
4420
  * @param options - Page and bundle options.
4421
+ * @throws {Error} When `bundle` is `"local"` and no bundle can be resolved.
4336
4422
  */
4337
4423
  declare function mountRedoc(app: Express, path: string, specUrl: string, options?: RedocOptions): void;
4338
4424
 
@@ -5173,6 +5259,6 @@ declare function createTestDatabase(models: readonly ModelClass[]): TestDatabase
5173
5259
  declare function withTestDatabase<T>(models: readonly ModelClass[], fn: (db: TestDatabase) => Promise<T>): Promise<T>;
5174
5260
 
5175
5261
  /** The installed SDK version. Single source of truth for the barrel + CLI. */
5176
- declare const VERSION = "0.22.0";
5262
+ declare const VERSION = "0.23.0";
5177
5263
 
5178
- export { type ActivationInput, ActivationService, type ActivationServiceOptions, type ActivationStore, type AdminField, type AdminListQuery, type AdminListResult, type AdminResource, type AdminRouterOptions, AdminSite, AppException, type AppExceptionHandlerOptions, type AppExceptionOptions, type AttachWebSocketOptions, AttemptThrottle, type AttemptThrottleOptions, AuditAction, type AuthResponse, type AuthResultPageOptions, type AuthRouterOptions, type AuthUser, type BackupOptions, type BaseAppSettings, BaseAuditLogModel, BaseController, BaseModel, BaseOAuthClient, BaseOutboxModel, type BaseResponse, BaseService, BaseUserModel, BaseUserRefreshTokenModel, BaseUserTokenModel, type BodySizeLimitOptions, type BroadcastOptions, type BroadcastResult, type BrokerManager, CEP_PATTERN, CNPJ_PATTERN, CPF_PATTERN, type CPUMetrics, CSRF_COOKIE_NAME, CSRF_HEADER_NAME, type CacheManager, type CachedOptions, type CachedResponse, type CatalogData, CircuitOpenError, type ClientIpOptions, CompositeFeatureFlagBackend, ConflictException, type CreateAppOpenApi, type CreateAppOptions, type CsrfOptions, type CursorPaginationFilter, DEFAULT_LOCALE, type DownloadOptions, type EmailMessage, type EmailOptions, EmailProvider, type EmailProviderOptions, EmailUtils, type Enum, type EnumHelpers, type EnumSpec, EnvFeatureFlagBackend, EventStream, type EventStreamOptions, type ExceptionDetails, ExpiredTokenException, type FeatureFlagBackend, FeatureFlags, type FieldChange, type FileLoggingHandle, type FileLoggingOptions, type FlagContext, ForbiddenException, type GPUMetrics, type GenerateOpenApiOptions, GitHubOAuthClient, GoogleOAuthClient, GracefulShutdown, type GracefulShutdownOptions, HTTPClient, type HTTPClientOptions, HTTP_500_LOG_FILE, HTTP_500_MARKER, type HandshakeInfo, type HealthCheck, type HealthRouterOptions, HttpMetrics, IDEMPOTENCY_HEADER, type IdempotencyOptions, type IdempotencyRedisLike, type IdempotencyStore, type InboundHandler, type InboundMessage, InvalidTokenException, type IssuedSession, JSONLogger, JWTUtils, type JWTUtilsOptions, type JwtAuthOptions, type JwtClaims, type JwtDecoderLike, LEVEL_LOG_FILES, LocalUploadStorage, type LocalUploadStorageOptions, type LogEntry, type LogExtra, type LogLevel, type LogSink, type LogSource, type LoginInput, type LoginResult, type LogsRouterOptions, type MediaKind, MemoryBroker, MemoryCacheManager, MemoryFeatureFlagBackend, MemoryIdempotencyStore, type MemoryMetrics, MemoryRateLimitStore, MemorySessionStore, MemoryThrottleBackend, MessageCatalog, type MessageHandler, MessagingHub, type MessagingProvider, type MetricsRouterOptions, MetricsUtils, type MfaChallenge, type MfaChallengeInput, type MfaCodeInput, type MfaEnrollment, MfaService, type MfaServiceOptions, type MfaStore, NotFoundException, type OAuthClientOptions, OAuthError, type OAuthTokens, type OAuthUser, OIDCProvider, type OIDCProviderOptions, type OpenApiDocument, type OpenApiInfo, type OutboundMedia, type OutboundResult, type OutboxPublisher, OutboxRelay, type OutboxRelayOptions, OutboxStatus, PHONE_BR_PATTERN, type PaginationFilter, type PaginationLinkOptions, type PasswordResetConfirmInput, type PasswordResetFormOptions, type PasswordResetRequestInput, PasswordResetService, type PasswordResetServiceOptions, type PasswordResetStore, PasswordUtils, REQUEST_ID_HEADER, RabbitBroker, type RabbitBrokerOptions, type RateLimitKeyFunc, type RateLimitOptions, type RateLimitRedisLike, type RateLimitResult, type RateLimitStore, RedisCacheManager, RedisIdempotencyStore, type RedisLike, type RedisPublisherLike, RedisRateLimitStore, RedisSSEBroker, type RedisSSEBrokerOptions, RedisSessionStore, type RedisSubscriberLike, type RedocOptions, type RefreshInput, Region, type RegionValue, type RegisterExceptionHandlersOptions, type RequestContext, type RequestTracingOptions, type ResponseMapper, RetryPolicy, type RunServerOptions, type S3ClientLike, S3UploadStorage, type S3UploadStorageOptions, SSEBroker, type SaveOptions, type SendOptions, ServerSentEvent, type ServerSentEventInit, type Session, type SessionMiddlewareOptions, type SessionRedisLike, SessionService, type SessionServiceOptions, type SessionStore, type SignupInput, type SlowQueryOptions, type SpecProvider, type StateBR, type SwaggerOptions, type SyncFilter, type SystemMetrics, TOTPHelper, type TOTPOptions, type TaskHandler, TaskManager, type TaskManagerOptions, TelegramProvider, type TelegramProviderOptions, TenantScopedRepository, type TestDatabase, type ThrottleBackend, type ThrottleStatus, type ToDictOptions, type TokenPair, TooManyRequestsException, type TooManyRequestsOptions, type ToolSpecOptions, TwilioSmsProvider, type TwilioSmsProviderOptions, type TwilioWebhookOptions, UF, type UFValue, UnauthorizedException, type UnhandledExceptionHandlerOptions, type UploadResult, type UploadStorage, UserAuthService, type UserAuthServiceOptions, type UserPublic, type UserStore, UserTokenPurpose, VERSION, ValidationException, type WSEnvelope, WebPushDispatcher, type WebPushDispatcherOptions, WebPushError, WebPushGoneError, type WebPushKeys, type WebPushPayload, type WebPushSubscription, type WebSocketConnection, WebSocketHub, type WebSocketHubOptions, type WebSocketLike, type WebhookSignatureOptions, WebhookSignatureVerifier, WhatsAppProvider, type WhatsAppProviderOptions, type WhatsAppWebhookOptions, activationSchema, addLogSink, attachWebSocketHub, authResponseSchema, authSettingsShape, backupDatabase, baseAppSettingsSchema, baseAppSettingsShape, baseResponseSchema, bearerToken, bodySizeLimitMiddleware, broadcastText, buildContentDisposition, buildPaginationLinkHeader, cached, centsField, cepField, citiesByUf, cnpjField, coerceFlag, configureFileLogging, configureLogging, corsSettingsShape, cpfField, cpfOrCnpjField, createApp, createOpenApiRegistry, createTestDatabase, createdByColumn, csrfMiddleware, cursorPaginationFilterSchema, cursorPaginationSchema, databaseSettingsShape, decodeCursor, defaultMessageCatalog, defineEnum, deletedAtColumn, diffSnapshots, emailSettingsShape, encodeCursor, looseBoolean as envBoolean, envList, generateCsrfToken, generateOAuthState, generateOpaqueToken, generateOpenApiDocument, getAuth, getClientIp, getConditions, getPaginationConditions, getRequestId, getState, hashOpaqueToken, hexColorField, idempotencyMiddleware, inboundMessageSchema, isValidCep, isValidCity, isValidCnpj, isValidCpf, isValidCpfCnpj, isValidPhoneBr, isValidUf, jwtSettingsShape, keyByHeader, keyByIp, keyByJwtClaim, keyByJwtSubject, latitudeField, listStates, loadSettings, logEntrySchema, logSettingsShape, loginSchema, longitudeField, looseBoolean, makeAdminRouter, makeAppExceptionHandler, makeAuthRouter, makeFlagGuard, makeHealthRouter, makeJwtAuthMiddleware, makeLogsRouter, makeMetricsRouter, makeSessionMiddleware, makeToolSpecRouter, makeTwilioWebhookRouter, makeUnhandledExceptionHandler, makeWhatsAppWebhookRouter, mfaChallengeSchema, mfaCodeSchema, mfaEnrollResponseSchema, minioSettingsShape, modifyDict, mountOpenApiJson, mountRedoc, mountSwaggerUi, nonEmptyStrField, nonNegativeFloatField, nonNegativeIntField, normalizeCep, normalizeCnpj, normalizeCpf, normalizeCpfCnpj, normalizePhoneBr, normalizeUf, notFoundHandler, onlyDigits, paginationFilterSchema, paginationSchema, parseAcceptLanguage, parseCookies, passwordResetConfirmSchema, passwordResetRequestSchema, percentField, phoneBrField, portField, positiveFloatField, positiveIntField, priceField, prometheusMiddleware, rabbitmqSettingsShape, rateLimitMiddleware, ratingField, ratioField, redisSettingsShape, refreshSchema, registerExceptionHandlers, renderAuthResultPage, renderPasswordResetFormPage, requestIdMiddleware, requestTracingMiddleware, requireRoles, resolveDownloadPath, runServer, runWithRequestContext, sendBytesDownload, sendFileDownload, serverSettingsShape, sessionCookie, sessionSettingsShape, setRequestId, signupSchema, slugField, snapshot, sseResponse, statesByRegion, syncFilterSchema, syncPaginationSchema, tableNameFor, toDict, toUtc, tokenFromUrl, tokenPairSchema, tokenSettingsShape, ufField, updatedByColumn, uploadSettingsShape, userPublicSchema, utcnow, validateTwilioSignature, verifyOpaqueToken, webPushKeysSchema, webPushPayloadSchema, webPushSettingsShape, webPushSubscriptionSchema, webSocketSettingsShape, withTestDatabase, wrapWithSlowQueryLog, wsEnvelopeSchema };
5264
+ export { type ActivationInput, ActivationService, type ActivationServiceOptions, type ActivationStore, type AdminField, type AdminListQuery, type AdminListResult, type AdminResource, type AdminRouterOptions, AdminSite, AppException, type AppExceptionHandlerOptions, type AppExceptionOptions, type AttachWebSocketOptions, AttemptThrottle, type AttemptThrottleOptions, AuditAction, type AuthResponse, type AuthResultPageOptions, type AuthRouterOptions, type AuthUser, type BackupOptions, type BaseAppSettings, BaseAuditLogModel, BaseController, BaseModel, BaseOAuthClient, BaseOutboxModel, type BaseResponse, BaseService, BaseUserModel, BaseUserRefreshTokenModel, BaseUserTokenModel, type BodySizeLimitOptions, type BroadcastOptions, type BroadcastResult, type BrokerManager, CEP_PATTERN, CNPJ_PATTERN, CPF_PATTERN, type CPUMetrics, CSRF_COOKIE_NAME, CSRF_HEADER_NAME, type CacheManager, type CachedOptions, type CachedResponse, type CatalogData, CircuitOpenError, type ClientIpOptions, CompositeFeatureFlagBackend, ConflictException, type CreateAppOpenApi, type CreateAppOptions, type CsrfOptions, type CursorPaginationFilter, DEFAULT_DOCS_FAVICON, DEFAULT_LOCALE, type DownloadOptions, type EmailMessage, type EmailOptions, EmailProvider, type EmailProviderOptions, EmailUtils, type Enum, type EnumHelpers, type EnumSpec, EnvFeatureFlagBackend, EventStream, type EventStreamOptions, type ExceptionDetails, ExpiredTokenException, type FeatureFlagBackend, FeatureFlags, type FieldChange, type FileLoggingHandle, type FileLoggingOptions, type FlagContext, ForbiddenException, type GPUMetrics, type GenerateOpenApiOptions, GitHubOAuthClient, GoogleOAuthClient, GracefulShutdown, type GracefulShutdownOptions, HTTPClient, type HTTPClientOptions, HTTP_500_LOG_FILE, HTTP_500_MARKER, type HandshakeInfo, type HealthCheck, type HealthRouterOptions, HttpMetrics, IDEMPOTENCY_HEADER, type IdempotencyOptions, type IdempotencyRedisLike, type IdempotencyStore, type InboundHandler, type InboundMessage, InvalidTokenException, type IssuedSession, JSONLogger, JWTUtils, type JWTUtilsOptions, type JwtAuthOptions, type JwtClaims, type JwtDecoderLike, LEVEL_LOG_FILES, LocalUploadStorage, type LocalUploadStorageOptions, type LogEntry, type LogExtra, type LogLevel, type LogSink, type LogSource, type LoginInput, type LoginResult, type LogsRouterOptions, type MediaKind, MemoryBroker, MemoryCacheManager, MemoryFeatureFlagBackend, MemoryIdempotencyStore, type MemoryMetrics, MemoryRateLimitStore, MemorySessionStore, MemoryThrottleBackend, MessageCatalog, type MessageHandler, MessagingHub, type MessagingProvider, type MetricsRouterOptions, MetricsUtils, type MfaChallenge, type MfaChallengeInput, type MfaCodeInput, type MfaEnrollment, MfaService, type MfaServiceOptions, type MfaStore, NotFoundException, type OAuthClientOptions, OAuthError, type OAuthTokens, type OAuthUser, OIDCProvider, type OIDCProviderOptions, type OpenApiDocument, type OpenApiInfo, type OutboundMedia, type OutboundResult, type OutboxPublisher, OutboxRelay, type OutboxRelayOptions, OutboxStatus, PHONE_BR_PATTERN, type PaginationFilter, type PaginationLinkOptions, type PasswordResetConfirmInput, type PasswordResetFormOptions, type PasswordResetRequestInput, PasswordResetService, type PasswordResetServiceOptions, type PasswordResetStore, PasswordUtils, REDOC_CDN_URL, REQUEST_ID_HEADER, RabbitBroker, type RabbitBrokerOptions, type RateLimitKeyFunc, type RateLimitOptions, type RateLimitRedisLike, type RateLimitResult, type RateLimitStore, RedisCacheManager, RedisIdempotencyStore, type RedisLike, type RedisPublisherLike, RedisRateLimitStore, RedisSSEBroker, type RedisSSEBrokerOptions, RedisSessionStore, type RedisSubscriberLike, type RedocBundleSource, type RedocOptions, type RefreshInput, Region, type RegionValue, type RegisterExceptionHandlersOptions, type RequestContext, type RequestTracingOptions, type ResponseMapper, RetryPolicy, type RunServerOptions, type S3ClientLike, S3UploadStorage, type S3UploadStorageOptions, SSEBroker, type SaveOptions, type SendOptions, ServerSentEvent, type ServerSentEventInit, type Session, type SessionMiddlewareOptions, type SessionRedisLike, SessionService, type SessionServiceOptions, type SessionStore, type SignupInput, type SlowQueryOptions, type SpecProvider, type StateBR, type SwaggerOptions, type SyncFilter, type SystemMetrics, TOTPHelper, type TOTPOptions, type TaskHandler, TaskManager, type TaskManagerOptions, TelegramProvider, type TelegramProviderOptions, TenantScopedRepository, type TestDatabase, type ThrottleBackend, type ThrottleStatus, type ToDictOptions, type TokenPair, TooManyRequestsException, type TooManyRequestsOptions, type ToolSpecOptions, TwilioSmsProvider, type TwilioSmsProviderOptions, type TwilioWebhookOptions, UF, type UFValue, UnauthorizedException, type UnhandledExceptionHandlerOptions, type UploadResult, type UploadStorage, UserAuthService, type UserAuthServiceOptions, type UserPublic, type UserStore, UserTokenPurpose, VERSION, ValidationException, type WSEnvelope, WebPushDispatcher, type WebPushDispatcherOptions, WebPushError, WebPushGoneError, type WebPushKeys, type WebPushPayload, type WebPushSubscription, type WebSocketConnection, WebSocketHub, type WebSocketHubOptions, type WebSocketLike, type WebhookSignatureOptions, WebhookSignatureVerifier, WhatsAppProvider, type WhatsAppProviderOptions, type WhatsAppWebhookOptions, activationSchema, addLogSink, attachWebSocketHub, authResponseSchema, authSettingsShape, backupDatabase, baseAppSettingsSchema, baseAppSettingsShape, baseResponseSchema, bearerToken, bodySizeLimitMiddleware, broadcastText, buildContentDisposition, buildPaginationLinkHeader, cached, centsField, cepField, citiesByUf, cnpjField, coerceFlag, configureFileLogging, configureLogging, corsSettingsShape, cpfField, cpfOrCnpjField, createApp, createOpenApiRegistry, createTestDatabase, createdByColumn, csrfMiddleware, cursorPaginationFilterSchema, cursorPaginationSchema, databaseSettingsShape, decodeCursor, defaultMessageCatalog, defineEnum, deletedAtColumn, diffSnapshots, emailSettingsShape, encodeCursor, looseBoolean as envBoolean, envList, generateCsrfToken, generateOAuthState, generateOpaqueToken, generateOpenApiDocument, getAuth, getClientIp, getConditions, getPaginationConditions, getRequestId, getState, hashOpaqueToken, hexColorField, idempotencyMiddleware, inboundMessageSchema, isValidCep, isValidCity, isValidCnpj, isValidCpf, isValidCpfCnpj, isValidPhoneBr, isValidUf, jwtSettingsShape, keyByHeader, keyByIp, keyByJwtClaim, keyByJwtSubject, latitudeField, listStates, loadSettings, logEntrySchema, logSettingsShape, loginSchema, longitudeField, looseBoolean, makeAdminRouter, makeAppExceptionHandler, makeAuthRouter, makeFlagGuard, makeHealthRouter, makeJwtAuthMiddleware, makeLogsRouter, makeMetricsRouter, makeSessionMiddleware, makeToolSpecRouter, makeTwilioWebhookRouter, makeUnhandledExceptionHandler, makeWhatsAppWebhookRouter, mfaChallengeSchema, mfaCodeSchema, mfaEnrollResponseSchema, minioSettingsShape, modifyDict, mountOpenApiJson, mountRedoc, mountSwaggerUi, nonEmptyStrField, nonNegativeFloatField, nonNegativeIntField, normalizeCep, normalizeCnpj, normalizeCpf, normalizeCpfCnpj, normalizePhoneBr, normalizeUf, notFoundHandler, onlyDigits, paginationFilterSchema, paginationSchema, parseAcceptLanguage, parseCookies, passwordResetConfirmSchema, passwordResetRequestSchema, percentField, phoneBrField, portField, positiveFloatField, positiveIntField, priceField, prometheusMiddleware, rabbitmqSettingsShape, rateLimitMiddleware, ratingField, ratioField, redisSettingsShape, refreshSchema, registerExceptionHandlers, renderAuthResultPage, renderPasswordResetFormPage, requestIdMiddleware, requestTracingMiddleware, requireRoles, resolveDownloadPath, resolveRedocBundle, runServer, runWithRequestContext, sendBytesDownload, sendFileDownload, serverSettingsShape, sessionCookie, sessionSettingsShape, setRequestId, signupSchema, slugField, snapshot, sseResponse, statesByRegion, syncFilterSchema, syncPaginationSchema, tableNameFor, toDict, toUtc, tokenFromUrl, tokenPairSchema, tokenSettingsShape, ufField, updatedByColumn, uploadSettingsShape, userPublicSchema, utcnow, validateTwilioSignature, verifyOpaqueToken, webPushKeysSchema, webPushPayloadSchema, webPushSettingsShape, webPushSubscriptionSchema, webSocketSettingsShape, withTestDatabase, wrapWithSlowQueryLog, wsEnvelopeSchema };
package/dist/index.d.ts CHANGED
@@ -4287,14 +4287,34 @@ declare function registerExceptionHandlers(app: Express, options?: RegisterExcep
4287
4287
  *
4288
4288
  * Swagger UI is served fully self-contained: its static assets ship with the
4289
4289
  * `swagger-ui-dist` dependency and are mounted locally (no CDN), with a small
4290
- * inline initializer pointing at the spec endpoint. Redoc is served as a single
4291
- * HTML page that loads the Redoc standalone bundle from a CDN (the renderer is
4292
- * ~1 MB and intentionally not vendored); override {@link RedocOptions.scriptUrl}
4293
- * to self-host it.
4290
+ * inline initializer pointing at the spec endpoint.
4291
+ *
4292
+ * Redoc's renderer is ~1 MB and is **not** vendored — the `redoc` package pulls
4293
+ * 22 dependencies and peers on `react`, `react-dom`, `styled-components`,
4294
+ * `mobx` and `core-js`, bounds no backend service should inherit just to render
4295
+ * a reference page. It is an **optional peer** instead: install `redoc` and
4296
+ * {@link mountRedoc} serves its standalone bundle from disk, so the page works
4297
+ * offline; without it the page falls back to the jsDelivr CDN and says so
4298
+ * out loud when the network blocks the bundle.
4299
+ *
4300
+ * Both pages declare an inline `<link rel="icon">`. Without one the browser
4301
+ * requests `/favicon.ico` at the origin root, which on an API-only service is a
4302
+ * 401, a 404 or an SPA catch-all — a red console error on every page load.
4294
4303
  */
4295
4304
 
4296
4305
  /** A JSON-serializable OpenAPI document. */
4297
4306
  type OpenApiDocument = Record<string, unknown>;
4307
+ /**
4308
+ * The bundled default favicon: a small SVG bolt as a `data:` URI.
4309
+ *
4310
+ * Inline on purpose — an asset route would be one more thing to mount, and the
4311
+ * whole point is to stop the browser from issuing a request the service cannot
4312
+ * answer. Pass {@link SwaggerOptions.favicon} to override it, or `false` to emit
4313
+ * no tag at all and let the browser fall back to `/favicon.ico`.
4314
+ */
4315
+ declare const DEFAULT_DOCS_FAVICON = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAzMiAzMiI+PHJlY3Qgd2lkdGg9IjMyIiBoZWlnaHQ9IjMyIiByeD0iNyIgZmlsbD0iIzRjNmVmNSIvPjxwYXRoIGQ9Ik0xNy45IDQuNSA4LjYgMTguNGg1LjJMMTMgMjcuNWw5LjQtMTMuOWgtNS4zeiIgZmlsbD0iI2ZmZiIvPjwvc3ZnPg==";
4316
+ /** The jsDelivr URL used when no local Redoc bundle is available. */
4317
+ declare const REDOC_CDN_URL = "https://cdn.jsdelivr.net/npm/redoc@2/bundles/redoc.standalone.js";
4298
4318
  /**
4299
4319
  * Mount the OpenAPI document as JSON at `path`.
4300
4320
  *
@@ -4307,6 +4327,29 @@ declare function mountOpenApiJson(app: Express, path: string, document: OpenApiD
4307
4327
  interface SwaggerOptions {
4308
4328
  /** Page title. Default `"API docs"`. */
4309
4329
  title?: string;
4330
+ /**
4331
+ * Favicon URL or `data:` URI. Default {@link DEFAULT_DOCS_FAVICON}. Pass
4332
+ * `false` to emit no tag, letting the browser request `/favicon.ico`.
4333
+ */
4334
+ favicon?: string | false;
4335
+ /**
4336
+ * Options merged into the `SwaggerUIBundle` constructor, after
4337
+ * {@link SWAGGER_UI_DEFAULTS} and before `presets`. Anything Swagger UI
4338
+ * accepts and JSON can carry.
4339
+ *
4340
+ * Two worth knowing:
4341
+ *
4342
+ * - `supportedSubmitMethods` — which verbs get a working **Try it out**.
4343
+ * Swagger UI enables all of them, so on an API with irreversible side
4344
+ * effects (sending, charging, dispatching) the docs page fires the real
4345
+ * thing. `["get"]` or `[]` narrows that.
4346
+ * - `layout: "StandaloneLayout"` — restores the Explore topbar, along with
4347
+ * the standalone preset script it needs.
4348
+ *
4349
+ * Function values throw at mount time rather than being dropped silently by
4350
+ * the JSON serialization.
4351
+ */
4352
+ ui?: Record<string, unknown>;
4310
4353
  }
4311
4354
  /**
4312
4355
  * Mount Swagger UI at `path`, reading the spec from `specUrl`.
@@ -4316,23 +4359,66 @@ interface SwaggerOptions {
4316
4359
  * @param app - The Express application.
4317
4360
  * @param path - Mount path for the UI (e.g. `/docs`).
4318
4361
  * @param specUrl - URL the UI fetches the OpenAPI document from.
4319
- * @param options - Page options.
4362
+ * @param options - Page and Swagger UI options.
4363
+ * @throws {Error} When `options.ui` carries a function value.
4320
4364
  */
4321
4365
  declare function mountSwaggerUi(app: Express, path: string, specUrl: string, options?: SwaggerOptions): void;
4366
+ /** Where {@link mountRedoc} takes the standalone renderer bundle from. */
4367
+ type RedocBundleSource = "auto" | "local" | "cdn";
4322
4368
  /** Options for {@link mountRedoc}. */
4323
4369
  interface RedocOptions {
4324
4370
  /** Page title. Default `"API reference"`. */
4325
4371
  title?: string;
4326
- /** URL of the Redoc standalone bundle. Defaults to the jsDelivr CDN. */
4372
+ /**
4373
+ * Favicon URL or `data:` URI. Default {@link DEFAULT_DOCS_FAVICON}. Pass
4374
+ * `false` to emit no tag, letting the browser request `/favicon.ico`.
4375
+ */
4376
+ favicon?: string | false;
4377
+ /**
4378
+ * Where the renderer comes from. Default `"auto"`.
4379
+ *
4380
+ * - `"auto"` — serve the `redoc` optional peer's bundle from disk when it is
4381
+ * installed, fall back to the CDN when it is not.
4382
+ * - `"local"` — serve it from disk, and **throw at mount time** when `redoc`
4383
+ * is not installed. Use this when an air-gapped deploy must not silently
4384
+ * degrade into a CDN request.
4385
+ * - `"cdn"` — always load from {@link REDOC_CDN_URL}.
4386
+ */
4387
+ bundle?: RedocBundleSource;
4388
+ /**
4389
+ * Absolute path to a Redoc standalone bundle to serve, instead of resolving
4390
+ * the `redoc` package. For a vendored copy, or a layout the resolver cannot
4391
+ * reach (the bundle is resolved from `process.cwd()`).
4392
+ */
4393
+ bundlePath?: string;
4394
+ /**
4395
+ * Explicit URL for the bundle. Wins over {@link RedocOptions.bundle} and
4396
+ * {@link RedocOptions.bundlePath} — use it to point at a copy you already
4397
+ * serve yourself.
4398
+ */
4327
4399
  scriptUrl?: string;
4328
4400
  }
4401
+ /**
4402
+ * Resolve the `redoc` package's standalone bundle from the application.
4403
+ *
4404
+ * Resolution starts at `process.cwd()`, not at this file: `redoc` is an
4405
+ * **optional peer**, so the copy that matters is the one the application
4406
+ * installed, and Node walks up from there to the project's `node_modules`.
4407
+ *
4408
+ * @returns The absolute path to the bundle, or `null` when `redoc` is absent.
4409
+ */
4410
+ declare function resolveRedocBundle(): string | null;
4329
4411
  /**
4330
4412
  * Mount Redoc at `path`, reading the spec from `specUrl`.
4331
4413
  *
4414
+ * By default the renderer is served from the `redoc` optional peer when it is
4415
+ * installed, so the page works offline; otherwise it falls back to the CDN.
4416
+ *
4332
4417
  * @param app - The Express application.
4333
4418
  * @param path - Mount path for Redoc (e.g. `/redoc`).
4334
4419
  * @param specUrl - URL Redoc fetches the OpenAPI document from.
4335
4420
  * @param options - Page and bundle options.
4421
+ * @throws {Error} When `bundle` is `"local"` and no bundle can be resolved.
4336
4422
  */
4337
4423
  declare function mountRedoc(app: Express, path: string, specUrl: string, options?: RedocOptions): void;
4338
4424
 
@@ -5173,6 +5259,6 @@ declare function createTestDatabase(models: readonly ModelClass[]): TestDatabase
5173
5259
  declare function withTestDatabase<T>(models: readonly ModelClass[], fn: (db: TestDatabase) => Promise<T>): Promise<T>;
5174
5260
 
5175
5261
  /** The installed SDK version. Single source of truth for the barrel + CLI. */
5176
- declare const VERSION = "0.22.0";
5262
+ declare const VERSION = "0.23.0";
5177
5263
 
5178
- export { type ActivationInput, ActivationService, type ActivationServiceOptions, type ActivationStore, type AdminField, type AdminListQuery, type AdminListResult, type AdminResource, type AdminRouterOptions, AdminSite, AppException, type AppExceptionHandlerOptions, type AppExceptionOptions, type AttachWebSocketOptions, AttemptThrottle, type AttemptThrottleOptions, AuditAction, type AuthResponse, type AuthResultPageOptions, type AuthRouterOptions, type AuthUser, type BackupOptions, type BaseAppSettings, BaseAuditLogModel, BaseController, BaseModel, BaseOAuthClient, BaseOutboxModel, type BaseResponse, BaseService, BaseUserModel, BaseUserRefreshTokenModel, BaseUserTokenModel, type BodySizeLimitOptions, type BroadcastOptions, type BroadcastResult, type BrokerManager, CEP_PATTERN, CNPJ_PATTERN, CPF_PATTERN, type CPUMetrics, CSRF_COOKIE_NAME, CSRF_HEADER_NAME, type CacheManager, type CachedOptions, type CachedResponse, type CatalogData, CircuitOpenError, type ClientIpOptions, CompositeFeatureFlagBackend, ConflictException, type CreateAppOpenApi, type CreateAppOptions, type CsrfOptions, type CursorPaginationFilter, DEFAULT_LOCALE, type DownloadOptions, type EmailMessage, type EmailOptions, EmailProvider, type EmailProviderOptions, EmailUtils, type Enum, type EnumHelpers, type EnumSpec, EnvFeatureFlagBackend, EventStream, type EventStreamOptions, type ExceptionDetails, ExpiredTokenException, type FeatureFlagBackend, FeatureFlags, type FieldChange, type FileLoggingHandle, type FileLoggingOptions, type FlagContext, ForbiddenException, type GPUMetrics, type GenerateOpenApiOptions, GitHubOAuthClient, GoogleOAuthClient, GracefulShutdown, type GracefulShutdownOptions, HTTPClient, type HTTPClientOptions, HTTP_500_LOG_FILE, HTTP_500_MARKER, type HandshakeInfo, type HealthCheck, type HealthRouterOptions, HttpMetrics, IDEMPOTENCY_HEADER, type IdempotencyOptions, type IdempotencyRedisLike, type IdempotencyStore, type InboundHandler, type InboundMessage, InvalidTokenException, type IssuedSession, JSONLogger, JWTUtils, type JWTUtilsOptions, type JwtAuthOptions, type JwtClaims, type JwtDecoderLike, LEVEL_LOG_FILES, LocalUploadStorage, type LocalUploadStorageOptions, type LogEntry, type LogExtra, type LogLevel, type LogSink, type LogSource, type LoginInput, type LoginResult, type LogsRouterOptions, type MediaKind, MemoryBroker, MemoryCacheManager, MemoryFeatureFlagBackend, MemoryIdempotencyStore, type MemoryMetrics, MemoryRateLimitStore, MemorySessionStore, MemoryThrottleBackend, MessageCatalog, type MessageHandler, MessagingHub, type MessagingProvider, type MetricsRouterOptions, MetricsUtils, type MfaChallenge, type MfaChallengeInput, type MfaCodeInput, type MfaEnrollment, MfaService, type MfaServiceOptions, type MfaStore, NotFoundException, type OAuthClientOptions, OAuthError, type OAuthTokens, type OAuthUser, OIDCProvider, type OIDCProviderOptions, type OpenApiDocument, type OpenApiInfo, type OutboundMedia, type OutboundResult, type OutboxPublisher, OutboxRelay, type OutboxRelayOptions, OutboxStatus, PHONE_BR_PATTERN, type PaginationFilter, type PaginationLinkOptions, type PasswordResetConfirmInput, type PasswordResetFormOptions, type PasswordResetRequestInput, PasswordResetService, type PasswordResetServiceOptions, type PasswordResetStore, PasswordUtils, REQUEST_ID_HEADER, RabbitBroker, type RabbitBrokerOptions, type RateLimitKeyFunc, type RateLimitOptions, type RateLimitRedisLike, type RateLimitResult, type RateLimitStore, RedisCacheManager, RedisIdempotencyStore, type RedisLike, type RedisPublisherLike, RedisRateLimitStore, RedisSSEBroker, type RedisSSEBrokerOptions, RedisSessionStore, type RedisSubscriberLike, type RedocOptions, type RefreshInput, Region, type RegionValue, type RegisterExceptionHandlersOptions, type RequestContext, type RequestTracingOptions, type ResponseMapper, RetryPolicy, type RunServerOptions, type S3ClientLike, S3UploadStorage, type S3UploadStorageOptions, SSEBroker, type SaveOptions, type SendOptions, ServerSentEvent, type ServerSentEventInit, type Session, type SessionMiddlewareOptions, type SessionRedisLike, SessionService, type SessionServiceOptions, type SessionStore, type SignupInput, type SlowQueryOptions, type SpecProvider, type StateBR, type SwaggerOptions, type SyncFilter, type SystemMetrics, TOTPHelper, type TOTPOptions, type TaskHandler, TaskManager, type TaskManagerOptions, TelegramProvider, type TelegramProviderOptions, TenantScopedRepository, type TestDatabase, type ThrottleBackend, type ThrottleStatus, type ToDictOptions, type TokenPair, TooManyRequestsException, type TooManyRequestsOptions, type ToolSpecOptions, TwilioSmsProvider, type TwilioSmsProviderOptions, type TwilioWebhookOptions, UF, type UFValue, UnauthorizedException, type UnhandledExceptionHandlerOptions, type UploadResult, type UploadStorage, UserAuthService, type UserAuthServiceOptions, type UserPublic, type UserStore, UserTokenPurpose, VERSION, ValidationException, type WSEnvelope, WebPushDispatcher, type WebPushDispatcherOptions, WebPushError, WebPushGoneError, type WebPushKeys, type WebPushPayload, type WebPushSubscription, type WebSocketConnection, WebSocketHub, type WebSocketHubOptions, type WebSocketLike, type WebhookSignatureOptions, WebhookSignatureVerifier, WhatsAppProvider, type WhatsAppProviderOptions, type WhatsAppWebhookOptions, activationSchema, addLogSink, attachWebSocketHub, authResponseSchema, authSettingsShape, backupDatabase, baseAppSettingsSchema, baseAppSettingsShape, baseResponseSchema, bearerToken, bodySizeLimitMiddleware, broadcastText, buildContentDisposition, buildPaginationLinkHeader, cached, centsField, cepField, citiesByUf, cnpjField, coerceFlag, configureFileLogging, configureLogging, corsSettingsShape, cpfField, cpfOrCnpjField, createApp, createOpenApiRegistry, createTestDatabase, createdByColumn, csrfMiddleware, cursorPaginationFilterSchema, cursorPaginationSchema, databaseSettingsShape, decodeCursor, defaultMessageCatalog, defineEnum, deletedAtColumn, diffSnapshots, emailSettingsShape, encodeCursor, looseBoolean as envBoolean, envList, generateCsrfToken, generateOAuthState, generateOpaqueToken, generateOpenApiDocument, getAuth, getClientIp, getConditions, getPaginationConditions, getRequestId, getState, hashOpaqueToken, hexColorField, idempotencyMiddleware, inboundMessageSchema, isValidCep, isValidCity, isValidCnpj, isValidCpf, isValidCpfCnpj, isValidPhoneBr, isValidUf, jwtSettingsShape, keyByHeader, keyByIp, keyByJwtClaim, keyByJwtSubject, latitudeField, listStates, loadSettings, logEntrySchema, logSettingsShape, loginSchema, longitudeField, looseBoolean, makeAdminRouter, makeAppExceptionHandler, makeAuthRouter, makeFlagGuard, makeHealthRouter, makeJwtAuthMiddleware, makeLogsRouter, makeMetricsRouter, makeSessionMiddleware, makeToolSpecRouter, makeTwilioWebhookRouter, makeUnhandledExceptionHandler, makeWhatsAppWebhookRouter, mfaChallengeSchema, mfaCodeSchema, mfaEnrollResponseSchema, minioSettingsShape, modifyDict, mountOpenApiJson, mountRedoc, mountSwaggerUi, nonEmptyStrField, nonNegativeFloatField, nonNegativeIntField, normalizeCep, normalizeCnpj, normalizeCpf, normalizeCpfCnpj, normalizePhoneBr, normalizeUf, notFoundHandler, onlyDigits, paginationFilterSchema, paginationSchema, parseAcceptLanguage, parseCookies, passwordResetConfirmSchema, passwordResetRequestSchema, percentField, phoneBrField, portField, positiveFloatField, positiveIntField, priceField, prometheusMiddleware, rabbitmqSettingsShape, rateLimitMiddleware, ratingField, ratioField, redisSettingsShape, refreshSchema, registerExceptionHandlers, renderAuthResultPage, renderPasswordResetFormPage, requestIdMiddleware, requestTracingMiddleware, requireRoles, resolveDownloadPath, runServer, runWithRequestContext, sendBytesDownload, sendFileDownload, serverSettingsShape, sessionCookie, sessionSettingsShape, setRequestId, signupSchema, slugField, snapshot, sseResponse, statesByRegion, syncFilterSchema, syncPaginationSchema, tableNameFor, toDict, toUtc, tokenFromUrl, tokenPairSchema, tokenSettingsShape, ufField, updatedByColumn, uploadSettingsShape, userPublicSchema, utcnow, validateTwilioSignature, verifyOpaqueToken, webPushKeysSchema, webPushPayloadSchema, webPushSettingsShape, webPushSubscriptionSchema, webSocketSettingsShape, withTestDatabase, wrapWithSlowQueryLog, wsEnvelopeSchema };
5264
+ export { type ActivationInput, ActivationService, type ActivationServiceOptions, type ActivationStore, type AdminField, type AdminListQuery, type AdminListResult, type AdminResource, type AdminRouterOptions, AdminSite, AppException, type AppExceptionHandlerOptions, type AppExceptionOptions, type AttachWebSocketOptions, AttemptThrottle, type AttemptThrottleOptions, AuditAction, type AuthResponse, type AuthResultPageOptions, type AuthRouterOptions, type AuthUser, type BackupOptions, type BaseAppSettings, BaseAuditLogModel, BaseController, BaseModel, BaseOAuthClient, BaseOutboxModel, type BaseResponse, BaseService, BaseUserModel, BaseUserRefreshTokenModel, BaseUserTokenModel, type BodySizeLimitOptions, type BroadcastOptions, type BroadcastResult, type BrokerManager, CEP_PATTERN, CNPJ_PATTERN, CPF_PATTERN, type CPUMetrics, CSRF_COOKIE_NAME, CSRF_HEADER_NAME, type CacheManager, type CachedOptions, type CachedResponse, type CatalogData, CircuitOpenError, type ClientIpOptions, CompositeFeatureFlagBackend, ConflictException, type CreateAppOpenApi, type CreateAppOptions, type CsrfOptions, type CursorPaginationFilter, DEFAULT_DOCS_FAVICON, DEFAULT_LOCALE, type DownloadOptions, type EmailMessage, type EmailOptions, EmailProvider, type EmailProviderOptions, EmailUtils, type Enum, type EnumHelpers, type EnumSpec, EnvFeatureFlagBackend, EventStream, type EventStreamOptions, type ExceptionDetails, ExpiredTokenException, type FeatureFlagBackend, FeatureFlags, type FieldChange, type FileLoggingHandle, type FileLoggingOptions, type FlagContext, ForbiddenException, type GPUMetrics, type GenerateOpenApiOptions, GitHubOAuthClient, GoogleOAuthClient, GracefulShutdown, type GracefulShutdownOptions, HTTPClient, type HTTPClientOptions, HTTP_500_LOG_FILE, HTTP_500_MARKER, type HandshakeInfo, type HealthCheck, type HealthRouterOptions, HttpMetrics, IDEMPOTENCY_HEADER, type IdempotencyOptions, type IdempotencyRedisLike, type IdempotencyStore, type InboundHandler, type InboundMessage, InvalidTokenException, type IssuedSession, JSONLogger, JWTUtils, type JWTUtilsOptions, type JwtAuthOptions, type JwtClaims, type JwtDecoderLike, LEVEL_LOG_FILES, LocalUploadStorage, type LocalUploadStorageOptions, type LogEntry, type LogExtra, type LogLevel, type LogSink, type LogSource, type LoginInput, type LoginResult, type LogsRouterOptions, type MediaKind, MemoryBroker, MemoryCacheManager, MemoryFeatureFlagBackend, MemoryIdempotencyStore, type MemoryMetrics, MemoryRateLimitStore, MemorySessionStore, MemoryThrottleBackend, MessageCatalog, type MessageHandler, MessagingHub, type MessagingProvider, type MetricsRouterOptions, MetricsUtils, type MfaChallenge, type MfaChallengeInput, type MfaCodeInput, type MfaEnrollment, MfaService, type MfaServiceOptions, type MfaStore, NotFoundException, type OAuthClientOptions, OAuthError, type OAuthTokens, type OAuthUser, OIDCProvider, type OIDCProviderOptions, type OpenApiDocument, type OpenApiInfo, type OutboundMedia, type OutboundResult, type OutboxPublisher, OutboxRelay, type OutboxRelayOptions, OutboxStatus, PHONE_BR_PATTERN, type PaginationFilter, type PaginationLinkOptions, type PasswordResetConfirmInput, type PasswordResetFormOptions, type PasswordResetRequestInput, PasswordResetService, type PasswordResetServiceOptions, type PasswordResetStore, PasswordUtils, REDOC_CDN_URL, REQUEST_ID_HEADER, RabbitBroker, type RabbitBrokerOptions, type RateLimitKeyFunc, type RateLimitOptions, type RateLimitRedisLike, type RateLimitResult, type RateLimitStore, RedisCacheManager, RedisIdempotencyStore, type RedisLike, type RedisPublisherLike, RedisRateLimitStore, RedisSSEBroker, type RedisSSEBrokerOptions, RedisSessionStore, type RedisSubscriberLike, type RedocBundleSource, type RedocOptions, type RefreshInput, Region, type RegionValue, type RegisterExceptionHandlersOptions, type RequestContext, type RequestTracingOptions, type ResponseMapper, RetryPolicy, type RunServerOptions, type S3ClientLike, S3UploadStorage, type S3UploadStorageOptions, SSEBroker, type SaveOptions, type SendOptions, ServerSentEvent, type ServerSentEventInit, type Session, type SessionMiddlewareOptions, type SessionRedisLike, SessionService, type SessionServiceOptions, type SessionStore, type SignupInput, type SlowQueryOptions, type SpecProvider, type StateBR, type SwaggerOptions, type SyncFilter, type SystemMetrics, TOTPHelper, type TOTPOptions, type TaskHandler, TaskManager, type TaskManagerOptions, TelegramProvider, type TelegramProviderOptions, TenantScopedRepository, type TestDatabase, type ThrottleBackend, type ThrottleStatus, type ToDictOptions, type TokenPair, TooManyRequestsException, type TooManyRequestsOptions, type ToolSpecOptions, TwilioSmsProvider, type TwilioSmsProviderOptions, type TwilioWebhookOptions, UF, type UFValue, UnauthorizedException, type UnhandledExceptionHandlerOptions, type UploadResult, type UploadStorage, UserAuthService, type UserAuthServiceOptions, type UserPublic, type UserStore, UserTokenPurpose, VERSION, ValidationException, type WSEnvelope, WebPushDispatcher, type WebPushDispatcherOptions, WebPushError, WebPushGoneError, type WebPushKeys, type WebPushPayload, type WebPushSubscription, type WebSocketConnection, WebSocketHub, type WebSocketHubOptions, type WebSocketLike, type WebhookSignatureOptions, WebhookSignatureVerifier, WhatsAppProvider, type WhatsAppProviderOptions, type WhatsAppWebhookOptions, activationSchema, addLogSink, attachWebSocketHub, authResponseSchema, authSettingsShape, backupDatabase, baseAppSettingsSchema, baseAppSettingsShape, baseResponseSchema, bearerToken, bodySizeLimitMiddleware, broadcastText, buildContentDisposition, buildPaginationLinkHeader, cached, centsField, cepField, citiesByUf, cnpjField, coerceFlag, configureFileLogging, configureLogging, corsSettingsShape, cpfField, cpfOrCnpjField, createApp, createOpenApiRegistry, createTestDatabase, createdByColumn, csrfMiddleware, cursorPaginationFilterSchema, cursorPaginationSchema, databaseSettingsShape, decodeCursor, defaultMessageCatalog, defineEnum, deletedAtColumn, diffSnapshots, emailSettingsShape, encodeCursor, looseBoolean as envBoolean, envList, generateCsrfToken, generateOAuthState, generateOpaqueToken, generateOpenApiDocument, getAuth, getClientIp, getConditions, getPaginationConditions, getRequestId, getState, hashOpaqueToken, hexColorField, idempotencyMiddleware, inboundMessageSchema, isValidCep, isValidCity, isValidCnpj, isValidCpf, isValidCpfCnpj, isValidPhoneBr, isValidUf, jwtSettingsShape, keyByHeader, keyByIp, keyByJwtClaim, keyByJwtSubject, latitudeField, listStates, loadSettings, logEntrySchema, logSettingsShape, loginSchema, longitudeField, looseBoolean, makeAdminRouter, makeAppExceptionHandler, makeAuthRouter, makeFlagGuard, makeHealthRouter, makeJwtAuthMiddleware, makeLogsRouter, makeMetricsRouter, makeSessionMiddleware, makeToolSpecRouter, makeTwilioWebhookRouter, makeUnhandledExceptionHandler, makeWhatsAppWebhookRouter, mfaChallengeSchema, mfaCodeSchema, mfaEnrollResponseSchema, minioSettingsShape, modifyDict, mountOpenApiJson, mountRedoc, mountSwaggerUi, nonEmptyStrField, nonNegativeFloatField, nonNegativeIntField, normalizeCep, normalizeCnpj, normalizeCpf, normalizeCpfCnpj, normalizePhoneBr, normalizeUf, notFoundHandler, onlyDigits, paginationFilterSchema, paginationSchema, parseAcceptLanguage, parseCookies, passwordResetConfirmSchema, passwordResetRequestSchema, percentField, phoneBrField, portField, positiveFloatField, positiveIntField, priceField, prometheusMiddleware, rabbitmqSettingsShape, rateLimitMiddleware, ratingField, ratioField, redisSettingsShape, refreshSchema, registerExceptionHandlers, renderAuthResultPage, renderPasswordResetFormPage, requestIdMiddleware, requestTracingMiddleware, requireRoles, resolveDownloadPath, resolveRedocBundle, runServer, runWithRequestContext, sendBytesDownload, sendFileDownload, serverSettingsShape, sessionCookie, sessionSettingsShape, setRequestId, signupSchema, slugField, snapshot, sseResponse, statesByRegion, syncFilterSchema, syncPaginationSchema, tableNameFor, toDict, toUtc, tokenFromUrl, tokenPairSchema, tokenSettingsShape, ufField, updatedByColumn, uploadSettingsShape, userPublicSchema, utcnow, validateTwilioSignature, verifyOpaqueToken, webPushKeysSchema, webPushPayloadSchema, webPushSettingsShape, webPushSubscriptionSchema, webSocketSettingsShape, withTestDatabase, wrapWithSlowQueryLog, wsEnvelopeSchema };
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
- import { z, looseBoolean, toDict } from './chunk-7Q5NBMSP.js';
2
- export { PasswordUtils, VERSION, baseAppSettingsSchema, baseAppSettingsShape, baseResponseSchema, centsField, corsSettingsShape, databaseSettingsShape, looseBoolean as envBoolean, hexColorField, latitudeField, loadSettings, longitudeField, looseBoolean, nonEmptyStrField, nonNegativeFloatField, nonNegativeIntField, percentField, portField, positiveFloatField, positiveIntField, priceField, ratingField, ratioField, serverSettingsShape, slugField, toDict, z } from './chunk-7Q5NBMSP.js';
1
+ import { z, looseBoolean, toDict } from './chunk-HC3TIN4M.js';
2
+ export { PasswordUtils, VERSION, baseAppSettingsSchema, baseAppSettingsShape, baseResponseSchema, centsField, corsSettingsShape, databaseSettingsShape, looseBoolean as envBoolean, hexColorField, latitudeField, loadSettings, longitudeField, looseBoolean, nonEmptyStrField, nonNegativeFloatField, nonNegativeIntField, percentField, portField, positiveFloatField, positiveIntField, priceField, ratingField, ratioField, serverSettingsShape, slugField, toDict, z } from './chunk-HC3TIN4M.js';
3
3
  import { AsyncLocalStorage } from 'async_hooks';
4
4
  import { Model, column, sql, BaseRepository, RecordNotFound, detectDialect, NodeSqliteDriver, AsyncEngine } from 'tempest-db-js';
5
5
  export { AsyncEngine, AsyncResult, AsyncSession, BaseRepository, Column, DeleteBuilder, InsertBuilder, Model, NoResultError, NodeSqliteDriver, PostgresDialect, RecordNotFound, SelectBuilder, SqliteDialect, SyncEngine, SyncSession, UpdateBuilder, and, belongsTo, column, columnsOf, createEngine, createSyncEngine, del, detectDialect, getDialect, hasMany, insert, join, loadRelations, not, or, parseDatabaseUrl, select, sql, update } from 'tempest-db-js';
@@ -14,6 +14,7 @@ import express2, { Router } from 'express';
14
14
  import { ZodError } from 'zod';
15
15
  import { OpenAPIRegistry, OpenApiGeneratorV31, OpenApiGeneratorV3 } from '@asteasolutions/zod-to-openapi';
16
16
  export { OpenAPIRegistry } from '@asteasolutions/zod-to-openapi';
17
+ import { createRequire } from 'module';
17
18
  import { getAbsoluteFSPath } from 'swagger-ui-dist';
18
19
  import { reflectTable, renderOperation } from 'tempest-db-js/migrations';
19
20
 
@@ -7556,7 +7557,6 @@ var HTTPClient = class {
7556
7557
  this.breakerRecord(host, true);
7557
7558
  if (attempt < this.retryPolicy.maxRetries) {
7558
7559
  await this.sleep(this.retryPolicy.sleepFor(attempt));
7559
- continue;
7560
7560
  }
7561
7561
  }
7562
7562
  }
@@ -10115,64 +10115,178 @@ function generateOpenApiDocument(registry, options) {
10115
10115
  const document = new Generator(registry.definitions).generateDocument(config);
10116
10116
  return document;
10117
10117
  }
10118
+ var DEFAULT_DOCS_FAVICON = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAzMiAzMiI+PHJlY3Qgd2lkdGg9IjMyIiBoZWlnaHQ9IjMyIiByeD0iNyIgZmlsbD0iIzRjNmVmNSIvPjxwYXRoIGQ9Ik0xNy45IDQuNSA4LjYgMTguNGg1LjJMMTMgMjcuNWw5LjQtMTMuOWgtNS4zeiIgZmlsbD0iI2ZmZiIvPjwvc3ZnPg==";
10119
+ var REDOC_CDN_URL = "https://cdn.jsdelivr.net/npm/redoc@2/bundles/redoc.standalone.js";
10120
+ var REDOC_BUNDLE_SPECIFIER = "redoc/bundles/redoc.standalone.js";
10121
+ function escapeHtml(value) {
10122
+ return value.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#39;");
10123
+ }
10124
+ function scriptLiteral(value) {
10125
+ return JSON.stringify(value).replace(/</g, "\\u003c");
10126
+ }
10127
+ function faviconTag(favicon) {
10128
+ if (favicon === false) return "";
10129
+ return `
10130
+ <link rel="icon" href="${escapeHtml(favicon)}" />`;
10131
+ }
10118
10132
  function mountOpenApiJson(app, path, document) {
10119
10133
  app.get(path, (_req, res) => {
10120
10134
  res.json(document);
10121
10135
  });
10122
10136
  }
10123
- function swaggerHtml(specUrl, title, assetsBase) {
10137
+ var SWAGGER_UI_DEFAULTS = Object.freeze({
10138
+ deepLinking: true,
10139
+ persistAuthorization: true,
10140
+ layout: "BaseLayout"
10141
+ });
10142
+ function assertSerializableUiOptions(options, trail = []) {
10143
+ if (typeof options === "function") {
10144
+ throw new Error(
10145
+ [
10146
+ `mountSwaggerUi: \`ui.${trail.join(".")}\` is a function, and the options are`,
10147
+ "serialized as JSON into the page, so it would be dropped silently. Swagger UI",
10148
+ "options that take a callback have to be wired in the browser."
10149
+ ].join(" ")
10150
+ );
10151
+ }
10152
+ if (Array.isArray(options)) {
10153
+ options.forEach(
10154
+ (entry, index) => assertSerializableUiOptions(entry, [...trail, String(index)])
10155
+ );
10156
+ return;
10157
+ }
10158
+ if (typeof options === "object" && options !== null) {
10159
+ for (const [key, value] of Object.entries(options)) {
10160
+ assertSerializableUiOptions(value, [...trail, key]);
10161
+ }
10162
+ }
10163
+ }
10164
+ function swaggerHtml(options) {
10165
+ const { specUrl, title, assetsBase, favicon, ui } = options;
10166
+ const merged = {
10167
+ url: specUrl,
10168
+ dom_id: "#swagger-ui",
10169
+ ...SWAGGER_UI_DEFAULTS,
10170
+ ...ui
10171
+ };
10172
+ const standalone = merged.layout === "StandaloneLayout";
10173
+ const presetScript = standalone ? `
10174
+ <script src="${escapeHtml(assetsBase)}/swagger-ui-standalone-preset.js"></script>` : "";
10175
+ const presets = standalone ? "[SwaggerUIBundle.presets.apis, SwaggerUIStandalonePreset]" : "[SwaggerUIBundle.presets.apis]";
10124
10176
  return `<!doctype html>
10125
10177
  <html lang="en">
10126
10178
  <head>
10127
10179
  <meta charset="utf-8" />
10128
10180
  <meta name="viewport" content="width=device-width, initial-scale=1" />
10129
- <title>${title}</title>
10130
- <link rel="stylesheet" href="${assetsBase}/swagger-ui.css" />
10181
+ <title>${escapeHtml(title)}</title>${faviconTag(favicon)}
10182
+ <link rel="stylesheet" href="${escapeHtml(assetsBase)}/swagger-ui.css" />
10131
10183
  </head>
10132
10184
  <body>
10133
10185
  <div id="swagger-ui"></div>
10134
- <script src="${assetsBase}/swagger-ui-bundle.js"></script>
10135
- <script src="${assetsBase}/swagger-ui-standalone-preset.js"></script>
10186
+ <script src="${escapeHtml(assetsBase)}/swagger-ui-bundle.js"></script>${presetScript}
10136
10187
  <script>
10137
- window.ui = SwaggerUIBundle({
10138
- url: ${JSON.stringify(specUrl)},
10139
- dom_id: "#swagger-ui",
10140
- presets: [SwaggerUIBundle.presets.apis, SwaggerUIStandalonePreset],
10141
- layout: "StandaloneLayout",
10142
- });
10188
+ var options = ${scriptLiteral(merged)};
10189
+ options.presets = ${presets};
10190
+ window.ui = SwaggerUIBundle(options);
10143
10191
  </script>
10144
10192
  </body>
10145
10193
  </html>`;
10146
10194
  }
10147
10195
  function mountSwaggerUi(app, path, specUrl, options = {}) {
10148
10196
  const title = options.title ?? "API docs";
10197
+ const favicon = options.favicon ?? DEFAULT_DOCS_FAVICON;
10198
+ const ui = options.ui ?? {};
10199
+ assertSerializableUiOptions(ui);
10149
10200
  const assetsPath = `${path.replace(/\/$/, "")}/assets`;
10150
10201
  app.use(assetsPath, express2.static(getAbsoluteFSPath()));
10151
10202
  const handler = (_req, res) => {
10152
- res.type("html").send(swaggerHtml(specUrl, title, assetsPath));
10203
+ res.type("html").send(swaggerHtml({ specUrl, title, assetsBase: assetsPath, favicon, ui }));
10153
10204
  };
10154
10205
  app.get(path, handler);
10155
10206
  }
10156
- function redocHtml(specUrl, title, scriptUrl) {
10207
+ function resolveRedocBundle() {
10208
+ try {
10209
+ const requireFrom = createRequire(join(process.cwd(), "package.json"));
10210
+ return requireFrom.resolve(REDOC_BUNDLE_SPECIFIER);
10211
+ } catch {
10212
+ return null;
10213
+ }
10214
+ }
10215
+ function redocHtml(specUrl, title, scriptUrl, favicon) {
10157
10216
  return `<!doctype html>
10158
10217
  <html lang="en">
10159
10218
  <head>
10160
10219
  <meta charset="utf-8" />
10161
10220
  <meta name="viewport" content="width=device-width, initial-scale=1" />
10162
- <title>${title}</title>
10163
- <style>body { margin: 0; padding: 0; }</style>
10221
+ <title>${escapeHtml(title)}</title>${faviconTag(favicon)}
10222
+ <style>
10223
+ body { margin: 0; padding: 0; }
10224
+ #redoc-load-error {
10225
+ display: none;
10226
+ font: 14px/1.6 system-ui, sans-serif;
10227
+ margin: 3rem auto;
10228
+ max-width: 40rem;
10229
+ padding: 0 1rem;
10230
+ }
10231
+ #redoc-load-error code {
10232
+ background: #f1f3f5;
10233
+ border-radius: 3px;
10234
+ padding: 0.1rem 0.3rem;
10235
+ }
10236
+ </style>
10164
10237
  </head>
10165
10238
  <body>
10166
- <redoc spec-url=${JSON.stringify(specUrl)}></redoc>
10167
- <script src=${JSON.stringify(scriptUrl)}></script>
10239
+ <div id="redoc-load-error">
10240
+ <h1>The API reference could not load</h1>
10241
+ <p>
10242
+ The Redoc renderer was requested from
10243
+ <code id="redoc-script-url"></code> and did not load. The OpenAPI
10244
+ document itself is fine \u2014 it is served at
10245
+ <code id="redoc-spec-url"></code>.
10246
+ </p>
10247
+ <p>
10248
+ On a closed network, install the renderer next to the service
10249
+ (<code>npm install redoc</code>) so it is served locally, or point
10250
+ <code>scriptUrl</code> at a copy you host.
10251
+ </p>
10252
+ </div>
10253
+ <redoc spec-url="${escapeHtml(specUrl)}"></redoc>
10254
+ <script>
10255
+ window.__redocLoadFailed = function () {
10256
+ document.getElementById("redoc-script-url").textContent = ${scriptLiteral(scriptUrl)};
10257
+ document.getElementById("redoc-spec-url").textContent = ${scriptLiteral(specUrl)};
10258
+ document.getElementById("redoc-load-error").style.display = "block";
10259
+ var element = document.querySelector("redoc");
10260
+ if (element) element.style.display = "none";
10261
+ };
10262
+ </script>
10263
+ <script src="${escapeHtml(scriptUrl)}" onerror="window.__redocLoadFailed()"></script>
10168
10264
  </body>
10169
10265
  </html>`;
10170
10266
  }
10171
10267
  function mountRedoc(app, path, specUrl, options = {}) {
10172
10268
  const title = options.title ?? "API reference";
10173
- const scriptUrl = options.scriptUrl ?? "https://cdn.jsdelivr.net/npm/redoc@2/bundles/redoc.standalone.js";
10269
+ const favicon = options.favicon ?? DEFAULT_DOCS_FAVICON;
10270
+ const source = options.bundle ?? "auto";
10271
+ const assetsPath = `${path.replace(/\/$/, "")}/assets`;
10272
+ const bundleRoute = `${assetsPath}/redoc.standalone.js`;
10273
+ let scriptUrl = options.scriptUrl;
10274
+ if (scriptUrl === void 0 && source !== "cdn") {
10275
+ const bundlePath = options.bundlePath ?? resolveRedocBundle();
10276
+ if (bundlePath !== null && bundlePath !== void 0) {
10277
+ app.get(bundleRoute, (_req, res) => {
10278
+ res.sendFile(bundlePath);
10279
+ });
10280
+ scriptUrl = bundleRoute;
10281
+ } else if (source === "local") {
10282
+ throw new Error(
10283
+ 'mountRedoc: bundle "local" requires the `redoc` package. Install it (`npm install redoc`) or pass `bundlePath` with an absolute path to a Redoc standalone bundle.'
10284
+ );
10285
+ }
10286
+ }
10287
+ const resolvedScriptUrl = scriptUrl ?? REDOC_CDN_URL;
10174
10288
  app.get(path, (_req, res) => {
10175
- res.type("html").send(redocHtml(specUrl, title, scriptUrl));
10289
+ res.type("html").send(redocHtml(specUrl, title, resolvedScriptUrl, favicon));
10176
10290
  });
10177
10291
  }
10178
10292
  function makeHealthRouter(options = {}) {
@@ -11201,6 +11315,6 @@ async function withTestDatabase(models, fn) {
11201
11315
  }
11202
11316
  }
11203
11317
 
11204
- export { ActivationService, AdminSite, AppException, AttemptThrottle, AuditAction, BaseAuditLogModel, BaseController, BaseModel, BaseOAuthClient, BaseOutboxModel, BaseService, BaseUserModel, BaseUserRefreshTokenModel, BaseUserTokenModel, CEP_PATTERN, CNPJ_PATTERN, CPF_PATTERN, CSRF_COOKIE_NAME, CSRF_HEADER_NAME, CircuitOpenError, CompositeFeatureFlagBackend, ConflictException, DEFAULT_LOCALE, EmailProvider, EmailUtils, EnvFeatureFlagBackend, EventStream, ExpiredTokenException, FeatureFlags, ForbiddenException, GitHubOAuthClient, GoogleOAuthClient, GracefulShutdown, HTTPClient, HTTP_500_LOG_FILE, HTTP_500_MARKER, HttpMetrics, IDEMPOTENCY_HEADER, InvalidTokenException, JSONLogger, JWTUtils, LEVEL_LOG_FILES, LocalUploadStorage, MemoryBroker, MemoryCacheManager, MemoryFeatureFlagBackend, MemoryIdempotencyStore, MemoryRateLimitStore, MemorySessionStore, MemoryThrottleBackend, MessageCatalog, MessagingHub, MetricsUtils, MfaService, NotFoundException, OAuthError, OIDCProvider, OutboxRelay, OutboxStatus, PHONE_BR_PATTERN, PasswordResetService, REQUEST_ID_HEADER, RabbitBroker, RedisCacheManager, RedisIdempotencyStore, RedisRateLimitStore, RedisSSEBroker, RedisSessionStore, Region, RetryPolicy, S3UploadStorage, SSEBroker, ServerSentEvent, SessionService, TOTPHelper, TaskManager, TelegramProvider, TenantScopedRepository, TooManyRequestsException, TwilioSmsProvider, UF, UnauthorizedException, UserAuthService, UserTokenPurpose, ValidationException, WebPushDispatcher, WebPushError, WebPushGoneError, WebSocketHub, WebhookSignatureVerifier, WhatsAppProvider, activationSchema, addLogSink, attachWebSocketHub, authResponseSchema, authSettingsShape, backupDatabase, bearerToken, bodySizeLimitMiddleware, broadcastText, buildContentDisposition, buildPaginationLinkHeader, cached2 as cached, cepField, citiesByUf, cnpjField, coerceFlag, configureFileLogging, configureLogging, cpfField, cpfOrCnpjField, createApp, createOpenApiRegistry, createTestDatabase, createdByColumn, csrfMiddleware, cursorPaginationFilterSchema, cursorPaginationSchema, decodeCursor, defaultMessageCatalog, defineEnum, deletedAtColumn, diffSnapshots, emailSettingsShape, encodeCursor, envList, generateCsrfToken, generateOAuthState, generateOpaqueToken, generateOpenApiDocument, getAuth, getClientIp, getConditions, getPaginationConditions, getRequestId, getState, hashOpaqueToken, idempotencyMiddleware, inboundMessageSchema, isValidCep, isValidCity, isValidCnpj, isValidCpf, isValidCpfCnpj, isValidPhoneBr, isValidUf, jwtSettingsShape, keyByHeader, keyByIp, keyByJwtClaim, keyByJwtSubject, listStates, logEntrySchema, logSettingsShape, loginSchema, makeAdminRouter, makeAppExceptionHandler, makeAuthRouter, makeFlagGuard, makeHealthRouter, makeJwtAuthMiddleware, makeLogsRouter, makeMetricsRouter, makeSessionMiddleware, makeToolSpecRouter, makeTwilioWebhookRouter, makeUnhandledExceptionHandler, makeWhatsAppWebhookRouter, mfaChallengeSchema, mfaCodeSchema, mfaEnrollResponseSchema, minioSettingsShape, modifyDict, mountOpenApiJson, mountRedoc, mountSwaggerUi, normalizeCep, normalizeCnpj, normalizeCpf, normalizeCpfCnpj, normalizePhoneBr, normalizeUf, notFoundHandler, onlyDigits, paginationFilterSchema, paginationSchema, parseAcceptLanguage, parseCookies, passwordResetConfirmSchema, passwordResetRequestSchema, phoneBrField, prometheusMiddleware, rabbitmqSettingsShape, rateLimitMiddleware, redisSettingsShape, refreshSchema, registerExceptionHandlers, renderAuthResultPage, renderPasswordResetFormPage, requestIdMiddleware, requestTracingMiddleware, requireRoles, resolveDownloadPath, runServer, runWithRequestContext, sendBytesDownload, sendFileDownload, sessionCookie, sessionSettingsShape, setRequestId, signupSchema, snapshot, sseResponse, statesByRegion, syncFilterSchema, syncPaginationSchema, tableNameFor, toUtc, tokenFromUrl, tokenPairSchema, tokenSettingsShape, ufField, updatedByColumn, uploadSettingsShape, userPublicSchema, utcnow, validateTwilioSignature, verifyOpaqueToken, webPushKeysSchema, webPushPayloadSchema, webPushSettingsShape, webPushSubscriptionSchema, webSocketSettingsShape, withTestDatabase, wrapWithSlowQueryLog, wsEnvelopeSchema };
11318
+ export { ActivationService, AdminSite, AppException, AttemptThrottle, AuditAction, BaseAuditLogModel, BaseController, BaseModel, BaseOAuthClient, BaseOutboxModel, BaseService, BaseUserModel, BaseUserRefreshTokenModel, BaseUserTokenModel, CEP_PATTERN, CNPJ_PATTERN, CPF_PATTERN, CSRF_COOKIE_NAME, CSRF_HEADER_NAME, CircuitOpenError, CompositeFeatureFlagBackend, ConflictException, DEFAULT_DOCS_FAVICON, DEFAULT_LOCALE, EmailProvider, EmailUtils, EnvFeatureFlagBackend, EventStream, ExpiredTokenException, FeatureFlags, ForbiddenException, GitHubOAuthClient, GoogleOAuthClient, GracefulShutdown, HTTPClient, HTTP_500_LOG_FILE, HTTP_500_MARKER, HttpMetrics, IDEMPOTENCY_HEADER, InvalidTokenException, JSONLogger, JWTUtils, LEVEL_LOG_FILES, LocalUploadStorage, MemoryBroker, MemoryCacheManager, MemoryFeatureFlagBackend, MemoryIdempotencyStore, MemoryRateLimitStore, MemorySessionStore, MemoryThrottleBackend, MessageCatalog, MessagingHub, MetricsUtils, MfaService, NotFoundException, OAuthError, OIDCProvider, OutboxRelay, OutboxStatus, PHONE_BR_PATTERN, PasswordResetService, REDOC_CDN_URL, REQUEST_ID_HEADER, RabbitBroker, RedisCacheManager, RedisIdempotencyStore, RedisRateLimitStore, RedisSSEBroker, RedisSessionStore, Region, RetryPolicy, S3UploadStorage, SSEBroker, ServerSentEvent, SessionService, TOTPHelper, TaskManager, TelegramProvider, TenantScopedRepository, TooManyRequestsException, TwilioSmsProvider, UF, UnauthorizedException, UserAuthService, UserTokenPurpose, ValidationException, WebPushDispatcher, WebPushError, WebPushGoneError, WebSocketHub, WebhookSignatureVerifier, WhatsAppProvider, activationSchema, addLogSink, attachWebSocketHub, authResponseSchema, authSettingsShape, backupDatabase, bearerToken, bodySizeLimitMiddleware, broadcastText, buildContentDisposition, buildPaginationLinkHeader, cached2 as cached, cepField, citiesByUf, cnpjField, coerceFlag, configureFileLogging, configureLogging, cpfField, cpfOrCnpjField, createApp, createOpenApiRegistry, createTestDatabase, createdByColumn, csrfMiddleware, cursorPaginationFilterSchema, cursorPaginationSchema, decodeCursor, defaultMessageCatalog, defineEnum, deletedAtColumn, diffSnapshots, emailSettingsShape, encodeCursor, envList, generateCsrfToken, generateOAuthState, generateOpaqueToken, generateOpenApiDocument, getAuth, getClientIp, getConditions, getPaginationConditions, getRequestId, getState, hashOpaqueToken, idempotencyMiddleware, inboundMessageSchema, isValidCep, isValidCity, isValidCnpj, isValidCpf, isValidCpfCnpj, isValidPhoneBr, isValidUf, jwtSettingsShape, keyByHeader, keyByIp, keyByJwtClaim, keyByJwtSubject, listStates, logEntrySchema, logSettingsShape, loginSchema, makeAdminRouter, makeAppExceptionHandler, makeAuthRouter, makeFlagGuard, makeHealthRouter, makeJwtAuthMiddleware, makeLogsRouter, makeMetricsRouter, makeSessionMiddleware, makeToolSpecRouter, makeTwilioWebhookRouter, makeUnhandledExceptionHandler, makeWhatsAppWebhookRouter, mfaChallengeSchema, mfaCodeSchema, mfaEnrollResponseSchema, minioSettingsShape, modifyDict, mountOpenApiJson, mountRedoc, mountSwaggerUi, normalizeCep, normalizeCnpj, normalizeCpf, normalizeCpfCnpj, normalizePhoneBr, normalizeUf, notFoundHandler, onlyDigits, paginationFilterSchema, paginationSchema, parseAcceptLanguage, parseCookies, passwordResetConfirmSchema, passwordResetRequestSchema, phoneBrField, prometheusMiddleware, rabbitmqSettingsShape, rateLimitMiddleware, redisSettingsShape, refreshSchema, registerExceptionHandlers, renderAuthResultPage, renderPasswordResetFormPage, requestIdMiddleware, requestTracingMiddleware, requireRoles, resolveDownloadPath, resolveRedocBundle, runServer, runWithRequestContext, sendBytesDownload, sendFileDownload, sessionCookie, sessionSettingsShape, setRequestId, signupSchema, snapshot, sseResponse, statesByRegion, syncFilterSchema, syncPaginationSchema, tableNameFor, toUtc, tokenFromUrl, tokenPairSchema, tokenSettingsShape, ufField, updatedByColumn, uploadSettingsShape, userPublicSchema, utcnow, validateTwilioSignature, verifyOpaqueToken, webPushKeysSchema, webPushPayloadSchema, webPushSettingsShape, webPushSubscriptionSchema, webSocketSettingsShape, withTestDatabase, wrapWithSlowQueryLog, wsEnvelopeSchema };
11205
11319
  //# sourceMappingURL=index.js.map
11206
11320
  //# sourceMappingURL=index.js.map