tempest-express-sdk 0.2.0 → 0.3.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 +7 -2
- package/dist/chunk-6ZKN2ELQ.js +6 -0
- package/dist/{chunk-6QNSLBL3.js.map → chunk-6ZKN2ELQ.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 +448 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +373 -4
- package/dist/index.d.ts +373 -4
- package/dist/index.js +437 -3
- package/dist/index.js.map +1 -1
- package/package.json +13 -1
- package/dist/chunk-6QNSLBL3.js +0 -6
package/dist/index.d.cts
CHANGED
|
@@ -3,7 +3,7 @@ export { z } from 'zod';
|
|
|
3
3
|
import * as tempest_db_js from 'tempest-db-js';
|
|
4
4
|
import { Model, ModelClass, BaseRepository, InferModel, WhereInput, InferInsert, PaginationFilter as PaginationFilter$1, PaginationResult } from 'tempest-db-js';
|
|
5
5
|
export { AsyncDriver, AsyncEngine, AsyncResult, AsyncSession, BaseRepository, BelongsTo, ColType, Column, ColumnFlags, CompiledQuery, CondNode, Condition, DeleteBuilder, DeleteNode, Dialect, EngineOptions, Executable, HasMany, InferInsert, InferModel, InsertBuilder, InsertNode, Model, ModelClass, NoResultError, NodeSqliteDriver, Operator, OrderTerm, PaginationResult, ParsedDatabaseUrl, PostgresDialect, QueryNode, RecordNotFound, Relation, RelationValue, PaginationFilter as RepositoryPaginationFilter, Returning, RowOf, SelectBuilder, SelectNode, SortDirection, SqliteDialect, SyncEngine, SyncSession, UpdateBuilder, UpdateNode, WhereArg, WhereInput, WithRelations, and, belongsTo, column, columnsOf, createEngine, createSyncEngine, del, detectDialect, getDialect, hasMany, insert, join, loadRelations, not, or, parseDatabaseUrl, select, sql, update } from 'tempest-db-js';
|
|
6
|
-
import {
|
|
6
|
+
import { Request, RequestHandler, Response as Response$1, Router, ErrorRequestHandler, Express } from 'express';
|
|
7
7
|
import * as ws from 'ws';
|
|
8
8
|
import { Server } from 'node:http';
|
|
9
9
|
import { OpenAPIRegistry } from '@asteasolutions/zod-to-openapi';
|
|
@@ -1130,6 +1130,271 @@ declare class AttemptThrottle {
|
|
|
1130
1130
|
reset(key: string): Promise<void>;
|
|
1131
1131
|
}
|
|
1132
1132
|
|
|
1133
|
+
/**
|
|
1134
|
+
* Trusted client-IP resolution, mirroring `utils.client_ip`.
|
|
1135
|
+
*
|
|
1136
|
+
* Reading the leftmost `X-Forwarded-For` entry is a security hole — that header
|
|
1137
|
+
* is client-controlled. Resolve from a SINGLE header the edge proxy sets itself
|
|
1138
|
+
* (e.g. `X-Real-IP`, `CF-Connecting-IP`), falling back to the socket peer.
|
|
1139
|
+
*/
|
|
1140
|
+
|
|
1141
|
+
/** Options for {@link getClientIp}. */
|
|
1142
|
+
interface ClientIpOptions {
|
|
1143
|
+
/**
|
|
1144
|
+
* Name of the single edge-set header to trust (case-insensitive, e.g.
|
|
1145
|
+
* `"x-real-ip"`). Omit to use only the transport peer.
|
|
1146
|
+
*/
|
|
1147
|
+
trustedHeader?: string;
|
|
1148
|
+
}
|
|
1149
|
+
/**
|
|
1150
|
+
* Resolve the client IP from an Express request.
|
|
1151
|
+
*
|
|
1152
|
+
* @param req - The inbound request.
|
|
1153
|
+
* @param options - The trusted header to read, if any.
|
|
1154
|
+
* @returns The resolved IP, or `"unknown"` when unavailable.
|
|
1155
|
+
*/
|
|
1156
|
+
declare function getClientIp(req: Request, options?: ClientIpOptions): string;
|
|
1157
|
+
|
|
1158
|
+
/**
|
|
1159
|
+
* TOTP (RFC 6238) helper for MFA, mirroring `utils.totp.TOTPHelper`.
|
|
1160
|
+
*
|
|
1161
|
+
* Implemented natively over `node:crypto` (HMAC-SHA1) — no external OTP library
|
|
1162
|
+
* needed. Generates a base32 secret, builds the `otpauth://` provisioning URI
|
|
1163
|
+
* (scanned as a QR code), and verifies a 6-digit code with a clock-drift window.
|
|
1164
|
+
*/
|
|
1165
|
+
/** Options for {@link TOTPHelper}. */
|
|
1166
|
+
interface TOTPOptions {
|
|
1167
|
+
/** Label shown in the authenticator app (e.g. the product name). */
|
|
1168
|
+
issuer: string;
|
|
1169
|
+
/** Time step in seconds. Default 30. */
|
|
1170
|
+
step?: number;
|
|
1171
|
+
/** Number of digits. Default 6. */
|
|
1172
|
+
digits?: number;
|
|
1173
|
+
}
|
|
1174
|
+
/** Stateless TOTP issuer + verifier. Construct one per app. */
|
|
1175
|
+
declare class TOTPHelper {
|
|
1176
|
+
private readonly issuer;
|
|
1177
|
+
private readonly step;
|
|
1178
|
+
private readonly digits;
|
|
1179
|
+
/**
|
|
1180
|
+
* @param options - Issuer label, time step and digit count.
|
|
1181
|
+
*/
|
|
1182
|
+
constructor(options: TOTPOptions);
|
|
1183
|
+
/**
|
|
1184
|
+
* Generate a fresh base32 secret (80 bits).
|
|
1185
|
+
*
|
|
1186
|
+
* @returns A base32-encoded TOTP secret to persist on the user row.
|
|
1187
|
+
*/
|
|
1188
|
+
generateSecret(): string;
|
|
1189
|
+
/**
|
|
1190
|
+
* Build the `otpauth://` provisioning URI (render as a QR code).
|
|
1191
|
+
*
|
|
1192
|
+
* @param secret - The base32 secret.
|
|
1193
|
+
* @param accountName - Identifier shown next to the issuer (e.g. the email).
|
|
1194
|
+
* @returns The `otpauth://totp/...` URI.
|
|
1195
|
+
*/
|
|
1196
|
+
provisioningUri(secret: string, accountName: string): string;
|
|
1197
|
+
/**
|
|
1198
|
+
* Verify a code against the secret for the current time window.
|
|
1199
|
+
*
|
|
1200
|
+
* @param secret - The base32 secret.
|
|
1201
|
+
* @param code - The submitted code.
|
|
1202
|
+
* @param window - Tolerance in steps (±). Default 1 (previous/current/next).
|
|
1203
|
+
* @returns `true` when the code matches within the window.
|
|
1204
|
+
*/
|
|
1205
|
+
verify(secret: string, code: string, window?: number): boolean;
|
|
1206
|
+
}
|
|
1207
|
+
|
|
1208
|
+
/**
|
|
1209
|
+
* Resilient HTTP client, mirroring `utils.http_client`.
|
|
1210
|
+
*
|
|
1211
|
+
* Wraps the native `fetch` with a retry policy (exponential backoff) and a
|
|
1212
|
+
* per-host circuit breaker: after N consecutive failures the breaker opens and
|
|
1213
|
+
* requests to that host fail fast with {@link CircuitOpenError} until a cooldown
|
|
1214
|
+
* elapses. No external dependency.
|
|
1215
|
+
*/
|
|
1216
|
+
/** Raised when the per-host circuit breaker is open. */
|
|
1217
|
+
declare class CircuitOpenError extends Error {
|
|
1218
|
+
readonly host: string;
|
|
1219
|
+
constructor(host: string);
|
|
1220
|
+
}
|
|
1221
|
+
/** Retry configuration for {@link HTTPClient}. */
|
|
1222
|
+
declare class RetryPolicy {
|
|
1223
|
+
readonly maxRetries: number;
|
|
1224
|
+
readonly baseDelayMs: number;
|
|
1225
|
+
readonly retryOn: number[];
|
|
1226
|
+
/**
|
|
1227
|
+
* @param maxRetries - Additional attempts after the first. Default 2.
|
|
1228
|
+
* @param baseDelayMs - Base backoff in ms (doubles each attempt). Default 100.
|
|
1229
|
+
* @param retryOn - HTTP status codes that trigger a retry. Default 5xx + 429.
|
|
1230
|
+
*/
|
|
1231
|
+
constructor(maxRetries?: number, baseDelayMs?: number, retryOn?: number[]);
|
|
1232
|
+
/** Backoff delay in ms before `attempt` (0-indexed). */
|
|
1233
|
+
sleepFor(attempt: number): number;
|
|
1234
|
+
}
|
|
1235
|
+
/** Options for {@link HTTPClient}. */
|
|
1236
|
+
interface HTTPClientOptions {
|
|
1237
|
+
/** Prepended to relative request paths. */
|
|
1238
|
+
baseUrl?: string;
|
|
1239
|
+
/** Headers merged into every request. */
|
|
1240
|
+
defaultHeaders?: Record<string, string>;
|
|
1241
|
+
/** Per-request timeout in ms. Default 30000. */
|
|
1242
|
+
timeoutMs?: number;
|
|
1243
|
+
/** Retry configuration. */
|
|
1244
|
+
retryPolicy?: RetryPolicy;
|
|
1245
|
+
/** Consecutive failures before the breaker opens. Default 5. */
|
|
1246
|
+
breakerThreshold?: number;
|
|
1247
|
+
/** Breaker cooldown in ms once open. Default 30000. */
|
|
1248
|
+
breakerCooldownMs?: number;
|
|
1249
|
+
}
|
|
1250
|
+
/** A `fetch` wrapper with retries and a per-host circuit breaker. */
|
|
1251
|
+
declare class HTTPClient {
|
|
1252
|
+
private readonly baseUrl;
|
|
1253
|
+
private readonly defaultHeaders;
|
|
1254
|
+
private readonly timeoutMs;
|
|
1255
|
+
private readonly retryPolicy;
|
|
1256
|
+
private readonly breakerThreshold;
|
|
1257
|
+
private readonly breakerCooldownMs;
|
|
1258
|
+
private readonly breakers;
|
|
1259
|
+
/**
|
|
1260
|
+
* @param options - Base URL, headers, timeout, retry and breaker settings.
|
|
1261
|
+
*/
|
|
1262
|
+
constructor(options?: HTTPClientOptions);
|
|
1263
|
+
private resolve;
|
|
1264
|
+
private hostOf;
|
|
1265
|
+
private breakerCheck;
|
|
1266
|
+
private breakerRecord;
|
|
1267
|
+
/**
|
|
1268
|
+
* Perform a request with retries and breaker protection.
|
|
1269
|
+
*
|
|
1270
|
+
* @param method - HTTP method.
|
|
1271
|
+
* @param url - Absolute URL or a path resolved against `baseUrl`.
|
|
1272
|
+
* @param init - Extra `fetch` init (headers, body, …).
|
|
1273
|
+
* @returns The `Response`.
|
|
1274
|
+
* @throws {CircuitOpenError} When the per-host breaker is open.
|
|
1275
|
+
*/
|
|
1276
|
+
request(method: string, url: string, init?: RequestInit): Promise<Response>;
|
|
1277
|
+
private sleep;
|
|
1278
|
+
/** GET request. */
|
|
1279
|
+
get(url: string, init?: RequestInit): Promise<Response>;
|
|
1280
|
+
/** POST request. */
|
|
1281
|
+
post(url: string, init?: RequestInit): Promise<Response>;
|
|
1282
|
+
/** PUT request. */
|
|
1283
|
+
put(url: string, init?: RequestInit): Promise<Response>;
|
|
1284
|
+
/** PATCH request. */
|
|
1285
|
+
patch(url: string, init?: RequestInit): Promise<Response>;
|
|
1286
|
+
/** DELETE request. */
|
|
1287
|
+
delete(url: string, init?: RequestInit): Promise<Response>;
|
|
1288
|
+
}
|
|
1289
|
+
|
|
1290
|
+
/**
|
|
1291
|
+
* System metrics, mirroring `utils.metrics.MetricsUtils`.
|
|
1292
|
+
*
|
|
1293
|
+
* Reads CPU, memory and process stats from Node's built-in `node:os` /
|
|
1294
|
+
* `process` — no native dependency (GPU metrics from the FastAPI SDK are out of
|
|
1295
|
+
* scope here). Includes a Prometheus text-format exporter.
|
|
1296
|
+
*/
|
|
1297
|
+
/** CPU load metrics. */
|
|
1298
|
+
interface CPUMetrics {
|
|
1299
|
+
/** Number of logical cores. */
|
|
1300
|
+
cores: number;
|
|
1301
|
+
/** 1-minute load average (0 on platforms without load average). */
|
|
1302
|
+
load1: number;
|
|
1303
|
+
/** Load average over 1 minute as a fraction of core count. */
|
|
1304
|
+
loadPercent: number;
|
|
1305
|
+
}
|
|
1306
|
+
/** Memory usage metrics (bytes). */
|
|
1307
|
+
interface MemoryMetrics {
|
|
1308
|
+
/** Total system memory. */
|
|
1309
|
+
total: number;
|
|
1310
|
+
/** Free system memory. */
|
|
1311
|
+
free: number;
|
|
1312
|
+
/** Used system memory. */
|
|
1313
|
+
used: number;
|
|
1314
|
+
/** Used memory as a percentage of total. */
|
|
1315
|
+
usedPercent: number;
|
|
1316
|
+
/** Resident set size of the current process. */
|
|
1317
|
+
processRss: number;
|
|
1318
|
+
}
|
|
1319
|
+
/** A snapshot of system + process metrics. */
|
|
1320
|
+
interface SystemMetrics {
|
|
1321
|
+
cpu: CPUMetrics;
|
|
1322
|
+
memory: MemoryMetrics;
|
|
1323
|
+
/** Process uptime in seconds. */
|
|
1324
|
+
uptimeSeconds: number;
|
|
1325
|
+
}
|
|
1326
|
+
/** Read CPU load metrics. */
|
|
1327
|
+
declare function readCpu(): CPUMetrics;
|
|
1328
|
+
/** Read memory usage metrics. */
|
|
1329
|
+
declare function readMemory(): MemoryMetrics;
|
|
1330
|
+
/** Read a full system snapshot. */
|
|
1331
|
+
declare function readSystem(): SystemMetrics;
|
|
1332
|
+
/**
|
|
1333
|
+
* Render a snapshot as Prometheus text-format metrics.
|
|
1334
|
+
*
|
|
1335
|
+
* @param snapshot - A snapshot (defaults to a fresh {@link readSystem}).
|
|
1336
|
+
* @returns The Prometheus exposition text.
|
|
1337
|
+
*/
|
|
1338
|
+
declare function toPrometheus(snapshot?: SystemMetrics): string;
|
|
1339
|
+
/** Stateless system-metrics reader + Prometheus exporter. */
|
|
1340
|
+
declare const MetricsUtils: {
|
|
1341
|
+
readonly cpu: typeof readCpu;
|
|
1342
|
+
readonly memory: typeof readMemory;
|
|
1343
|
+
readonly system: typeof readSystem;
|
|
1344
|
+
readonly toPrometheus: typeof toPrometheus;
|
|
1345
|
+
};
|
|
1346
|
+
|
|
1347
|
+
/**
|
|
1348
|
+
* Transactional email, mirroring `utils.email.EmailUtils`.
|
|
1349
|
+
*
|
|
1350
|
+
* Wraps the optional `nodemailer` peer (lazily imported) behind a tiny
|
|
1351
|
+
* `send` surface. The transport is created once from SMTP options and reused.
|
|
1352
|
+
*/
|
|
1353
|
+
/** SMTP connection + sender options. */
|
|
1354
|
+
interface EmailOptions {
|
|
1355
|
+
/** SMTP host. */
|
|
1356
|
+
host: string;
|
|
1357
|
+
/** SMTP port. Default 587. */
|
|
1358
|
+
port?: number;
|
|
1359
|
+
/** Use TLS on connect. Default `false` (STARTTLS on 587). */
|
|
1360
|
+
secure?: boolean;
|
|
1361
|
+
/** SMTP auth user. */
|
|
1362
|
+
user?: string;
|
|
1363
|
+
/** SMTP auth password. */
|
|
1364
|
+
password?: string;
|
|
1365
|
+
/** Default `From` address. */
|
|
1366
|
+
from: string;
|
|
1367
|
+
}
|
|
1368
|
+
/** A single email message. */
|
|
1369
|
+
interface EmailMessage {
|
|
1370
|
+
/** Recipient(s). */
|
|
1371
|
+
to: string | string[];
|
|
1372
|
+
/** Subject line. */
|
|
1373
|
+
subject: string;
|
|
1374
|
+
/** Plain-text body. */
|
|
1375
|
+
text?: string;
|
|
1376
|
+
/** HTML body. */
|
|
1377
|
+
html?: string;
|
|
1378
|
+
/** Override the default `From`. */
|
|
1379
|
+
from?: string;
|
|
1380
|
+
}
|
|
1381
|
+
/** Sends transactional email over SMTP via `nodemailer`. */
|
|
1382
|
+
declare class EmailUtils {
|
|
1383
|
+
private readonly options;
|
|
1384
|
+
private transport;
|
|
1385
|
+
/**
|
|
1386
|
+
* @param options - SMTP connection and default sender.
|
|
1387
|
+
*/
|
|
1388
|
+
constructor(options: EmailOptions);
|
|
1389
|
+
private ready;
|
|
1390
|
+
/**
|
|
1391
|
+
* Send an email message.
|
|
1392
|
+
*
|
|
1393
|
+
* @param message - The message (recipients, subject, body).
|
|
1394
|
+
*/
|
|
1395
|
+
send(message: EmailMessage): Promise<void>;
|
|
1396
|
+
}
|
|
1397
|
+
|
|
1133
1398
|
/**
|
|
1134
1399
|
* Cache managers, mirroring `cache.redis_manager`.
|
|
1135
1400
|
*
|
|
@@ -1445,7 +1710,7 @@ declare class EventStream {
|
|
|
1445
1710
|
* @param res - The Express response to stream into.
|
|
1446
1711
|
* @param stream - The event stream to drain.
|
|
1447
1712
|
*/
|
|
1448
|
-
declare function sseResponse(req: Request, res: Response, stream: EventStream): Promise<void>;
|
|
1713
|
+
declare function sseResponse(req: Request, res: Response$1, stream: EventStream): Promise<void>;
|
|
1449
1714
|
|
|
1450
1715
|
/**
|
|
1451
1716
|
* In-process SSE broker, mirroring `sse.broker.SSEBroker`.
|
|
@@ -1875,6 +2140,110 @@ declare class LocalUploadStorage implements UploadStorage {
|
|
|
1875
2140
|
*/
|
|
1876
2141
|
declare function buildContentDisposition(filename: string, inline?: boolean): string;
|
|
1877
2142
|
|
|
2143
|
+
/** Web Push DTOs (Zod), mirroring `webpush.schemas`. */
|
|
2144
|
+
|
|
2145
|
+
/** The browser-provided push subscription keys. */
|
|
2146
|
+
declare const webPushKeysSchema: z.ZodObject<{
|
|
2147
|
+
p256dh: z.ZodString;
|
|
2148
|
+
auth: z.ZodString;
|
|
2149
|
+
}, "strip", z.ZodTypeAny, {
|
|
2150
|
+
auth: string;
|
|
2151
|
+
p256dh: string;
|
|
2152
|
+
}, {
|
|
2153
|
+
auth: string;
|
|
2154
|
+
p256dh: string;
|
|
2155
|
+
}>;
|
|
2156
|
+
/** A browser push subscription. */
|
|
2157
|
+
declare const webPushSubscriptionSchema: z.ZodObject<{
|
|
2158
|
+
endpoint: z.ZodString;
|
|
2159
|
+
keys: z.ZodObject<{
|
|
2160
|
+
p256dh: z.ZodString;
|
|
2161
|
+
auth: z.ZodString;
|
|
2162
|
+
}, "strip", z.ZodTypeAny, {
|
|
2163
|
+
auth: string;
|
|
2164
|
+
p256dh: string;
|
|
2165
|
+
}, {
|
|
2166
|
+
auth: string;
|
|
2167
|
+
p256dh: string;
|
|
2168
|
+
}>;
|
|
2169
|
+
}, "strip", z.ZodTypeAny, {
|
|
2170
|
+
keys: {
|
|
2171
|
+
auth: string;
|
|
2172
|
+
p256dh: string;
|
|
2173
|
+
};
|
|
2174
|
+
endpoint: string;
|
|
2175
|
+
}, {
|
|
2176
|
+
keys: {
|
|
2177
|
+
auth: string;
|
|
2178
|
+
p256dh: string;
|
|
2179
|
+
};
|
|
2180
|
+
endpoint: string;
|
|
2181
|
+
}>;
|
|
2182
|
+
/** A push notification payload. */
|
|
2183
|
+
declare const webPushPayloadSchema: z.ZodObject<{
|
|
2184
|
+
title: z.ZodString;
|
|
2185
|
+
body: z.ZodOptional<z.ZodString>;
|
|
2186
|
+
url: z.ZodOptional<z.ZodString>;
|
|
2187
|
+
data: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
2188
|
+
}, "strip", z.ZodTypeAny, {
|
|
2189
|
+
title: string;
|
|
2190
|
+
url?: string | undefined;
|
|
2191
|
+
data?: Record<string, unknown> | undefined;
|
|
2192
|
+
body?: string | undefined;
|
|
2193
|
+
}, {
|
|
2194
|
+
title: string;
|
|
2195
|
+
url?: string | undefined;
|
|
2196
|
+
data?: Record<string, unknown> | undefined;
|
|
2197
|
+
body?: string | undefined;
|
|
2198
|
+
}>;
|
|
2199
|
+
type WebPushKeys = z.infer<typeof webPushKeysSchema>;
|
|
2200
|
+
type WebPushSubscription = z.infer<typeof webPushSubscriptionSchema>;
|
|
2201
|
+
type WebPushPayload = z.infer<typeof webPushPayloadSchema>;
|
|
2202
|
+
|
|
2203
|
+
/**
|
|
2204
|
+
* Web Push (VAPID) dispatch, mirroring `webpush.dispatcher`.
|
|
2205
|
+
*
|
|
2206
|
+
* Wraps the optional `web-push` peer (lazily imported). A `410 Gone` / `404`
|
|
2207
|
+
* from the push service means the subscription is dead — surfaced as
|
|
2208
|
+
* {@link WebPushGoneError} so the caller can prune it from storage.
|
|
2209
|
+
*/
|
|
2210
|
+
|
|
2211
|
+
/** A Web Push delivery failure. */
|
|
2212
|
+
declare class WebPushError extends Error {
|
|
2213
|
+
readonly statusCode?: number | undefined;
|
|
2214
|
+
constructor(message: string, statusCode?: number | undefined);
|
|
2215
|
+
}
|
|
2216
|
+
/** The subscription is expired/unsubscribed (410/404) — prune it. */
|
|
2217
|
+
declare class WebPushGoneError extends WebPushError {
|
|
2218
|
+
constructor(statusCode: number);
|
|
2219
|
+
}
|
|
2220
|
+
/** Options for {@link WebPushDispatcher}. */
|
|
2221
|
+
interface WebPushDispatcherOptions {
|
|
2222
|
+
/** VAPID public key. */
|
|
2223
|
+
publicKey: string;
|
|
2224
|
+
/** VAPID private key. */
|
|
2225
|
+
privateKey: string;
|
|
2226
|
+
/** VAPID subject (`mailto:` or site URL). */
|
|
2227
|
+
subject: string;
|
|
2228
|
+
}
|
|
2229
|
+
/** Sends Web Push notifications with configured VAPID details. */
|
|
2230
|
+
declare class WebPushDispatcher {
|
|
2231
|
+
private readonly options;
|
|
2232
|
+
/**
|
|
2233
|
+
* @param options - VAPID keys and subject.
|
|
2234
|
+
*/
|
|
2235
|
+
constructor(options: WebPushDispatcherOptions);
|
|
2236
|
+
/**
|
|
2237
|
+
* Send a payload to a single subscription.
|
|
2238
|
+
*
|
|
2239
|
+
* @param subscription - The browser push subscription.
|
|
2240
|
+
* @param payload - The notification payload.
|
|
2241
|
+
* @throws {WebPushGoneError} When the subscription is expired (410/404).
|
|
2242
|
+
* @throws {WebPushError} On any other delivery failure.
|
|
2243
|
+
*/
|
|
2244
|
+
send(subscription: WebPushSubscription, payload: WebPushPayload): Promise<void>;
|
|
2245
|
+
}
|
|
2246
|
+
|
|
1878
2247
|
/**
|
|
1879
2248
|
* Auth DTOs (Zod), mirroring `auth.schemas`.
|
|
1880
2249
|
*
|
|
@@ -2467,6 +2836,6 @@ interface RunServerOptions {
|
|
|
2467
2836
|
declare function runServer(app: Express, options?: RunServerOptions): Promise<Server>;
|
|
2468
2837
|
|
|
2469
2838
|
/** The installed SDK version. Single source of truth for the barrel + CLI. */
|
|
2470
|
-
declare const VERSION = "0.
|
|
2839
|
+
declare const VERSION = "0.3.0";
|
|
2471
2840
|
|
|
2472
|
-
export { AppException, type AppExceptionHandlerOptions, type AppExceptionOptions, type AttachWebSocketOptions, AttemptThrottle, type AttemptThrottleOptions, type AuthResponse, type AuthRouterOptions, type AuthUser, type BaseAppSettings, BaseController, BaseModel, type BaseResponse, BaseService, type BrokerManager, CEP_PATTERN, CNPJ_PATTERN, CPF_PATTERN, type CacheManager, type CachedOptions, type CatalogData, CompositeFeatureFlagBackend, ConflictException, type CreateAppOpenApi, type CreateAppOptions, type CursorPaginationFilter, DEFAULT_LOCALE, type Enum, type EnumHelpers, type EnumSpec, EnvFeatureFlagBackend, EventStream, type EventStreamOptions, type ExceptionDetails, ExpiredTokenException, type FeatureFlagBackend, FeatureFlags, type FlagContext, ForbiddenException, type GenerateOpenApiOptions, HTTP_500_MARKER, type HandshakeInfo, type HealthCheck, type HealthRouterOptions, InvalidTokenException, type IssuedSession, JSONLogger, JWTUtils, type JWTUtilsOptions, type JwtAuthOptions, type JwtClaims, LocalUploadStorage, type LocalUploadStorageOptions, type LogExtra, type LogLevel, type LoginInput, MemoryBroker, MemoryCacheManager, MemoryFeatureFlagBackend, MemorySessionStore, MemoryThrottleBackend, MessageCatalog, type MessageHandler, NotFoundException, type OpenApiDocument, type OpenApiInfo, PHONE_BR_PATTERN, type PaginationFilter, PasswordUtils, REQUEST_ID_HEADER, RabbitBroker, type RabbitBrokerOptions, RedisCacheManager, type RedisLike, type RedocOptions, type RefreshInput, Region, type RegionValue, type RegisterExceptionHandlersOptions, type RequestContext, type ResponseMapper, type RunServerOptions, SSEBroker, type SaveOptions, ServerSentEvent, type ServerSentEventInit, type Session, type SessionMiddlewareOptions, SessionService, type SessionServiceOptions, type SessionStore, type SignupInput, type StateBR, type SwaggerOptions, type TaskHandler, TaskManager, type TaskManagerOptions, type ThrottleBackend, type ThrottleStatus, type ToDictOptions, type TokenPair, TooManyRequestsException, type TooManyRequestsOptions, UF, type UFValue, UnauthorizedException, type UnhandledExceptionHandlerOptions, type UploadResult, type UploadStorage, UserAuthService, type UserAuthServiceOptions, type UserPublic, type UserStore, VERSION, ValidationException, type WSEnvelope, type WebSocketConnection, WebSocketHub, type WebSocketHubOptions, type WebSocketLike, attachWebSocketHub, authResponseSchema, baseAppSettingsSchema, baseAppSettingsShape, baseResponseSchema, bearerToken, buildContentDisposition, cached, cepField, citiesByUf, cnpjField, coerceFlag, configureLogging, corsSettingsShape, cpfField, cpfOrCnpjField, createApp, createOpenApiRegistry, createdByColumn, cursorPaginationFilterSchema, cursorPaginationSchema, databaseSettingsShape, decodeCursor, defaultMessageCatalog, defineEnum, deletedAtColumn, encodeCursor, generateOpaqueToken, generateOpenApiDocument, getAuth, getConditions, getPaginationConditions, getRequestId, getState, hashOpaqueToken, isValidCep, isValidCity, isValidCnpj, isValidCpf, isValidCpfCnpj, isValidPhoneBr, isValidUf, listStates, loadSettings, loginSchema, makeAppExceptionHandler, makeAuthRouter, makeFlagGuard, makeHealthRouter, makeJwtAuthMiddleware, makeSessionMiddleware, makeUnhandledExceptionHandler, modifyDict, mountOpenApiJson, mountRedoc, mountSwaggerUi, normalizeCep, normalizeCnpj, normalizeCpf, normalizeCpfCnpj, normalizePhoneBr, normalizeUf, notFoundHandler, onlyDigits, paginationFilterSchema, paginationSchema, parseAcceptLanguage, parseCookies, phoneBrField, refreshSchema, registerExceptionHandlers, requestIdMiddleware, requireRoles, runServer, runWithRequestContext, serverSettingsShape, sessionCookie, setRequestId, signupSchema, sseResponse, statesByRegion, tableNameFor, toDict, toUtc, tokenFromUrl, tokenPairSchema, ufField, updatedByColumn, userPublicSchema, utcnow, verifyOpaqueToken, wsEnvelopeSchema };
|
|
2841
|
+
export { AppException, type AppExceptionHandlerOptions, type AppExceptionOptions, type AttachWebSocketOptions, AttemptThrottle, type AttemptThrottleOptions, type AuthResponse, type AuthRouterOptions, type AuthUser, type BaseAppSettings, BaseController, BaseModel, type BaseResponse, BaseService, type BrokerManager, CEP_PATTERN, CNPJ_PATTERN, CPF_PATTERN, type CPUMetrics, type CacheManager, type CachedOptions, type CatalogData, CircuitOpenError, type ClientIpOptions, CompositeFeatureFlagBackend, ConflictException, type CreateAppOpenApi, type CreateAppOptions, type CursorPaginationFilter, DEFAULT_LOCALE, type EmailMessage, type EmailOptions, EmailUtils, type Enum, type EnumHelpers, type EnumSpec, EnvFeatureFlagBackend, EventStream, type EventStreamOptions, type ExceptionDetails, ExpiredTokenException, type FeatureFlagBackend, FeatureFlags, type FlagContext, ForbiddenException, type GenerateOpenApiOptions, HTTPClient, type HTTPClientOptions, HTTP_500_MARKER, type HandshakeInfo, type HealthCheck, type HealthRouterOptions, InvalidTokenException, type IssuedSession, JSONLogger, JWTUtils, type JWTUtilsOptions, type JwtAuthOptions, type JwtClaims, LocalUploadStorage, type LocalUploadStorageOptions, type LogExtra, type LogLevel, type LoginInput, MemoryBroker, MemoryCacheManager, MemoryFeatureFlagBackend, type MemoryMetrics, MemorySessionStore, MemoryThrottleBackend, MessageCatalog, type MessageHandler, MetricsUtils, NotFoundException, type OpenApiDocument, type OpenApiInfo, PHONE_BR_PATTERN, type PaginationFilter, PasswordUtils, REQUEST_ID_HEADER, RabbitBroker, type RabbitBrokerOptions, RedisCacheManager, type RedisLike, type RedocOptions, type RefreshInput, Region, type RegionValue, type RegisterExceptionHandlersOptions, type RequestContext, type ResponseMapper, RetryPolicy, type RunServerOptions, SSEBroker, type SaveOptions, ServerSentEvent, type ServerSentEventInit, type Session, type SessionMiddlewareOptions, SessionService, type SessionServiceOptions, type SessionStore, type SignupInput, type StateBR, type SwaggerOptions, type SystemMetrics, TOTPHelper, type TOTPOptions, type TaskHandler, TaskManager, type TaskManagerOptions, type ThrottleBackend, type ThrottleStatus, type ToDictOptions, type TokenPair, TooManyRequestsException, type TooManyRequestsOptions, UF, type UFValue, UnauthorizedException, type UnhandledExceptionHandlerOptions, type UploadResult, type UploadStorage, UserAuthService, type UserAuthServiceOptions, type UserPublic, type UserStore, VERSION, ValidationException, type WSEnvelope, WebPushDispatcher, type WebPushDispatcherOptions, WebPushError, WebPushGoneError, type WebPushKeys, type WebPushPayload, type WebPushSubscription, type WebSocketConnection, WebSocketHub, type WebSocketHubOptions, type WebSocketLike, attachWebSocketHub, authResponseSchema, baseAppSettingsSchema, baseAppSettingsShape, baseResponseSchema, bearerToken, buildContentDisposition, cached, cepField, citiesByUf, cnpjField, coerceFlag, configureLogging, corsSettingsShape, cpfField, cpfOrCnpjField, createApp, createOpenApiRegistry, createdByColumn, cursorPaginationFilterSchema, cursorPaginationSchema, databaseSettingsShape, decodeCursor, defaultMessageCatalog, defineEnum, deletedAtColumn, encodeCursor, generateOpaqueToken, generateOpenApiDocument, getAuth, getClientIp, getConditions, getPaginationConditions, getRequestId, getState, hashOpaqueToken, isValidCep, isValidCity, isValidCnpj, isValidCpf, isValidCpfCnpj, isValidPhoneBr, isValidUf, listStates, loadSettings, loginSchema, makeAppExceptionHandler, makeAuthRouter, makeFlagGuard, makeHealthRouter, makeJwtAuthMiddleware, makeSessionMiddleware, makeUnhandledExceptionHandler, modifyDict, mountOpenApiJson, mountRedoc, mountSwaggerUi, normalizeCep, normalizeCnpj, normalizeCpf, normalizeCpfCnpj, normalizePhoneBr, normalizeUf, notFoundHandler, onlyDigits, paginationFilterSchema, paginationSchema, parseAcceptLanguage, parseCookies, phoneBrField, refreshSchema, registerExceptionHandlers, requestIdMiddleware, requireRoles, runServer, runWithRequestContext, serverSettingsShape, sessionCookie, setRequestId, signupSchema, sseResponse, statesByRegion, tableNameFor, toDict, toUtc, tokenFromUrl, tokenPairSchema, ufField, updatedByColumn, userPublicSchema, utcnow, verifyOpaqueToken, webPushKeysSchema, webPushPayloadSchema, webPushSubscriptionSchema, wsEnvelopeSchema };
|