urembo-hub-api
Preparing search index...
live-shopping/live-shopping.service
LiveShoppingService
Class LiveShoppingService
Index
Constructors
constructor
Methods
add
Message
add
Product
To
Session
create
Session
delete
Session
feature
Product
get
All
Sessions
get
Live
Shopping
Stats
get
Session
By
Id
get
Session
Messages
get
Session
Participants
get
User
Sessions
join
Session
leave
Session
remove
Product
From
Session
search
Sessions
update
Session
Constructors
constructor
new
LiveShoppingService
(
prisma
:
PrismaService
)
:
LiveShoppingService
Parameters
prisma
:
PrismaService
Returns
LiveShoppingService
Methods
add
Message
addMessage
(
createMessageDto
:
CreateLiveMessageDto
,
userId
:
string
,
)
:
Promise
<
{
user
:
{
email
:
string
;
fullName
:
string
;
id
:
string
;
role
:
user_role
}
;
}
&
{
createdAt
:
Date
;
id
:
string
;
isModerator
:
boolean
;
message
:
string
;
messageType
:
string
;
sessionId
:
string
;
userId
:
string
;
}
,
>
Parameters
createMessageDto
:
CreateLiveMessageDto
userId
:
string
Returns
Promise
<
{
user
:
{
email
:
string
;
fullName
:
string
;
id
:
string
;
role
:
user_role
}
;
}
&
{
createdAt
:
Date
;
id
:
string
;
isModerator
:
boolean
;
message
:
string
;
messageType
:
string
;
sessionId
:
string
;
userId
:
string
;
}
,
>
add
Product
To
Session
addProductToSession
(
sessionId
:
string
,
productId
:
string
,
userId
:
string
,
userRole
:
string
,
)
:
Promise
<
{
product
:
{
currency
:
string
;
id
:
string
;
imageUrl
:
string
;
name
:
string
;
price
:
Decimal
;
stockQuantity
:
number
;
}
;
}
&
{
createdAt
:
Date
;
featuredAt
:
Date
;
id
:
string
;
isCurrentlyFeatured
:
boolean
;
isFeatured
:
boolean
;
position
:
number
;
productId
:
string
;
sessionId
:
string
;
}
,
>
Parameters
sessionId
:
string
productId
:
string
userId
:
string
userRole
:
string
Returns
Promise
<
{
product
:
{
currency
:
string
;
id
:
string
;
imageUrl
:
string
;
name
:
string
;
price
:
Decimal
;
stockQuantity
:
number
;
}
;
}
&
{
createdAt
:
Date
;
featuredAt
:
Date
;
id
:
string
;
isCurrentlyFeatured
:
boolean
;
isFeatured
:
boolean
;
position
:
number
;
productId
:
string
;
sessionId
:
string
;
}
,
>
create
Session
createSession
(
createSessionDto
:
CreateLiveSessionDto
,
userId
:
string
,
)
:
Promise
<
{
retailer
:
{
businessName
:
string
;
email
:
string
;
fullName
:
string
;
id
:
string
;
}
;
}
&
{
actualEnd
:
Date
;
actualStart
:
Date
;
createdAt
:
Date
;
description
:
string
;
endedAt
:
Date
;
id
:
string
;
isActive
:
boolean
;
retailerId
:
string
;
scheduledAt
:
Date
;
startedAt
:
Date
;
status
:
string
;
streamUrl
:
string
;
thumbnailUrl
:
string
;
title
:
string
;
updatedAt
:
Date
;
vendorId
:
string
;
viewerCount
:
number
;
}
,
>
Parameters
createSessionDto
:
CreateLiveSessionDto
userId
:
string
Returns
Promise
<
{
retailer
:
{
businessName
:
string
;
email
:
string
;
fullName
:
string
;
id
:
string
;
}
;
}
&
{
actualEnd
:
Date
;
actualStart
:
Date
;
createdAt
:
Date
;
description
:
string
;
endedAt
:
Date
;
id
:
string
;
isActive
:
boolean
;
retailerId
:
string
;
scheduledAt
:
Date
;
startedAt
:
Date
;
status
:
string
;
streamUrl
:
string
;
thumbnailUrl
:
string
;
title
:
string
;
updatedAt
:
Date
;
vendorId
:
string
;
viewerCount
:
number
;
}
,
>
delete
Session
deleteSession
(
id
:
string
,
userId
:
string
,
userRole
:
string
,
)
:
Promise
<
{
message
:
string
}
>
Parameters
id
:
string
userId
:
string
userRole
:
string
Returns
Promise
<
{
message
:
string
}
>
feature
Product
featureProduct
(
sessionId
:
string
,
productId
:
string
,
userId
:
string
,
userRole
:
string
,
)
:
Promise
<
{
message
:
string
}
>
Parameters
sessionId
:
string
productId
:
string
userId
:
string
userRole
:
string
Returns
Promise
<
{
message
:
string
}
>
get
All
Sessions
getAllSessions
(
page
?:
number
,
limit
?:
number
,
status
?:
string
,
retailerId
?:
string
,
category
?:
string
,
)
:
Promise
<
{
pagination
:
{
limit
:
number
;
page
:
number
;
pages
:
number
;
total
:
number
;
}
;
sessions
:
(
{
_count
:
{
messages
:
number
;
participants
:
number
}
;
products
:
(
{
product
:
{
currency
:
string
;
id
:
string
;
imageUrl
:
string
;
name
:
string
;
price
:
Decimal
;
stockQuantity
:
number
;
}
;
}
&
{
createdAt
:
Date
;
featuredAt
:
Date
;
id
:
string
;
isCurrentlyFeatured
:
boolean
;
isFeatured
:
boolean
;
position
:
number
;
productId
:
string
;
sessionId
:
string
;
}
)
[]
;
retailer
:
{
businessName
:
string
;
email
:
string
;
fullName
:
string
;
id
:
string
;
}
;
}
&
{
actualEnd
:
Date
;
actualStart
:
Date
;
createdAt
:
Date
;
description
:
string
;
endedAt
:
Date
;
id
:
string
;
isActive
:
boolean
;
retailerId
:
string
;
scheduledAt
:
Date
;
startedAt
:
Date
;
status
:
string
;
streamUrl
:
string
;
thumbnailUrl
:
string
;
title
:
string
;
updatedAt
:
Date
;
vendorId
:
string
;
viewerCount
:
number
;
}
)
[]
;
}
,
>
Parameters
page
:
number
= 1
limit
:
number
= 10
Optional
status
:
string
Optional
retailerId
:
string
Optional
category
:
string
Returns
Promise
<
{
pagination
:
{
limit
:
number
;
page
:
number
;
pages
:
number
;
total
:
number
;
}
;
sessions
:
(
{
_count
:
{
messages
:
number
;
participants
:
number
}
;
products
:
(
{
product
:
{
currency
:
string
;
id
:
string
;
imageUrl
:
string
;
name
:
string
;
price
:
Decimal
;
stockQuantity
:
number
;
}
;
}
&
{
createdAt
:
Date
;
featuredAt
:
Date
;
id
:
string
;
isCurrentlyFeatured
:
boolean
;
isFeatured
:
boolean
;
position
:
number
;
productId
:
string
;
sessionId
:
string
;
}
)
[]
;
retailer
:
{
businessName
:
string
;
email
:
string
;
fullName
:
string
;
id
:
string
;
}
;
}
&
{
actualEnd
:
Date
;
actualStart
:
Date
;
createdAt
:
Date
;
description
:
string
;
endedAt
:
Date
;
id
:
string
;
isActive
:
boolean
;
retailerId
:
string
;
scheduledAt
:
Date
;
startedAt
:
Date
;
status
:
string
;
streamUrl
:
string
;
thumbnailUrl
:
string
;
title
:
string
;
updatedAt
:
Date
;
vendorId
:
string
;
viewerCount
:
number
;
}
)
[]
;
}
,
>
get
Live
Shopping
Stats
getLiveShoppingStats
(
userId
?:
string
,
userRole
?:
string
,
)
:
Promise
<
{
endedSessions
:
number
;
liveSessions
:
number
;
scheduledSessions
:
number
;
totalMessages
:
number
;
totalParticipants
:
number
;
totalSessions
:
number
;
}
,
>
Parameters
Optional
userId
:
string
Optional
userRole
:
string
Returns
Promise
<
{
endedSessions
:
number
;
liveSessions
:
number
;
scheduledSessions
:
number
;
totalMessages
:
number
;
totalParticipants
:
number
;
totalSessions
:
number
;
}
,
>
get
Session
By
Id
getSessionById
(
id
:
string
,
)
:
Promise
<
{
messages
:
(
{
user
:
{
email
:
string
;
fullName
:
string
;
id
:
string
;
role
:
user_role
;
}
;
}
&
{
createdAt
:
Date
;
id
:
string
;
isModerator
:
boolean
;
message
:
string
;
messageType
:
string
;
sessionId
:
string
;
userId
:
string
;
}
)
[]
;
participants
:
(
{
user
:
{
email
:
string
;
fullName
:
string
;
id
:
string
;
role
:
user_role
;
}
;
}
&
{
id
:
string
;
isActive
:
boolean
;
joinedAt
:
Date
;
lastSeenAt
:
Date
;
leftAt
:
Date
;
sessionId
:
string
;
userId
:
string
;
}
)
[]
;
products
:
(
{
product
:
{
currency
:
string
;
id
:
string
;
imageUrl
:
string
;
name
:
string
;
price
:
Decimal
;
stockQuantity
:
number
;
}
;
}
&
{
createdAt
:
Date
;
featuredAt
:
Date
;
id
:
string
;
isCurrentlyFeatured
:
boolean
;
isFeatured
:
boolean
;
position
:
number
;
productId
:
string
;
sessionId
:
string
;
}
)
[]
;
retailer
:
{
businessName
:
string
;
email
:
string
;
fullName
:
string
;
id
:
string
;
}
;
}
&
{
actualEnd
:
Date
;
actualStart
:
Date
;
createdAt
:
Date
;
description
:
string
;
endedAt
:
Date
;
id
:
string
;
isActive
:
boolean
;
retailerId
:
string
;
scheduledAt
:
Date
;
startedAt
:
Date
;
status
:
string
;
streamUrl
:
string
;
thumbnailUrl
:
string
;
title
:
string
;
updatedAt
:
Date
;
vendorId
:
string
;
viewerCount
:
number
;
}
,
>
Parameters
id
:
string
Returns
Promise
<
{
messages
:
(
{
user
:
{
email
:
string
;
fullName
:
string
;
id
:
string
;
role
:
user_role
;
}
;
}
&
{
createdAt
:
Date
;
id
:
string
;
isModerator
:
boolean
;
message
:
string
;
messageType
:
string
;
sessionId
:
string
;
userId
:
string
;
}
)
[]
;
participants
:
(
{
user
:
{
email
:
string
;
fullName
:
string
;
id
:
string
;
role
:
user_role
;
}
;
}
&
{
id
:
string
;
isActive
:
boolean
;
joinedAt
:
Date
;
lastSeenAt
:
Date
;
leftAt
:
Date
;
sessionId
:
string
;
userId
:
string
;
}
)
[]
;
products
:
(
{
product
:
{
currency
:
string
;
id
:
string
;
imageUrl
:
string
;
name
:
string
;
price
:
Decimal
;
stockQuantity
:
number
;
}
;
}
&
{
createdAt
:
Date
;
featuredAt
:
Date
;
id
:
string
;
isCurrentlyFeatured
:
boolean
;
isFeatured
:
boolean
;
position
:
number
;
productId
:
string
;
sessionId
:
string
;
}
)
[]
;
retailer
:
{
businessName
:
string
;
email
:
string
;
fullName
:
string
;
id
:
string
;
}
;
}
&
{
actualEnd
:
Date
;
actualStart
:
Date
;
createdAt
:
Date
;
description
:
string
;
endedAt
:
Date
;
id
:
string
;
isActive
:
boolean
;
retailerId
:
string
;
scheduledAt
:
Date
;
startedAt
:
Date
;
status
:
string
;
streamUrl
:
string
;
thumbnailUrl
:
string
;
title
:
string
;
updatedAt
:
Date
;
vendorId
:
string
;
viewerCount
:
number
;
}
,
>
get
Session
Messages
getSessionMessages
(
sessionId
:
string
,
page
?:
number
,
limit
?:
number
,
)
:
Promise
<
{
messages
:
(
{
user
:
{
email
:
string
;
fullName
:
string
;
id
:
string
;
role
:
user_role
;
}
;
}
&
{
createdAt
:
Date
;
id
:
string
;
isModerator
:
boolean
;
message
:
string
;
messageType
:
string
;
sessionId
:
string
;
userId
:
string
;
}
)
[]
;
pagination
:
{
limit
:
number
;
page
:
number
;
pages
:
number
;
total
:
number
}
;
}
,
>
Parameters
sessionId
:
string
page
:
number
= 1
limit
:
number
= 50
Returns
Promise
<
{
messages
:
(
{
user
:
{
email
:
string
;
fullName
:
string
;
id
:
string
;
role
:
user_role
;
}
;
}
&
{
createdAt
:
Date
;
id
:
string
;
isModerator
:
boolean
;
message
:
string
;
messageType
:
string
;
sessionId
:
string
;
userId
:
string
;
}
)
[]
;
pagination
:
{
limit
:
number
;
page
:
number
;
pages
:
number
;
total
:
number
}
;
}
,
>
get
Session
Participants
getSessionParticipants
(
sessionId
:
string
,
)
:
Promise
<
(
{
user
:
{
email
:
string
;
fullName
:
string
;
id
:
string
;
role
:
user_role
}
;
}
&
{
id
:
string
;
isActive
:
boolean
;
joinedAt
:
Date
;
lastSeenAt
:
Date
;
leftAt
:
Date
;
sessionId
:
string
;
userId
:
string
;
}
)
[]
,
>
Parameters
sessionId
:
string
Returns
Promise
<
(
{
user
:
{
email
:
string
;
fullName
:
string
;
id
:
string
;
role
:
user_role
}
;
}
&
{
id
:
string
;
isActive
:
boolean
;
joinedAt
:
Date
;
lastSeenAt
:
Date
;
leftAt
:
Date
;
sessionId
:
string
;
userId
:
string
;
}
)
[]
,
>
get
User
Sessions
getUserSessions
(
userId
:
string
,
userRole
:
string
,
page
?:
number
,
limit
?:
number
,
)
:
Promise
<
{
pagination
:
{
limit
:
number
;
page
:
number
;
pages
:
number
;
total
:
number
;
}
;
sessions
:
(
{
_count
:
{
messages
:
number
;
participants
:
number
}
;
retailer
:
{
businessName
:
string
;
email
:
string
;
fullName
:
string
;
id
:
string
;
}
;
}
&
{
actualEnd
:
Date
;
actualStart
:
Date
;
createdAt
:
Date
;
description
:
string
;
endedAt
:
Date
;
id
:
string
;
isActive
:
boolean
;
retailerId
:
string
;
scheduledAt
:
Date
;
startedAt
:
Date
;
status
:
string
;
streamUrl
:
string
;
thumbnailUrl
:
string
;
title
:
string
;
updatedAt
:
Date
;
vendorId
:
string
;
viewerCount
:
number
;
}
)
[]
;
}
,
>
Parameters
userId
:
string
userRole
:
string
page
:
number
= 1
limit
:
number
= 10
Returns
Promise
<
{
pagination
:
{
limit
:
number
;
page
:
number
;
pages
:
number
;
total
:
number
;
}
;
sessions
:
(
{
_count
:
{
messages
:
number
;
participants
:
number
}
;
retailer
:
{
businessName
:
string
;
email
:
string
;
fullName
:
string
;
id
:
string
;
}
;
}
&
{
actualEnd
:
Date
;
actualStart
:
Date
;
createdAt
:
Date
;
description
:
string
;
endedAt
:
Date
;
id
:
string
;
isActive
:
boolean
;
retailerId
:
string
;
scheduledAt
:
Date
;
startedAt
:
Date
;
status
:
string
;
streamUrl
:
string
;
thumbnailUrl
:
string
;
title
:
string
;
updatedAt
:
Date
;
vendorId
:
string
;
viewerCount
:
number
;
}
)
[]
;
}
,
>
join
Session
joinSession
(
sessionId
:
string
,
userId
:
string
,
)
:
Promise
<
|
{
user
:
{
email
:
string
;
fullName
:
string
;
id
:
string
;
role
:
user_role
}
;
}
&
{
id
:
string
;
isActive
:
boolean
;
joinedAt
:
Date
;
lastSeenAt
:
Date
;
leftAt
:
Date
;
sessionId
:
string
;
userId
:
string
;
}
|
{
message
:
string
}
,
>
Parameters
sessionId
:
string
userId
:
string
Returns
Promise
<
|
{
user
:
{
email
:
string
;
fullName
:
string
;
id
:
string
;
role
:
user_role
}
;
}
&
{
id
:
string
;
isActive
:
boolean
;
joinedAt
:
Date
;
lastSeenAt
:
Date
;
leftAt
:
Date
;
sessionId
:
string
;
userId
:
string
;
}
|
{
message
:
string
}
,
>
leave
Session
leaveSession
(
sessionId
:
string
,
userId
:
string
)
:
Promise
<
{
message
:
string
}
>
Parameters
sessionId
:
string
userId
:
string
Returns
Promise
<
{
message
:
string
}
>
remove
Product
From
Session
removeProductFromSession
(
sessionId
:
string
,
productId
:
string
,
userId
:
string
,
userRole
:
string
,
)
:
Promise
<
{
message
:
string
}
>
Parameters
sessionId
:
string
productId
:
string
userId
:
string
userRole
:
string
Returns
Promise
<
{
message
:
string
}
>
search
Sessions
searchSessions
(
query
:
string
,
userId
?:
string
,
userRole
?:
string
,
)
:
Promise
<
(
{
_count
:
{
messages
:
number
;
participants
:
number
}
;
retailer
:
{
businessName
:
string
;
email
:
string
;
fullName
:
string
;
id
:
string
;
}
;
}
&
{
actualEnd
:
Date
;
actualStart
:
Date
;
createdAt
:
Date
;
description
:
string
;
endedAt
:
Date
;
id
:
string
;
isActive
:
boolean
;
retailerId
:
string
;
scheduledAt
:
Date
;
startedAt
:
Date
;
status
:
string
;
streamUrl
:
string
;
thumbnailUrl
:
string
;
title
:
string
;
updatedAt
:
Date
;
vendorId
:
string
;
viewerCount
:
number
;
}
)
[]
,
>
Parameters
query
:
string
Optional
userId
:
string
Optional
userRole
:
string
Returns
Promise
<
(
{
_count
:
{
messages
:
number
;
participants
:
number
}
;
retailer
:
{
businessName
:
string
;
email
:
string
;
fullName
:
string
;
id
:
string
;
}
;
}
&
{
actualEnd
:
Date
;
actualStart
:
Date
;
createdAt
:
Date
;
description
:
string
;
endedAt
:
Date
;
id
:
string
;
isActive
:
boolean
;
retailerId
:
string
;
scheduledAt
:
Date
;
startedAt
:
Date
;
status
:
string
;
streamUrl
:
string
;
thumbnailUrl
:
string
;
title
:
string
;
updatedAt
:
Date
;
vendorId
:
string
;
viewerCount
:
number
;
}
)
[]
,
>
update
Session
updateSession
(
id
:
string
,
updateSessionDto
:
UpdateLiveSessionDto
,
userId
:
string
,
userRole
:
string
,
)
:
Promise
<
{
products
:
(
{
product
:
{
currency
:
string
;
id
:
string
;
imageUrl
:
string
;
name
:
string
;
price
:
Decimal
;
stockQuantity
:
number
;
}
;
}
&
{
createdAt
:
Date
;
featuredAt
:
Date
;
id
:
string
;
isCurrentlyFeatured
:
boolean
;
isFeatured
:
boolean
;
position
:
number
;
productId
:
string
;
sessionId
:
string
;
}
)
[]
;
retailer
:
{
businessName
:
string
;
email
:
string
;
fullName
:
string
;
id
:
string
;
}
;
}
&
{
actualEnd
:
Date
;
actualStart
:
Date
;
createdAt
:
Date
;
description
:
string
;
endedAt
:
Date
;
id
:
string
;
isActive
:
boolean
;
retailerId
:
string
;
scheduledAt
:
Date
;
startedAt
:
Date
;
status
:
string
;
streamUrl
:
string
;
thumbnailUrl
:
string
;
title
:
string
;
updatedAt
:
Date
;
vendorId
:
string
;
viewerCount
:
number
;
}
,
>
Parameters
id
:
string
updateSessionDto
:
UpdateLiveSessionDto
userId
:
string
userRole
:
string
Returns
Promise
<
{
products
:
(
{
product
:
{
currency
:
string
;
id
:
string
;
imageUrl
:
string
;
name
:
string
;
price
:
Decimal
;
stockQuantity
:
number
;
}
;
}
&
{
createdAt
:
Date
;
featuredAt
:
Date
;
id
:
string
;
isCurrentlyFeatured
:
boolean
;
isFeatured
:
boolean
;
position
:
number
;
productId
:
string
;
sessionId
:
string
;
}
)
[]
;
retailer
:
{
businessName
:
string
;
email
:
string
;
fullName
:
string
;
id
:
string
;
}
;
}
&
{
actualEnd
:
Date
;
actualStart
:
Date
;
createdAt
:
Date
;
description
:
string
;
endedAt
:
Date
;
id
:
string
;
isActive
:
boolean
;
retailerId
:
string
;
scheduledAt
:
Date
;
startedAt
:
Date
;
status
:
string
;
streamUrl
:
string
;
thumbnailUrl
:
string
;
title
:
string
;
updatedAt
:
Date
;
vendorId
:
string
;
viewerCount
:
number
;
}
,
>
Settings
Member Visibility
Protected
Inherited
External
Theme
OS
Light
Dark
On This Page
Constructors
constructor
Methods
add
Message
add
Product
To
Session
create
Session
delete
Session
feature
Product
get
All
Sessions
get
Live
Shopping
Stats
get
Session
By
Id
get
Session
Messages
get
Session
Participants
get
User
Sessions
join
Session
leave
Session
remove
Product
From
Session
search
Sessions
update
Session
urembo-hub-api
Loading...