tempest-express-sdk 0.28.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/README.md +1 -1
- package/dist/{chunk-3NS5KVHT.js → chunk-7T4MZJZT.js} +3 -3
- package/dist/{chunk-3NS5KVHT.js.map → chunk-7T4MZJZT.js.map} +1 -1
- package/dist/cli.cjs +1 -1
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +1 -1
- package/dist/index.cjs +559 -58
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +355 -2
- package/dist/index.d.ts +355 -2
- package/dist/index.js +550 -60
- package/dist/index.js.map +1 -1
- package/package.json +6 -1
package/dist/index.d.cts
CHANGED
|
@@ -3586,6 +3586,231 @@ 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
|
+
|
|
3589
3814
|
/**
|
|
3590
3815
|
* Related child models surfaced on a parent's detail view — Django's
|
|
3591
3816
|
* `TabularInline` analog, mirroring `admin.config.Inline`.
|
|
@@ -4938,6 +5163,8 @@ interface AdminRenderContext {
|
|
|
4938
5163
|
currentPath: string;
|
|
4939
5164
|
/** Sidebar entries, one per registered model. */
|
|
4940
5165
|
navModels: AdminNavEntry[];
|
|
5166
|
+
/** Sidebar entries for the system tools (logs, SQL console). */
|
|
5167
|
+
navSystem: AdminNavEntry[];
|
|
4941
5168
|
/** Banners rendered above the content. */
|
|
4942
5169
|
messages: AdminMessage[];
|
|
4943
5170
|
}
|
|
@@ -5234,6 +5461,93 @@ interface AdminFormView {
|
|
|
5234
5461
|
* @throws Error When called without a session, since the form needs a CSRF token.
|
|
5235
5462
|
*/
|
|
5236
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;
|
|
5237
5551
|
/** The outcome of a CSV import, as the page renders it. */
|
|
5238
5552
|
interface AdminImportView {
|
|
5239
5553
|
/** Plural display name of the model being imported into. */
|
|
@@ -5328,6 +5642,33 @@ interface AdminRouterOptions {
|
|
|
5328
5642
|
accessPolicy?: AdminAccessPolicy;
|
|
5329
5643
|
/** Largest upload the panel accepts, in bytes. Default `10485760` (10 MB). */
|
|
5330
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;
|
|
5331
5672
|
}
|
|
5332
5673
|
/**
|
|
5333
5674
|
* Build the admin panel router.
|
|
@@ -7073,6 +7414,18 @@ interface LogsRouterOptions {
|
|
|
7073
7414
|
/** Middlewares run before the handler (e.g. a token guard). */
|
|
7074
7415
|
guards?: RequestHandler[];
|
|
7075
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>[]>;
|
|
7076
7429
|
/**
|
|
7077
7430
|
* Build a router serving `GET <path>` with query params `source`, `page` and
|
|
7078
7431
|
* `pageSize`. Returns `{ items, total, page, pageSize, pages }`, newest first.
|
|
@@ -7137,6 +7490,6 @@ declare function createTestDatabase(models: readonly ModelClass[]): TestDatabase
|
|
|
7137
7490
|
declare function withTestDatabase<T>(models: readonly ModelClass[], fn: (db: TestDatabase) => Promise<T>): Promise<T>;
|
|
7138
7491
|
|
|
7139
7492
|
/** The installed SDK version. Single source of truth for the barrel + CLI. */
|
|
7140
|
-
declare const VERSION = "0.
|
|
7493
|
+
declare const VERSION = "0.29.0";
|
|
7141
7494
|
|
|
7142
|
-
export { ADMIN_CSS, type ActivationInput, ActivationService, type ActivationServiceOptions, type ActivationStore, type AdminAccessPolicy, type AdminAction, type AdminActionCategory, type AdminActionContext, type AdminActionHandler, type AdminActionOptions, type AdminActionResult, type AdminAuditEntryView, type AdminAuditView, type AdminAuthBackend, type AdminAutomapOptions, type AdminBusinessCardView, type AdminDashboardCard, type AdminDashboardMetrics, type AdminDetailView, type AdminFilterKind, type AdminFilterView, type AdminFormField, type AdminFormView, type AdminImportView, type AdminInline, type AdminInlineOptions, type AdminInlineRowView, type AdminInlineView, type AdminJsonField, type AdminJsonListQuery, type AdminJsonListResult, type AdminJsonResource, type AdminJsonRouterOptions, AdminJsonSite, type AdminLens, type AdminLensOptions, type AdminListView, type AdminMessage, type AdminMfaVerifier, AdminModel, type AdminModelOptions, type AdminNavEntry, AdminPermission, type AdminRenderContext, type AdminRouterOptions, type AdminRow, type AdminSelectOption, type AdminSession, AdminSessionStore, type AdminSessionStoreOptions, AdminSite, type AdminSiteOptions, type AdminSortView, type AdminTheme, type AdminWidget, AppException, type AppExceptionHandlerOptions, type AppExceptionOptions, type AttachWebSocketOptions, AttemptThrottle, type AttemptThrottleOptions, AuditAction, type AuthResponse, type AuthResultPageOptions, type AuthRouterOptions, type AuthUser, type BackupOptions, type BaseAppSettings, BaseAuditLogModel, BaseController, BaseModel, BaseOAuthClient, BaseOutboxModel, type BaseResponse, BaseService, BaseUserModel, BaseUserRefreshTokenModel, BaseUserTokenModel, type BodySizeLimitOptions, type BroadcastOptions, type BroadcastResult, type BrokerManager, type BuildFormFieldsOptions, type BulkActionOption, CEP_PATTERN, CNPJ_PATTERN, CPF_PATTERN, type CPUMetrics, CSRF_COOKIE_NAME, CSRF_HEADER_NAME, type CacheManager, type CachedOptions, type CachedResponse, type CardCompute, type CardData, type CatalogData, CircuitOpenError, type ClientIpOptions, CompositeFeatureFlagBackend, ConflictException, type CreateAppOpenApi, type CreateAppOptions, type CsrfOptions, type CursorPaginationFilter, DEFAULT_DOCS_FAVICON, DEFAULT_LOCALE, type DownloadOptions, type EmailMessage, type EmailOptions, EmailProvider, type EmailProviderOptions, EmailUtils, type Enum, type EnumHelpers, type EnumSpec, EnvFeatureFlagBackend, EventStream, type EventStreamOptions, type ExceptionDetails, ExpiredTokenException, type FeatureFlagBackend, FeatureFlags, type FieldChange, type FileLoggingHandle, type FileLoggingOptions, type FlagContext, ForbiddenException, type GPUMetrics, type GenerateOpenApiOptions, GitHubOAuthClient, GoogleOAuthClient, GracefulShutdown, type GracefulShutdownOptions, HTTPClient, type HTTPClientOptions, HTTP_500_LOG_FILE, HTTP_500_MARKER, type HandshakeInfo, type HealthCheck, type HealthRouterOptions, HttpMetrics, IDEMPOTENCY_HEADER, type IdempotencyOptions, type IdempotencyRedisLike, type IdempotencyStore, type InboundHandler, type InboundMessage, InvalidTokenException, type IssuedSession, JSONLogger, JWTUtils, type JWTUtilsOptions, type JwtAuthOptions, type JwtClaims, type JwtDecoderLike, LEVEL_LOG_FILES, LocalUploadStorage, type LocalUploadStorageOptions, type LogEntry, type LogExtra, type LogLevel, type LogSink, type LogSource, type LoginInput, type LoginResult, type LogsRouterOptions, type MediaKind, MemoryBroker, MemoryCacheManager, MemoryFeatureFlagBackend, MemoryIdempotencyStore, type MemoryMetrics, MemoryRateLimitStore, MemorySessionStore, MemoryThrottleBackend, MessageCatalog, type MessageHandler, MessagingHub, type MessagingProvider, type MetricCard, type MetricPartition, type MetricTrend, type MetricValue, type MetricsRouterOptions, MetricsUtils, type MfaChallenge, type MfaChallengeInput, type MfaCodeInput, type MfaEnrollment, MfaService, type MfaServiceOptions, type MfaStore, MultipartLimitError, NotFoundException, type OAuthClientOptions, OAuthError, type OAuthTokens, type OAuthUser, OIDCProvider, type OIDCProviderOptions, type OpenApiDocument, type OpenApiInfo, type OutboundMedia, type OutboundResult, type OutboxPublisher, OutboxRelay, type OutboxRelayOptions, OutboxStatus, PHONE_BR_PATTERN, type PaginationFilter, type PaginationLinkOptions, type ParseFormBodyOptions, type ParseMultipartOptions, type ParsedAdminForm, type ParsedMultipart, type PasswordResetConfirmInput, type PasswordResetFormOptions, type PasswordResetRequestInput, PasswordResetService, type PasswordResetServiceOptions, type PasswordResetStore, PasswordUtils, REDOC_CDN_URL, REQUEST_ID_HEADER, RabbitBroker, type RabbitBrokerOptions, type RateLimitKeyFunc, type RateLimitOptions, type RateLimitRedisLike, type RateLimitResult, type RateLimitStore, RedisCacheManager, RedisIdempotencyStore, type RedisLike, type RedisPublisherLike, RedisRateLimitStore, RedisSSEBroker, type RedisSSEBrokerOptions, RedisSessionStore, type RedisSubscriberLike, type RedocBundleSource, type RedocOptions, type RefreshInput, Region, type RegionValue, type RegisterExceptionHandlersOptions, type RequestContext, type RequestTracingOptions, type ResolvedAdminTheme, type ResponseMapper, RetryPolicy, type RunServerOptions, type S3ClientLike, S3UploadStorage, type S3UploadStorageOptions, SSEBroker, type SaveOptions, type SendOptions, ServerSentEvent, type ServerSentEventInit, type Session, type SessionMiddlewareOptions, type SessionRedisLike, SessionService, type SessionServiceOptions, type SessionStore, type SignupInput, type SlowQueryOptions, type SpecProvider, type StateBR, type SwaggerOptions, type SyncFilter, type SystemMetrics, TOTPHelper, type TOTPOptions, type TaskHandler, TaskManager, type TaskManagerOptions, TelegramProvider, type TelegramProviderOptions, TenantScopedRepository, type TestDatabase, type ThrottleBackend, type ThrottleStatus, type ToDictOptions, type TokenPair, TooManyRequestsException, type TooManyRequestsOptions, type ToolSpecOptions, TwilioSmsProvider, type TwilioSmsProviderOptions, type TwilioWebhookOptions, UF, type UFValue, UnauthorizedException, type UnhandledExceptionHandlerOptions, type UploadResult, type UploadStorage, type UploadedFile, UserAuthService, type UserAuthServiceOptions, UserModelAuthBackend, type UserModelAuthBackendOptions, type UserPublic, type UserStore, UserTokenPurpose, VERSION, ValidationException, type WSEnvelope, WebPushDispatcher, type WebPushDispatcherOptions, WebPushError, WebPushGoneError, type WebPushKeys, type WebPushPayload, type WebPushSubscription, type WebSocketConnection, WebSocketHub, type WebSocketHubOptions, type WebSocketLike, type WebhookSignatureOptions, WebhookSignatureVerifier, WhatsAppProvider, type WhatsAppProviderOptions, type WhatsAppWebhookOptions, type WidgetSpec, activationSchema, addLogSink, adminAction, adminColumns, adminInline, adminLens, adminThemeCss, attachWebSocketHub, authResponseSchema, authSettingsShape, backupDatabase, baseAppSettingsSchema, baseAppSettingsShape, baseResponseSchema, bearerToken, bodySizeLimitMiddleware, broadcastText, buildContentDisposition, buildFormFields, buildPaginationLinkHeader, cached, centsField, cepField, citiesByUf, cnpjField, coerceFlag, configureFileLogging, configureLogging, corsSettingsShape, cpfField, cpfOrCnpjField, createApp, createOpenApiRegistry, createTestDatabase, createdByColumn, csrfMiddleware, csrfTokenMatches, cursorPaginationFilterSchema, cursorPaginationSchema, databaseSettingsShape, decodeCursor, defaultMessageCatalog, defineEnum, deletedAtColumn, diffSnapshots, emailSettingsShape, encodeCursor, looseBoolean as envBoolean, envList, escapeHtml, filterForColumn, foreignKeyFields, foreignKeyLabel, foreignKeyTable, formatCellValue, formatFieldValue, generateCsrfToken, generateOAuthState, generateOpaqueToken, generateOpenApiDocument, getAuth, getClientIp, getConditions, getPaginationConditions, getRequestId, getState, groupInlineSubmission, hashOpaqueToken, hexColorField, humanizeField, idempotencyMiddleware, inboundMessageSchema, isColumnOptional, isMultipart, isSearchableColumn, isValidCep, isValidCity, isValidCnpj, isValidCpf, isValidCpfCnpj, isValidPhoneBr, isValidUf, jwtSettingsShape, keyByHeader, keyByIp, keyByJwtClaim, keyByJwtSubject, latitudeField, listStates, loadSettings, logEntrySchema, logSettingsShape, loginSchema, longitudeField, looseBoolean, makeAdminJsonRouter, makeAdminRouter, makeAppExceptionHandler, makeAuthRouter, makeFlagGuard, makeHealthRouter, makeJwtAuthMiddleware, makeLogsRouter, makeMetricsRouter, makeSessionMiddleware, makeToolSpecRouter, makeTwilioWebhookRouter, makeUnhandledExceptionHandler, makeWhatsAppWebhookRouter, metricCard, mfaChallengeSchema, mfaCodeSchema, mfaEnrollResponseSchema, minioSettingsShape, modifyDict, mountOpenApiJson, mountRedoc, mountSwaggerUi, nonEmptyStrField, nonNegativeFloatField, nonNegativeIntField, normalizeCep, normalizeCnpj, normalizeCpf, normalizeCpfCnpj, normalizePhoneBr, normalizeUf, notFoundHandler, onlyDigits, paginationFilterSchema, paginationSchema, parseAcceptLanguage, parseCookies, parseCsv, parseFormBody, parseMultipart, partitionTotal, passwordResetConfirmSchema, passwordResetRequestSchema, percentField, phoneBrField, portField, positiveFloatField, positiveIntField, priceField, prometheusMiddleware, rabbitmqSettingsShape, rateLimitMiddleware, ratingField, ratioField, redisSettingsShape, refreshSchema, registerExceptionHandlers, renderAuthResultPage, renderDashboardPage, renderDetailPage, renderFormPage, renderImportPage, renderLayout, renderListPage, renderLoginPage, renderMfaPage, renderPasswordResetFormPage, requestIdMiddleware, requestTracingMiddleware, requireRoles, resolveAdminTheme, resolveDownloadPath, resolveRedocBundle, runServer, runWithRequestContext, sendBytesDownload, sendFileDownload, serverSettingsShape, sessionCookie, sessionSettingsShape, setRequestId, signupSchema, slugField, snapshot, sseResponse, statesByRegion, syncFilterSchema, syncPaginationSchema, tableNameFor, toDict, toUtc, tokenFromUrl, tokenPairSchema, tokenSettingsShape, trendDirection, trendPercent, ufField, updatedByColumn, uploadSettingsShape, userPublicSchema, utcnow, validateTwilioSignature, verifyOpaqueToken, webPushKeysSchema, webPushPayloadSchema, webPushSettingsShape, webPushSubscriptionSchema, webSocketSettingsShape, widgetForColumn, withTestDatabase, wrapWithSlowQueryLog, wsEnvelopeSchema };
|
|
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 };
|