tempest-express-sdk 0.25.0 → 0.27.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
@@ -3492,6 +3492,144 @@ declare class MessagingHub {
3492
3492
  broadcast(channel: string, recipients: string[], text: string, options?: BroadcastOptions): Promise<BroadcastResult[]>;
3493
3493
  }
3494
3494
 
3495
+ /**
3496
+ * Business-metric cards for the admin dashboard, mirroring `admin.dashboard`.
3497
+ *
3498
+ * Distinct from the system panel (CPU/memory): these are value / trend /
3499
+ * partition cards computed from the application's own data — "orders today",
3500
+ * "revenue vs last week", "users by plan". Register them on the
3501
+ * {@link AdminSite} and they render above the model cards.
3502
+ *
3503
+ * ```ts
3504
+ * const site = new AdminSite({
3505
+ * title: "Shop",
3506
+ * dashboardCards: [
3507
+ * metricCard("Orders today", async (session) => ({
3508
+ * kind: "value",
3509
+ * value: await new BaseRepository(OrderModel, session).count(),
3510
+ * unit: "orders",
3511
+ * })),
3512
+ * ],
3513
+ * });
3514
+ * ```
3515
+ */
3516
+
3517
+ /** A single headline number. */
3518
+ interface MetricValue {
3519
+ kind: "value";
3520
+ /** The value to show — a number, or a preformatted string. */
3521
+ value: number | string;
3522
+ /** Optional unit suffix (`"orders"`, `"BRL"`). */
3523
+ unit?: string;
3524
+ }
3525
+ /** A number compared against a previous period. */
3526
+ interface MetricTrend {
3527
+ kind: "trend";
3528
+ /** The current value. */
3529
+ value: number;
3530
+ /** The value for the comparison period. */
3531
+ previous: number;
3532
+ /** Optional unit suffix. */
3533
+ unit?: string;
3534
+ }
3535
+ /** A breakdown of a total across labeled segments. */
3536
+ interface MetricPartition {
3537
+ kind: "partition";
3538
+ /** `(label, value)` pairs. */
3539
+ segments: {
3540
+ label: string;
3541
+ value: number;
3542
+ }[];
3543
+ }
3544
+ /** What a card's `compute` returns. */
3545
+ type CardData = MetricValue | MetricTrend | MetricPartition;
3546
+ /** Async function computing one card from a DB session. */
3547
+ type CardCompute = (session: AsyncSession) => Promise<CardData>;
3548
+ /** A dashboard business-metric card. */
3549
+ interface MetricCard {
3550
+ /** The card heading. */
3551
+ label: string;
3552
+ /** Async function returning the card data. */
3553
+ compute: CardCompute;
3554
+ /** Optional sub-label shown under the value. */
3555
+ helpText?: string;
3556
+ }
3557
+ /**
3558
+ * Describe a dashboard card.
3559
+ *
3560
+ * @param label - The card heading.
3561
+ * @param compute - Async function returning the card data.
3562
+ * @param helpText - Optional sub-label.
3563
+ * @returns The card descriptor to pass to `new AdminSite({ dashboardCards })`.
3564
+ */
3565
+ declare function metricCard(label: string, compute: CardCompute, helpText?: string): MetricCard;
3566
+ /**
3567
+ * Return the percentage change a trend represents.
3568
+ *
3569
+ * @param trend - The computed trend.
3570
+ * @returns `delta / previous * 100`, or `null` when there is no baseline to
3571
+ * divide by — a percentage against zero is undefined, not infinite.
3572
+ */
3573
+ declare function trendPercent(trend: MetricTrend): number | null;
3574
+ /**
3575
+ * Return which way a trend moved.
3576
+ *
3577
+ * @param trend - The computed trend.
3578
+ * @returns `"up"`, `"down"` or `"flat"`.
3579
+ */
3580
+ declare function trendDirection(trend: MetricTrend): "up" | "down" | "flat";
3581
+ /**
3582
+ * Return the sum of a partition's segment values.
3583
+ *
3584
+ * @param partition - The computed partition.
3585
+ * @returns The total across segments.
3586
+ */
3587
+ declare function partitionTotal(partition: MetricPartition): number;
3588
+
3589
+ /**
3590
+ * Named, saved list-view presets — Laravel Nova's "lenses", mirroring
3591
+ * `admin.config.Lens`.
3592
+ *
3593
+ * A lens bundles a set of filters and an optional ordering under a label. On
3594
+ * the list view lenses render as tabs; clicking one applies its filters (ANDed
3595
+ * with whatever the operator typed) and its ordering. A "support triage" lens
3596
+ * pinning `{ status: "open", priority: { gte: 3 } }` sorted oldest-first gets
3597
+ * an operator to the working set in one click instead of re-entering filters
3598
+ * every morning.
3599
+ */
3600
+
3601
+ /** Options accepted by {@link adminLens}. */
3602
+ interface AdminLensOptions {
3603
+ /** Lens identifier; its slug is the `?lens=` value. */
3604
+ name: string;
3605
+ /** Conditions merged into the query, in repository `where` shape. */
3606
+ filters?: WhereInput<Record<string, unknown>>;
3607
+ /** Ordering column; prefix with `-` for descending. */
3608
+ orderBy?: string;
3609
+ /** Tab label. Defaults to `name`. */
3610
+ label?: string;
3611
+ }
3612
+ /** A registered lens. */
3613
+ interface AdminLens {
3614
+ /** Lens identifier. */
3615
+ name: string;
3616
+ /** URL slug — the `?lens=` value. */
3617
+ slug: string;
3618
+ /** Tab label. */
3619
+ label: string;
3620
+ /** Conditions merged into the query. */
3621
+ filters: WhereInput<Record<string, unknown>>;
3622
+ /** Ordering column, or `null`. `-column` means descending. */
3623
+ orderBy: string | null;
3624
+ }
3625
+ /**
3626
+ * Describe a saved list-view preset.
3627
+ *
3628
+ * @param options - Name, filters, ordering and label.
3629
+ * @returns The lens descriptor to pass to `AdminModel({ lenses: [...] })`.
3630
+ */
3631
+ declare function adminLens(options: AdminLensOptions): AdminLens;
3632
+
3495
3633
  /**
3496
3634
  * Signed-cookie sessions for the admin panel, mirroring `admin.session`.
3497
3635
  *
@@ -3702,97 +3840,6 @@ interface BulkActionOption {
3702
3840
  dangerous: boolean;
3703
3841
  }
3704
3842
 
3705
- /**
3706
- * Column introspection for the admin panel, mirroring `admin.forms`' widget
3707
- * derivation.
3708
- *
3709
- * `tempest-db-js` keeps rich runtime metadata on every column — the canonical
3710
- * type kind, enum members, `varchar` length, the not-null/default/primary-key
3711
- * flags and the foreign-key reference — so the admin derives its form widgets
3712
- * and list filters from the model itself instead of asking the project to
3713
- * restate them. Kept separate from the router so the (fiddly) type handling is
3714
- * unit-testable in isolation.
3715
- */
3716
-
3717
- /** The set of form controls the admin knows how to render. */
3718
- type AdminWidget = "text" | "textarea" | "number" | "checkbox" | "datetime" | "date" | "time" | "select" | "json";
3719
- /** A `(value, label)` pair for a `select` widget. */
3720
- interface AdminSelectOption {
3721
- value: string;
3722
- label: string;
3723
- }
3724
- /** The widget a column maps to, plus the attributes that render it. */
3725
- interface WidgetSpec {
3726
- /** The control to render. */
3727
- widget: AdminWidget;
3728
- /** `step` attribute for `number` widgets, or `null`. */
3729
- step: string | null;
3730
- /** Options for `select` widgets (empty otherwise). */
3731
- options: AdminSelectOption[];
3732
- }
3733
- /** How a column is surfaced in the list view's filter bar. */
3734
- type AdminFilterKind = "select" | "daterange" | "text";
3735
- /**
3736
- * Humanize a column key into a form label (`lastLoginAt` → `Last Login At`).
3737
- *
3738
- * @param name - The column key.
3739
- * @returns A title-cased label.
3740
- */
3741
- declare function humanizeField(name: string): string;
3742
- /**
3743
- * Return every column of a model, keyed by field name in declaration order.
3744
- *
3745
- * @param model - The model class.
3746
- * @returns The column map (do not mutate).
3747
- */
3748
- declare function adminColumns(model: ModelClass): Record<string, Column<unknown>>;
3749
- /**
3750
- * Map a column to the widget that edits it.
3751
- *
3752
- * `json` is matched before anything else because a JSON column carries no
3753
- * useful scalar type, and `enum` is matched before the string kinds so its
3754
- * members become a dropdown rather than a free-text input.
3755
- *
3756
- * @param column - The column to inspect.
3757
- * @returns The widget, its `number` step (or `null`) and its `select` options.
3758
- */
3759
- declare function widgetForColumn(column: Column<unknown>): WidgetSpec;
3760
- /**
3761
- * Whether a column may be left blank on submit — it is nullable, carries a
3762
- * default, or is the primary key the database fills in.
3763
- *
3764
- * @param column - The column to inspect.
3765
- * @returns `true` when the field is optional.
3766
- */
3767
- declare function isColumnOptional(column: Column<unknown>): boolean;
3768
- /**
3769
- * Map a column to the filter control the list view shows for it.
3770
- *
3771
- * Booleans and enums become dropdowns, date-like columns become a from/to pair
3772
- * of date inputs, and anything else falls back to an equality text input.
3773
- *
3774
- * @param column - The column to inspect.
3775
- * @returns The filter kind and, for `select`, its options.
3776
- */
3777
- declare function filterForColumn(column: Column<unknown>): {
3778
- kind: AdminFilterKind;
3779
- options: AdminSelectOption[];
3780
- };
3781
- /**
3782
- * Return the table a column points at, when it carries a foreign key.
3783
- *
3784
- * @param column - The column to inspect.
3785
- * @returns The referenced table name, or `null` for a plain column.
3786
- */
3787
- declare function foreignKeyTable(column: Column<unknown>): string | null;
3788
- /**
3789
- * Whether a column holds free text a `LIKE '%…%'` search can match.
3790
- *
3791
- * @param column - The column to inspect.
3792
- * @returns `true` for `varchar` / `text` / `char` columns.
3793
- */
3794
- declare function isSearchableColumn(column: Column<unknown>): boolean;
3795
-
3796
3843
  /**
3797
3844
  * Declarative admin configuration for one model, mirroring `admin.config`.
3798
3845
  *
@@ -3839,6 +3886,34 @@ interface AdminModelOptions<C extends ModelClass> {
3839
3886
  * delete and runs against the checked rows.
3840
3887
  */
