tempest-express-sdk 0.27.0 → 0.29.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
@@ -3586,6 +3586,291 @@ declare function trendDirection(trend: MetricTrend): "up" | "down" | "flat";
3586
3586
  */
3587
3587
  declare function partitionTotal(partition: MetricPartition): number;
3588
3588
 
3589
+ /**
3590
+ * The admin panel's log reader and exporters, mirroring `admin.router`'s logs
3591
+ * page and `admin` log export helpers.
3592
+ *
3593
+ * Reads the structured JSON records `configureFileLogging` writes, filters them
3594
+ * the way the page does, and renders the same selection as markdown or JSON so
3595
+ * an export never disagrees with the page it was taken from.
3596
+ *
3597
+ * The page is **opt-in**: the payload carries tracebacks and request metadata,
3598
+ * so it only exists when a project passes a log directory to `makeAdminRouter`.
3599
+ */
3600
+ /** A parsed log record, as the panel reads it. */
3601
+ interface AdminLogEntry {
3602
+ /** Severity, when the record carries one. */
3603
+ level: string;
3604
+ /** The logger name. */
3605
+ logger: string;
3606
+ /** The message text. */
3607
+ message: string;
3608
+ /** ISO timestamp, when present. */
3609
+ timestamp: string;
3610
+ /** The stack trace, when the record carries one. */
3611
+ stack: string | null;
3612
+ /** Correlation fields worth showing next to the message. */
3613
+ context: Record<string, unknown>;
3614
+ /** Everything the record carried, verbatim. */
3615
+ raw: Record<string, unknown>;
3616
+ }
3617
+ /**
3618
+ * Normalize a raw JSON log line into the shape the page renders.
3619
+ *
3620
+ * @param raw - The parsed record.
3621
+ * @returns The normalized entry.
3622
+ */
3623
+ declare function toLogEntry(raw: Record<string, unknown>): AdminLogEntry;
3624
+ /**
3625
+ * Filter entries by a free-text term.
3626
+ *
3627
+ * Matches the message, the logger and the stack, because an operator hunting a
3628
+ * 500 usually has a fragment of the traceback, not of the message.
3629
+ *
3630
+ * @param entries - The entries to filter.
3631
+ * @param term - The search term; empty returns everything.
3632
+ * @returns The matching entries.
3633
+ */
3634
+ declare function filterLogEntries(entries: AdminLogEntry[], term: string): AdminLogEntry[];
3635
+ /**
3636
+ * Render entries as markdown, ready to paste into an issue.
3637
+ *
3638
+ * Each stack goes in a fenced block so it survives the paste with its
3639
+ * indentation intact, and the header declares the source, the filter and — when
3640
+ * the cap truncated the selection — how many records matched in total, so a
3641
+ * partial export never reads as a complete one.
3642
+ *
3643
+ * @param entries - The entries to render, newest first.
3644
+ * @param options - The source and search term the page had applied, and the
3645
+ * total number of matches before the cap.
3646
+ * @returns The markdown document.
3647
+ */
3648
+ declare function renderLogEntriesMarkdown(entries: AdminLogEntry[], options: {
3649
+ source: string;
3650
+ query: string;
3651
+ total: number;
3652
+ }): string;
3653
+ /**
3654
+ * Render entries as JSON, verbatim.
3655
+ *
3656
+ * @param entries - The entries to render, newest first.
3657
+ * @returns The JSON document, carrying every field the application logged.
3658
+ */
3659
+ declare function renderLogEntriesJson(entries: AdminLogEntry[]): string;
3660
+
3661
+ /**
3662
+ * A SQL console for the admin, with a policy in front of it — mirroring
3663
+ * `admin.sql_shell`.
3664
+ *
3665
+ * Every serious admin panel grows one of these, because eventually someone
3666
+ * needs an answer the list view cannot give. This is that console, plus the
3667
+ * guard rails to make it survivable.
3668
+ *
3669
+ * ## Read this before enabling it
3670
+ *
3671
+ * **A SQL filter in the application is defence in depth, not a security
3672
+ * boundary.** The analyser here parses statements properly (via
3673
+ * `node-sql-parser`) rather than matching strings, which stops the ordinary
3674
+ * mistakes: a `DROP` typed by someone who meant to `SELECT`, an `UPDATE` with
3675
+ * no `WHERE`, a query against a table holding card data. It will not stop a
3676
+ * determined operator with time — SQL has CTEs, subqueries, functions, dialect
3677
+ * extensions and comment tricks, and any parser-based allowlist is a game of
3678
+ * coverage.
3679
+ *
3680
+ * The boundary that actually holds is the **database user**. A role granted
3681
+ * only `SELECT` on three tables cannot `DROP` anything, whatever reaches it:
3682
+ *
3683
+ * ```sql
3684
+ * CREATE ROLE admin_console LOGIN PASSWORD '…';
3685
+ * GRANT CONNECT ON DATABASE app TO admin_console;
3686
+ * GRANT SELECT ON orders, customers, invoices TO admin_console;
3687
+ * ```
3688
+ *
3689
+ * Point the console's `run` at *that* connection, then use the policy to narrow
3690
+ * further and to produce a readable refusal instead of a database error. Used
3691
+ * that way the two layers complement each other. Used alone, the policy is a
3692
+ * speed bump.
3693
+ *
3694
+ * The console is **off by default**, and every attempt — allowed or refused —
3695
+ * reaches the audit hook.
3696
+ */
3697
+ /**
3698
+ * What a console may do, one statement family per member.
3699
+ *
3700
+ * Split the way an operator thinks about risk rather than the way SQL groups
3701
+ * keywords: `DELETE` is separate from `UPDATE` because losing rows and
3702
+ * corrupting them are different incidents, and `DROP` is separate from the rest
3703
+ * of DDL because it is the one nobody undoes.
3704
+ */
3705
+ declare const SqlCapability: {
3706
+ /** `SELECT`, `WITH … SELECT`, `EXPLAIN`, `SHOW`. */
3707
+ readonly READ: "read";
3708
+ /** Adds rows. */
3709
+ readonly INSERT: "insert";
3710
+ /** Changes rows. */
3711
+ readonly UPDATE: "update";
3712
+ /** Removes rows. */
3713
+ readonly DELETE: "delete";
3714
+ /** `CREATE` / `ALTER` / `COMMENT`. */
3715
+ readonly DDL: "ddl";
3716
+ /** `DROP` and `TRUNCATE`: irreversible structure loss. */
3717
+ readonly DROP: "drop";
3718
+ /**
3719
+ * `GRANT` / `REVOKE` / `SET`, and anything the analyser cannot classify.
3720
+ * Unknown statements land here on purpose, so a construct nobody anticipated
3721
+ * needs the most privileged capability rather than the least.
3722
+ */
3723
+ readonly ADMIN: "admin";
3724
+ };
3725
+ /** A {@link SqlCapability} value. */
3726
+ type SqlCapability = (typeof SqlCapability)[keyof typeof SqlCapability];
3727
+ /** What the analyser concluded about a submitted statement. */
3728
+ interface SqlAnalysis {
3729
+ /** How many statements the text carries. */
3730
+ statements: number;
3731
+ /** The capabilities the text needs, deduplicated. */
3732
+ capabilities: SqlCapability[];
3733
+ /** Tables the parser could name, lowercased. */
3734
+ tables: string[];
3735
+ /** Whether the parser understood the text at all. */
3736
+ parsed: boolean;
3737
+ /** Whether any statement mutates rows without a `WHERE`. */
3738
+ unscopedWrite: boolean;
3739
+ }
3740
+ /** The rules a console enforces before running anything. */
3741
+ interface SqlConsolePolicy {
3742
+ /** Capabilities the console may use. Default `["read"]`. */
3743
+ capabilities?: readonly SqlCapability[];
3744
+ /** When set, only these tables may be touched (lowercased comparison). */
3745
+ allowTables?: readonly string[];
3746
+ /** Tables that may never be touched, whatever `allowTables` says. */
3747
+ denyTables?: readonly string[];
3748
+ /** Refuse an `UPDATE`/`DELETE` with no `WHERE`. Default `true`. */
3749
+ requireWhereOnWrites?: boolean;
3750
+ /** Rows returned to the browser. Default `200`. */
3751
+ maxRows?: number;
3752
+ }
3753
+ /** One console attempt, handed to the audit hook whether or not it ran. */
3754
+ interface SqlAuditEntry {
3755
+ /** The submitted text, verbatim. */
3756
+ sql: string;
3757
+ /** The operator's display name. */
3758
+ principal: string;
3759
+ /** Whether the policy let it run. */
3760
+ allowed: boolean;
3761
+ /** Why it was refused, or `null` when it ran. */
3762
+ reason: string | null;
3763
+ /** What the analyser concluded. */
3764
+ analysis: SqlAnalysis;
3765
+ /** Wall-clock duration in milliseconds, or `null` when it never ran. */
3766
+ durationMs: number | null;
3767
+ /** Rows returned, or `null` when it never ran or returned none. */
3768
+ rowCount: number | null;
3769
+ }
3770
+ /** Called for every attempt, allowed or refused. */
3771
+ type SqlAuditHook = (entry: SqlAuditEntry) => void | Promise<void>;
3772
+ /** The subset of `node-sql-parser` this module uses. */
3773
+ interface SqlParser {
3774
+ astify(sql: string, options: {
3775
+ database: string;
3776
+ }): unknown;
3777
+ tableList(sql: string, options: {
3778
+ database: string;
3779
+ }): string[];
3780
+ }
3781
+ /**
3782
+ * Load `node-sql-parser`, or throw an error naming the install command.
3783
+ *
3784
+ * @returns A parser instance.
3785
+ * @throws Error When the optional peer is not installed.
3786
+ */
3787
+ declare function loadSqlParser(): Promise<SqlParser>;
3788
+ /**
3789
+ * Classify a submitted statement.
3790
+ *
3791
+ * Text the parser cannot understand is not rejected here — it comes back as
3792
+ * `parsed: false` needing {@link SqlCapability.ADMIN}, so an unanticipated
3793
+ * construct requires the most privileged capability instead of slipping through
3794
+ * as the least.
3795
+ *
3796
+ * @param sql - The submitted text.
3797
+ * @param dialect - The parser dialect (`postgresql`, `sqlite`, `mysql`, …).
3798
+ * @param parser - The loaded parser.
3799
+ * @returns What the text needs and touches.
3800
+ */
3801
+ declare function analyzeSql(sql: string, dialect: string, parser: SqlParser): SqlAnalysis;
3802
+ /**
3803
+ * Decide whether a policy lets an analysed statement run.
3804
+ *
3805
+ * @param analysis - What the analyser concluded.
3806
+ * @param policy - The console's rules.
3807
+ * @returns The verdict and, on refusal, a reason the operator can act on.
3808
+ */
3809
+ declare function checkSqlPolicy(analysis: SqlAnalysis, policy: SqlConsolePolicy): {
3810
+ allowed: boolean;
3811
+ reason: string | null;
3812
+ };
3813
+
3814
+ /**
3815
+ * Related child models surfaced on a parent's detail view — Django's
3816
+ * `TabularInline` analog, mirroring `admin.config.Inline`.
3817
+ *
3818
+ * An inline lists the child rows that point back at the record being viewed,
3819
+ * so an order shows its line items and a user shows their API keys without a
3820
+ * round trip to another screen. A read-only inline renders a compact table with
3821
+ * links into the child's own admin; an `editable` one renders the same rows as
3822
+ * an in-place formset — one input row per child plus a blank row to add
3823
+ * another — that posts back to the parent.
3824
+ */
3825
+
3826
+ /** Options accepted by {@link adminInline}. */
3827
+ interface AdminInlineOptions {
3828
+ /** The child model class. */
3829
+ model: ModelClass;
3830
+ /** The child column referencing the parent. */
3831
+ fkField: string;
3832
+ /**
3833
+ * Columns to show. Falls back to the child admin's `listDisplay`, then to
3834
+ * every column the child declares.
3835
+ */
3836
+ listDisplay?: readonly string[];
3837
+ /** Section heading. Defaults to the child's plural display name. */
3838
+ label?: string;
3839
+ /** Render the rows as an editable in-place formset. Default `false`. */
3840
+ editable?: boolean;
3841
+ /**
3842
+ * Add a per-row delete checkbox. Editable inlines only, and still gated on
3843
+ * the child admin's `canDelete`. Default `false`.
3844
+ */
3845
+ canDelete?: boolean;
3846
+ }
3847
+ /** A configured inline. */
3848
+ interface AdminInline {
3849
+ /** The child model class. */
3850
+ model: ModelClass;
3851
+ /** The child admin slug — the child model's table name. */
3852
+ slug: string;
3853
+ /** The child column referencing the parent. */
3854
+ fkField: string;
3855
+ /** Columns to show, or `null` to fall back to the child admin's. */
3856
+ listDisplay: string[] | null;
3857
+ /** Section heading, or `null` to derive one. */
3858
+ label: string | null;
3859
+ /** Whether the rows render as an editable formset. */
3860
+ editable: boolean;
3861
+ /** Whether an editable row offers a delete checkbox. */
3862
+ canDelete: boolean;
3863
+ }
3864
+ /**
3865
+ * Describe a related child model to surface on a parent's detail view.
3866
+ *
3867
+ * @param options - Child model, the column pointing back at the parent, and
3868
+ * the presentation flags.
3869
+ * @returns The inline descriptor to pass to `AdminModel({ inlines: [...] })`.
3870
+ * @throws Error When the child model declares no table name.
3871
+ */
3872
+ declare function adminInline(options: AdminInlineOptions): AdminInline;
3873
+
3589
3874
  /**
3590
3875
  * Named, saved list-view presets — Laravel Nova's "lenses", mirroring
3591
3876
  * `admin.config.Lens`.
@@ -3914,6 +4199,11 @@ interface AdminModelOptions<C extends ModelClass> {
3914
4199
  * of every related row — for target tables too large to pre-load.
3915
4200
  */
