@fonderie/auth 7.23.0 → 7.24.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -3,8 +3,8 @@ export { IMfaChallenge, ISession } from './types.cjs';
3
3
  import { IFonderieModule, IAdminDescription, IEventCatalogEntry, IReadinessProblem, IFonderieApp, IDefaultTemplate, IAdminRoute } from '@fonderie/core';
4
4
  import { IStoreAdapter } from '@fonderie/store';
5
5
  import { EventBus } from '@fonderie/events';
6
- import { I as IAuthConfig, a as IRequestLocation } from './session-DZ7QOw1J.cjs';
7
- export { A as AUTH_CONFIG_KEYS, b as AuthLimitedRoute, c as AuthMessageKey, C as CLIENT_KINDS, d as ClientKind, e as IAuthRateLimitConfig, f as IAuthRuntimeConfig, g as IAuthSecrets, h as IDataExportContributor, i as ILocationRequest, j as ISessionPolicy, L as LocationResolver, M as MESSAGE_KEYS, S as SESSION_POLICY_PRESETS, k as buildAuthAccountLimiter, l as buildAuthIpLimiter, m as clientKindOf, n as configForClient, r as readAuthRuntimeConfig, o as resolveLocation, s as sanitizeLocation, p as sessionPolicyConfigKeys, w as withSession } from './session-DZ7QOw1J.cjs';
6
+ import { I as IAuthConfig, a as IRequestLocation } from './session-D-KcJlRQ.cjs';
7
+ export { A as AUTH_CONFIG_KEYS, b as AuthLimitedRoute, c as AuthMessageKey, C as CLIENT_KINDS, d as ClientKind, e as IAuthRateLimitConfig, f as IAuthRuntimeConfig, g as IAuthSecrets, h as IDataExportContributor, i as ILocationRequest, j as ISessionPolicy, L as LocationResolver, M as MESSAGE_KEYS, S as SESSION_POLICY_PRESETS, k as buildAuthAccountLimiter, l as buildAuthIpLimiter, m as clientKindOf, n as configForClient, r as readAuthRuntimeConfig, o as resolveLocation, s as sanitizeLocation, p as sessionPolicyConfigKeys, w as withSession } from './session-D-KcJlRQ.cjs';
8
8
  import { IUserDTO } from './dtos/user.cjs';
9
9
  export { toUserDTO } from './dtos/user.cjs';
10
10
  export { requireAuth, validate } from '@fonderie/core/middlewares';
@@ -24,7 +24,7 @@ declare class AuthModule implements IFonderieModule {
24
24
  install(app: IFonderieApp): void;
25
25
  }
26
26
 
27
- declare const DEFAULT_TEMPLATES: Record<"email-registration" | "email-verification" | "password-reset" | "phone-otp" | "mfa-enabled" | "mfa-disabled" | "mfa-backup-codes-regenerated" | "email-changed" | "phone-changed" | "password-revoked" | "oauth-registration" | "oauth-linked" | "oauth-unlinked", IDefaultTemplate>;
27
+ declare const DEFAULT_TEMPLATES: Record<"email-registration" | "email-verification" | "password-reset" | "phone-otp" | "mfa-enabled" | "mfa-disabled" | "mfa-backup-codes-regenerated" | "email-changed" | "phone-changed" | "password-revoked" | "oauth-registration" | "oauth-linked" | "oauth-unlinked" | "account-deletion-code" | "account-deletion-scheduled" | "account-restored", IDefaultTemplate>;
28
28
 