3841
3888
  actions?: readonly AdminAction<C>[];
3889
+ /**
3890
+ * Audit-log model backing the detail view's change timeline. Pair it with a
3891
+ * repository that actually writes the rows — the panel only reads them.
3892
+ */
3893
+ auditModel?: ModelClass;
3894
+ /**
3895
+ * Saved list-view presets rendered as tabs above the table, each applying
3896
+ * its filters and ordering through `?lens=<slug>`.
3897
+ */
3898
+ lenses?: readonly AdminLens[];
3899
+ /**
3900
+ * String columns rendered as file inputs. The uploaded file is written
3901
+ * through `uploadStorage` and the returned storage key goes in the column.
3902
+ */
3903
+ uploadFields?: readonly string[];
3904
+ /** Backend persisting uploaded files. Required when `uploadFields` is set. */
3905
+ uploadStorage?: UploadStorage;
3906
+ /**
3907
+ * Expose the CSV import page (`GET/POST {prefix}/m/{slug}/import`), which
3908
+ * bulk-creates rows from an uploaded file. Default `false`; also requires
3909
+ * `canCreate`.
3910
+ */
3911
+ canImport?: boolean;
3912
+ /**
3913
+ * Foreign-key columns rendered as a typed search box instead of a `<select>`
3914
+ * of every related row — for target tables too large to pre-load.
3915
+ */
3916
+ autocompleteFields?: readonly string[];
3842
3917
  }