3916
4201
  autocompleteFields?: readonly string[];
4202
+ /**
4203
+ * Related child models listed on this model's detail view. Each shows the
4204
+ * rows pointing back through its `fkField`.
4205
+ */
4206
+ inlines?: readonly AdminInline[];
3917
4207
  }
3918
4208
  /**
3919
4209
  * The admin configuration for one model.
@@ -3963,6 +4253,8 @@ declare class AdminModel<C extends ModelClass = ModelClass> {
3963
4253
  readonly canImport: boolean;
3964
4254
  /** Foreign-key columns rendered as a typed search box. */
3965
4255
  readonly autocompleteFields: string[];
4256
+ /** Related child models listed on the detail view. */
4257
+ readonly inlines: AdminInline[];
3966
4258
  private readonly actions;
3967
4259
  private readonly slugOverride;
3968
4260
  private readonly listDisplayOverride;
@@ -4330,6 +4622,11 @@ interface ParseFormBodyOptions {
4330
4622
  * key already — so it reads them like any other string column.
4331
4623
  */
4332
4624
  uploadsAsText?: boolean;
4625
+ /**
4626
+ * Restrict parsing to these columns. An inline formset uses it to keep the
4627
+ * foreign key pointing at the parent out of the operator's reach.
4628
+ */
4629
+ only?: readonly string[];
4333
4630
  }
