tempest-express-sdk 0.8.0 → 0.10.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 +5 -4
- package/dist/chunk-U3SXT3KR.js +6 -0
- package/dist/{chunk-JWJJAIXV.js.map → chunk-U3SXT3KR.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 +159 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +227 -86
- package/dist/index.d.ts +227 -86
- package/dist/index.js +157 -4
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-JWJJAIXV.js +0 -6
package/dist/index.d.cts
CHANGED
|
@@ -1291,8 +1291,9 @@ declare class HTTPClient {
|
|
|
1291
1291
|
* System metrics, mirroring `utils.metrics.MetricsUtils`.
|
|
1292
1292
|
*
|
|
1293
1293
|
* Reads CPU, memory and process stats from Node's built-in `node:os` /
|
|
1294
|
-
* `process` — no native dependency
|
|
1295
|
-
*
|
|
1294
|
+
* `process` — no native dependency. Optional GPU metrics shell out to
|
|
1295
|
+
* `nvidia-smi` (returns `[]` when unavailable). Includes a Prometheus
|
|
1296
|
+
* text-format exporter.
|
|
1296
1297
|
*/
|
|
1297
1298
|
/** CPU load metrics. */
|
|
1298
1299
|
interface CPUMetrics {
|
|
@@ -1316,6 +1317,19 @@ interface MemoryMetrics {
|
|
|
1316
1317
|
/** Resident set size of the current process. */
|
|
1317
1318
|
processRss: number;
|
|
1318
1319
|
}
|
|
1320
|
+
/** A single GPU's metrics (from `nvidia-smi`). */
|
|
1321
|
+
interface GPUMetrics {
|
|
1322
|
+
/** GPU index. */
|
|
1323
|
+
index: number;
|
|
1324
|
+
/** GPU utilization percent. */
|
|
1325
|
+
utilizationPercent: number;
|
|
1326
|
+
/** Used memory in MiB. */
|
|
1327
|
+
memoryUsedMb: number;
|
|
1328
|
+
/** Total memory in MiB. */
|
|
1329
|
+
memoryTotalMb: number;
|
|
1330
|
+
/** Core temperature in °C. */
|
|
1331
|
+
temperatureC: number;
|
|
1332
|
+
}
|
|
1319
1333
|
/** A snapshot of system + process metrics. */
|
|
1320
1334
|
interface SystemMetrics {
|
|
1321
1335
|
cpu: CPUMetrics;
|
|
@@ -1330,17 +1344,26 @@ declare function readMemory(): MemoryMetrics;
|
|
|
1330
1344
|
/** Read a full system snapshot. */
|
|
1331
1345
|
declare function readSystem(): SystemMetrics;
|
|
1332
1346
|
/**
|
|
1333
|
-
*
|
|
1347
|
+
* Read GPU metrics via `nvidia-smi`. Returns `[]` when the tool is absent or
|
|
1348
|
+
* fails (no GPU, not installed) — never throws.
|
|
1349
|
+
*
|
|
1350
|
+
* @returns One {@link GPUMetrics} per detected GPU.
|
|
1351
|
+
*/
|
|
1352
|
+
declare function readGpus(): Promise<GPUMetrics[]>;
|
|
1353
|
+
/**
|
|
1354
|
+
* Render metrics as Prometheus text-format.
|
|
1334
1355
|
*
|
|
1335
|
-
* @param snapshot - A snapshot (defaults to a fresh {@link readSystem}).
|
|
1356
|
+
* @param snapshot - A system snapshot (defaults to a fresh {@link readSystem}).
|
|
1357
|
+
* @param gpus - Optional GPU metrics to append (from {@link readGpus}).
|
|
1336
1358
|
* @returns The Prometheus exposition text.
|
|
1337
1359
|
*/
|
|
1338
|
-
declare function toPrometheus(snapshot?: SystemMetrics): string;
|
|
1360
|
+
declare function toPrometheus(snapshot?: SystemMetrics, gpus?: GPUMetrics[]): string;
|
|
1339
1361
|
/** Stateless system-metrics reader + Prometheus exporter. */
|
|
1340
1362
|
declare const MetricsUtils: {
|
|
1341
1363
|
readonly cpu: typeof readCpu;
|
|
1342
1364
|
readonly memory: typeof readMemory;
|
|
1343
1365
|
readonly system: typeof readSystem;
|
|
1366
|
+
readonly gpus: typeof readGpus;
|
|
1344
1367
|
readonly toPrometheus: typeof toPrometheus;
|
|
1345
1368
|
};
|
|
1346
1369
|
|
|
@@ -2618,6 +2641,51 @@ interface TwilioWebhookOptions {
|
|
|
2618
2641
|
*/
|
|
2619
2642
|
declare function makeTwilioWebhookRouter(options: TwilioWebhookOptions): Router;
|
|
2620
2643
|
|
|
2644
|
+
/**
|
|
2645
|
+
* Email channel — a {@link MessagingProvider} over {@link EmailUtils}.
|
|
2646
|
+
*
|
|
2647
|
+
* Lets transactional email participate in the same swappable messaging contract
|
|
2648
|
+
* as WhatsApp/Telegram/SMS: `sendText` sends a plain email, `sendMedia` sends
|
|
2649
|
+
* the media as a link in the body. Inbound (`onMessage`) is absent — email
|
|
2650
|
+
* ingestion is out of scope. Requires the optional `nodemailer` peer via
|
|
2651
|
+
* {@link EmailUtils}.
|
|
2652
|
+
*/
|
|
2653
|
+
|
|
2654
|
+
/** Options for {@link EmailProvider}. */
|
|
2655
|
+
interface EmailProviderOptions {
|
|
2656
|
+
/** The configured SMTP sender. */
|
|
2657
|
+
email: EmailUtils;
|
|
2658
|
+
/** Default subject line for `sendText`/`sendMedia`. Default `"Notification"`. */
|
|
2659
|
+
subject?: string;
|
|
2660
|
+
}
|
|
2661
|
+
/** An email-backed {@link MessagingProvider}. */
|
|
2662
|
+
declare class EmailProvider implements MessagingProvider {
|
|
2663
|
+
private readonly email;
|
|
2664
|
+
private readonly subject;
|
|
2665
|
+
/**
|
|
2666
|
+
* @param options - The email sender and default subject.
|
|
2667
|
+
*/
|
|
2668
|
+
constructor(options: EmailProviderOptions);
|
|
2669
|
+
/**
|
|
2670
|
+
* Send a plain-text email.
|
|
2671
|
+
*
|
|
2672
|
+
* @param to - Recipient address.
|
|
2673
|
+
* @param text - Body text (also used as HTML).
|
|
2674
|
+
* @returns A sent result.
|
|
2675
|
+
*/
|
|
2676
|
+
sendText(to: string, text: string): Promise<OutboundResult>;
|
|
2677
|
+
/**
|
|
2678
|
+
* Send an email linking to the media (caption becomes the lead text).
|
|
2679
|
+
*
|
|
2680
|
+
* @param to - Recipient address.
|
|
2681
|
+
* @param media - The media reference (URL) + optional caption.
|
|
2682
|
+
* @returns A sent result.
|
|
2683
|
+
*/
|
|
2684
|
+
sendMedia(to: string, media: OutboundMedia): Promise<OutboundResult>;
|
|
2685
|
+
/** Always `"connected"` — SMTP reachability is verified on first send. */
|
|
2686
|
+
status(): Promise<string>;
|
|
2687
|
+
}
|
|
2688
|
+
|
|
2621
2689
|
/**
|
|
2622
2690
|
* Admin site + resource registry, mirroring `admin.site` / `admin.config`.
|
|
2623
2691
|
*
|
|
@@ -2896,6 +2964,17 @@ declare const mfaCodeSchema: z.ZodObject<{
|
|
|
2896
2964
|
}, {
|
|
2897
2965
|
code: string;
|
|
2898
2966
|
}>;
|
|
2967
|
+
/** MFA login-challenge body (`POST /auth/mfa/challenge`). */
|
|
2968
|
+
declare const mfaChallengeSchema: z.ZodObject<{
|
|
2969
|
+
mfaToken: z.ZodString;
|
|
2970
|
+
code: z.ZodString;
|
|
2971
|
+
}, "strip", z.ZodTypeAny, {
|
|
2972
|
+
code: string;
|
|
2973
|
+
mfaToken: string;
|
|
2974
|
+
}, {
|
|
2975
|
+
code: string;
|
|
2976
|
+
mfaToken: string;
|
|
2977
|
+
}>;
|
|
2899
2978
|
/** Activation body (`POST /auth/activate`). */
|
|
2900
2979
|
declare const activationSchema: z.ZodObject<{
|
|
2901
2980
|
token: z.ZodString;
|
|
@@ -2930,17 +3009,100 @@ type TokenPair = z.infer<typeof tokenPairSchema>;
|
|
|
2930
3009
|
type UserPublic = z.infer<typeof userPublicSchema>;
|
|
2931
3010
|
type AuthResponse = z.infer<typeof authResponseSchema>;
|
|
2932
3011
|
type MfaCodeInput = z.infer<typeof mfaCodeSchema>;
|
|
3012
|
+
type MfaChallengeInput = z.infer<typeof mfaChallengeSchema>;
|
|
2933
3013
|
type ActivationInput = z.infer<typeof activationSchema>;
|
|
2934
3014
|
type PasswordResetRequestInput = z.infer<typeof passwordResetRequestSchema>;
|
|
2935
3015
|
type PasswordResetConfirmInput = z.infer<typeof passwordResetConfirmSchema>;
|
|
2936
3016
|
|
|
3017
|
+
/**
|
|
3018
|
+
* TOTP MFA enrollment/verification, mirroring the FastAPI SDK MFA flow.
|
|
3019
|
+
*
|
|
3020
|
+
* Orchestrates {@link TOTPHelper} over a pluggable {@link MfaStore}: enroll
|
|
3021
|
+
* (generate + persist a secret, return the provisioning URI), confirm (verify a
|
|
3022
|
+
* code and flip MFA on), verify (login step) and disable.
|
|
3023
|
+
*/
|
|
3024
|
+
|
|
3025
|
+
/** Persistence port for MFA secrets/state. */
|
|
3026
|
+
interface MfaStore {
|
|
3027
|
+
/** Persist a user's TOTP secret (pending until confirmed). */
|
|
3028
|
+
setSecret(userId: string, secret: string): Promise<void>;
|
|
3029
|
+
/** Read a user's TOTP secret, or `null`. */
|
|
3030
|
+
getSecret(userId: string): Promise<string | null>;
|
|
3031
|
+
/** Flip the MFA-enabled flag. */
|
|
3032
|
+
setEnabled(userId: string, enabled: boolean): Promise<void>;
|
|
3033
|
+
/** Whether MFA is enabled for the user. */
|
|
3034
|
+
isEnabled(userId: string): Promise<boolean>;
|
|
3035
|
+
}
|
|
3036
|
+
/** The result of starting enrollment. */
|
|
3037
|
+
interface MfaEnrollment {
|
|
3038
|
+
/** The base32 secret (persist server-side; also shown once for manual entry). */
|
|
3039
|
+
secret: string;
|
|
3040
|
+
/** The `otpauth://` URI to render as a QR code. */
|
|
3041
|
+
otpauthUri: string;
|
|
3042
|
+
}
|
|
3043
|
+
/** Options for {@link MfaService}. */
|
|
3044
|
+
interface MfaServiceOptions {
|
|
3045
|
+
/** The MFA persistence port. */
|
|
3046
|
+
store: MfaStore;
|
|
3047
|
+
/** The TOTP helper (issuer preconfigured). */
|
|
3048
|
+
totp: TOTPHelper;
|
|
3049
|
+
}
|
|
3050
|
+
declare class MfaService {
|
|
3051
|
+
private readonly store;
|
|
3052
|
+
private readonly totp;
|
|
3053
|
+
/**
|
|
3054
|
+
* @param options - Store and TOTP helper.
|
|
3055
|
+
*/
|
|
3056
|
+
constructor(options: MfaServiceOptions);
|
|
3057
|
+
/**
|
|
3058
|
+
* Begin enrollment: generate and persist a secret, return the QR URI.
|
|
3059
|
+
*
|
|
3060
|
+
* @param userId - The enrolling user.
|
|
3061
|
+
* @param accountName - Label shown in the authenticator (usually the email).
|
|
3062
|
+
* @returns The secret and provisioning URI.
|
|
3063
|
+
*/
|
|
3064
|
+
enroll(userId: string, accountName: string): Promise<MfaEnrollment>;
|
|
3065
|
+
/**
|
|
3066
|
+
* Confirm enrollment by verifying a code, enabling MFA on success.
|
|
3067
|
+
*
|
|
3068
|
+
* @param userId - The user.
|
|
3069
|
+
* @param code - The 6-digit code from the authenticator.
|
|
3070
|
+
* @throws {ValidationException} When no secret is pending or the code is wrong.
|
|
3071
|
+
*/
|
|
3072
|
+
confirm(userId: string, code: string): Promise<void>;
|
|
3073
|
+
/**
|
|
3074
|
+
* Verify a code (login step). Returns `false` without throwing.
|
|
3075
|
+
*
|
|
3076
|
+
* @param userId - The user.
|
|
3077
|
+
* @param code - The submitted code.
|
|
3078
|
+
* @returns `true` when the code is valid.
|
|
3079
|
+
*/
|
|
3080
|
+
verify(userId: string, code: string): Promise<boolean>;
|
|
3081
|
+
/**
|
|
3082
|
+
* Whether MFA is enabled for a user (used to gate the login challenge).
|
|
3083
|
+
*
|
|
3084
|
+
* @param userId - The user.
|
|
3085
|
+
* @returns `true` when MFA is enabled.
|
|
3086
|
+
*/
|
|
3087
|
+
isEnabled(userId: string): Promise<boolean>;
|
|
3088
|
+
/**
|
|
3089
|
+
* Disable MFA after verifying a code.
|
|
3090
|
+
*
|
|
3091
|
+
* @param userId - The user.
|
|
3092
|
+
* @param code - The submitted code.
|
|
3093
|
+
* @throws {ValidationException} When the code is invalid.
|
|
3094
|
+
*/
|
|
3095
|
+
disable(userId: string, code: string): Promise<void>;
|
|
3096
|
+
}
|
|
3097
|
+
|
|
2937
3098
|
/**
|
|
2938
3099
|
* User authentication service, mirroring `auth.service.UserAuthService`.
|
|
2939
3100
|
*
|
|
2940
3101
|
* Orchestrates signup / login / refresh over a pluggable {@link UserStore},
|
|
2941
3102
|
* {@link PasswordUtils} and {@link JWTUtils}. It is ORM-agnostic — back the
|
|
2942
|
-
* store with a `tempest-db-js` repository (or anything else).
|
|
2943
|
-
*
|
|
3103
|
+
* store with a `tempest-db-js` repository (or anything else). With an
|
|
3104
|
+
* {@link MfaService} wired in, `login` returns an MFA challenge for enrolled
|
|
3105
|
+
* users (complete it via {@link UserAuthService.verifyMfaChallenge}).
|
|
2944
3106
|
*/
|
|
2945
3107
|
|
|
2946
3108
|
/** A persisted user as the auth layer needs to see it. */
|
|
@@ -2985,7 +3147,23 @@ interface UserAuthServiceOptions {
|
|
|
2985
3147
|
accessTtlSeconds?: number;
|
|
2986
3148
|
/** Refresh-token lifetime in seconds. Default 1209600 (14 days). */
|
|
2987
3149
|
refreshTtlSeconds?: number;
|
|
2988
|
-
|
|
3150
|
+
/**
|
|
3151
|
+
* When provided, `login` returns an MFA challenge instead of tokens for users
|
|
3152
|
+
* with MFA enabled; complete it with {@link UserAuthService.verifyMfaChallenge}.
|
|
3153
|
+
*/
|
|
3154
|
+
mfa?: MfaService;
|
|
3155
|
+
/** MFA challenge-token lifetime in seconds. Default 300 (5 min). */
|
|
3156
|
+
mfaChallengeTtlSeconds?: number;
|
|
3157
|
+
}
|
|
3158
|
+
/** Returned by `login` when the user must complete an MFA challenge. */
|
|
3159
|
+
interface MfaChallenge {
|
|
3160
|
+
/** Discriminator: an MFA step is required before tokens are issued. */
|
|
3161
|
+
mfaRequired: true;
|
|
3162
|
+
/** Short-lived token to submit alongside the code to `verifyMfaChallenge`. */
|
|
3163
|
+
mfaToken: string;
|
|
3164
|
+
}
|
|
3165
|
+
/** `login` result: either full auth, or an MFA challenge to complete. */
|
|
3166
|
+
type LoginResult = AuthResponse | MfaChallenge;
|
|
2989
3167
|
declare class UserAuthService {
|
|
2990
3168
|
private readonly store;
|
|
2991
3169
|
private readonly password;
|
|
@@ -2993,6 +3171,8 @@ declare class UserAuthService {
|
|
|
2993
3171
|
private readonly passwordMinLength;
|
|
2994
3172
|
private readonly accessTtlSeconds;
|
|
2995
3173
|
private readonly refreshTtlSeconds;
|
|
3174
|
+
private readonly mfa;
|
|
3175
|
+
private readonly mfaChallengeTtlSeconds;
|
|
2996
3176
|
/**
|
|
2997
3177
|
* @param options - Store, password/JWT helpers and token policy.
|
|
2998
3178
|
*/
|
|
@@ -3012,10 +3192,20 @@ declare class UserAuthService {
|
|
|
3012
3192
|
* Authenticate a user by email + password.
|
|
3013
3193
|
*
|
|
3014
3194
|
* @param data - Validated login payload.
|
|
3015
|
-
* @returns
|
|
3195
|
+
* @returns Full auth, or an {@link MfaChallenge} when MFA is enabled.
|
|
3016
3196
|
* @throws {UnauthorizedException} On bad credentials or inactive account.
|
|
3017
3197
|
*/
|
|
3018
|
-
login(data: LoginInput): Promise<
|
|
3198
|
+
login(data: LoginInput): Promise<LoginResult>;
|
|
3199
|
+
/**
|
|
3200
|
+
* Complete an MFA login challenge: verify the code and issue tokens.
|
|
3201
|
+
*
|
|
3202
|
+
* @param mfaToken - The challenge token from {@link login}.
|
|
3203
|
+
* @param code - The authenticator code.
|
|
3204
|
+
* @returns The public user and a fresh token pair.
|
|
3205
|
+
* @throws {UnauthorizedException} When the challenge/code is invalid, MFA is
|
|
3206
|
+
* not configured, or the account no longer exists / is inactive.
|
|
3207
|
+
*/
|
|
3208
|
+
verifyMfaChallenge(mfaToken: string, code: string): Promise<AuthResponse>;
|
|
3019
3209
|
/**
|
|
3020
3210
|
* Exchange a valid refresh token for a new token pair.
|
|
3021
3211
|
*
|
|
@@ -3027,80 +3217,6 @@ declare class UserAuthService {
|
|
|
3027
3217
|
refresh(refreshToken: string): Promise<AuthResponse>;
|
|
3028
3218
|
}
|
|
3029
3219
|
|
|
3030
|
-
/**
|
|
3031
|
-
* TOTP MFA enrollment/verification, mirroring the FastAPI SDK MFA flow.
|
|
3032
|
-
*
|
|
3033
|
-
* Orchestrates {@link TOTPHelper} over a pluggable {@link MfaStore}: enroll
|
|
3034
|
-
* (generate + persist a secret, return the provisioning URI), confirm (verify a
|
|
3035
|
-
* code and flip MFA on), verify (login step) and disable.
|
|
3036
|
-
*/
|
|
3037
|
-
|
|
3038
|
-
/** Persistence port for MFA secrets/state. */
|
|
3039
|
-
interface MfaStore {
|
|
3040
|
-
/** Persist a user's TOTP secret (pending until confirmed). */
|
|
3041
|
-
setSecret(userId: string, secret: string): Promise<void>;
|
|
3042
|
-
/** Read a user's TOTP secret, or `null`. */
|
|
3043
|
-
getSecret(userId: string): Promise<string | null>;
|
|
3044
|
-
/** Flip the MFA-enabled flag. */
|
|
3045
|
-
setEnabled(userId: string, enabled: boolean): Promise<void>;
|
|
3046
|
-
/** Whether MFA is enabled for the user. */
|
|
3047
|
-
isEnabled(userId: string): Promise<boolean>;
|
|
3048
|
-
}
|
|
3049
|
-
/** The result of starting enrollment. */
|
|
3050
|
-
interface MfaEnrollment {
|
|
3051
|
-
/** The base32 secret (persist server-side; also shown once for manual entry). */
|
|
3052
|
-
secret: string;
|
|
3053
|
-
/** The `otpauth://` URI to render as a QR code. */
|
|
3054
|
-
otpauthUri: string;
|
|
3055
|
-
}
|
|
3056
|
-
/** Options for {@link MfaService}. */
|
|
3057
|
-
interface MfaServiceOptions {
|
|
3058
|
-
/** The MFA persistence port. */
|
|
3059
|
-
store: MfaStore;
|
|
3060
|
-
/** The TOTP helper (issuer preconfigured). */
|
|
3061
|
-
totp: TOTPHelper;
|
|
3062
|
-
}
|
|
3063
|
-
declare class MfaService {
|
|
3064
|
-
private readonly store;
|
|
3065
|
-
private readonly totp;
|
|
3066
|
-
/**
|
|
3067
|
-
* @param options - Store and TOTP helper.
|
|
3068
|
-
*/
|
|
3069
|
-
constructor(options: MfaServiceOptions);
|
|
3070
|
-
/**
|
|
3071
|
-
* Begin enrollment: generate and persist a secret, return the QR URI.
|
|
3072
|
-
*
|
|
3073
|
-
* @param userId - The enrolling user.
|
|
3074
|
-
* @param accountName - Label shown in the authenticator (usually the email).
|
|
3075
|
-
* @returns The secret and provisioning URI.
|
|
3076
|
-
*/
|
|
3077
|
-
enroll(userId: string, accountName: string): Promise<MfaEnrollment>;
|
|
3078
|
-
/**
|
|
3079
|
-
* Confirm enrollment by verifying a code, enabling MFA on success.
|
|
3080
|
-
*
|
|
3081
|
-
* @param userId - The user.
|
|
3082
|
-
* @param code - The 6-digit code from the authenticator.
|
|
3083
|
-
* @throws {ValidationException} When no secret is pending or the code is wrong.
|
|
3084
|
-
*/
|
|
3085
|
-
confirm(userId: string, code: string): Promise<void>;
|
|
3086
|
-
/**
|
|
3087
|
-
* Verify a code (login step). Returns `false` without throwing.
|
|
3088
|
-
*
|
|
3089
|
-
* @param userId - The user.
|
|
3090
|
-
* @param code - The submitted code.
|
|
3091
|
-
* @returns `true` when the code is valid.
|
|
3092
|
-
*/
|
|
3093
|
-
verify(userId: string, code: string): Promise<boolean>;
|
|
3094
|
-
/**
|
|
3095
|
-
* Disable MFA after verifying a code.
|
|
3096
|
-
*
|
|
3097
|
-
* @param userId - The user.
|
|
3098
|
-
* @param code - The submitted code.
|
|
3099
|
-
* @throws {ValidationException} When the code is invalid.
|
|
3100
|
-
*/
|
|
3101
|
-
disable(userId: string, code: string): Promise<void>;
|
|
3102
|
-
}
|
|
3103
|
-
|
|
3104
3220
|
/**
|
|
3105
3221
|
* Email-activation flow, mirroring the FastAPI SDK activation flow.
|
|
3106
3222
|
*
|
|
@@ -3509,6 +3625,31 @@ interface HealthRouterOptions {
|
|
|
3509
3625
|
*/
|
|
3510
3626
|
declare function makeHealthRouter(options?: HealthRouterOptions): Router;
|
|
3511
3627
|
|
|
3628
|
+
/**
|
|
3629
|
+
* Prometheus `/metrics` router, mirroring `api.routers.metrics`.
|
|
3630
|
+
*
|
|
3631
|
+
* Serves {@link MetricsUtils.toPrometheus} as `text/plain`. Optionally includes
|
|
3632
|
+
* GPU metrics (via `nvidia-smi`) and can be guarded so the endpoint stays on the
|
|
3633
|
+
* internal network / behind auth.
|
|
3634
|
+
*/
|
|
3635
|
+
|
|
3636
|
+
/** Options for {@link makeMetricsRouter}. */
|
|
3637
|
+
interface MetricsRouterOptions {
|
|
3638
|
+
/** Route path. Default `/metrics`. */
|
|
3639
|
+
path?: string;
|
|
3640
|
+
/** Include GPU metrics via `nvidia-smi` (adds a subprocess call). Default `false`. */
|
|
3641
|
+
includeGpu?: boolean;
|
|
3642
|
+
/** Optional guard middleware (e.g. internal-network or token check). */
|
|
3643
|
+
guard?: RequestHandler;
|
|
3644
|
+
}
|
|
3645
|
+
/**
|
|
3646
|
+
* Build the Prometheus metrics router.
|
|
3647
|
+
*
|
|
3648
|
+
* @param options - Path, GPU toggle and optional guard.
|
|
3649
|
+
* @returns An Express router exposing the metrics endpoint.
|
|
3650
|
+
*/
|
|
3651
|
+
declare function makeMetricsRouter(options?: MetricsRouterOptions): Router;
|
|
3652
|
+
|
|
3512
3653
|
/**
|
|
3513
3654
|
* Application factory and server runner, mirroring `api.app` + `api.server`.
|
|
3514
3655
|
*
|
|
@@ -3575,6 +3716,6 @@ interface RunServerOptions {
|
|
|
3575
3716
|
declare function runServer(app: Express, options?: RunServerOptions): Promise<Server>;
|
|
3576
3717
|
|
|
3577
3718
|
/** The installed SDK version. Single source of truth for the barrel + CLI. */
|
|
3578
|
-
declare const VERSION = "0.
|
|
3719
|
+
declare const VERSION = "0.10.0";
|
|
3579
3720
|
|
|
3580
|
-
export { type ActivationInput, ActivationService, type ActivationServiceOptions, type ActivationStore, type AdminField, type AdminListQuery, type AdminListResult, type AdminResource, type AdminRouterOptions, AdminSite, 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, type InboundHandler, type InboundMessage, InvalidTokenException, type IssuedSession, JSONLogger, JWTUtils, type JWTUtilsOptions, type JwtAuthOptions, type JwtClaims, LocalUploadStorage, type LocalUploadStorageOptions, type LogExtra, type LogLevel, type LoginInput, type MediaKind, MemoryBroker, MemoryCacheManager, MemoryFeatureFlagBackend, type MemoryMetrics, MemorySessionStore, MemoryThrottleBackend, MessageCatalog, type MessageHandler, type MessagingProvider, MetricsUtils, type MfaCodeInput, type MfaEnrollment, MfaService, type MfaServiceOptions, type MfaStore, NotFoundException, type OpenApiDocument, type OpenApiInfo, type OutboundMedia, type OutboundResult, PHONE_BR_PATTERN, type PaginationFilter, type PasswordResetConfirmInput, type PasswordResetRequestInput, PasswordResetService, type PasswordResetServiceOptions, type PasswordResetStore, PasswordUtils, REQUEST_ID_HEADER, RabbitBroker, type RabbitBrokerOptions, RedisCacheManager, type RedisLike, type RedisPublisherLike, RedisSSEBroker, type RedisSSEBrokerOptions, RedisSessionStore, type RedisSubscriberLike, type RedocOptions, type RefreshInput, Region, type RegionValue, type RegisterExceptionHandlersOptions, type RequestContext, type ResponseMapper, RetryPolicy, type RunServerOptions, SSEBroker, type SaveOptions, type SendOptions, ServerSentEvent, type ServerSentEventInit, type Session, type SessionMiddlewareOptions, type SessionRedisLike, SessionService, type SessionServiceOptions, type SessionStore, type SignupInput, type StateBR, type SwaggerOptions, type SystemMetrics, TOTPHelper, type TOTPOptions, type TaskHandler, TaskManager, type TaskManagerOptions, TelegramProvider, type TelegramProviderOptions, type ThrottleBackend, type ThrottleStatus, type ToDictOptions, type TokenPair, TooManyRequestsException, type TooManyRequestsOptions, TwilioSmsProvider, type TwilioSmsProviderOptions, type TwilioWebhookOptions, 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, WhatsAppProvider, type WhatsAppProviderOptions, type WhatsAppWebhookOptions, activationSchema, 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, inboundMessageSchema, isValidCep, isValidCity, isValidCnpj, isValidCpf, isValidCpfCnpj, isValidPhoneBr, isValidUf, listStates, loadSettings, loginSchema, makeAdminRouter, makeAppExceptionHandler, makeAuthRouter, makeFlagGuard, makeHealthRouter, makeJwtAuthMiddleware, makeSessionMiddleware, makeTwilioWebhookRouter, makeUnhandledExceptionHandler, makeWhatsAppWebhookRouter, mfaCodeSchema, mfaEnrollResponseSchema, modifyDict, mountOpenApiJson, mountRedoc, mountSwaggerUi, normalizeCep, normalizeCnpj, normalizeCpf, normalizeCpfCnpj, normalizePhoneBr, normalizeUf, notFoundHandler, onlyDigits, paginationFilterSchema, paginationSchema, parseAcceptLanguage, parseCookies, passwordResetConfirmSchema, passwordResetRequestSchema, phoneBrField, refreshSchema, registerExceptionHandlers, requestIdMiddleware, requireRoles, runServer, runWithRequestContext, serverSettingsShape, sessionCookie, setRequestId, signupSchema, sseResponse, statesByRegion, tableNameFor, toDict, toUtc, tokenFromUrl, tokenPairSchema, ufField, updatedByColumn, userPublicSchema, utcnow, validateTwilioSignature, verifyOpaqueToken, webPushKeysSchema, webPushPayloadSchema, webPushSubscriptionSchema, wsEnvelopeSchema };
|
|
3721
|
+
export { type ActivationInput, ActivationService, type ActivationServiceOptions, type ActivationStore, type AdminField, type AdminListQuery, type AdminListResult, type AdminResource, type AdminRouterOptions, AdminSite, 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, EmailProvider, type EmailProviderOptions, EmailUtils, type Enum, type EnumHelpers, type EnumSpec, EnvFeatureFlagBackend, EventStream, type EventStreamOptions, type ExceptionDetails, ExpiredTokenException, type FeatureFlagBackend, FeatureFlags, type FlagContext, ForbiddenException, type GPUMetrics, type GenerateOpenApiOptions, HTTPClient, type HTTPClientOptions, HTTP_500_MARKER, type HandshakeInfo, type HealthCheck, type HealthRouterOptions, type InboundHandler, type InboundMessage, InvalidTokenException, type IssuedSession, JSONLogger, JWTUtils, type JWTUtilsOptions, type JwtAuthOptions, type JwtClaims, LocalUploadStorage, type LocalUploadStorageOptions, type LogExtra, type LogLevel, type LoginInput, type LoginResult, type MediaKind, MemoryBroker, MemoryCacheManager, MemoryFeatureFlagBackend, type MemoryMetrics, MemorySessionStore, MemoryThrottleBackend, MessageCatalog, type MessageHandler, type MessagingProvider, type MetricsRouterOptions, MetricsUtils, type MfaChallenge, type MfaChallengeInput, type MfaCodeInput, type MfaEnrollment, MfaService, type MfaServiceOptions, type MfaStore, NotFoundException, type OpenApiDocument, type OpenApiInfo, type OutboundMedia, type OutboundResult, PHONE_BR_PATTERN, type PaginationFilter, type PasswordResetConfirmInput, type PasswordResetRequestInput, PasswordResetService, type PasswordResetServiceOptions, type PasswordResetStore, PasswordUtils, REQUEST_ID_HEADER, RabbitBroker, type RabbitBrokerOptions, RedisCacheManager, type RedisLike, type RedisPublisherLike, RedisSSEBroker, type RedisSSEBrokerOptions, RedisSessionStore, type RedisSubscriberLike, type RedocOptions, type RefreshInput, Region, type RegionValue, type RegisterExceptionHandlersOptions, type RequestContext, type ResponseMapper, RetryPolicy, type RunServerOptions, SSEBroker, type SaveOptions, type SendOptions, ServerSentEvent, type ServerSentEventInit, type Session, type SessionMiddlewareOptions, type SessionRedisLike, SessionService, type SessionServiceOptions, type SessionStore, type SignupInput, type StateBR, type SwaggerOptions, type SystemMetrics, TOTPHelper, type TOTPOptions, type TaskHandler, TaskManager, type TaskManagerOptions, TelegramProvider, type TelegramProviderOptions, type ThrottleBackend, type ThrottleStatus, type ToDictOptions, type TokenPair, TooManyRequestsException, type TooManyRequestsOptions, TwilioSmsProvider, type TwilioSmsProviderOptions, type TwilioWebhookOptions, 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, WhatsAppProvider, type WhatsAppProviderOptions, type WhatsAppWebhookOptions, activationSchema, 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, inboundMessageSchema, isValidCep, isValidCity, isValidCnpj, isValidCpf, isValidCpfCnpj, isValidPhoneBr, isValidUf, listStates, loadSettings, loginSchema, makeAdminRouter, makeAppExceptionHandler, makeAuthRouter, makeFlagGuard, makeHealthRouter, makeJwtAuthMiddleware, makeMetricsRouter, makeSessionMiddleware, makeTwilioWebhookRouter, makeUnhandledExceptionHandler, makeWhatsAppWebhookRouter, mfaChallengeSchema, mfaCodeSchema, mfaEnrollResponseSchema, modifyDict, mountOpenApiJson, mountRedoc, mountSwaggerUi, normalizeCep, normalizeCnpj, normalizeCpf, normalizeCpfCnpj, normalizePhoneBr, normalizeUf, notFoundHandler, onlyDigits, paginationFilterSchema, paginationSchema, parseAcceptLanguage, parseCookies, passwordResetConfirmSchema, passwordResetRequestSchema, phoneBrField, refreshSchema, registerExceptionHandlers, requestIdMiddleware, requireRoles, runServer, runWithRequestContext, serverSettingsShape, sessionCookie, setRequestId, signupSchema, sseResponse, statesByRegion, tableNameFor, toDict, toUtc, tokenFromUrl, tokenPairSchema, ufField, updatedByColumn, userPublicSchema, utcnow, validateTwilioSignature, verifyOpaqueToken, webPushKeysSchema, webPushPayloadSchema, webPushSubscriptionSchema, wsEnvelopeSchema };
|