3843
3918
  /**
3844
3919
  * The admin configuration for one model.
@@ -3876,6 +3951,18 @@ declare class AdminModel<C extends ModelClass = ModelClass> {
3876
3951
  readonly canEdit: boolean;
3877
3952
  /** Whether the delete action is exposed. */
3878
3953
  readonly canDelete: boolean;
3954
+ /** Audit-log model backing the detail timeline, or `null`. */
3955
+ readonly auditModel: ModelClass | null;
3956
+ /** Saved list-view presets, in declaration order. */
3957
+ readonly lenses: AdminLens[];
3958
+ /** Columns rendered as file inputs. */
3959
+ readonly uploadFields: string[];
3960
+ /** Backend persisting uploaded files, or `null`. */
3961
+ readonly uploadStorage: UploadStorage | null;
3962
+ /** Whether the CSV import page is exposed. */
3963
+ readonly canImport: boolean;
3964
+ /** Foreign-key columns rendered as a typed search box. */
3965
+ readonly autocompleteFields: string[];
3879
3966
  private readonly actions;
3880
3967
  private readonly slugOverride;
3881
3968
  private readonly listDisplayOverride;
@@ -3919,6 +4006,20 @@ declare class AdminModel<C extends ModelClass = ModelClass> {
3919
4006
  * @returns The configured `listDisplay`, or every column but the password hash.
3920
4007
  */
3921
4008
  listDisplayNames(): string[];
4009
+ /**
4010
+ * Look a lens up by its slug.
4011
+ *
4012
+ * @param slug - The `?lens=` value.
4013
+ * @returns The lens, or `null` when nothing matches.
4014
+ */
4015
+ getLens(slug: string): AdminLens | null;
4016
+ /**
4017
+ * Return the audit/timestamp columns the model actually declares.
4018
+ *
4019
+ * @returns The subset of `createdAt` / `updatedAt` / `createdBy` /
4020
+ * `updatedBy` present on the model, in that order.
4021
+ */
4022
+ auditFieldNames(): string[];
3922
4023
  /**
3923
4024
  * Return the columns the detail view renders.
3924
4025
  *
@@ -3927,7 +4028,11 @@ declare class AdminModel<C extends ModelClass = ModelClass> {
3927
4028
  * where an operator goes to see the whole record, so trimming it there would
3928
4029
  * hide data with nowhere else to read it.
3929
4030
  *
3930
- * @returns Every column but the password hash, in declaration order.
4031
+ * The audit/timestamp columns are held back too — they render in the detail
4032
+ * view's own audit panel, next to the change history, rather than scattered
4033
+ * among the domain fields.
4034
+ *
4035
+ * @returns Every domain column, in declaration order.
3931
4036
  */
3932
4037
  detailFieldNames(): string[];
3933
4038
  /**
@@ -3966,6 +4071,213 @@ declare class AdminModel<C extends ModelClass = ModelClass> {
3966
4071
  /** The row type a configured {@link AdminModel} reads and writes. */
3967
4072
  type AdminRow<A> = A extends AdminModel<infer C> ? InferModel<C> : never;
3968
4073
 
4074
+ /**
4075
+ * Granular per-model, per-action access control, mirroring
4076
+ * `admin.permissions`.
4077
+ *
4078
+ * Out of the box every operator who can sign in (`isAdmin`) can do everything
4079
+ * the {@link AdminModel} flags allow. To narrow a principal to a subset of
4080
+ * models or actions — a "support" role that may view orders but never delete
4081
+ * them, an "editor" who may touch content models only — hand an
4082
+ * {@link AdminAccessPolicy} to `makeAdminRouter`.
4083
+ *
4084
+ * ```ts
4085
+ * const policy: AdminAccessPolicy = (user, admin, action) => {
4086
+ * if (user.role === "superadmin") return true;
4087
+ * if (user.role === "support") return action === AdminPermission.VIEW;
4088
+ * return false;
4089
+ * };
4090
+ *
4091
+ * makeAdminRouter(site, { ..., accessPolicy: policy });
4092
+ * ```
4093
+ *
4094
+ * The policy **composes with** the `canCreate` / `canEdit` / `canDelete` flags
4095
+ * rather than replacing them: both have to allow an action. A denied `VIEW`
4096
+ * also hides the model from the dashboard and the sidebar, so an operator is
4097
+ * never shown a door that will answer `403`.
4098
+ */
4099
+
4100
+ /** An admin action gated by an {@link AdminAccessPolicy}. */
4101
+ declare const AdminPermission: {
4102
+ readonly VIEW: "view";
4103
+ readonly CREATE: "create";
4104
+ readonly EDIT: "edit";
4105
+ readonly DELETE: "delete";
4106
+ };
4107
+ /** An {@link AdminPermission} value. */
4108
+ type AdminPermission = (typeof AdminPermission)[keyof typeof AdminPermission];
4109
+ /**
4110
+ * Decides whether `principal` may perform `action` on the model behind
4111
+ * `admin`. Sync or async; return truthy to allow.
4112
+ */
4113
+ type AdminAccessPolicy = (principal: unknown, admin: AdminModel, action: AdminPermission) => boolean | Promise<boolean>;
4114
+
4115
+ /**
4116
+ * Multipart form parsing for the admin's upload and import screens.
4117
+ *
4118
+ * The panel's ordinary forms are `application/x-www-form-urlencoded`, which
4119
+ * Express parses on its own. A form carrying a file is `multipart/form-data`,
4120
+ * which it does not — so this module wraps `busboy`, the streaming parser
4121
+ * behind most of the Node ecosystem's upload middleware.
4122
+ *
4123
+ * `busboy` is an **optional peer**: only a project that configures
4124
+ * `uploadFields` or `canImport` needs it, and the error below says exactly what
4125
+ * to install. Multipart is a wire format with a long tail of correctness
4126
+ * (boundary handling, transfer encodings, filename escaping) — the kind of
4127
+ * parser this SDK depends on rather than reimplements.
4128
+ */
4129
+
4130
+ /** One uploaded file, buffered in memory. */
4131
+ interface UploadedFile {
4132
+ /** The form field the file arrived on. */
4133
+ field: string;
4134
+ /** The client-supplied filename, already stripped of any path. */
4135
+ filename: string;
4136
+ /** The declared MIME type. */
4137
+ contentType: string;
4138
+ /** The file bytes. */
4139
+ data: Buffer;
4140
+ }
4141
+ /** The result of parsing a multipart body. */
4142
+ interface ParsedMultipart {
4143
+ /** Text fields, keyed by name. A repeated field keeps its last value. */
4144
+ fields: Record<string, string>;
4145
+ /** Uploaded files that carried a filename and at least one byte. */
4146
+ files: UploadedFile[];
4147
+ }
4148
+ /** Options for {@link parseMultipart}. */
4149
+ interface ParseMultipartOptions {
4150
+ /** Reject a file larger than this many bytes. Default `10 * 1024 * 1024`. */
4151
+ maxFileBytes?: number;
4152
+ /** Reject more than this many files in one submission. Default `10`. */
4153
+ maxFiles?: number;
4154
+ }
4155
+ /**
4156
+ * Raised when a submission exceeds a configured multipart limit.
4157
+ *
4158
+ * Distinct from a parse failure so the caller can turn it into a `400` with a
4159
+ * message the operator can act on ("the file is too large") instead of a
4160
+ * generic failure.
4161
+ */
4162
+ declare class MultipartLimitError extends Error {
4163
+ /**
4164
+ * @param message - The operator-facing explanation.
4165
+ */
4166
+ constructor(message: string);
4167
+ }
4168
+ /**
4169
+ * Parse a `multipart/form-data` request body.
4170
+ *
4171
+ * Files are buffered in memory, which is what the admin needs — an operator
4172
+ * attaching a document or a CSV, not a streaming ingest path — and bounded by
4173
+ * `maxFileBytes` so a large upload cannot exhaust the process.
4174
+ *
4175
+ * @param req - The inbound request.
4176
+ * @param options - Size and count limits.
4177
+ * @returns The text fields and the uploaded files.
4178
+ * @throws MultipartLimitError When a limit is exceeded.
4179
+ * @throws Error When `busboy` is missing or the body is not valid multipart.
4180
+ */
4181
+ declare function parseMultipart(req: Request, options?: ParseMultipartOptions): Promise<ParsedMultipart>;
4182
+ /**
4183
+ * Whether a request carries a multipart body.
4184
+ *
4185
+ * @param req - The inbound request.
4186
+ * @returns `true` when the content type is `multipart/form-data`.
4187
+ */
4188
+ declare function isMultipart(req: Request): boolean;
4189
+
4190
+ /**
4191
+ * Column introspection for the admin panel, mirroring `admin.forms`' widget
4192
+ * derivation.
4193
+ *
4194
+ * `tempest-db-js` keeps rich runtime metadata on every column — the canonical
4195
+ * type kind, enum members, `varchar` length, the not-null/default/primary-key
4196
+ * flags and the foreign-key reference — so the admin derives its form widgets
4197
+ * and list filters from the model itself instead of asking the project to
4198
+ * restate them. Kept separate from the router so the (fiddly) type handling is
4199
+ * unit-testable in isolation.
4200
+ */
4201
+
4202
+ /** The set of form controls the admin knows how to render. */
4203
+ type AdminWidget = "text" | "textarea" | "number" | "checkbox" | "datetime" | "date" | "time" | "select" | "json" | "file" | "autocomplete";
4204
+ /** A `(value, label)` pair for a `select` widget. */
4205
+ interface AdminSelectOption {
4206
+ value: string;
4207
+ label: string;
4208
+ }
4209
+ /** The widget a column maps to, plus the attributes that render it. */
4210
+ interface WidgetSpec {
4211
+ /** The control to render. */
4212
+ widget: AdminWidget;
4213
+ /** `step` attribute for `number` widgets, or `null`. */
4214
+ step: string | null;
4215
+ /** Options for `select` widgets (empty otherwise). */
4216
+ options: AdminSelectOption[];
4217
+ }
4218
+ /** How a column is surfaced in the list view's filter bar. */
4219
+ type AdminFilterKind = "select" | "daterange" | "text";
4220
+ /**
4221
+ * Humanize a column key into a form label (`lastLoginAt` → `Last Login At`).
4222
+ *
4223
+ * @param name - The column key.
4224
+ * @returns A title-cased label.
4225
+ */
4226
+ declare function humanizeField(name: string): string;
4227
+ /**
4228
+ * Return every column of a model, keyed by field name in declaration order.
4229
+ *
4230
+ * @param model - The model class.
4231
+ * @returns The column map (do not mutate).
4232
+ */
4233
+ declare function adminColumns(model: ModelClass): Record<string, Column<unknown>>;
4234
+ /**
4235
+ * Map a column to the widget that edits it.
4236
+ *
4237
+ * `json` is matched before anything else because a JSON column carries no
4238
+ * useful scalar type, and `enum` is matched before the string kinds so its
4239
+ * members become a dropdown rather than a free-text input.
4240
+ *
4241
+ * @param column - The column to inspect.
4242
+ * @returns The widget, its `number` step (or `null`) and its `select` options.
4243
+ */
4244
+ declare function widgetForColumn(column: Column<unknown>): WidgetSpec;
4245
+ /**
4246
+ * Whether a column may be left blank on submit — it is nullable, carries a
4247
+ * default, or is the primary key the database fills in.
4248
+ *
4249
+ * @param column - The column to inspect.
4250
+ * @returns `true` when the field is optional.
4251
+ */
4252
+ declare function isColumnOptional(column: Column<unknown>): boolean;
4253
+ /**
4254
+ * Map a column to the filter control the list view shows for it.
4255
+ *
4256
+ * Booleans and enums become dropdowns, date-like columns become a from/to pair
4257
+ * of date inputs, and anything else falls back to an equality text input.
4258
+ *
4259
+ * @param column - The column to inspect.
4260
+ * @returns The filter kind and, for `select`, its options.
4261
+ */
4262
+ declare function filterForColumn(column: Column<unknown>): {
4263
+ kind: AdminFilterKind;
4264
+ options: AdminSelectOption[];
4265
+ };
4266
+ /**
4267
+ * Return the table a column points at, when it carries a foreign key.
4268
+ *
4269
+ * @param column - The column to inspect.
4270
+ * @returns The referenced table name, or `null` for a plain column.
4271
+ */
4272
+ declare function foreignKeyTable(column: Column<unknown>): string | null;
4273
+ /**
4274
+ * Whether a column holds free text a `LIKE '%…%'` search can match.
4275
+ *
4276
+ * @param column - The column to inspect.
4277
+ * @returns `true` for `varchar` / `text` / `char` columns.
4278
+ */
4279
+ declare function isSearchableColumn(column: Column<unknown>): boolean;
4280
+
3969
4281
  /**
3970
4282
  * Form building and submission parsing for the admin CRUD views, mirroring
3971
4283
  * `admin.forms`.
@@ -3996,6 +4308,10 @@ interface AdminFormField {
3996
4308
  options: AdminSelectOption[];
3997
4309
  /** Per-field validation error, or `null`. */
3998
4310
  error: string | null;
4311
+ /** For an `autocomplete` widget, the JSON search endpoint backing the input. */
4312
+ autocompleteUrl: string | null;
4313
+ /** For an `autocomplete` widget, the label of the currently selected row. */
4314
+ displayLabel: string;
3999
4315
  }
