File tree 3 files changed +37
-38
lines changed 3 files changed +37
-38
lines changed Original file line number Diff line number Diff line change
1
+ - [ 2025-04-15] [ Expose token and session types] ( https://github.com/RubricLab/auth/commit/e898a1f64f1ea77bdd02ce89ff027c2f7593d89f )
1
2
- [ 2025-04-07] [ verbose utils, bump] ( https://github.com/RubricLab/auth/commit/fd78ca0bc1824339b2b1a6ffb72eccc5c13d8d1c )
2
3
- [ 2025-02-14] [ fix build] ( https://github.com/RubricLab/auth/commit/c54af553ae56c720d886f97e6ee510bbb2ade498 )
3
4
- [ 2025-02-14] [ apiKeyAuthorizationProviders, vercel, brex] ( https://github.com/RubricLab/auth/commit/498233933eccab4cb147a0b4bd8a01f75ccc2a75 )
Original file line number Diff line number Diff line change 1
1
// export type AuthUrl = `http${'s' | ''}://${string}${'.' | ':'}${string}`
2
-
3
2
export type AuthUrl = string
3
+ export type Token = {
4
+ accessToken : string
5
+ refreshToken : string
6
+ expiresAt : Date
7
+ }
8
+ export type Session = {
9
+ key : string
10
+ userId : string
11
+ expiresAt : Date
12
+ user : {
13
+ apiKeyAuthorizationAccounts : {
14
+ provider : string
15
+ accountId : string
16
+ apiKey : string
17
+ } [ ]
18
+ oAuth2AuthenticationAccounts : {
19
+ provider : string
20
+ accountId : string
21
+ accessToken : string
22
+ refreshToken : string
23
+ expiresAt : Date
24
+ } [ ]
25
+ oAuth2AuthorizationAccounts : {
26
+ provider : string
27
+ accountId : string
28
+ accessToken : string
29
+ refreshToken : string
30
+ expiresAt : Date
31
+ } [ ]
32
+ }
33
+ }
4
34
export type Oauth2AuthenticationProvider = {
5
35
method : 'oauth2'
6
36
getAuthenticationUrl : ( options : { redirectUri : string ; state : string } ) => Promise < URL >
7
- getToken : ( options : { code : string ; redirectUri : string } ) => Promise < {
8
- accessToken : string
9
- refreshToken : string
10
- expiresAt : Date
11
- } >
37
+ getToken : ( options : { code : string ; redirectUri : string } ) => Promise < Token >
12
38
getUser : ( options : { accessToken : string } ) => Promise < {
13
39
accountId : string
14
40
email : string
@@ -26,11 +52,7 @@ export type Oauth2AuthorizationProvider = {
26
52
redirectUri : string
27
53
state : string
28
54
} ) => Promise < URL >
29
- getToken : ( options : { code : string ; redirectUri : string } ) => Promise < {
30
- accessToken : string
31
- refreshToken : string
32
- expiresAt : Date
33
- } >
55
+ getToken : ( options : { code : string ; redirectUri : string } ) => Promise < Token >
34
56
getUser : ( options : { accessToken : string } ) => Promise < {
35
57
accountId : string
36
58
email : string
@@ -94,32 +116,7 @@ export type DatabaseProvider = {
94
116
email : string
95
117
expiresAt : Date
96
118
} >
97
- getSession : ( data : { key : string } ) => Promise < {
98
- key : string
99
- userId : string
100
- expiresAt : Date
101
- user : {
102
- apiKeyAuthorizationAccounts : {
103
- provider : string
104
- accountId : string
105
- apiKey : string
106
- } [ ]
107
- oAuth2AuthenticationAccounts : {
108
- provider : string
109
- accountId : string
110
- accessToken : string
111
- refreshToken : string
112
- expiresAt : Date
113
- } [ ]
114
- oAuth2AuthorizationAccounts : {
115
- provider : string
116
- accountId : string
117
- accessToken : string
118
- refreshToken : string
119
- expiresAt : Date
120
- } [ ]
121
- }
122
- } | null >
119
+ getSession : ( data : { key : string } ) => Promise < Session | null >
123
120
getOAuth2AuthenticationAccount : ( data : {
124
121
provider : string
125
122
accountId : string
Original file line number Diff line number Diff line change 10
10
"lint:fix" : " bun x biome check --fix --unsafe . && bun x biome lint --write --unsafe ."
11
11
},
12
12
"name" : " @rubriclab/auth" ,
13
- "version" : " 0.0.32 " ,
13
+ "version" : " 0.0.33 " ,
14
14
"main" : " lib/index.ts" ,
15
+ "types" : " lib/types.ts" ,
15
16
"dependencies" : {
16
17
"@rubriclab/config" : " *" ,
17
18
"@rubriclab/package" : " *" ,
You can’t perform that action at this time.
0 commit comments