tempest-express-sdk 0.6.0 → 0.8.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 +4 -4
- package/dist/chunk-JWJJAIXV.js +6 -0
- package/dist/{chunk-3IDD2UXU.js.map → chunk-JWJJAIXV.js.map} +1 -1
- package/dist/cli.cjs +2 -2
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +2 -2
- package/dist/cli.js.map +1 -1
- package/dist/index.cjs +397 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +358 -2
- package/dist/index.d.ts +358 -2
- package/dist/index.js +388 -2
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
- package/dist/chunk-3IDD2UXU.js +0 -6
package/dist/index.d.ts
CHANGED
|
@@ -1635,6 +1635,45 @@ interface SessionMiddlewareOptions {
|
|
|
1635
1635
|
*/
|
|
1636
1636
|
declare function makeSessionMiddleware(service: SessionService, options?: SessionMiddlewareOptions): RequestHandler;
|
|
1637
1637
|
|
|
1638
|
+
/**
|
|
1639
|
+
* Redis-backed {@link SessionStore} for multi-replica deployments.
|
|
1640
|
+
*
|
|
1641
|
+
* Sessions live under `sess:<idHash>` with a Redis TTL; a per-user set
|
|
1642
|
+
* (`sess:user:<userId>`) indexes them so `listByUser`/`deleteByUser` work
|
|
1643
|
+
* without scanning. Takes an injected client (node-redis v4 compatible) so the
|
|
1644
|
+
* SDK never hard-depends on `redis`. Expired keys drop via TTL; stale index
|
|
1645
|
+
* entries are pruned lazily on read.
|
|
1646
|
+
*/
|
|
1647
|
+
|
|
1648
|
+
/** The subset of a node-redis v4 client this store needs. */
|
|
1649
|
+
interface SessionRedisLike {
|
|
1650
|
+
get(key: string): Promise<string | null>;
|
|
1651
|
+
set(key: string, value: string, options?: {
|
|
1652
|
+
EX?: number;
|
|
1653
|
+
}): Promise<unknown>;
|
|
1654
|
+
del(key: string): Promise<unknown>;
|
|
1655
|
+
sAdd(key: string, member: string): Promise<unknown>;
|
|
1656
|
+
sRem(key: string, member: string): Promise<unknown>;
|
|
1657
|
+
sMembers(key: string): Promise<string[]>;
|
|
1658
|
+
}
|
|
1659
|
+
/** Redis-backed session store. */
|
|
1660
|
+
declare class RedisSessionStore implements SessionStore {
|
|
1661
|
+
private readonly client;
|
|
1662
|
+
private readonly prefix;
|
|
1663
|
+
/**
|
|
1664
|
+
* @param client - A connected node-redis v4 (or compatible) client.
|
|
1665
|
+
* @param prefix - Key prefix. Default `sess:`.
|
|
1666
|
+
*/
|
|
1667
|
+
constructor(client: SessionRedisLike, prefix?: string);
|
|
1668
|
+
private key;
|
|
1669
|
+
private userKey;
|
|
1670
|
+
get(idHash: string): Promise<Session | null>;
|
|
1671
|
+
set(session: Session): Promise<void>;
|
|
1672
|
+
delete(idHash: string): Promise<void>;
|
|
1673
|
+
deleteByUser(userId: string): Promise<number>;
|
|
1674
|
+
listByUser(userId: string): Promise<Session[]>;
|
|
1675
|
+
}
|
|
1676
|
+
|
|
1638
1677
|
/**
|
|
1639
1678
|
* Server-Sent Events primitives, mirroring `sse.event_stream`.
|
|
1640
1679
|
*
|
|
@@ -1761,6 +1800,73 @@ declare class SSEBroker {
|
|
|
1761
1800
|
publish(channel: string, data: unknown, event?: string): number;
|
|
1762
1801
|
}
|
|
1763
1802
|
|
|
1803
|
+
/**
|
|
1804
|
+
* Redis pub/sub SSE broker for multi-replica deployments.
|
|
1805
|
+
*
|
|
1806
|
+
* The in-process {@link SSEBroker} only reaches subscribers on the same node.
|
|
1807
|
+
* {@link RedisSSEBroker} publishes to a Redis channel; every replica's
|
|
1808
|
+
* subscriber connection receives it and fans out to its local {@link EventStream}s
|
|
1809
|
+
* — so a publish on any node reaches SSE clients on all nodes. Takes injected
|
|
1810
|
+
* node-redis v4 clients (a dedicated subscriber connection, per Redis pub/sub
|
|
1811
|
+
* rules) so the SDK never hard-depends on `redis`.
|
|
1812
|
+
*/
|
|
1813
|
+
|
|
1814
|
+
/** Publisher side (the main client). */
|
|
1815
|
+
interface RedisPublisherLike {
|
|
1816
|
+
publish(channel: string, message: string): Promise<unknown>;
|
|
1817
|
+
}
|
|
1818
|
+
/** Subscriber side (a dedicated connection — `client.duplicate()`). */
|
|
1819
|
+
interface RedisSubscriberLike {
|
|
1820
|
+
subscribe(channel: string, listener: (message: string) => void): Promise<unknown>;
|
|
1821
|
+
unsubscribe(channel: string): Promise<unknown>;
|
|
1822
|
+
}
|
|
1823
|
+
/** Options for {@link RedisSSEBroker}. */
|
|
1824
|
+
interface RedisSSEBrokerOptions extends EventStreamOptions {
|
|
1825
|
+
/** Redis channel prefix. Default `sse:`. */
|
|
1826
|
+
prefix?: string;
|
|
1827
|
+
}
|
|
1828
|
+
/** Cross-replica SSE fan-out over Redis pub/sub. */
|
|
1829
|
+
declare class RedisSSEBroker {
|
|
1830
|
+
private readonly publisher;
|
|
1831
|
+
private readonly subscriber;
|
|
1832
|
+
private readonly local;
|
|
1833
|
+
private readonly prefix;
|
|
1834
|
+
private readonly streamOptions;
|
|
1835
|
+
/**
|
|
1836
|
+
* @param publisher - The main Redis client (used to `publish`).
|
|
1837
|
+
* @param subscriber - A dedicated subscriber connection (`client.duplicate()`).
|
|
1838
|
+
* @param options - Channel prefix + per-stream options.
|
|
1839
|
+
*/
|
|
1840
|
+
constructor(publisher: RedisPublisherLike, subscriber: RedisSubscriberLike, options?: RedisSSEBrokerOptions);
|
|
1841
|
+
private channelKey;
|
|
1842
|
+
/** Emit a decoded payload to every local stream on a channel. */
|
|
1843
|
+
private emitLocal;
|
|
1844
|
+
/**
|
|
1845
|
+
* Register a subscriber stream, subscribing to the Redis channel on first use.
|
|
1846
|
+
*
|
|
1847
|
+
* @param channel - The channel name.
|
|
1848
|
+
* @returns A fresh {@link EventStream} to serve to the client.
|
|
1849
|
+
*/
|
|
1850
|
+
register(channel: string): Promise<EventStream>;
|
|
1851
|
+
/**
|
|
1852
|
+
* Remove a subscriber stream; unsubscribe from Redis when the last leaves.
|
|
1853
|
+
*
|
|
1854
|
+
* @param channel - The channel name.
|
|
1855
|
+
* @param stream - The stream to remove.
|
|
1856
|
+
*/
|
|
1857
|
+
unregister(channel: string, stream: EventStream): Promise<void>;
|
|
1858
|
+
/** Local subscriber count on `channel` (this replica only). */
|
|
1859
|
+
localSubscribers(channel: string): number;
|
|
1860
|
+
/**
|
|
1861
|
+
* Publish to every subscriber across all replicas.
|
|
1862
|
+
*
|
|
1863
|
+
* @param channel - The channel name.
|
|
1864
|
+
* @param data - The payload (JSON-encoded).
|
|
1865
|
+
* @param event - Optional event name.
|
|
1866
|
+
*/
|
|
1867
|
+
publish(channel: string, data: unknown, event?: string): Promise<void>;
|
|
1868
|
+
}
|
|
1869
|
+
|
|
1764
1870
|
/** WebSocket message envelope, mirroring `websockets.schemas`. */
|
|
1765
1871
|
|
|
1766
1872
|
/** The canonical message envelope exchanged over a socket. */
|
|
@@ -2771,12 +2877,62 @@ declare const authResponseSchema: z.ZodObject<{
|
|
|
2771
2877
|
expiresIn: number;
|
|
2772
2878
|
};
|
|
2773
2879
|
}>;
|
|
2880
|
+
/** MFA enrollment response (`POST /auth/mfa/enroll`). */
|
|
2881
|
+
declare const mfaEnrollResponseSchema: z.ZodObject<{
|
|
2882
|
+
secret: z.ZodString;
|
|
2883
|
+
otpauthUri: z.ZodString;
|
|
2884
|
+
}, "strip", z.ZodTypeAny, {
|
|
2885
|
+
secret: string;
|
|
2886
|
+
otpauthUri: string;
|
|
2887
|
+
}, {
|
|
2888
|
+
secret: string;
|
|
2889
|
+
otpauthUri: string;
|
|
2890
|
+
}>;
|
|
2891
|
+
/** A 6-digit MFA code body (`POST /auth/mfa/confirm|disable`). */
|
|
2892
|
+
declare const mfaCodeSchema: z.ZodObject<{
|
|
2893
|
+
code: z.ZodString;
|
|
2894
|
+
}, "strip", z.ZodTypeAny, {
|
|
2895
|
+
code: string;
|
|
2896
|
+
}, {
|
|
2897
|
+
code: string;
|
|
2898
|
+
}>;
|
|
2899
|
+
/** Activation body (`POST /auth/activate`). */
|
|
2900
|
+
declare const activationSchema: z.ZodObject<{
|
|
2901
|
+
token: z.ZodString;
|
|
2902
|
+
}, "strip", z.ZodTypeAny, {
|
|
2903
|
+
token: string;
|
|
2904
|
+
}, {
|
|
2905
|
+
token: string;
|
|
2906
|
+
}>;
|
|
2907
|
+
/** Password-reset request body (`POST /auth/password-reset/request`). */
|
|
2908
|
+
declare const passwordResetRequestSchema: z.ZodObject<{
|
|
2909
|
+
email: z.ZodString;
|
|
2910
|
+
}, "strip", z.ZodTypeAny, {
|
|
2911
|
+
email: string;
|
|
2912
|
+
}, {
|
|
2913
|
+
email: string;
|
|
2914
|
+
}>;
|
|
2915
|
+
/** Password-reset confirm body (`POST /auth/password-reset/confirm`). */
|
|
2916
|
+
declare const passwordResetConfirmSchema: z.ZodObject<{
|
|
2917
|
+
token: z.ZodString;
|
|
2918
|
+
password: z.ZodString;
|
|
2919
|
+
}, "strip", z.ZodTypeAny, {
|
|
2920
|
+
password: string;
|
|
2921
|
+
token: string;
|
|
2922
|
+
}, {
|
|
2923
|
+
password: string;
|
|
2924
|
+
token: string;
|
|
2925
|
+
}>;
|
|
2774
2926
|
type SignupInput = z.infer<typeof signupSchema>;
|
|
2775
2927
|
type LoginInput = z.infer<typeof loginSchema>;
|
|
2776
2928
|
type RefreshInput = z.infer<typeof refreshSchema>;
|
|
2777
2929
|
type TokenPair = z.infer<typeof tokenPairSchema>;
|
|
2778
2930
|
type UserPublic = z.infer<typeof userPublicSchema>;
|
|
2779
2931
|
type AuthResponse = z.infer<typeof authResponseSchema>;
|
|
2932
|
+
type MfaCodeInput = z.infer<typeof mfaCodeSchema>;
|
|
2933
|
+
type ActivationInput = z.infer<typeof activationSchema>;
|
|
2934
|
+
type PasswordResetRequestInput = z.infer<typeof passwordResetRequestSchema>;
|
|
2935
|
+
type PasswordResetConfirmInput = z.infer<typeof passwordResetConfirmSchema>;
|
|
2780
2936
|
|
|
2781
2937
|
/**
|
|
2782
2938
|
* User authentication service, mirroring `auth.service.UserAuthService`.
|
|
@@ -2871,6 +3027,197 @@ declare class UserAuthService {
|
|
|
2871
3027
|
refresh(refreshToken: string): Promise<AuthResponse>;
|
|
2872
3028
|
}
|
|
2873
3029
|
|
|
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
|
+
/**
|
|
3105
|
+
* Email-activation flow, mirroring the FastAPI SDK activation flow.
|
|
3106
|
+
*
|
|
3107
|
+
* Issues a single-use opaque token (only its SHA-256 hash is stored), emails
|
|
3108
|
+
* the plaintext to the user, and activates the account when the link is opened.
|
|
3109
|
+
*/
|
|
3110
|
+
/** Persistence port for activation tokens. */
|
|
3111
|
+
interface ActivationStore {
|
|
3112
|
+
/** Persist a token hash + expiry (epoch ms) for a user. */
|
|
3113
|
+
saveActivationToken(userId: string, tokenHash: string, expiresAt: number): Promise<void>;
|
|
3114
|
+
/** Look up a token hash, returning the owner + expiry, or `null`. */
|
|
3115
|
+
findActivationToken(tokenHash: string): Promise<{
|
|
3116
|
+
userId: string;
|
|
3117
|
+
expiresAt: number;
|
|
3118
|
+
} | null>;
|
|
3119
|
+
/** Remove a token hash (single-use). */
|
|
3120
|
+
clearActivationToken(tokenHash: string): Promise<void>;
|
|
3121
|
+
/** Mark a user active. */
|
|
3122
|
+
activate(userId: string): Promise<void>;
|
|
3123
|
+
}
|
|
3124
|
+
/** Options for {@link ActivationService}. */
|
|
3125
|
+
interface ActivationServiceOptions {
|
|
3126
|
+
/** The activation persistence port. */
|
|
3127
|
+
store: ActivationStore;
|
|
3128
|
+
/** Token lifetime in seconds. Default 86400 (24h). */
|
|
3129
|
+
ttlSeconds?: number;
|
|
3130
|
+
}
|
|
3131
|
+
declare class ActivationService {
|
|
3132
|
+
private readonly store;
|
|
3133
|
+
private readonly ttlSeconds;
|
|
3134
|
+
/**
|
|
3135
|
+
* @param options - Store and token TTL.
|
|
3136
|
+
*/
|
|
3137
|
+
constructor(options: ActivationServiceOptions);
|
|
3138
|
+
/**
|
|
3139
|
+
* Start activation: issue a token and persist its hash.
|
|
3140
|
+
*
|
|
3141
|
+
* @param userId - The user to activate.
|
|
3142
|
+
* @returns The one-time plaintext token (embed in the activation link).
|
|
3143
|
+
*/
|
|
3144
|
+
start(userId: string): Promise<string>;
|
|
3145
|
+
/**
|
|
3146
|
+
* Activate an account from a token.
|
|
3147
|
+
*
|
|
3148
|
+
* @param token - The plaintext token from the activation link.
|
|
3149
|
+
* @returns The activated user id.
|
|
3150
|
+
* @throws {InvalidTokenException} When the token is unknown or expired.
|
|
3151
|
+
*/
|
|
3152
|
+
activate(token: string): Promise<string>;
|
|
3153
|
+
}
|
|
3154
|
+
|
|
3155
|
+
/**
|
|
3156
|
+
* Password-reset flow, mirroring the FastAPI SDK reset flow.
|
|
3157
|
+
*
|
|
3158
|
+
* `request` issues a single-use opaque token (hash stored) for a known email,
|
|
3159
|
+
* returning it so the caller can email the reset link — without leaking whether
|
|
3160
|
+
* the email exists. `confirm` validates the token + new password and rehashes.
|
|
3161
|
+
*/
|
|
3162
|
+
|
|
3163
|
+
/** Persistence port for password resets. */
|
|
3164
|
+
interface PasswordResetStore {
|
|
3165
|
+
/** Resolve a (lowercased) email to a user id, or `null`. */
|
|
3166
|
+
findUserIdByEmail(email: string): Promise<string | null>;
|
|
3167
|
+
/** Persist a reset token hash + expiry (epoch ms). */
|
|
3168
|
+
saveResetToken(userId: string, tokenHash: string, expiresAt: number): Promise<void>;
|
|
3169
|
+
/** Look up a reset token hash, returning owner + expiry, or `null`. */
|
|
3170
|
+
findResetToken(tokenHash: string): Promise<{
|
|
3171
|
+
userId: string;
|
|
3172
|
+
expiresAt: number;
|
|
3173
|
+
} | null>;
|
|
3174
|
+
/** Remove a reset token hash (single-use). */
|
|
3175
|
+
clearResetToken(tokenHash: string): Promise<void>;
|
|
3176
|
+
/** Overwrite a user's password hash. */
|
|
3177
|
+
updatePassword(userId: string, passwordHash: string): Promise<void>;
|
|
3178
|
+
}
|
|
3179
|
+
/** Options for {@link PasswordResetService}. */
|
|
3180
|
+
interface PasswordResetServiceOptions {
|
|
3181
|
+
/** The reset persistence port. */
|
|
3182
|
+
store: PasswordResetStore;
|
|
3183
|
+
/** Password hasher. */
|
|
3184
|
+
password: PasswordUtils;
|
|
3185
|
+
/** Token lifetime in seconds. Default 3600 (1h). */
|
|
3186
|
+
ttlSeconds?: number;
|
|
3187
|
+
/** Minimum new-password length. Default 12. */
|
|
3188
|
+
passwordMinLength?: number;
|
|
3189
|
+
}
|
|
3190
|
+
declare class PasswordResetService {
|
|
3191
|
+
private readonly store;
|
|
3192
|
+
private readonly password;
|
|
3193
|
+
private readonly ttlSeconds;
|
|
3194
|
+
private readonly passwordMinLength;
|
|
3195
|
+
/**
|
|
3196
|
+
* @param options - Store, password hasher and policy.
|
|
3197
|
+
*/
|
|
3198
|
+
constructor(options: PasswordResetServiceOptions);
|
|
3199
|
+
/**
|
|
3200
|
+
* Request a reset for `email`.
|
|
3201
|
+
*
|
|
3202
|
+
* Returns the plaintext token only when the email maps to a user; otherwise
|
|
3203
|
+
* `null`. Callers should respond with the same success shape either way to
|
|
3204
|
+
* avoid user enumeration — email the token only when present.
|
|
3205
|
+
*
|
|
3206
|
+
* @param email - The account email.
|
|
3207
|
+
* @returns The one-time token, or `null` when no user matches.
|
|
3208
|
+
*/
|
|
3209
|
+
request(email: string): Promise<string | null>;
|
|
3210
|
+
/**
|
|
3211
|
+
* Confirm a reset: validate the token + new password and rehash.
|
|
3212
|
+
*
|
|
3213
|
+
* @param token - The plaintext reset token.
|
|
3214
|
+
* @param newPassword - The new plaintext password.
|
|
3215
|
+
* @throws {ValidationException} When the new password is too short.
|
|
3216
|
+
* @throws {InvalidTokenException} When the token is unknown or expired.
|
|
3217
|
+
*/
|
|
3218
|
+
confirm(token: string, newPassword: string): Promise<void>;
|
|
3219
|
+
}
|
|
3220
|
+
|
|
2874
3221
|
/**
|
|
2875
3222
|
* JWT auth middleware + role guards, mirroring `api.dependencies.auth`.
|
|
2876
3223
|
*
|
|
@@ -2978,6 +3325,15 @@ interface AuthRouterOptions {
|
|
|
2978
3325
|
prefix?: string;
|
|
2979
3326
|
/** When provided, OpenAPI paths are registered for Swagger/Redoc. */
|
|
2980
3327
|
registry?: OpenAPIRegistry;
|
|
3328
|
+
/** Mount `POST /auth/activate` when provided. */
|
|
3329
|
+
activation?: ActivationService;
|
|
3330
|
+
/** Mount `POST /auth/password-reset/{request,confirm}` when provided. */
|
|
3331
|
+
passwordReset?: PasswordResetService;
|
|
3332
|
+
/**
|
|
3333
|
+
* Mount guarded `POST /auth/mfa/{enroll,confirm,disable}` when provided. The
|
|
3334
|
+
* enrolling account label defaults to the `email` claim (falls back to `sub`).
|
|
3335
|
+
*/
|
|
3336
|
+
mfa?: MfaService;
|
|
2981
3337
|
}
|
|
2982
3338
|
/**
|
|
2983
3339
|
* Build the auth router.
|
|
@@ -3219,6 +3575,6 @@ interface RunServerOptions {
|
|
|
3219
3575
|
declare function runServer(app: Express, options?: RunServerOptions): Promise<Server>;
|
|
3220
3576
|
|
|
3221
3577
|
/** The installed SDK version. Single source of truth for the barrel + CLI. */
|
|
3222
|
-
declare const VERSION = "0.
|
|
3578
|
+
declare const VERSION = "0.8.0";
|
|
3223
3579
|
|
|
3224
|
-
export { 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, NotFoundException, type OpenApiDocument, type OpenApiInfo, type OutboundMedia, type OutboundResult, 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, type SendOptions, 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, 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, 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, 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, validateTwilioSignature, verifyOpaqueToken, webPushKeysSchema, webPushPayloadSchema, webPushSubscriptionSchema, wsEnvelopeSchema };
|
|
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 };
|