tempest-express-sdk 0.28.0 → 0.30.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
@@ -2800,6 +2800,26 @@ declare class RabbitBroker implements BrokerManager {
2800
2800
 
2801
2801
  /** A handler for a registered task. */
2802
2802
  type TaskHandler<P = unknown> = (payload: P) => Promise<void> | void;
2803
+ /** One registered task, as the inventory reports it. */
2804
+ interface TaskInventoryEntry {
2805
+ /** The task name handlers are registered under. */
2806
+ name: string;
2807
+ /** A human-readable description, when the registration supplied one. */
2808
+ description: string | null;
2809
+ /** The declared schedule, when the registration supplied one. */
2810
+ schedule: string | null;
2811
+ }
2812
+ /** Optional metadata attached at registration, surfaced by the inventory. */
2813
+ interface TaskRegistrationOptions {
2814
+ /** What the task does, for an operator reading the panel. */
2815
+ description?: string;
2816
+ /**
2817
+ * The schedule this task is expected to run on (a cron expression, an
2818
+ * interval — whatever your scheduler speaks). Recorded and displayed, never
2819
+ * interpreted: the manager consumes a queue, it does not schedule.
2820
+ */
2821
+ schedule?: string;
2822
+ }
2803
2823
  /** Options for {@link TaskManager}. */
2804
2824
  interface TaskManagerOptions {
2805
2825
  /** The broker to publish/consume on. Defaults to a {@link MemoryBroker}. */
@@ -2811,6 +2831,7 @@ declare class TaskManager {
2811
2831
  private readonly broker;
2812
2832
  private readonly queue;
2813
2833
  private readonly handlers;
2834
+ private readonly metadata;
2814
2835
  private unsubscribe;
2815
2836
  /**
2816
2837
  * @param options - Broker and queue name.
@@ -2821,8 +2842,21 @@ declare class TaskManager {
2821
2842
  *
2822
2843
  * @param name - The task name.
2823
2844
  * @param handler - The handler invoked with the task payload.
2845
+ * @param options - Description and declared schedule, surfaced by
2846
+ * {@link TaskManager.inventory} and by the admin panel's tasks page.
2847
+ */
2848
+ register<P = unknown>(name: string, handler: TaskHandler<P>, options?: TaskRegistrationOptions): void;
2849
+ /**
2850
+ * Return what this process would run, ordered by name.
2851
+ *
2852
+ * This is the **declared** side of background work — the handlers this
2853
+ * process knows about — not queue state. A broker's pending depth is not
2854
+ * something the manager can see, and a screen that implied otherwise would
2855
+ * be worse than one that says nothing.
2856
+ *
2857
+ * @returns One entry per registered task.
2824
2858
  */
2825
- register<P = unknown>(name: string, handler: TaskHandler<P>): void;
2859
+ inventory(): TaskInventoryEntry[];
2826
2860
  /**
2827
2861
  * Enqueue a task by name.
2828
2862
  *
@@ -2839,6 +2873,144 @@ declare class TaskManager {
2839
2873
  stop(): Promise<void>;
2840
2874
  }
2841
2875
 
2876
+ /** Lifecycle state of a job row. */
2877
+ declare const JobStatus: {
2878
+ /** Written, not started. */
2879
+ readonly QUEUED: "queued";
2880
+ /** A worker picked it up. */
2881
+ readonly RUNNING: "running";
2882
+ /** Finished cleanly. */
2883
+ readonly SUCCEEDED: "succeeded";
2884
+ /** Finished with an error. */
2885
+ readonly FAILED: "failed";
2886
+ /** An operator stopped it before it finished. */
2887
+ readonly CANCELLED: "cancelled";
2888
+ };
2889
+ /** A {@link JobStatus} value. */
2890
+ type JobStatus = (typeof JobStatus)[keyof typeof JobStatus];
2891
+ /**
2892
+ * Base for a persisted job record. Subclass it, set `tablename`, and index
2893
+ * `name` plus `status` in a migration.
2894
+ *
2895
+ * ```ts
2896
+ * export class JobModel extends BaseJobModel {
2897
+ * static override tablename = "job";
2898
+ * }
2899
+ * ```
2900
+ */
2901
+ declare abstract class BaseJobModel extends BaseModel {
2902
+ /** The task name this run belongs to. */
2903
+ name: tempest_db_js.Column<string, tempest_db_js.ColumnFlags & {
2904
+ notNull: true;
2905
+ }>;
2906
+ /** Lifecycle state — a {@link JobStatus} value. */
2907
+ status: tempest_db_js.Column<string, tempest_db_js.ColumnFlags & {
2908
+ notNull: true;
2909
+ } & {
2910
+ hasDefault: true;
2911
+ }>;
2912
+ /** The payload the run was started with. */
2913
+ payload: tempest_db_js.Column<Record<string, unknown>, tempest_db_js.ColumnFlags>;
2914
+ /** Whatever the run produced, for an operator to read afterwards. */
2915
+ result: tempest_db_js.Column<Record<string, unknown>, tempest_db_js.ColumnFlags>;
2916
+ /** The failure message, when the run failed. */
2917
+ error: tempest_db_js.Column<string, tempest_db_js.ColumnFlags>;
2918
+ /** How many times the run has been attempted. */
2919
+ attempts: tempest_db_js.Column<number, tempest_db_js.ColumnFlags & {
2920
+ notNull: true;
2921
+ } & {
2922
+ hasDefault: true;
2923
+ }>;
2924
+ /** When a worker picked it up. */
2925
+ startedAt: tempest_db_js.Column<Date, tempest_db_js.ColumnFlags>;
2926
+ /** When it reached a terminal state. */
2927
+ finishedAt: tempest_db_js.Column<Date, tempest_db_js.ColumnFlags>;
2928
+ }
2929
+ /**
2930
+ * The small surface workers write job rows through.
2931
+ *
2932
+ * Every transition is a method rather than a raw update, so "finished" always
2933
+ * means the same three columns moved together — a status without a
2934
+ * `finishedAt` is the kind of half-written row that makes a history screen lie.
2935
+ */
2936
+ declare class JobStore<C extends ModelClass = ModelClass> {
2937
+ readonly model: C;
2938
+ private readonly repository;
2939
+ /**
2940
+ * @param model - The concrete {@link BaseJobModel} subclass.
2941
+ * @param session - The session rows are written on.
2942
+ */
2943
+ constructor(model: C, session: AsyncSession);
2944
+ /**
2945
+ * Record a job about to run.
2946
+ *
2947
+ * @param name - The task name.
2948
+ * @param payload - The payload the run was started with.
2949
+ * @returns The created row.
2950
+ */
2951
+ enqueue(name: string, payload?: Record<string, unknown>): Promise<Record<string, unknown>>;
2952
+ /**
2953
+ * Mark a job as picked up, counting the attempt.
2954
+ *
2955
+ * @param id - The job id.
2956
+ * @param attempt - Which attempt this is. Default `1`.
2957
+ * @returns How many rows changed.
2958
+ */
2959
+ start(id: string, attempt?: number): Promise<number>;
2960
+ /**
2961
+ * Mark a job as finished cleanly.
2962
+ *
2963
+ * @param id - The job id.
2964
+ * @param result - Whatever the run produced.
2965
+ * @returns How many rows changed.
2966
+ */
2967
+ succeed(id: string, result?: Record<string, unknown>): Promise<number>;
2968
+ /**
2969
+ * Mark a job as failed.
2970
+ *
2971
+ * @param id - The job id.
2972
+ * @param error - The failure, as an `Error` or a message.
2973
+ * @returns How many rows changed.
2974
+ */
2975
+ fail(id: string, error: unknown): Promise<number>;
2976
+ /**
2977
+ * Ask a job to stop.
2978
+ *
2979
+ * A job already in a terminal state is left alone and reported as not
2980
+ * cancelled, so an operator clicking cancel on a run that just finished sees
2981
+ * the truth rather than a row rewritten under them.
2982
+ *
2983
+ * @param id - The job id.
2984
+ * @returns Whether the row moved to `cancelled`.
2985
+ */
2986
+ cancel(id: string): Promise<boolean>;
2987
+ /**
2988
+ * Read one job row.
2989
+ *
2990
+ * @param id - The job id.
2991
+ * @returns The row, or `null`.
2992
+ */
2993
+ get(id: string): Promise<Record<string, unknown> | null>;
2994
+ /**
2995
+ * Read a page of jobs, newest first.
2996
+ *
2997
+ * @param filter - Page, size and optional `name` / `status` filters.
2998
+ * @returns The page plus its metadata.
2999
+ */
3000
+ list(filter?: {
3001
+ page?: number;
3002
+ pageSize?: number;
3003
+ name?: string;
3004
+ status?: JobStatus;
3005
+ }): Promise<{
3006
+ items: Record<string, unknown>[];
3007
+ total: number;
3008
+ page: number;
3009
+ pageSize: number;
3010
+ pages: number;
3011
+ }>;
3012
+ }
3013
+
2842
3014
  /**
2843
3015
  * Feature-flag backends, mirroring `flags.backends`.
2844
3016
  *
@@ -3586,6 +3758,231 @@ declare function trendDirection(trend: MetricTrend): "up" | "down" | "flat";
3586
3758
  */
3587
3759
  declare function partitionTotal(partition: MetricPartition): number;
3588
3760
 
3761
+ /**
3762
+ * The admin panel's log reader and exporters, mirroring `admin.router`'s logs
3763
+ * page and `admin` log export helpers.
3764
+ *
3765
+ * Reads the structured JSON records `configureFileLogging` writes, filters them
3766
+ * the way the page does, and renders the same selection as markdown or JSON so
3767
+ * an export never disagrees with the page it was taken from.
3768
+ *
3769
+ * The page is **opt-in**: the payload carries tracebacks and request metadata,
3770
+ * so it only exists when a project passes a log directory to `makeAdminRouter`.
3771
+ */
3772
+ /** A parsed log record, as the panel reads it. */
3773
+ interface AdminLogEntry {
3774
+ /** Severity, when the record carries one. */
3775
+ level: string;
3776
+ /** The logger name. */
3777
+ logger: string;
3778
+ /** The message text. */
3779
+ message: string;
3780
+ /** ISO timestamp, when present. */
3781
+ timestamp: string;
3782
+ /** The stack trace, when the record carries one. */
3783
+ stack: string | null;
3784
+ /** Correlation fields worth showing next to the message. */
3785
+ context: Record<string, unknown>;
3786
+ /** Everything the record carried, verbatim. */
3787
+ raw: Record<string, unknown>;
3788
+ }
3789
+ /**
3790
+ * Normalize a raw JSON log line into the shape the page renders.
3791
+ *
3792
+ * @param raw - The parsed record.
3793
+ * @returns The normalized entry.
3794
+ */
3795
+ declare function toLogEntry(raw: Record<string, unknown>): AdminLogEntry;
3796
+ /**
3797
+ * Filter entries by a free-text term.
3798
+ *
3799
+ * Matches the message, the logger and the stack, because an operator hunting a
3800
+ * 500 usually has a fragment of the traceback, not of the message.
3801
+ *
3802
+ * @param entries - The entries to filter.
3803
+ * @param term - The search term; empty returns everything.
3804
+ * @returns The matching entries.
3805
+ */
3806
+ declare function filterLogEntries(entries: AdminLogEntry[], term: string): AdminLogEntry[];
3807
+ /**
3808
+ * Render entries as markdown, ready to paste into an issue.
3809
+ *
3810
+ * Each stack goes in a fenced block so it survives the paste with its
3811
+ * indentation intact, and the header declares the source, the filter and — when
3812
+ * the cap truncated the selection — how many records matched in total, so a
3813
+ * partial export never reads as a complete one.
3814
+ *
3815
+ * @param entries - The entries to render, newest first.
3816
+ * @param options - The source and search term the page had applied, and the
3817
+ * total number of matches before the cap.
3818
+ * @returns The markdown document.
3819
+ */
3820
+ declare function renderLogEntriesMarkdown(entries: AdminLogEntry[], options: {
3821
+ source: string;
3822
+ query: string;
3823
+ total: number;
3824
+ }): string;
3825
+ /**
3826
+ * Render entries as JSON, verbatim.
3827
+ *
3828
+ * @param entries - The entries to render, newest first.
3829
+ * @returns The JSON document, carrying every field the application logged.
3830
+ */
3831
+ declare function renderLogEntriesJson(entries: AdminLogEntry[]): string;
3832
+
3833
+ /**
3834
+ * A SQL console for the admin, with a policy in front of it — mirroring
3835
+ * `admin.sql_shell`.
3836
+ *
3837
+ * Every serious admin panel grows one of these, because eventually someone
3838
+ * needs an answer the list view cannot give. This is that console, plus the
3839
+ * guard rails to make it survivable.
3840
+ *
3841
+ * ## Read this before enabling it
3842
+ *
3843
+ * **A SQL filter in the application is defence in depth, not a security
3844
+ * boundary.** The analyser here parses statements properly (via
3845
+ * `node-sql-parser`) rather than matching strings, which stops the ordinary
3846
+ * mistakes: a `DROP` typed by someone who meant to `SELECT`, an `UPDATE` with
3847
+ * no `WHERE`, a query against a table holding card data. It will not stop a
3848
+ * determined operator with time — SQL has CTEs, subqueries, functions, dialect
3849
+ * extensions and comment tricks, and any parser-based allowlist is a game of
3850
+ * coverage.
3851
+ *
3852
+ * The boundary that actually holds is the **database user**. A role granted
3853
+ * only `SELECT` on three tables cannot `DROP` anything, whatever reaches it:
3854
+ *
3855
+ * ```sql
3856
+ * CREATE ROLE admin_console LOGIN PASSWORD '…';
3857
+ * GRANT CONNECT ON DATABASE app TO admin_console;
3858
+ * GRANT SELECT ON orders, customers, invoices TO admin_console;
3859
+ * ```
3860
+ *
3861
+ * Point the console's `run` at *that* connection, then use the policy to narrow
3862
+ * further and to produce a readable refusal instead of a database error. Used
3863
+ * that way the two layers complement each other. Used alone, the policy is a
3864
+ * speed bump.
3865
+ *
3866
+ * The console is **off by default**, and every attempt — allowed or refused —
3867
+ * reaches the audit hook.
3868
+ */
3869
+ /**
3870
+ * What a console may do, one statement family per member.
3871
+ *
3872
+ * Split the way an operator thinks about risk rather than the way SQL groups
3873
+ * keywords: `DELETE` is separate from `UPDATE` because losing rows and
3874
+ * corrupting them are different incidents, and `DROP` is separate from the rest
3875
+ * of DDL because it is the one nobody undoes.
3876
+ */
3877
+ declare const SqlCapability: {
3878
+ /** `SELECT`, `WITH … SELECT`, `EXPLAIN`, `SHOW`. */
3879
+ readonly READ: "read";
3880
+ /** Adds rows. */
3881
+ readonly INSERT: "insert";
3882
+ /** Changes rows. */
3883
+ readonly UPDATE: "update";
3884
+ /** Removes rows. */
3885
+ readonly DELETE: "delete";
3886
+ /** `CREATE` / `ALTER` / `COMMENT`. */
3887
+ readonly DDL: "ddl";
3888
+ /** `DROP` and `TRUNCATE`: irreversible structure loss. */
3889
+ readonly DROP: "drop";
3890
+ /**
3891
+ * `GRANT` / `REVOKE` / `SET`, and anything the analyser cannot classify.
3892
+ * Unknown statements land here on purpose, so a construct nobody anticipated
3893
+ * needs the most privileged capability rather than the least.
3894
+ */
3895
+ readonly ADMIN: "admin";
3896
+ };
3897
+ /** A {@link SqlCapability} value. */
3898
+ type SqlCapability = (typeof SqlCapability)[keyof typeof SqlCapability];
3899
+ /** What the analyser concluded about a submitted statement. */
3900
+ interface SqlAnalysis {
3901
+ /** How many statements the text carries. */
3902
+ statements: number;
3903
+ /** The capabilities the text needs, deduplicated. */
3904
+ capabilities: SqlCapability[];
3905
+ /** Tables the parser could name, lowercased. */
3906
+ tables: string[];
3907
+ /** Whether the parser understood the text at all. */
3908
+ parsed: boolean;
3909
+ /** Whether any statement mutates rows without a `WHERE`. */
3910
+ unscopedWrite: boolean;
3911
+ }
3912
+ /** The rules a console enforces before running anything. */
3913
+ interface SqlConsolePolicy {
3914
+ /** Capabilities the console may use. Default `["read"]`. */
3915
+ capabilities?: readonly SqlCapability[];
3916
+ /** When set, only these tables may be touched (lowercased comparison). */
3917
+ allowTables?: readonly string[];
3918
+ /** Tables that may never be touched, whatever `allowTables` says. */
3919
+ denyTables?: readonly string[];
3920
+ /** Refuse an `UPDATE`/`DELETE` with no `WHERE`. Default `true`. */
3921
+ requireWhereOnWrites?: boolean;
3922
+ /** Rows returned to the browser. Default `200`. */
3923
+ maxRows?: number;
3924
+ }
3925
+ /** One console attempt, handed to the audit hook whether or not it ran. */
3926
+ interface SqlAuditEntry {
3927
+ /** The submitted text, verbatim. */
3928
+ sql: string;
3929
+ /** The operator's display name. */
3930
+ principal: string;
3931
+ /** Whether the policy let it run. */
3932
+ allowed: boolean;
3933
+ /** Why it was refused, or `null` when it ran. */
3934
+ reason: string | null;
3935
+ /** What the analyser concluded. */
3936
+ analysis: SqlAnalysis;
3937
+ /** Wall-clock duration in milliseconds, or `null` when it never ran. */
3938
+ durationMs: number | null;
3939
+ /** Rows returned, or `null` when it never ran or returned none. */
3940
+ rowCount: number | null;
3941
+ }
3942
+ /** Called for every attempt, allowed or refused. */
3943
+ type SqlAuditHook = (entry: SqlAuditEntry) => void | Promise<void>;
3944
+ /** The subset of `node-sql-parser` this module uses. */
3945
+ interface SqlParser {
3946
+ astify(sql: string, options: {
3947
+ database: string;
3948
+ }): unknown;
3949
+ tableList(sql: string, options: {
3950
+ database: string;
3951
+ }): string[];
3952
+ }
3953
+ /**
3954
+ * Load `node-sql-parser`, or throw an error naming the install command.
3955
+ *
3956
+ * @returns A parser instance.
3957
+ * @throws Error When the optional peer is not installed.
3958
+ */
3959
+ declare function loadSqlParser(): Promise<SqlParser>;
3960
+ /**
3961
+ * Classify a submitted statement.
3962
+ *
3963
+ * Text the parser cannot understand is not rejected here — it comes back as
3964
+ * `parsed: false` needing {@link SqlCapability.ADMIN}, so an unanticipated
3965
+ * construct requires the most privileged capability instead of slipping through
3966
+ * as the least.
3967
+ *
3968
+ * @param sql - The submitted text.
3969
+ * @param dialect - The parser dialect (`postgresql`, `sqlite`, `mysql`, …).
3970
+ * @param parser - The loaded parser.
3971
+ * @returns What the text needs and touches.
3972
+ */
3973
+ declare function analyzeSql(sql: string, dialect: string, parser: SqlParser): SqlAnalysis;
3974
+ /**
3975
+ * Decide whether a policy lets an analysed statement run.
3976
+ *
3977
+ * @param analysis - What the analyser concluded.
3978
+ * @param policy - The console's rules.
3979
+ * @returns The verdict and, on refusal, a reason the operator can act on.
3980
+ */
3981
+ declare function checkSqlPolicy(analysis: SqlAnalysis, policy: SqlConsolePolicy): {
3982
+ allowed: boolean;
3983
+ reason: string | null;
3984
+ };
3985
+
3589
3986
  /**
3590
3987
  * Related child models surfaced on a parent's detail view — Django's
3591
3988
  * `TabularInline` analog, mirroring `admin.config.Inline`.
@@ -4887,7 +5284,7 @@ declare class AdminSite {
4887
5284
  * It ships as a string rather than an asset because the package publishes only
4888
5285
  * `dist`: a `.css` file on disk would not survive the build.
4889
5286
  */
4890
- /** The stylesheet text. */
5287
+ /** The stylesheet the panel serves: the ported base plus this SDK's additions. */
4891
5288
  declare const ADMIN_CSS: string;
4892
5289
 
4893
5290
  /**
@@ -4938,6 +5335,8 @@ interface AdminRenderContext {
4938
5335
  currentPath: string;
4939
5336
  /** Sidebar entries, one per registered model. */
4940
5337
  navModels: AdminNavEntry[];
5338
+ /** Sidebar entries for the system tools (logs, SQL console). */
5339
+ navSystem: AdminNavEntry[];
4941
5340
  /** Banners rendered above the content. */
4942
5341
  messages: AdminMessage[];
4943
5342
  }
@@ -5234,6 +5633,172 @@ interface AdminFormView {
5234
5633
  * @throws Error When called without a session, since the form needs a CSRF token.
5235
5634
  */
5236
5635
  declare function renderFormPage(context: AdminRenderContext, view: AdminFormView): string;
5636
+ /** One row of the logs page. */
5637
+ interface AdminLogRowView {
5638
+ /** Severity, lowercased, driving the badge colour. */
5639
+ level: string;
5640
+ /** ISO timestamp, or `""`. */
5641
+ timestamp: string;
5642
+ /** Logger name. */
5643
+ logger: string;
5644
+ /** Message text. */
5645
+ message: string;
5646
+ /** Stack trace, or `null` when the record carries none. */
5647
+ stack: string | null;
5648
+ /** Correlation fields, already formatted as `key: value` pairs. */
5649
+ context: {
5650
+ key: string;
5651
+ value: string;
5652
+ }[];
5653
+ }
5654
+ /** The view model the logs page renders. */
5655
+ interface AdminLogsView {
5656
+ /** Available source selectors. */
5657
+ sources: {
5658
+ value: string;
5659
+ label: string;
5660
+ selected: boolean;
5661
+ }[];
5662
+ /** The current search term. */
5663
+ query: string;
5664
+ /** The rows on this page, newest first. */
5665
+ rows: AdminLogRowView[];
5666
+ /** Total matching records. */
5667
+ total: number;
5668
+ /** Current page, 1-based. */
5669
+ page: number;
5670
+ /** Total pages. */
5671
+ pages: number;
5672
+ /** URL of the previous page, or `null`. */
5673
+ prevUrl: string | null;
5674
+ /** URL of the next page, or `null`. */
5675
+ nextUrl: string | null;
5676
+ /** URL exporting the current selection as markdown. */
5677
+ exportMarkdownUrl: string;
5678
+ /** URL exporting the current selection as JSON. */
5679
+ exportJsonUrl: string;
5680
+ /** Cap the export applies. */
5681
+ exportMax: number;
5682
+ }
5683
+ /**
5684
+ * Render the application-logs page.
5685
+ *
5686
+ * A record carrying a stack becomes a `<details>` whose summary is the message
5687
+ * itself, collapsed by default: a page full of 500s has to stay scannable, and
5688
+ * that needs no JavaScript.
5689
+ *
5690
+ * @param context - The shared chrome data.
5691
+ * @param view - The prepared logs view model.
5692
+ * @returns The full page.
5693
+ */
5694
+ declare function renderLogsPage(context: AdminRenderContext, view: AdminLogsView): string;
5695
+ /** The tasks page view model. */
5696
+ interface AdminTasksView {
5697
+ /** Declared tasks this process would run, or `null` when no manager was given. */
5698
+ inventory: {
5699
+ name: string;
5700
+ description: string;
5701
+ schedule: string;
5702
+ }[] | null;
5703
+ /** Persisted runs, or `null` when no job store was given. */
5704
+ runs: {
5705
+ rows: {
5706
+ id: string;
5707
+ name: string;
5708
+ status: string;
5709
+ startedAt: string;
5710
+ finishedAt: string;
5711
+ attempts: string;
5712
+ url: string;
5713
+ }[];
5714
+ total: number;
5715
+ page: number;
5716
+ pages: number;
5717
+ prevUrl: string | null;
5718
+ nextUrl: string | null;
5719
+ statuses: {
5720
+ value: string;
5721
+ label: string;
5722
+ selected: boolean;
5723
+ }[];
5724
+ nameQuery: string;
5725
+ } | null;
5726
+ }
5727
+ /**
5728
+ * Render the background-tasks page.
5729
+ *
5730
+ * Either half may be missing: a service given only a `TaskManager` shows what
5731
+ * is declared, one given only a job store shows what ran. A section with no
5732
+ * source is omitted rather than rendered empty, because an empty table implies
5733
+ * there is nothing to see — and what the panel deliberately cannot show is live
5734
+ * queue depth, which no broker exposes.
5735
+ *
5736
+ * @param context - The shared chrome data.
5737
+ * @param view - The prepared tasks view model.
5738
+ * @returns The full page.
5739
+ */
5740
+ declare function renderTasksPage(context: AdminRenderContext, view: AdminTasksView): string;
5741
+ /** One job run, as the detail page renders it. */
5742
+ interface AdminTaskDetailView {
5743
+ /** The job id. */
5744
+ id: string;
5745
+ /** The task name. */
5746
+ name: string;
5747
+ /** Lifecycle state. */
5748
+ status: string;
5749
+ /** Field rows: timestamps, attempts and the like. */
5750
+ fields: {
5751
+ label: string;
5752
+ value: string;
5753
+ }[];
5754
+ /** The payload, pretty-printed, or `null`. */
5755
+ payload: string | null;
5756
+ /** The result, pretty-printed, or `null`. */
5757
+ result: string | null;
5758
+ /** The failure message, or `null`. */
5759
+ error: string | null;
5760
+ /** URL back to the tasks page. */
5761
+ backUrl: string;
5762
+ /** URL the cancel form posts to, or `null` when the run cannot be cancelled. */
5763
+ cancelUrl: string | null;
5764
+ }
5765
+ /**
5766
+ * Render one job run.
5767
+ *
5768
+ * @param context - The shared chrome data (with an active session).
5769
+ * @param view - The prepared run view model.
5770
+ * @returns The full page.
5771
+ * @throws Error When called without a session, since cancel needs a CSRF token.
5772
+ */
5773
+ declare function renderTaskDetailPage(context: AdminRenderContext, view: AdminTaskDetailView): string;
5774
+ /** The view model the SQL console renders. */
5775
+ interface AdminSqlView {
5776
+ /** The submitted statement, echoed back into the textarea. */
5777
+ sql: string;
5778
+ /** Capabilities this console is allowed to use. */
5779
+ capabilities: string[];
5780
+ /** A refusal or execution error, or `null`. */
5781
+ error: string | null;
5782
+ /** Column names of the result, when one ran. */
5783
+ columns: string[];
5784
+ /** Result rows, already formatted. */
5785
+ rows: string[][];
5786
+ /** Rows returned, or `null` when nothing ran. */
5787
+ rowCount: number | null;
5788
+ /** Whether the result was truncated by the row cap. */
5789
+ truncated: boolean;
5790
+ /** Wall-clock duration in milliseconds, or `null`. */
5791
+ durationMs: number | null;
5792
+ }
5793
+ /**
5794
+ * Render the SQL console.
5795
+ *
5796
+ * @param context - The shared chrome data (with an active session).
5797
+ * @param view - The prepared console view model.
5798
+ * @returns The full page.
5799
+ * @throws Error When called without a session, since the form needs a CSRF token.
5800
+ */
5801
+ declare function renderSqlPage(context: AdminRenderContext, view: AdminSqlView): string;
5237
5802
  /** The outcome of a CSV import, as the page renders it. */
5238
5803
  interface AdminImportView {
5239
5804
  /** Plural display name of the model being imported into. */
@@ -5328,6 +5893,46 @@ interface AdminRouterOptions {
5328
5893
  accessPolicy?: AdminAccessPolicy;
5329
5894
  /** Largest upload the panel accepts, in bytes. Default `10485760` (10 MB). */
5330
5895
  maxUploadBytes?: number;
5896
+ /**
5897
+ * Expose the application-logs page, reading the JSON files
5898
+ * `configureFileLogging` writes to this directory. Omitted keeps the page
5899
+ * off: the payload carries tracebacks and request metadata.
5900
+ */
5901
+ logDir?: string;
5902
+ /**
5903
+ * Expose the SQL console. Omitted keeps it off. Read the guard rails in
5904
+ * `@/admin/sqlConsole` before enabling it: the policy is defence in depth,
5905
+ * and the boundary that holds is the database user behind `run`.
5906
+ */
5907
+ sqlConsole?: AdminSqlConsoleOptions;
5908
+ /**
5909
+ * Expose the background-tasks page. Either half may be omitted: with only a
5910
+ * `manager` the page shows what this process declares, with only a `jobs`
5911
+ * store it shows what the workers recorded.
5912
+ */
5913
+ tasks?: AdminTasksOptions;
5914
+ }
5915
+ /** Configuration for the optional tasks page. */
5916
+ interface AdminTasksOptions {
5917
+ /** The task manager whose registry supplies the declared schedule. */
5918
+ manager?: TaskManager;
5919
+ /** Builds a job store on the request's session, supplying the run history. */
5920
+ jobs?: (session: AsyncSession) => JobStore;
5921
+ }
5922
+ /** Configuration for the optional SQL console. */
5923
+ interface AdminSqlConsoleOptions {
5924
+ /** The rules enforced before anything runs. Defaults to read-only. */
5925
+ policy?: SqlConsolePolicy;
5926
+ /**
5927
+ * Executes an approved statement. Omitted runs it on the request's own
5928
+ * session — point this at a restricted database role instead whenever the
5929
+ * console can do more than read.
5930
+ */
5931
+ run?: (sql: string, session: AsyncSession) => Promise<Record<string, unknown>[]>;
5932
+ /** Parser dialect. Default `"postgresql"`. */
5933
+ dialect?: string;
5934
+ /** Called for every attempt, allowed or refused. */
5935
+ onAudit?: SqlAuditHook;
5331
5936
  }
5332
5937
  /**
5333
5938
  * Build the admin panel router.
@@ -7073,6 +7678,18 @@ interface LogsRouterOptions {
7073
7678
  /** Middlewares run before the handler (e.g. a token guard). */
7074
7679
  guards?: RequestHandler[];
7075
7680
  }
7681
+ /**
7682
+ * Read and parse the structured log records a source selector covers.
7683
+ *
7684
+ * Shared by the JSON logs endpoint and the admin panel's logs page so the two
7685
+ * never disagree about what "the error log" contains. A corrupt line is skipped
7686
+ * rather than failing the read: one bad write should not hide the rest.
7687
+ *
7688
+ * @param dir - The log directory.
7689
+ * @param source - Which file(s) to read.
7690
+ * @returns The parsed records, in file order (oldest first).
7691
+ */
7692
+ declare function readLogEntries(dir: string, source: LogSource): Promise<Record<string, unknown>[]>;
7076
7693
  /**
7077
7694
  * Build a router serving `GET <path>` with query params `source`, `page` and
7078
7695
  * `pageSize`. Returns `{ items, total, page, pageSize, pages }`, newest first.
@@ -7137,6 +7754,6 @@ declare function createTestDatabase(models: readonly ModelClass[]): TestDatabase
7137
7754
  declare function withTestDatabase<T>(models: readonly ModelClass[], fn: (db: TestDatabase) => Promise<T>): Promise<T>;
7138
7755
 
7139
7756
  /** The installed SDK version. Single source of truth for the barrel + CLI. */
7140
- declare const VERSION = "0.28.0";
7757
+ declare const VERSION = "0.30.0";
7141
7758
 
7142
- export { ADMIN_CSS, type ActivationInput, ActivationService, type ActivationServiceOptions, type ActivationStore, type AdminAccessPolicy, type AdminAction, type AdminActionCategory, type AdminActionContext, type AdminActionHandler, type AdminActionOptions, type AdminActionResult, type AdminAuditEntryView, type AdminAuditView, type AdminAuthBackend, type AdminAutomapOptions, type AdminBusinessCardView, type AdminDashboardCard, type AdminDashboardMetrics, type AdminDetailView, type AdminFilterKind, type AdminFilterView, type AdminFormField, type AdminFormView, type AdminImportView, type AdminInline, type AdminInlineOptions, type AdminInlineRowView, type AdminInlineView, type AdminJsonField, type AdminJsonListQuery, type AdminJsonListResult, type AdminJsonResource, type AdminJsonRouterOptions, AdminJsonSite, type AdminLens, type AdminLensOptions, type AdminListView, type AdminMessage, type AdminMfaVerifier, AdminModel, type AdminModelOptions, type AdminNavEntry, AdminPermission, type AdminRenderContext, type AdminRouterOptions, type AdminRow, type AdminSelectOption, type AdminSession, AdminSessionStore, type AdminSessionStoreOptions, AdminSite, type AdminSiteOptions, type AdminSortView, type AdminTheme, type AdminWidget, 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, type BuildFormFieldsOptions, type BulkActionOption, CEP_PATTERN, CNPJ_PATTERN, CPF_PATTERN, type CPUMetrics, CSRF_COOKIE_NAME, CSRF_HEADER_NAME, type CacheManager, type CachedOptions, type CachedResponse, type CardCompute, type CardData, 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 MetricCard, type MetricPartition, type MetricTrend, type MetricValue, type MetricsRouterOptions, MetricsUtils, type MfaChallenge, type MfaChallengeInput, type MfaCodeInput, type MfaEnrollment, MfaService, type MfaServiceOptions, type MfaStore, MultipartLimitError, 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 ParseFormBodyOptions, type ParseMultipartOptions, type ParsedAdminForm, type ParsedMultipart, 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 ResolvedAdminTheme, 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, type UploadedFile, UserAuthService, type UserAuthServiceOptions, UserModelAuthBackend, type UserModelAuthBackendOptions, 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, type WidgetSpec, activationSchema, addLogSink, adminAction, adminColumns, adminInline, adminLens, adminThemeCss, attachWebSocketHub, authResponseSchema, authSettingsShape, backupDatabase, baseAppSettingsSchema, baseAppSettingsShape, baseResponseSchema, bearerToken, bodySizeLimitMiddleware, broadcastText, buildContentDisposition, buildFormFields, buildPaginationLinkHeader, cached, centsField, cepField, citiesByUf, cnpjField, coerceFlag, configureFileLogging, configureLogging, corsSettingsShape, cpfField, cpfOrCnpjField, createApp, createOpenApiRegistry, createTestDatabase, createdByColumn, csrfMiddleware, csrfTokenMatches, cursorPaginationFilterSchema, cursorPaginationSchema, databaseSettingsShape, decodeCursor, defaultMessageCatalog, defineEnum, deletedAtColumn, diffSnapshots, emailSettingsShape, encodeCursor, looseBoolean as envBoolean, envList, escapeHtml, filterForColumn, foreignKeyFields, foreignKeyLabel, foreignKeyTable, formatCellValue, formatFieldValue, generateCsrfToken, generateOAuthState, generateOpaqueToken, generateOpenApiDocument, getAuth, getClientIp, getConditions, getPaginationConditions, getRequestId, getState, groupInlineSubmission, hashOpaqueToken, hexColorField, humanizeField, idempotencyMiddleware, inboundMessageSchema, isColumnOptional, isMultipart, isSearchableColumn, isValidCep, isValidCity, isValidCnpj, isValidCpf, isValidCpfCnpj, isValidPhoneBr, isValidUf, jwtSettingsShape, keyByHeader, keyByIp, keyByJwtClaim, keyByJwtSubject, latitudeField, listStates, loadSettings, logEntrySchema, logSettingsShape, loginSchema, longitudeField, looseBoolean, makeAdminJsonRouter, makeAdminRouter, makeAppExceptionHandler, makeAuthRouter, makeFlagGuard, makeHealthRouter, makeJwtAuthMiddleware, makeLogsRouter, makeMetricsRouter, makeSessionMiddleware, makeToolSpecRouter, makeTwilioWebhookRouter, makeUnhandledExceptionHandler, makeWhatsAppWebhookRouter, metricCard, mfaChallengeSchema, mfaCodeSchema, mfaEnrollResponseSchema, minioSettingsShape, modifyDict, mountOpenApiJson, mountRedoc, mountSwaggerUi, nonEmptyStrField, nonNegativeFloatField, nonNegativeIntField, normalizeCep, normalizeCnpj, normalizeCpf, normalizeCpfCnpj, normalizePhoneBr, normalizeUf, notFoundHandler, onlyDigits, paginationFilterSchema, paginationSchema, parseAcceptLanguage, parseCookies, parseCsv, parseFormBody, parseMultipart, partitionTotal, passwordResetConfirmSchema, passwordResetRequestSchema, percentField, phoneBrField, portField, positiveFloatField, positiveIntField, priceField, prometheusMiddleware, rabbitmqSettingsShape, rateLimitMiddleware, ratingField, ratioField, redisSettingsShape, refreshSchema, registerExceptionHandlers, renderAuthResultPage, renderDashboardPage, renderDetailPage, renderFormPage, renderImportPage, renderLayout, renderListPage, renderLoginPage, renderMfaPage, renderPasswordResetFormPage, requestIdMiddleware, requestTracingMiddleware, requireRoles, resolveAdminTheme, resolveDownloadPath, resolveRedocBundle, runServer, runWithRequestContext, sendBytesDownload, sendFileDownload, serverSettingsShape, sessionCookie, sessionSettingsShape, setRequestId, signupSchema, slugField, snapshot, sseResponse, statesByRegion, syncFilterSchema, syncPaginationSchema, tableNameFor, toDict, toUtc, tokenFromUrl, tokenPairSchema, tokenSettingsShape, trendDirection, trendPercent, ufField, updatedByColumn, uploadSettingsShape, userPublicSchema, utcnow, validateTwilioSignature, verifyOpaqueToken, webPushKeysSchema, webPushPayloadSchema, webPushSettingsShape, webPushSubscriptionSchema, webSocketSettingsShape, widgetForColumn, withTestDatabase, wrapWithSlowQueryLog, wsEnvelopeSchema };
7759
+ export { ADMIN_CSS, type ActivationInput, ActivationService, type ActivationServiceOptions, type ActivationStore, type AdminAccessPolicy, type AdminAction, type AdminActionCategory, type AdminActionContext, type AdminActionHandler, type AdminActionOptions, type AdminActionResult, type AdminAuditEntryView, type AdminAuditView, type AdminAuthBackend, type AdminAutomapOptions, type AdminBusinessCardView, type AdminDashboardCard, type AdminDashboardMetrics, type AdminDetailView, type AdminFilterKind, type AdminFilterView, type AdminFormField, type AdminFormView, type AdminImportView, type AdminInline, type AdminInlineOptions, type AdminInlineRowView, type AdminInlineView, type AdminJsonField, type AdminJsonListQuery, type AdminJsonListResult, type AdminJsonResource, type AdminJsonRouterOptions, AdminJsonSite, type AdminLens, type AdminLensOptions, type AdminListView, type AdminLogEntry, type AdminLogRowView, type AdminLogsView, type AdminMessage, type AdminMfaVerifier, AdminModel, type AdminModelOptions, type AdminNavEntry, AdminPermission, type AdminRenderContext, type AdminRouterOptions, type AdminRow, type AdminSelectOption, type AdminSession, AdminSessionStore, type AdminSessionStoreOptions, AdminSite, type AdminSiteOptions, type AdminSortView, type AdminSqlConsoleOptions, type AdminSqlView, type AdminTaskDetailView, type AdminTasksOptions, type AdminTasksView, type AdminTheme, type AdminWidget, 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, BaseJobModel, BaseModel, BaseOAuthClient, BaseOutboxModel, type BaseResponse, BaseService, BaseUserModel, BaseUserRefreshTokenModel, BaseUserTokenModel, type BodySizeLimitOptions, type BroadcastOptions, type BroadcastResult, type BrokerManager, type BuildFormFieldsOptions, type BulkActionOption, CEP_PATTERN, CNPJ_PATTERN, CPF_PATTERN, type CPUMetrics, CSRF_COOKIE_NAME, CSRF_HEADER_NAME, type CacheManager, type CachedOptions, type CachedResponse, type CardCompute, type CardData, 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, JobStatus, JobStore, 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 MetricCard, type MetricPartition, type MetricTrend, type MetricValue, type MetricsRouterOptions, MetricsUtils, type MfaChallenge, type MfaChallengeInput, type MfaCodeInput, type MfaEnrollment, MfaService, type MfaServiceOptions, type MfaStore, MultipartLimitError, 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 ParseFormBodyOptions, type ParseMultipartOptions, type ParsedAdminForm, type ParsedMultipart, 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 ResolvedAdminTheme, 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 SqlAnalysis, type SqlAuditEntry, type SqlAuditHook, SqlCapability, type SqlConsolePolicy, type StateBR, type SwaggerOptions, type SyncFilter, type SystemMetrics, TOTPHelper, type TOTPOptions, type TaskHandler, type TaskInventoryEntry, TaskManager, type TaskManagerOptions, type TaskRegistrationOptions, 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, type UploadedFile, UserAuthService, type UserAuthServiceOptions, UserModelAuthBackend, type UserModelAuthBackendOptions, 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, type WidgetSpec, activationSchema, addLogSink, adminAction, adminColumns, adminInline, adminLens, adminThemeCss, analyzeSql, attachWebSocketHub, authResponseSchema, authSettingsShape, backupDatabase, baseAppSettingsSchema, baseAppSettingsShape, baseResponseSchema, bearerToken, bodySizeLimitMiddleware, broadcastText, buildContentDisposition, buildFormFields, buildPaginationLinkHeader, cached, centsField, cepField, checkSqlPolicy, citiesByUf, cnpjField, coerceFlag, configureFileLogging, configureLogging, corsSettingsShape, cpfField, cpfOrCnpjField, createApp, createOpenApiRegistry, createTestDatabase, createdByColumn, csrfMiddleware, csrfTokenMatches, cursorPaginationFilterSchema, cursorPaginationSchema, databaseSettingsShape, decodeCursor, defaultMessageCatalog, defineEnum, deletedAtColumn, diffSnapshots, emailSettingsShape, encodeCursor, looseBoolean as envBoolean, envList, escapeHtml, filterForColumn, filterLogEntries, foreignKeyFields, foreignKeyLabel, foreignKeyTable, formatCellValue, formatFieldValue, generateCsrfToken, generateOAuthState, generateOpaqueToken, generateOpenApiDocument, getAuth, getClientIp, getConditions, getPaginationConditions, getRequestId, getState, groupInlineSubmission, hashOpaqueToken, hexColorField, humanizeField, idempotencyMiddleware, inboundMessageSchema, isColumnOptional, isMultipart, isSearchableColumn, isValidCep, isValidCity, isValidCnpj, isValidCpf, isValidCpfCnpj, isValidPhoneBr, isValidUf, jwtSettingsShape, keyByHeader, keyByIp, keyByJwtClaim, keyByJwtSubject, latitudeField, listStates, loadSettings, loadSqlParser, logEntrySchema, logSettingsShape, loginSchema, longitudeField, looseBoolean, makeAdminJsonRouter, makeAdminRouter, makeAppExceptionHandler, makeAuthRouter, makeFlagGuard, makeHealthRouter, makeJwtAuthMiddleware, makeLogsRouter, makeMetricsRouter, makeSessionMiddleware, makeToolSpecRouter, makeTwilioWebhookRouter, makeUnhandledExceptionHandler, makeWhatsAppWebhookRouter, metricCard, mfaChallengeSchema, mfaCodeSchema, mfaEnrollResponseSchema, minioSettingsShape, modifyDict, mountOpenApiJson, mountRedoc, mountSwaggerUi, nonEmptyStrField, nonNegativeFloatField, nonNegativeIntField, normalizeCep, normalizeCnpj, normalizeCpf, normalizeCpfCnpj, normalizePhoneBr, normalizeUf, notFoundHandler, onlyDigits, paginationFilterSchema, paginationSchema, parseAcceptLanguage, parseCookies, parseCsv, parseFormBody, parseMultipart, partitionTotal, passwordResetConfirmSchema, passwordResetRequestSchema, percentField, phoneBrField, portField, positiveFloatField, positiveIntField, priceField, prometheusMiddleware, rabbitmqSettingsShape, rateLimitMiddleware, ratingField, ratioField, readLogEntries, redisSettingsShape, refreshSchema, registerExceptionHandlers, renderAuthResultPage, renderDashboardPage, renderDetailPage, renderFormPage, renderImportPage, renderLayout, renderListPage, renderLogEntriesJson, renderLogEntriesMarkdown, renderLoginPage, renderLogsPage, renderMfaPage, renderPasswordResetFormPage, renderSqlPage, renderTaskDetailPage, renderTasksPage, requestIdMiddleware, requestTracingMiddleware, requireRoles, resolveAdminTheme, resolveDownloadPath, resolveRedocBundle, runServer, runWithRequestContext, sendBytesDownload, sendFileDownload, serverSettingsShape, sessionCookie, sessionSettingsShape, setRequestId, signupSchema, slugField, snapshot, sseResponse, statesByRegion, syncFilterSchema, syncPaginationSchema, tableNameFor, toDict, toLogEntry, toUtc, tokenFromUrl, tokenPairSchema, tokenSettingsShape, trendDirection, trendPercent, ufField, updatedByColumn, uploadSettingsShape, userPublicSchema, utcnow, validateTwilioSignature, verifyOpaqueToken, webPushKeysSchema, webPushPayloadSchema, webPushSettingsShape, webPushSubscriptionSchema, webSocketSettingsShape, widgetForColumn, withTestDatabase, wrapWithSlowQueryLog, wsEnvelopeSchema };