@fonderie/auth 7.11.1 → 7.13.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
@@ -1,6 +1,6 @@
1
1
  import { IUser } from './types.cjs';
2
2
  export { IMfaChallenge, ISession } from './types.cjs';
3
- import { IFonderieModule, IAdminDescription, IReadinessProblem, IFonderieApp, IAdminRoute } from '@fonderie/core';
3
+ import { IFonderieModule, IAdminDescription, IReadinessProblem, IFonderieApp, IDefaultTemplate, IAdminRoute } from '@fonderie/core';
4
4
  import { IStoreAdapter } from '@fonderie/store';
5
5
  import { EventBus } from '@fonderie/events';
6
6
  import { I as IAuthConfig, a as IRequestLocation } from './session-BBF5t-3Y.cjs';
@@ -23,71 +23,7 @@ declare class AuthModule implements IFonderieModule {
23
23
  install(app: IFonderieApp): void;
24
24
  }
25
25
 
26
- declare const DEFAULT_TEMPLATES: {
27
- "email-registration": {
28
- subject: string;
29
- html: string;
30
- text: string;
31
- };
32
- "email-verification": {
33
- subject: string;
34
- html: string;
35
- text: string;
36
- };
37
- "password-reset": {
38
- subject: string;
39
- html: string;
40
- text: string;
41
- };
42
- "phone-otp": {
43
- text: string;
44
- };
45
- "mfa-enabled": {
46
- subject: string;
47
- html: string;
48
- text: string;
49
- };
50
- "mfa-disabled": {
51
- subject: string;
52
- html: string;
53
- text: string;
54
- };
55
- "mfa-backup-codes-regenerated": {
56
- subject: string;
57
- html: string;
58
- text: string;
59
- };
60
- "email-changed": {
61
- subject: string;
62
- html: string;
63
- text: string;
64
- };
65
- "phone-changed": {
66
- subject: string;
67
- html: string;
68
- text: string;
69
- };
70
- "password-revoked": {
71
- subject: string;
72
- html: string;
73
- text: string;
74
- };
75
- "oauth-registration": {
76
- subject: string;
77
- html: string;
78
- text: string;
79
- };
80
- "oauth-linked": {
81
- subject: string;
82
- html: string;
83
- text: string;
84
- };
85
- "oauth-unlinked": {
86
- subject: string;
87
- html: string;
88
- text: string;
89
- };
90
- };
26
+ 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>;
91
27
 
