2021-02-08 11:08:35 +00:00
|
|
|
json.access_token resource.access_token.token
|
|
|
|
json.account_id resource.active_account_user&.account_id
|
2020-07-27 16:49:26 +00:00
|
|
|
json.available_name resource.available_name
|
2021-02-08 11:08:35 +00:00
|
|
|
json.avatar_url resource.avatar_url
|
|
|
|
json.confirmed resource.confirmed?
|
|
|
|
json.display_name resource.display_name
|
2022-02-02 14:07:33 +00:00
|
|
|
json.message_signature resource.message_signature
|
2020-05-31 17:40:20 +00:00
|
|
|
json.email resource.email
|
2021-02-08 11:08:35 +00:00
|
|
|
json.hmac_identifier resource.hmac_identifier if GlobalConfig.get('CHATWOOT_INBOX_HMAC_KEY')['CHATWOOT_INBOX_HMAC_KEY'].present?
|
|
|
|
json.id resource.id
|
|
|
|
json.inviter_id resource.active_account_user&.inviter_id
|
|
|
|
json.name resource.name
|
|
|
|
json.provider resource.provider
|
2020-05-31 17:40:20 +00:00
|
|
|
json.pubsub_token resource.pubsub_token
|
2021-09-02 12:59:45 +00:00
|
|
|
json.custom_attributes resource.custom_attributes if resource.custom_attributes.present?
|
2020-06-02 18:20:39 +00:00
|
|
|
json.role resource.active_account_user&.role
|
2021-01-10 13:55:33 +00:00
|
|
|
json.ui_settings resource.ui_settings
|
2021-02-08 11:08:35 +00:00
|
|
|
json.uid resource.uid
|
2020-05-31 17:40:20 +00:00
|
|
|
json.accounts do
|
|
|
|
json.array! resource.account_users do |account_user|
|
|
|
|
json.id account_user.account_id
|
|
|
|
json.name account_user.account.name
|
2022-08-03 06:10:03 +00:00
|
|
|
json.status account_user.account.status
|
2020-05-31 17:40:20 +00:00
|
|
|
json.active_at account_user.active_at
|
|
|
|
json.role account_user.role
|
2021-10-14 19:00:48 +00:00
|
|
|
# the actual availability user has configured
|
|
|
|
json.availability account_user.availability
|
|
|
|
# availability derived from presence
|
2021-10-07 07:51:46 +00:00
|
|
|
json.availability_status account_user.availability_status
|
|
|
|
json.auto_offline account_user.auto_offline
|
2020-05-31 17:40:20 +00:00
|
|
|
end
|
|
|
|
end
|