import BaseAPI from './BaseAPI' ; export default class Users extends BaseAPI { public profile ; constructor ( token , retries_limit ) { super ( token , retries_limit ) ; this . profile = new UsersProfile ( token , retries_limit ) ; } public conversations ( cursor = null , exclude_archived = true , limit = 100 , types = 'public_channel' , user = null , extraArgs = { } ) { const args = { cursor , exclude_archived , limit , types , user , ... extraArgs } ; return this . _get ( 'users.conversations' , args ) ; } public deletePhoto ( extraArgs = { } ) { const args = { ... extraArgs } ; return this . _get ( 'users.deletePhoto' , args ) ; } public getPresence ( user , extraArgs = { } ) { const args = { user , ... extraArgs } ; return this . _get ( 'users.getPresence' , args ) ; } public identity ( extraArgs = { } ) { const args = { ... extraArgs } ; return this . _get ( 'users.identity' , args ) ; } public info ( user , include_locale = false , extraArgs = { } ) { const args = { user , include_locale , ... extraArgs } ; return this . _get ( 'users.info' , args ) ; } public list ( cursor = null , include_locale = false , limit = 0 , presence = false , extraArgs = { } ) { const args = { cursor , include_locale , limit , presence , ... extraArgs } ; return this . _get ( 'users.list' , args ) ; } public lookupByEmail ( email , extraArgs = { } ) { const args = { email , ... extraArgs } ; return this . _get ( 'users.lookupByEmail' , args ) ; } public setActive ( extraArgs = { } ) { return this . _post ( 'users.lookupByEmail' , extraArgs ) ; } public setPhoto ( image , extraArgs = { } ) { const args = { ... extraArgs } ; return this . _post_file ( 'users.setPhoto' , { image } , args ) ; } public setPresence ( presence , extraArgs = { } ) { const args = { presence , ... extraArgs } ; return this . _post ( 'users.setPresence' , args ) ; } } class UsersProfile extends BaseAPI { public get ( include_labels = false , user = null , extraArgs = { } ) { const args = { include_labels , user , ... extraArgs } ; return this . _get ( 'users.profile.get' , args ) ; } public set ( name = null , profile = null , user = null , value = null , extraArgs = { } ) { const args = { name , profile , user , value , ... extraArgs } ; return this . _post ( 'users.profile.set' , args ) ; } }