4000
4316
  /** The outcome of parsing a submitted create/edit form. */
4001
4317
  interface ParsedAdminForm {
@@ -4004,6 +4320,17 @@ interface ParsedAdminForm {
4004
4320
  /** Per-field error messages, keyed by column. Empty when the form is valid. */
4005
4321
  errors: Record<string, string>;
4006
4322
  }
4323
+ /** Options for {@link parseFormBody}. */
4324
+ interface ParseFormBodyOptions {
4325
+ /**
4326
+ * Read upload columns as plain text instead of skipping them.
4327
+ *
4328
+ * The create/edit form skips them because the router writes the storage key
4329
+ * after saving the file. A CSV import has no file to save — it carries the
4330
+ * key already — so it reads them like any other string column.
4331
+ */
4332
+ uploadsAsText?: boolean;
4333
+ }
4007
4334
  /** Options for {@link buildFormFields}. */
4008
4335
  interface BuildFormFieldsOptions {
4009
4336
  /** Current values, keyed by column — a row on edit, a re-submission on error. */
@@ -4016,6 +4343,13 @@ interface BuildFormFieldsOptions {
4016
4343
  * of a raw identity text input.
4017
4344
  */
4018
4345
  foreignKeyOptions?: Record<string, AdminSelectOption[]>;
4346
+ /**
4347
+ * Search endpoints for foreign-key columns listed in `autocompleteFields`,
4348
+ * keyed by column. A field listed here renders as a typed search box.
4349
+ */
4350
+ autocompleteUrls?: Record<string, string>;
4351
+ /** Current labels for autocomplete fields, keyed by column. */
4352
+ autocompleteLabels?: Record<string, string>;
4019
4353
  }
4020
4354
  /**
4021
4355
  * Render a stored value into the string a control pre-fills with.
@@ -4051,7 +4385,7 @@ declare function buildFormFields(admin: AdminModel, options?: BuildFormFieldsOpt
4051
4385
  * @param body - The parsed request body.
4052
4386
  * @returns The coerced values plus any per-field errors.
4053
4387
  */
4054
- declare function parseFormBody(admin: AdminModel, body: Record<string, unknown>): ParsedAdminForm;
4388
+ declare function parseFormBody(admin: AdminModel, body: Record<string, unknown>, options?: ParseFormBodyOptions): ParsedAdminForm;
4055
4389
  /**
4056
4390
  * Render a stored value for a read-only list or detail cell.
4057
4391
  *
@@ -4366,6 +4700,11 @@ interface AdminSiteOptions {
4366
4700
  siteUrl?: string;
4367
4701
  /** Typed appearance overrides. Omitted keeps the stock look. */
4368
4702
  theme?: AdminTheme;
4703
+ /**
4704
+ * Business-metric cards rendered at the top of the dashboard, each computed
4705
+ * from the database on load. Distinct from the system CPU/memory panel.
4706
+ */
4707
+ dashboardCards?: readonly MetricCard[];
4369
4708
  }
4370
4709
  /** Options accepted by {@link AdminSite.automap}. */
4371
4710
  interface AdminAutomapOptions extends Omit<AdminModelOptions<ModelClass>, "model"> {
@@ -4398,6 +4737,8 @@ declare class AdminSite {
4398
4737
  readonly siteUrl: string | null;
4399
4738
  /** Typed appearance overrides. */
4400
4739
  readonly theme: AdminTheme;
4740
+ /** Business-metric cards rendered at the top of the dashboard. */
4741
+ readonly dashboardCards: MetricCard[];
4401
4742
  private readonly registry;
4402
4743
  /**
4403
4744
  * Initialize the site.
@@ -4567,6 +4908,33 @@ interface AdminDashboardCard {
4567
4908
  /** URL of the create form, or `null` when creation is disabled. */
4568
4909
  newUrl: string | null;
4569
4910
  }
4911
+ /** One business-metric card, already computed and formatted for rendering. */
4912
+ interface AdminBusinessCardView {
4913
+ /** The card heading. */
4914
+ label: string;
4915
+ /** Which shape to render. */
4916
+ kind: "value" | "trend" | "partition";
4917
+ /** Headline value (`value` and `trend` cards). */
4918
+ value: string;
4919
+ /** Optional unit suffix. */
4920
+ unit: string | null;
4921
+ /** Trend direction (`trend` cards). */
4922
+ direction: "up" | "down" | "flat";
4923
+ /** Formatted percentage change, or `null` when there is no baseline. */
4924
+ percent: string | null;
4925
+ /** Previous-period value, as text (`trend` cards). */
4926
+ previous: string;
4927
+ /** Segments with their share of the total (`partition` cards). */
4928
+ segments: {
4929
+ label: string;
4930
+ value: string;
4931
+ percent: number;
4932
+ }[];
4933
+ /** Optional sub-label. */
4934
+ helpText: string | null;
4935
+ /** Set when the card's compute threw, so the dashboard still renders. */
4936
+ error: string | null;
4937
+ }
4570
4938
  /** The system metrics panel on the dashboard. */
4571
4939
  interface AdminDashboardMetrics {
4572
4940
  /** CPU load as a percentage of available cores. */
@@ -4587,7 +4955,7 @@ interface AdminDashboardMetrics {
4587
4955
  * @param metrics - The system metrics panel, or `null` when disabled.
4588
4956
  * @returns The full page.
4589
4957
  */
4590
- declare function renderDashboardPage(context: AdminRenderContext, cards: AdminDashboardCard[], metrics: AdminDashboardMetrics | null): string;
4958
+ declare function renderDashboardPage(context: AdminRenderContext, cards: AdminDashboardCard[], metrics: AdminDashboardMetrics | null, businessCards?: AdminBusinessCardView[]): string;
4591
4959
  /** A filter control rendered above the list view. */
4592
4960
  interface AdminFilterView {
4593
4961
  /** Column key the control filters on. */
@@ -4650,6 +5018,8 @@ interface AdminListView {
4650
5018
  sort: Record<string, AdminSortView>;
4651
5019
  /** URL of the create form, or `null` when creation is disabled. */
4652
5020
  newUrl: string | null;
5021
+ /** URL of the CSV import page, or `null` when import is disabled. */
5022
+ importUrl: string | null;
4653
5023
  /** Bulk actions offered above the table. Empty hides the whole bulk UI. */
4654
5024
  bulkActions: BulkActionOption[];
4655
5025
  /** URL the bulk form posts to. */
@@ -4658,6 +5028,12 @@ interface AdminListView {
4658
5028
  exportCsvUrl: string;
4659
5029
  /** URL exporting the current result set as JSON. */
4660
5030
  exportJsonUrl: string;
5031
+ /** Saved-preset tabs rendered above the table. Empty hides the strip. */
5032
+ lenses: {
5033
+ label: string;
5034
+ url: string;
5035
+ active: boolean;
5036
+ }[];
4661
5037
  }
4662
5038
  /**
4663
5039
  * Render the paginated list view, with its search box, filters and sortable
@@ -4668,6 +5044,33 @@ interface AdminListView {
4668
5044
  * @returns The full page.
4669
5045
  */
4670
5046
  declare function renderListPage(context: AdminRenderContext, view: AdminListView): string;
5047
+ /** One entry in the detail view's change timeline. */
5048
+ interface AdminAuditEntryView {
5049
+ /** The mutation kind (`create` / `update` / `delete`). */
5050
+ action: string;
5051
+ /** When it happened, already formatted. */
5052
+ at: string;
5053
+ /** Who did it — a resolved display name, or the raw actor id. */
5054
+ actor: string;
5055
+ /** The per-field diff. */
5056
+ changes: {
5057
+ field: string;
5058
+ before: string;
5059
+ after: string;
5060
+ }[];
5061
+ /** Extra metadata the writer recorded, as JSON text, or `null`. */
5062
+ context: string | null;
5063
+ }
5064
+ /** The "who and when" panel below a record's fields. */
5065
+ interface AdminAuditView {
5066
+ /** Timestamp and actor rows, already resolved and formatted. */
5067
+ fields: {
5068
+ label: string;
5069
+ value: string;
5070
+ }[];
5071
+ /** The change timeline, newest first. Empty when there is none to show. */
5072
+ history: AdminAuditEntryView[];
5073
+ }
4671
5074
  /** The view model the detail page renders. */
4672
5075
  interface AdminDetailView {
4673
5076
  /** Singular display name. */
@@ -4685,6 +5088,8 @@ interface AdminDetailView {
4685
5088
  editUrl: string | null;
4686
5089
  /** URL the delete form posts to, or `null` when deletion is disabled. */
4687
5090
  deleteUrl: string | null;
5091
+ /** The audit panel, or `null` when the model carries no audit columns. */
5092
+ audit: AdminAuditView | null;
4688
5093
  }
4689
5094
  /**
4690
5095
  * Render the single-record detail view.
@@ -4719,6 +5124,38 @@ interface AdminFormView {
4719
5124
  * @throws Error When called without a session, since the form needs a CSRF token.
4720
5125
  */
4721
5126
  declare function renderFormPage(context: AdminRenderContext, view: AdminFormView): string;
5127
+ /** The outcome of a CSV import, as the page renders it. */
5128
+ interface AdminImportView {
5129
+ /** Plural display name of the model being imported into. */
5130
+ title: string;
5131
+ /** URL the upload form posts to. */
5132
+ actionUrl: string;
5133
+ /** URL of the list view. */
5134
+ backUrl: string;
5135
+ /** The column headers the CSV is expected to carry. */
5136
+ columns: string[];
5137
+ /** A form-level error, or `null`. */
5138
+ error: string | null;
5139
+ /** How many rows were created, or `null` before the first submission. */
5140
+ created: number | null;
5141
+ /** Per-row failures, numbered as the spreadsheet numbers them. */
5142
+ rowErrors: {
5143
+ row: number;
5144
+ message: string;
5145
+ }[];
5146
+ }
5147
+ /**
5148
+ * Render the CSV import page.
5149
+ *
5150
+ * Row numbers start at 2 because row 1 is the header, so the numbers line up
5151
+ * with what the operator sees in their spreadsheet.
5152
+ *
5153
+ * @param context - The shared chrome data (with an active session).
5154
+ * @param view - The prepared import view model.
5155
+ * @returns The full page.
5156
+ * @throws Error When called without a session, since the form needs a CSRF token.
5157
+ */
5158
+ declare function renderImportPage(context: AdminRenderContext, view: AdminImportView): string;
4722
5159
 
4723
5160
  /**
4724
5161
  * The server-rendered admin panel router, mirroring `admin.router`.
@@ -4774,6 +5211,13 @@ interface AdminRouterOptions {
4774
5211
  * click on a large table from becoming an outage.
4775
5212
  */
4776
5213
  exportMaxRows?: number;
5214
+ /**
5215
+ * Granular access control layered on top of the `AdminModel` flags. Omitted
5216
+ * lets every signed-in operator do whatever those flags allow.
5217
+ */
5218
+ accessPolicy?: AdminAccessPolicy;
5219
+ /** Largest upload the panel accepts, in bytes. Default `10485760` (10 MB). */
5220
+ maxUploadBytes?: number;
4777
5221
  }
4778
5222
  /**
4779
5223
  * Build the admin panel router.
@@ -4784,6 +5228,20 @@ interface AdminRouterOptions {
4784
5228
  * @throws Error When the signing key is shorter than 32 characters.
4785
5229
  */
4786
5230
  declare function makeAdminRouter(site: AdminSite, options: AdminRouterOptions): Router;
5231
+ /**
5232
+ * Parse a CSV document into one record per row, keyed by the header.
5233
+ *
5234
+ * Implements RFC 4180 quoting rather than splitting on commas: a quoted field
5235
+ * may contain commas, newlines and doubled quotes, and an import that mangles
5236
+ * those silently corrupts exactly the rows a human took the trouble to quote.
5237
+ * The leading UTF-8 BOM Excel writes is stripped, because otherwise the first
5238
+ * header name never matches a column.
5239
+ *
5240
+ * @param text - The CSV document.
5241
+ * @returns One record per data row; `[]` when the file has only a header.
5242
+ * @throws Error When the document has no header row.
5243
+ */
5244
+ declare function parseCsv(text: string): Record<string, string>[];
4787
5245
 
4788
5246
  /**
4789
5247
  * Headless admin: resource registry for the JSON admin API.
@@ -6555,6 +7013,6 @@ declare function createTestDatabase(models: readonly ModelClass[]): TestDatabase
6555
7013
  declare function withTestDatabase<T>(models: readonly ModelClass[], fn: (db: TestDatabase) => Promise<T>): Promise<T>;
6556
7014
 
6557
7015
  /** The installed SDK version. Single source of truth for the barrel + CLI. */
6558
- declare const VERSION = "0.25.0";
7016
+ declare const VERSION = "0.27.0";
6559
7017
 
6560
- export { ADMIN_CSS, type ActivationInput, ActivationService, type ActivationServiceOptions, type ActivationStore, type AdminAction, type AdminActionCategory, type AdminActionContext, type AdminActionHandler, type AdminActionOptions, type AdminActionResult, type AdminAuthBackend, type AdminAutomapOptions, type AdminDashboardCard, type AdminDashboardMetrics, type AdminDetailView, type AdminFilterKind, type AdminFilterView, type AdminFormField, type AdminFormView, type AdminJsonField, type AdminJsonListQuery, type AdminJsonListResult, type AdminJsonResource, type AdminJsonRouterOptions, AdminJsonSite, type AdminListView, type AdminMessage, type AdminMfaVerifier, AdminModel, type AdminModelOptions, type AdminNavEntry, 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 CatalogData, CircuitOpenError, type ClientIpOptions, CompositeFeatureFlagBackend, ConflictException, type CreateAppOpenApi, type CreateAppOptions, type CsrfOptions, type CursorPaginationFilter, DEFAULT_DOCS_FAVICON, DEFAULT_LOCALE, type DownloadOptions, type EmailMessage, type EmailOptions, EmailProvider, type EmailProviderOptions, EmailUtils, type Enum, type EnumHelpers, type EnumSpec, EnvFeatureFlagBackend, EventStream, type EventStreamOptions, type ExceptionDetails, ExpiredTokenException, type FeatureFlagBackend, FeatureFlags, type FieldChange, type FileLoggingHandle, type FileLoggingOptions, type FlagContext, ForbiddenException, type GPUMetrics, type GenerateOpenApiOptions, GitHubOAuthClient, GoogleOAuthClient, GracefulShutdown, type GracefulShutdownOptions, HTTPClient, type HTTPClientOptions, HTTP_500_LOG_FILE, HTTP_500_MARKER, type HandshakeInfo, type HealthCheck, type HealthRouterOptions, HttpMetrics, IDEMPOTENCY_HEADER, type IdempotencyOptions, type IdempotencyRedisLike, type IdempotencyStore, type InboundHandler, type InboundMessage, InvalidTokenException, type IssuedSession, JSONLogger, JWTUtils, type JWTUtilsOptions, type JwtAuthOptions, type JwtClaims, type JwtDecoderLike, LEVEL_LOG_FILES, LocalUploadStorage, type LocalUploadStorageOptions, type LogEntry, type LogExtra, type LogLevel, type LogSink, type LogSource, type LoginInput, type LoginResult, type LogsRouterOptions, type MediaKind, MemoryBroker, MemoryCacheManager, MemoryFeatureFlagBackend, MemoryIdempotencyStore, type MemoryMetrics, MemoryRateLimitStore, MemorySessionStore, MemoryThrottleBackend, MessageCatalog, type MessageHandler, MessagingHub, type MessagingProvider, type MetricsRouterOptions, MetricsUtils, type MfaChallenge, type MfaChallengeInput, type MfaCodeInput, type MfaEnrollment, MfaService, type MfaServiceOptions, type MfaStore, NotFoundException, type OAuthClientOptions, OAuthError, type OAuthTokens, type OAuthUser, OIDCProvider, type OIDCProviderOptions, type OpenApiDocument, type OpenApiInfo, type OutboundMedia, type OutboundResult, type OutboxPublisher, OutboxRelay, type OutboxRelayOptions, OutboxStatus, PHONE_BR_PATTERN, type PaginationFilter, type PaginationLinkOptions, type ParsedAdminForm, 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, 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, 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, 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, mfaChallengeSchema, mfaCodeSchema, mfaEnrollResponseSchema, minioSettingsShape, modifyDict, mountOpenApiJson, mountRedoc, mountSwaggerUi, nonEmptyStrField, nonNegativeFloatField, nonNegativeIntField, normalizeCep, normalizeCnpj, normalizeCpf, normalizeCpfCnpj, normalizePhoneBr, normalizeUf, notFoundHandler, onlyDigits, paginationFilterSchema, paginationSchema, parseAcceptLanguage, parseCookies, parseFormBody, passwordResetConfirmSchema, passwordResetRequestSchema, percentField, phoneBrField, portField, positiveFloatField, positiveIntField, priceField, prometheusMiddleware, rabbitmqSettingsShape, rateLimitMiddleware, ratingField, ratioField, redisSettingsShape, refreshSchema, registerExceptionHandlers, renderAuthResultPage, renderDashboardPage, renderDetailPage, renderFormPage, 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, ufField, updatedByColumn, uploadSettingsShape, userPublicSchema, utcnow, validateTwilioSignature, verifyOpaqueToken, webPushKeysSchema, webPushPayloadSchema, webPushSettingsShape, webPushSubscriptionSchema, webSocketSettingsShape, widgetForColumn, withTestDatabase, wrapWithSlowQueryLog, wsEnvelopeSchema };
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 };