29
29
  interface ILoginEventDTO {
30
30
  id: string;
@@ -126,6 +126,20 @@ declare const changePasswordSchema: z.ZodObject<{
126
126
  declare const mfaTokenSchema: z.ZodObject<{
127
127
  token: z.ZodString;
128
128
  }, z.core.$strip>;
129
+ declare const requestDeletionSchema: z.ZodObject<{
130
+ channel: z.ZodEnum<{
131
+ email: "email";
132
+ sms: "sms";
133
+ }>;
134
+ }, z.core.$strip>;
135
+ declare const confirmDeletionSchema: z.ZodObject<{
136
+ code: z.ZodString;
137
+ mfaCode: z.ZodOptional<z.ZodString>;
138
+ }, z.core.$strip>;
139
+ declare const restoreAccountSchema: z.ZodObject<{
140
+ restoreToken: z.ZodString;
141
+ mfaCode: z.ZodOptional<z.ZodString>;
142
+ }, z.core.$strip>;
129
143
  type RegisterInput = z.infer<typeof registerSchema>;
130
144
  type LoginInput = z.infer<typeof loginSchema>;
131
145
  type ResetPasswordInput = z.infer<typeof resetPasswordSchema>;
@@ -137,20 +151,23 @@ type schemas_RegisterInput = RegisterInput;
137
151
  type schemas_ResetPasswordInput = ResetPasswordInput;
138
152
  declare const schemas_appleNativeSchema: typeof appleNativeSchema;
139
153
  declare const schemas_changePasswordSchema: typeof changePasswordSchema;
154
+ declare const schemas_confirmDeletionSchema: typeof confirmDeletionSchema;
140
155
  declare const schemas_forgotPasswordSchema: typeof forgotPasswordSchema;
141
156
  declare const schemas_googleNativeSchema: typeof googleNativeSchema;
142
157
  declare const schemas_loginSchema: typeof loginSchema;
143
158
  declare const schemas_mfaTokenSchema: typeof mfaTokenSchema;
144
159
  declare const schemas_refreshSchema: typeof refreshSchema;
145
160
  declare const schemas_registerSchema: typeof registerSchema;
161
+ declare const schemas_requestDeletionSchema: typeof requestDeletionSchema;
146
162
  declare const schemas_resetPasswordSchema: typeof resetPasswordSchema;
163
+ declare const schemas_restoreAccountSchema: typeof restoreAccountSchema;
147
164
  declare const schemas_updateEmailSchema: typeof updateEmailSchema;
148
165
  declare const schemas_updatePhoneSchema: typeof updatePhoneSchema;
149
166
  declare const schemas_updatePreferencesSchema: typeof updatePreferencesSchema;
150
167
  declare const schemas_updateProfileSchema: typeof updateProfileSchema;
151
168
  declare const schemas_verifySchema: typeof verifySchema;
152
169
  declare namespace schemas {
153
- export { type schemas_ChangePasswordInput as ChangePasswordInput, type schemas_LoginInput as LoginInput, type schemas_RegisterInput as RegisterInput, type schemas_ResetPasswordInput as ResetPasswordInput, schemas_appleNativeSchema as appleNativeSchema, schemas_changePasswordSchema as changePasswordSchema, schemas_forgotPasswordSchema as forgotPasswordSchema, schemas_googleNativeSchema as googleNativeSchema, schemas_loginSchema as loginSchema, schemas_mfaTokenSchema as mfaTokenSchema, schemas_refreshSchema as refreshSchema, schemas_registerSchema as registerSchema, schemas_resetPasswordSchema as resetPasswordSchema, schemas_updateEmailSchema as updateEmailSchema, schemas_updatePhoneSchema as updatePhoneSchema, schemas_updatePreferencesSchema as updatePreferencesSchema, schemas_updateProfileSchema as updateProfileSchema, schemas_verifySchema as verifySchema };
170
+ export { type schemas_ChangePasswordInput as ChangePasswordInput, type schemas_LoginInput as LoginInput, type schemas_RegisterInput as RegisterInput, type schemas_ResetPasswordInput as ResetPasswordInput, schemas_appleNativeSchema as appleNativeSchema, schemas_changePasswordSchema as changePasswordSchema, schemas_confirmDeletionSchema as confirmDeletionSchema, schemas_forgotPasswordSchema as forgotPasswordSchema, schemas_googleNativeSchema as googleNativeSchema, schemas_loginSchema as loginSchema, schemas_mfaTokenSchema as mfaTokenSchema, schemas_refreshSchema as refreshSchema, schemas_registerSchema as registerSchema, schemas_requestDeletionSchema as requestDeletionSchema, schemas_resetPasswordSchema as resetPasswordSchema, schemas_restoreAccountSchema as restoreAccountSchema, schemas_updateEmailSchema as updateEmailSchema, schemas_updatePhoneSchema as updatePhoneSchema, schemas_updatePreferencesSchema as updatePreferencesSchema, schemas_updateProfileSchema as updateProfileSchema, schemas_verifySchema as verifySchema };
154
171
  }
155
172
 
156
173
  declare function normalizeEmail(email: string): string;
package/dist/index.d.ts CHANGED
@@ -3,8 +3,8 @@ export { IMfaChallenge, ISession } from './types.js';
3
3
  import { IFonderieModule, IAdminDescription, IEventCatalogEntry, IReadinessProblem, IFonderieApp, IDefaultTemplate, IAdminRoute } from '@fonderie/core';
4
4
  import { IStoreAdapter } from '@fonderie/store';
5
5
  import { EventBus } from '@fonderie/events';
6
- import { I as IAuthConfig, a as IRequestLocation } from './session-DZ7QOw1J.js';
7
- export { A as AUTH_CONFIG_KEYS, b as AuthLimitedRoute, c as AuthMessageKey, C as CLIENT_KINDS, d as ClientKind, e as IAuthRateLimitConfig, f as IAuthRuntimeConfig, g as IAuthSecrets, h as IDataExportContributor, i as ILocationRequest, j as ISessionPolicy, L as LocationResolver, M as MESSAGE_KEYS, S as SESSION_POLICY_PRESETS, k as buildAuthAccountLimiter, l as buildAuthIpLimiter, m as clientKindOf, n as configForClient, r as readAuthRuntimeConfig, o as resolveLocation, s as sanitizeLocation, p as sessionPolicyConfigKeys, w as withSession } from './session-DZ7QOw1J.js';
6
+ import { I as IAuthConfig, a as IRequestLocation } from './session-D-KcJlRQ.js';
7
+ export { A as AUTH_CONFIG_KEYS, b as AuthLimitedRoute, c as AuthMessageKey, C as CLIENT_KINDS, d as ClientKind, e as IAuthRateLimitConfig, f as IAuthRuntimeConfig, g as IAuthSecrets, h as IDataExportContributor, i as ILocationRequest, j as ISessionPolicy, L as LocationResolver, M as MESSAGE_KEYS, S as SESSION_POLICY_PRESETS, k as buildAuthAccountLimiter, l as buildAuthIpLimiter, m as clientKindOf, n as configForClient, r as readAuthRuntimeConfig, o as resolveLocation, s as sanitizeLocation, p as sessionPolicyConfigKeys, w as withSession } from './session-D-KcJlRQ.js';
8
8
  import { IUserDTO } from './dtos/user.js';
9
9
  export { toUserDTO } from './dtos/user.js';
10
10
  export { requireAuth, validate } from '@fonderie/core/middlewares';
@@ -24,7 +24,7 @@ declare class AuthModule implements IFonderieModule {
24
24
  install(app: IFonderieApp): void;
25
25
  }
26
26
 
27
- declare const DEFAULT_TEMPLATES: Record<"email-registration" | "email-verification" | "password-reset" | "phone-otp" | "mfa-enabled" | "mfa-disabled" | "mfa-backup-codes-regenerated" | "email-changed" | "phone-changed" | "password-revoked" | "oauth-registration" | "oauth-linked" | "oauth-unlinked", IDefaultTemplate>;
27
+ declare const DEFAULT_TEMPLATES: Record<"email-registration" | "email-verification" | "password-reset" | "phone-otp" | "mfa-enabled" | "mfa-disabled" | "mfa-backup-codes-regenerated" | "email-changed" | "phone-changed" | "password-revoked" | "oauth-registration" | "oauth-linked" | "oauth-unlinked" | "account-deletion-code" | "account-deletion-scheduled" | "account-restored", IDefaultTemplate>;
28
28
 
29
29
  interface ILoginEventDTO {
30
30
  id: string;
@@ -126,6 +126,20 @@ declare const changePasswordSchema: z.ZodObject<{
126
126
  declare const mfaTokenSchema: z.ZodObject<{
127
127
  token: z.ZodString;
128
128
  }, z.core.$strip>;
129
+ declare const requestDeletionSchema: z.ZodObject<{
130
+ channel: z.ZodEnum<{
131
+ email: "email";
132
+ sms: "sms";
133
+ }>;
134
+ }, z.core.$strip>;
135
+ declare const confirmDeletionSchema: z.ZodObject<{
136
+ code: z.ZodString;
137
+ mfaCode: z.ZodOptional<z.ZodString>;
138
+ }, z.core.$strip>;
139
+ declare const restoreAccountSchema: z.ZodObject<{
140
+ restoreToken: z.ZodString;
141
+ mfaCode: z.ZodOptional<z.ZodString>;
142
+ }, z.core.$strip>;
129
143
  type RegisterInput = z.infer<typeof registerSchema>;
130
144
  type LoginInput = z.infer<typeof loginSchema>;
131
145
  type ResetPasswordInput = z.infer<typeof resetPasswordSchema>;
@@ -137,20 +151,23 @@ type schemas_RegisterInput = RegisterInput;
137
151
  type schemas_ResetPasswordInput = ResetPasswordInput;
138
152
  declare const schemas_appleNativeSchema: typeof appleNativeSchema;
139
153
  declare const schemas_changePasswordSchema: typeof changePasswordSchema;
154
+ declare const schemas_confirmDeletionSchema: typeof confirmDeletionSchema;
140
155
  declare const schemas_forgotPasswordSchema: typeof forgotPasswordSchema;
141
156
  declare const schemas_googleNativeSchema: typeof googleNativeSchema;
142
157
  declare const schemas_loginSchema: typeof loginSchema;
143
158
  declare const schemas_mfaTokenSchema: typeof mfaTokenSchema;
144
159
  declare const schemas_refreshSchema: typeof refreshSchema;
145
160
  declare const schemas_registerSchema: typeof registerSchema;
161
+ declare const schemas_requestDeletionSchema: typeof requestDeletionSchema;
146
162
  declare const schemas_resetPasswordSchema: typeof resetPasswordSchema;
163
+ declare const schemas_restoreAccountSchema: typeof restoreAccountSchema;
147
164
  declare const schemas_updateEmailSchema: typeof updateEmailSchema;
148
165
  declare const schemas_updatePhoneSchema: typeof updatePhoneSchema;
149
166
  declare const schemas_updatePreferencesSchema: typeof updatePreferencesSchema;
150
167
  declare const schemas_updateProfileSchema: typeof updateProfileSchema;
151
168
  declare const schemas_verifySchema: typeof verifySchema;
152
169
  declare namespace schemas {
153
- export { type schemas_ChangePasswordInput as ChangePasswordInput, type schemas_LoginInput as LoginInput, type schemas_RegisterInput as RegisterInput, type schemas_ResetPasswordInput as ResetPasswordInput, schemas_appleNativeSchema as appleNativeSchema, schemas_changePasswordSchema as changePasswordSchema, schemas_forgotPasswordSchema as forgotPasswordSchema, schemas_googleNativeSchema as googleNativeSchema, schemas_loginSchema as loginSchema, schemas_mfaTokenSchema as mfaTokenSchema, schemas_refreshSchema as refreshSchema, schemas_registerSchema as registerSchema, schemas_resetPasswordSchema as resetPasswordSchema, schemas_updateEmailSchema as updateEmailSchema, schemas_updatePhoneSchema as updatePhoneSchema, schemas_updatePreferencesSchema as updatePreferencesSchema, schemas_updateProfileSchema as updateProfileSchema, schemas_verifySchema as verifySchema };
170
+ export { type schemas_ChangePasswordInput as ChangePasswordInput, type schemas_LoginInput as LoginInput, type schemas_RegisterInput as RegisterInput, type schemas_ResetPasswordInput as ResetPasswordInput, schemas_appleNativeSchema as appleNativeSchema, schemas_changePasswordSchema as changePasswordSchema, schemas_confirmDeletionSchema as confirmDeletionSchema, schemas_forgotPasswordSchema as forgotPasswordSchema, schemas_googleNativeSchema as googleNativeSchema, schemas_loginSchema as loginSchema, schemas_mfaTokenSchema as mfaTokenSchema, schemas_refreshSchema as refreshSchema, schemas_registerSchema as registerSchema, schemas_requestDeletionSchema as requestDeletionSchema, schemas_resetPasswordSchema as resetPasswordSchema, schemas_restoreAccountSchema as restoreAccountSchema, schemas_updateEmailSchema as updateEmailSchema, schemas_updatePhoneSchema as updatePhoneSchema, schemas_updatePreferencesSchema as updatePreferencesSchema, schemas_updateProfileSchema as updateProfileSchema, schemas_verifySchema as verifySchema };
154
171
  }
155
172
 
156
173
  declare function normalizeEmail(email: string): string;