File tree Expand file tree Collapse file tree 4 files changed +27
-0
lines changed Expand file tree Collapse file tree 4 files changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -13,11 +13,13 @@ export * from './middlewares/hook.middleware';
13
13
14
14
// Models
15
15
export * from './models/register-token' ;
16
+ export * from './models/session' ;
16
17
export * from './models/user' ;
17
18
18
19
// Repositories
19
20
export * from './repositories/register-token.repository' ;
20
21
export * from './repositories/email-template.repository' ;
22
+ export * from './repositories/session.repository' ;
21
23
export * from './repositories/user.repository' ;
22
24
23
25
// Routers
Original file line number Diff line number Diff line change
1
+ export type Session = {
2
+ refresh_token : string ;
3
+ access_token : string ;
4
+ expires_at : number ;
5
+ user_id : string ;
6
+ } ;
Original file line number Diff line number Diff line change
1
+ import type { Session } from '../models/session' ;
2
+
3
+ export interface SessionRepository {
4
+ upsert ( session : Session ) : Promise < void > ;
5
+
6
+ deleteByUserId ( { user_id } : { user_id : string } ) : Promise < void > ;
7
+
8
+ findByUserId ( { user_id } : { user_id : string } ) : Promise < Session | null > ;
9
+ }
Original file line number Diff line number Diff line change
1
+ import type { Session } from '../models/session' ;
2
+
3
+ export type AuthServiceDto = {
4
+ email : string ;
5
+ password : string ;
6
+ } ;
7
+
8
+ export interface AuthService {
9
+ execute ( dto : AuthServiceDto ) : Promise < Omit < Session , 'user_id' > > ;
10
+ }
You can’t perform that action at this time.
0 commit comments