4334
4631
  /** Options for {@link buildFormFields}. */
4335
4632
  interface BuildFormFieldsOptions {
@@ -4866,6 +5163,8 @@ interface AdminRenderContext {
4866
5163
  currentPath: string;
4867
5164
  /** Sidebar entries, one per registered model. */
4868
5165
  navModels: AdminNavEntry[];
5166
+ /** Sidebar entries for the system tools (logs, SQL console). */
5167
+ navSystem: AdminNavEntry[];
4869
5168
  /** Banners rendered above the content. */
4870
5169
  messages: AdminMessage[];
4871
5170
  }
@@ -5071,6 +5370,40 @@ interface AdminAuditView {
5071
5370
  /** The change timeline, newest first. Empty when there is none to show. */
5072
5371
  history: AdminAuditEntryView[];
5073
5372
  }
5373
+ /** One row inside an inline block. */
5374
+ interface AdminInlineRowView {
5375
+ /** Row key — the child's identity, or `new<n>` for the blank add row. */
5376
+ key: string;
5377
+ /** Formatted cells, for a read-only inline. */
5378
+ cells: string[];
5379
+ /** Editable controls, for an editable inline. */
5380
+ fields: AdminFormField[];
5381
+ /** Link into the child's own admin, or `null` when it has none. */
5382
+ url: string | null;
5383
+ }
5384
+ /** A related-child block on the detail view. */
5385
+ interface AdminInlineView {
5386
+ /** Section heading. */
5387
+ label: string;
5388
+ /** How many child rows exist in total. */
5389
+ total: number;
5390
+ /** Column headings. */
5391
+ columns: string[];
5392
+ /** Whether the rows render as an editable formset. */
5393
+ editable: boolean;
5394
+ /** Whether an editable row offers a delete checkbox. */
5395
+ canDelete: boolean;
5396
+ /** URL of the child's create form, pre-filled with the parent key. */
5397
+ addUrl: string | null;
5398
+ /** URL the formset posts to. */
5399
+ formAction: string;
5400
+ /** The child rows. */
5401
+ rows: AdminInlineRowView[];
5402
+ /** The blank add row, for an editable inline. */
5403
+ newRow: AdminInlineRowView | null;
5404
+ /** Whether more rows exist than the block renders. */
5405
+ truncated: boolean;
5406
+ }
5074
5407
  /** The view model the detail page renders. */
5075
5408
  interface AdminDetailView {
5076
5409
  /** Singular display name. */
@@ -5090,6 +5423,10 @@ interface AdminDetailView {
5090
5423
  deleteUrl: string | null;
5091
5424
  /** The audit panel, or `null` when the model carries no audit columns. */
5092
5425
  audit: AdminAuditView | null;
5426
+ /** Related-child blocks rendered below the fields. */
5427
+ inlines: AdminInlineView[];
5428
+ /** A form-level error from an inline submission, or `null`. */
5429
+ inlineError: string | null;
5093
5430
  }
5094
5431
  /**
5095
5432
  * Render the single-record detail view.
@@ -5124,6 +5461,93 @@ interface AdminFormView {
5124
5461
  * @throws Error When called without a session, since the form needs a CSRF token.
5125
5462
  */
5126
5463
  declare function renderFormPage(context: AdminRenderContext, view: AdminFormView): string;
5464
+ /** One row of the logs page. */
5465
+ interface AdminLogRowView {
5466
+ /** Severity, lowercased, driving the badge colour. */
5467
+ level: string;
5468
+ /** ISO timestamp, or `""`. */
5469
+ timestamp: string;
5470
+ /** Logger name. */
5471
+ logger: string;
5472
+ /** Message text. */
5473
+ message: string;
5474
+ /** Stack trace, or `null` when the record carries none. */
5475
+ stack: string | null;
5476
+ /** Correlation fields, already formatted as `key: value` pairs. */
5477
+ context: {
5478
+ key: string;
5479
+ value: string;
5480
+ }[];
5481
+ }
5482
+ /** The view model the logs page renders. */
5483
+ interface AdminLogsView {
5484
+ /** Available source selectors. */
5485
+ sources: {
5486
+ value: string;
5487
+ label: string;
5488
+ selected: boolean;
5489
+ }[];
5490
+ /** The current search term. */
5491
+ query: string;
5492
+ /** The rows on this page, newest first. */
5493
+ rows: AdminLogRowView[];
5494
+ /** Total matching records. */
5495
+ total: number;
5496
+ /** Current page, 1-based. */
5497
+ page: number;
5498
+ /** Total pages. */
5499
+ pages: number;
5500
+ /** URL of the previous page, or `null`. */
5501
+ prevUrl: string | null;
5502
+ /** URL of the next page, or `null`. */
5503
+ nextUrl: string | null;
5504
+ /** URL exporting the current selection as markdown. */
5505
+ exportMarkdownUrl: string;
5506
+ /** URL exporting the current selection as JSON. */
5507
+ exportJsonUrl: string;
5508
+ /** Cap the export applies. */
5509
+ exportMax: number;
5510
+ }
5511
+ /**
5512
+ * Render the application-logs page.
5513
+ *
5514
+ * A record carrying a stack becomes a `<details>` whose summary is the message
5515
+ * itself, collapsed by default: a page full of 500s has to stay scannable, and
5516
+ * that needs no JavaScript.
5517
+ *
5518
+ * @param context - The shared chrome data.
5519
+ * @param view - The prepared logs view model.
5520
+ * @returns The full page.
5521
+ */
5522
+ declare function renderLogsPage(context: AdminRenderContext, view: AdminLogsView): string;
5523
+ /** The view model the SQL console renders. */
5524
+ interface AdminSqlView {
5525
+ /** The submitted statement, echoed back into the textarea. */
5526
+ sql: string;
5527
+ /** Capabilities this console is allowed to use. */
5528
+ capabilities: string[];
5529
+ /** A refusal or execution error, or `null`. */
5530
+ error: string | null;
5531
+ /** Column names of the result, when one ran. */
5532
+ columns: string[];
5533
+ /** Result rows, already formatted. */
5534
+ rows: string[][];
5535
+ /** Rows returned, or `null` when nothing ran. */
5536
+ rowCount: number | null;
5537
+ /** Whether the result was truncated by the row cap. */
5538
+ truncated: boolean;
5539
+ /** Wall-clock duration in milliseconds, or `null`. */
5540
+ durationMs: number | null;
5541
+ }
5542
+ /**
5543
+ * Render the SQL console.
5544
+ *
5545
+ * @param context - The shared chrome data (with an active session).
5546
+ * @param view - The prepared console view model.
5547
+ * @returns The full page.
5548
+ * @throws Error When called without a session, since the form needs a CSRF token.
5549
+ */
5550
+ declare function renderSqlPage(context: AdminRenderContext, view: AdminSqlView): string;
5127
5551
  /** The outcome of a CSV import, as the page renders it. */
5128
5552
  interface AdminImportView {
5129
5553
  /** Plural display name of the model being imported into. */
@@ -5218,6 +5642,33 @@ interface AdminRouterOptions {
5218
5642
  accessPolicy?: AdminAccessPolicy;
5219
5643
  /** Largest upload the panel accepts, in bytes. Default `10485760` (10 MB). */
5220
5644
  maxUploadBytes?: number;
5645
+ /**
5646
+ * Expose the application-logs page, reading the JSON files
5647
+ * `configureFileLogging` writes to this directory. Omitted keeps the page
5648
+ * off: the payload carries tracebacks and request metadata.
5649
+ */
5650
+ logDir?: string;
5651
+ /**
5652
+ * Expose the SQL console. Omitted keeps it off. Read the guard rails in
5653
+ * `@/admin/sqlConsole` before enabling it: the policy is defence in depth,
5654
+ * and the boundary that holds is the database user behind `run`.
5655
+ */
5656
+ sqlConsole?: AdminSqlConsoleOptions;
5657
+ }
5658
+ /** Configuration for the optional SQL console. */
5659
+ interface AdminSqlConsoleOptions {
5660
+ /** The rules enforced before anything runs. Defaults to read-only. */
5661
+ policy?: SqlConsolePolicy;
5662
+ /**
5663
+ * Executes an approved statement. Omitted runs it on the request's own
5664
+ * session — point this at a restricted database role instead whenever the
5665
+ * console can do more than read.
5666
+ */
5667
+ run?: (sql: string, session: AsyncSession) => Promise<Record<string, unknown>[]>;
5668
+ /** Parser dialect. Default `"postgresql"`. */
5669
+ dialect?: string;
5670
+ /** Called for every attempt, allowed or refused. */
5671
+ onAudit?: SqlAuditHook;
5221
5672
  }
5222
5673
  /**
5223
5674
  * Build the admin panel router.
@@ -5228,6 +5679,20 @@ interface AdminRouterOptions {
5228
5679
  * @throws Error When the signing key is shorter than 32 characters.
5229
5680
  */
5230
5681
  declare function makeAdminRouter(site: AdminSite, options: AdminRouterOptions): Router;
5682
+ /**
5683
+ * Group a posted formset body by row key.
5684
+ *
5685
+ * Inputs arrive named `row.<key>.<column>`, plus `row.<key>.__delete` for the
5686
+ * per-row delete checkbox. Anything else in the body — the CSRF token — is
5687
+ * ignored here.
5688
+ *
5689
+ * @param body - The parsed request body.
5690
+ * @returns The values keyed by row, and the row keys marked for deletion.
5691
+ */
5692
+ declare function groupInlineSubmission(body: Record<string, unknown>): {
5693
+ rows: Record<string, Record<string, string>>;
5694
+ deletions: Set<string>;
5695
+ };
5231
5696
  /**
5232
5697
  * Parse a CSV document into one record per row, keyed by the header.
5233
5698
  *
@@ -6949,6 +7414,18 @@ interface LogsRouterOptions {
6949
7414
  /** Middlewares run before the handler (e.g. a token guard). */
6950
7415
  guards?: RequestHandler[];
6951
7416
  }
7417
+ /**
7418
+ * Read and parse the structured log records a source selector covers.
7419
+ *
7420
+ * Shared by the JSON logs endpoint and the admin panel's logs page so the two
7421
+ * never disagree about what "the error log" contains. A corrupt line is skipped
7422
+ * rather than failing the read: one bad write should not hide the rest.
7423
+ *
7424
+ * @param dir - The log directory.
7425
+ * @param source - Which file(s) to read.
7426
+ * @returns The parsed records, in file order (oldest first).
7427
+ */
7428
+ declare function readLogEntries(dir: string, source: LogSource): Promise<Record<string, unknown>[]>;
6952
7429
  /**
6953
7430
  * Build a router serving `GET <path>` with query params `source`, `page` and
6954
7431
  * `pageSize`. Returns `{ items, total, page, pageSize, pages }`, newest first.
@@ -7013,6 +7490,6 @@ declare function createTestDatabase(models: readonly ModelClass[]): TestDatabase
7013
7490
  declare function withTestDatabase<T>(models: readonly ModelClass[], fn: (db: TestDatabase) => Promise<T>): Promise<T>;
7014
7491
 
7015
7492
  /** The installed SDK version. Single source of truth for the barrel + CLI. */
7016
- declare const VERSION = "0.27.0";
7493
+ declare const VERSION = "0.29.0";
7017
7494
 
7018
- 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 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, 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, 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 };
7495
+ 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 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 SqlAnalysis, type SqlAuditEntry, type SqlAuditHook, SqlCapability, type SqlConsolePolicy, 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, 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, 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 };