92
28
  interface ILoginEventDTO {
93
29
  id: string;
@@ -121,8 +57,10 @@ declare const registerSchema: z.ZodUnion<readonly [z.ZodObject<{
121
57
  password: z.ZodString;
122
58
  firstName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
123
59
  lastName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
60
+ locale: z.ZodOptional<z.ZodNullable<z.ZodString>>;
124
61
  }, z.core.$strip>, z.ZodObject<{
125
62
  phone: z.ZodString;
63
+ locale: z.ZodOptional<z.ZodNullable<z.ZodString>>;
126
64
  }, z.core.$strip>]>;
127
65
  declare const loginSchema: z.ZodUnion<readonly [z.ZodObject<{
128
66
  email: z.ZodPipe<z.ZodString, z.ZodEmail>;
@@ -230,8 +168,11 @@ declare function importUser(store: IStoreAdapter, user: IImportUser): Promise<{
230
168
 
231
169
  interface IPurgeOptions {
232
170
  olderThanDays: number;
171
+ bus?: {
172
+ emit(type: string, payload: unknown): Promise<void>;
173
+ } | undefined;
233
174
  }
234
- declare function purgeSoftDeletedUsers(store: IStoreAdapter, { olderThanDays }: IPurgeOptions): Promise<number>;
175
+ declare function purgeSoftDeletedUsers(store: IStoreAdapter, { olderThanDays, bus }: IPurgeOptions): Promise<number>;
235
176
  interface IUserRetentionScheduleOptions extends IPurgeOptions {
236
177
  intervalMs?: number;
237
178
  onPurge?: (deleted: number) => void;
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { IUser } from './types.js';
2
2
  export { IMfaChallenge, ISession } from './types.js';
3
- import { IFonderieModule, IAdminDescription, IReadinessProblem, IFonderieApp, IAdminRoute } from '@fonderie/core';
3
+ import { IFonderieModule, IAdminDescription, IReadinessProblem, IFonderieApp, IDefaultTemplate, IAdminRoute } from '@fonderie/core';
4
4
  import { IStoreAdapter } from '@fonderie/store';
5
5
  import { EventBus } from '@fonderie/events';
6
6
  import { I as IAuthConfig, a as IRequestLocation } from './session-BBF5t-3Y.js';
@@ -23,71 +23,7 @@ declare class AuthModule implements IFonderieModule {
23
23
  install(app: IFonderieApp): void;
24
24
  }
25
25
 
26
- declare const DEFAULT_TEMPLATES: {
27
- "email-registration": {
28
- subject: string;
29
- html: string;
30
- text: string;
31
- };
32
- "email-verification": {
33
- subject: string;
34
- html: string;
35
- text: string;
36
- };
37
- "password-reset": {
38
- subject: string;
39
- html: string;
40
- text: string;
41
- };
42
- "phone-otp": {
43
- text: string;
44
- };
45
- "mfa-enabled": {
46
- subject: string;
47
- html: string;
48
- text: string;
49
- };
50
- "mfa-disabled": {
51
- subject: string;
52
- html: string;
53
- text: string;
54
- };
55
- "mfa-backup-codes-regenerated": {
56
- subject: string;
57
- html: string;
58
- text: string;
59
- };
60
- "email-changed": {
61
- subject: string;
62
- html: string;
63
- text: string;
64
- };
65
- "phone-changed": {
66
- subject: string;
67
- html: string;
68
- text: string;
69
- };
70
- "password-revoked": {
71
- subject: string;
72
- html: string;
73
- text: string;
74
- };
75
- "oauth-registration": {
76
- subject: string;
77
- html: string;
78
- text: string;
79
- };
80
- "oauth-linked": {
81
- subject: string;
82
- html: string;
83
- text: string;
84
- };
85
- "oauth-unlinked": {
86
- subject: string;
87
- html: string;
88
- text: string;
89
- };
90
- };
26
+ 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>;
91
27
 
92
28
  interface ILoginEventDTO {
93
29
  id: string;
@@ -121,8 +57,10 @@ declare const registerSchema: z.ZodUnion<readonly [z.ZodObject<{
121
57
  password: z.ZodString;
122
58
  firstName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
123
59
  lastName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
60
+ locale: z.ZodOptional<z.ZodNullable<z.ZodString>>;
124
61
  }, z.core.$strip>, z.ZodObject<{
125
62
  phone: z.ZodString;
63
+ locale: z.ZodOptional<z.ZodNullable<z.ZodString>>;
126
64
  }, z.core.$strip>]>;
127
65
  declare const loginSchema: z.ZodUnion<readonly [z.ZodObject<{
128
66
  email: z.ZodPipe<z.ZodString, z.ZodEmail>;
@@ -230,8 +168,11 @@ declare function importUser(store: IStoreAdapter, user: IImportUser): Promise<{
230
168
 
231
169
  interface IPurgeOptions {
232
170
  olderThanDays: number;
171
+ bus?: {
172
+ emit(type: string, payload: unknown): Promise<void>;
173
+ } | undefined;
233
174
  }
234
- declare function purgeSoftDeletedUsers(store: IStoreAdapter, { olderThanDays }: IPurgeOptions): Promise<number>;
175
+ declare function purgeSoftDeletedUsers(store: IStoreAdapter, { olderThanDays, bus }: IPurgeOptions): Promise<number>;
235
176
  interface IUserRetentionScheduleOptions extends IPurgeOptions {
236
177
  intervalMs?: number;
237
178
  onPurge?: (deleted: number) => void;