better-buddy-share-backend
Preparing search index...
dao/db/SessionDAO
SessionDAO
Class SessionDAO
Hierarchy (
View Summary
)
BaseDAO
SessionDAO
Implements
ISessionDAO
Index
Constructors
constructor
Properties
db
Methods
cleanup
Expired
Sessions
And
Tokens
create
Session
execute
Query
execute
Query
Multiple
extend
Session
get
Active
Sessions
map
Cache
Error
map
Error
map
Postgres
Error
revoke
All
User
Sessions
revoke
Session
scalar
touch
Session
Last
Used
Constructors
constructor
new
SessionDAO
(
dbClient
:
IDbClient
)
:
SessionDAO
Parameters
dbClient
:
IDbClient
Returns
SessionDAO
Properties
Protected
Readonly
db
db
:
IDbClient
Methods
cleanup
Expired
Sessions
And
Tokens
cleanupExpiredSessionsAndTokens
()
:
Promise
<
boolean
>
Returns
Promise
<
boolean
>
create
Session
createSession
(
user_id
:
number
,
expires_at
:
Date
,
ip_address
?:
string
,
user_agent
?:
string
,
device_info
?:
string
,
)
:
Promise
<
Session
|
null
>
Parameters
user_id
:
number
expires_at
:
Date
Optional
ip_address
:
string
Optional
user_agent
:
string
Optional
device_info
:
string
Returns
Promise
<
Session
|
null
>
Protected
execute
Query
executeQuery
<
T
>
(
query
:
string
,
params
?:
any
[]
)
:
Promise
<
T
|
null
>
Type Parameters
T
Parameters
query
:
string
Optional
params
:
any
[]
Returns
Promise
<
T
|
null
>
Protected
execute
Query
Multiple
executeQueryMultiple
<
T
>
(
query
:
string
,
params
?:
any
[]
)
:
Promise
<
T
[]
>
Type Parameters
T
Parameters
query
:
string
Optional
params
:
any
[]
Returns
Promise
<
T
[]
>
extend
Session
extendSession
(
session_id
:
string
,
new_expires_at
?:
Date
,
)
:
Promise
<
Session
|
null
>
Parameters
session_id
:
string
new_expires_at
:
Date
= ...
Returns
Promise
<
Session
|
null
>
get
Active
Sessions
getActiveSessions
(
user_id
:
number
)
:
Promise
<
Session
[]
>
Parameters
user_id
:
number
Returns
Promise
<
Session
[]
>
Protected
map
Cache
Error
mapCacheError
(
error
:
any
)
:
DaoError
Parameters
error
:
any
Returns
DaoError
Protected
map
Error
mapError
(
error
:
any
)
:
DaoError
Parameters
error
:
any
Returns
DaoError
Protected
map
Postgres
Error
mapPostgresError
(
error
:
any
)
:
DaoError
Parameters
error
:
any
Returns
DaoError
revoke
All
User
Sessions
revokeAllUserSessions
(
userId
:
number
)
:
Promise
<
boolean
>
Parameters
userId
:
number
Returns
Promise
<
boolean
>
revoke
Session
revokeSession
(
session_id
:
string
)
:
Promise
<
boolean
>
Parameters
session_id
:
string
Returns
Promise
<
boolean
>
Protected
scalar
scalar
<
T
=
any
>
(
query
:
string
,
params
?:
any
[]
)
:
Promise
<
T
>
Type Parameters
T
=
any
Parameters
query
:
string
Optional
params
:
any
[]
Returns
Promise
<
T
>
touch
Session
Last
Used
touchSessionLastUsed
(
session_id
:
string
)
:
Promise
<
Session
|
null
>
Parameters
session_id
:
string
Returns
Promise
<
Session
|
null
>
Settings
Member Visibility
Protected
Inherited
External
Theme
OS
Light
Dark
On This Page
Constructors
constructor
Properties
db
Methods
cleanup
Expired
Sessions
And
Tokens
create
Session
execute
Query
execute
Query
Multiple
extend
Session
get
Active
Sessions
map
Cache
Error
map
Error
map
Postgres
Error
revoke
All
User
Sessions
revoke
Session
scalar
touch
Session
Last
Used
better-buddy-share-backend
Loading...