Built motion from commit 52c8a02d.|2.6.29
[motion2.git] / server / api / user / index.js
1 // *************************************************************************
2 // *                                                                       *
3 // * xCALLY Motion -  The Omnichannel Contact Center                       *
4 // * Copyright (c) Xenialab s.r.l. All Rights Reserved                     *
5 // *                                                                       *
6 // *************************************************************************
7 // *                                                                       *
8 // * Email: info@xcally.com                                                *
9 // * Website: https://www.xcally.com                                       *
10 // *                                                                       *
11 // *************************************************************************
12 // *                                                                       *
13 // * The SOFTWARE PRODUCT is protected by copyright laws and international *
14 // * copyright treaties, as well as other intellectual property laws and   *
15 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                         *
16 // *                                                                       *
17 // *************************************************************************
18 var _0xae24=['addContacts','post','bulkCreate','addQueues','diskStorage','join','root','format','%s-%s','originalname','single','addAvatar','login','/:id/logout','logout','/:id/pause','pause','unpause','addTeams','/:id/mail_interactions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','/:id/openchannel_interactions','/:id/whatsapp_interactions','addWhatsappInteractions','addFaxAccounts','addMailAccounts','/:id/openchannel_accounts','addOpenchannelAccounts','addSmsAccounts','/:id/chat_websites','addChatWebsites','/:id/whatsapp_accounts','addWhatsappAccounts','createApiKey','put','/:id','update','/:id/password','changePassword','removeQueues','delete','removeTeams','destroy','/:id/chat_interactions','removeMailInteractions','removeFaxInteractions','removeOpenchannelInteractions','removeWhatsappInteractions','removeMailAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeChatWebsites','removeWhatsappAccounts','removeApiKey','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./user.controller','get','index','/describe','/whoami','isAuthenticated','whoami','/presence','getPresence','show','/:id/avatar','/:id/open_tabs','getOpenTabs','/:id/contacts','/:id/queues','getQueues','/:id/queues_rt','getVoiceQueuesRt','/:id/groups','/:id/recordings','getScreenRecordings','getChatInteractions','/:id/openchannel/interactions','getOpenchannelInteractions','getSmsInteractions','/:id/fax/interactions','/:id/teams','getTeams','/:id/lists','getLists','/:id/agents','/:id/prefixes','getVoicePrefixes','/:id/fax_accounts','getFaxAccounts','/:id/mail_accounts','getMailAccounts','/:id/sms_accounts','getSmsAccounts','getChatWebsites','getWhatsappAccounts','/:id/scheduled_calls','getScheduledCalls','/:id/api_key'];(function(_0x2ba609,_0x391585){var _0x563793=function(_0x3f28f5){while(--_0x3f28f5){_0x2ba609['push'](_0x2ba609['shift']());}};_0x563793(++_0x391585);}(_0xae24,0x180));var _0x4ae2=function(_0x5680b5,_0x11cdf7){_0x5680b5=_0x5680b5-0x0;var _0x52012c=_0xae24[_0x5680b5];return _0x52012c;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x4ae2('0x0'));var timeout=require(_0x4ae2('0x1'));var express=require(_0x4ae2('0x2'));var router=express[_0x4ae2('0x3')]();var fs_extra=require(_0x4ae2('0x4'));var auth=require(_0x4ae2('0x5'));var interaction=require(_0x4ae2('0x6'));var config=require(_0x4ae2('0x7'));var controller=require(_0x4ae2('0x8'));router[_0x4ae2('0x9')]('/',auth['isAuthenticated'](),controller[_0x4ae2('0xa')]);router[_0x4ae2('0x9')](_0x4ae2('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0x4ae2('0x9')](_0x4ae2('0xc'),auth[_0x4ae2('0xd')](),controller[_0x4ae2('0xe')]);router[_0x4ae2('0x9')](_0x4ae2('0xf'),auth[_0x4ae2('0xd')](),controller[_0x4ae2('0x10')]);router[_0x4ae2('0x9')]('/:id',auth[_0x4ae2('0xd')](),controller[_0x4ae2('0x11')]);router['get'](_0x4ae2('0x12'),controller['getAvatar']);router[_0x4ae2('0x9')](_0x4ae2('0x13'),auth['isAuthenticated'](),controller[_0x4ae2('0x14')]);router['get'](_0x4ae2('0x15'),auth[_0x4ae2('0xd')](),controller['getContacts']);router[_0x4ae2('0x9')](_0x4ae2('0x16'),auth[_0x4ae2('0xd')](),controller[_0x4ae2('0x17')]);router[_0x4ae2('0x9')](_0x4ae2('0x18'),auth[_0x4ae2('0xd')](),controller[_0x4ae2('0x19')]);router[_0x4ae2('0x9')](_0x4ae2('0x1a'),auth[_0x4ae2('0xd')](),controller['getGroups']);router[_0x4ae2('0x9')](_0x4ae2('0x1b'),auth[_0x4ae2('0xd')](),controller['getRecordings']);router[_0x4ae2('0x9')]('/:id/screen_recordings',auth[_0x4ae2('0xd')](),controller[_0x4ae2('0x1c')]);router[_0x4ae2('0x9')]('/:id/chat/interactions',auth[_0x4ae2('0xd')](),controller[_0x4ae2('0x1d')]);router[_0x4ae2('0x9')](_0x4ae2('0x1e'),auth[_0x4ae2('0xd')](),controller[_0x4ae2('0x1f')]);router[_0x4ae2('0x9')]('/:id/mail/interactions',auth[_0x4ae2('0xd')](),controller['getMailInteractions']);router[_0x4ae2('0x9')]('/:id/sms/interactions',auth[_0x4ae2('0xd')](),controller[_0x4ae2('0x20')]);router['get'](_0x4ae2('0x21'),auth[_0x4ae2('0xd')](),controller['getFaxInteractions']);router[_0x4ae2('0x9')]('/:id/whatsapp/interactions',auth[_0x4ae2('0xd')](),controller['getWhatsappInteractions']);router[_0x4ae2('0x9')](_0x4ae2('0x22'),auth[_0x4ae2('0xd')](),controller[_0x4ae2('0x23')]);router[_0x4ae2('0x9')](_0x4ae2('0x24'),auth['isAuthenticated'](),controller[_0x4ae2('0x25')]);router[_0x4ae2('0x9')](_0x4ae2('0x26'),auth[_0x4ae2('0xd')](),controller['getAgents']);router[_0x4ae2('0x9')](_0x4ae2('0x27'),auth[_0x4ae2('0xd')](),controller[_0x4ae2('0x28')]);router['get'](_0x4ae2('0x29'),auth[_0x4ae2('0xd')](),controller[_0x4ae2('0x2a')]);router[_0x4ae2('0x9')](_0x4ae2('0x2b'),auth[_0x4ae2('0xd')](),controller[_0x4ae2('0x2c')]);router[_0x4ae2('0x9')]('/:id/openchannel_accounts',auth['isAuthenticated'](),controller['getOpenchannelAccounts']);router['get'](_0x4ae2('0x2d'),auth[_0x4ae2('0xd')](),controller[_0x4ae2('0x2e')]);router[_0x4ae2('0x9')]('/:id/chat_websites',auth[_0x4ae2('0xd')](),controller[_0x4ae2('0x2f')]);router[_0x4ae2('0x9')]('/:id/whatsapp_accounts',auth[_0x4ae2('0xd')](),controller[_0x4ae2('0x30')]);router[_0x4ae2('0x9')](_0x4ae2('0x31'),auth[_0x4ae2('0xd')](),controller[_0x4ae2('0x32')]);router[_0x4ae2('0x9')](_0x4ae2('0x33'),auth[_0x4ae2('0xd')](),controller['getApiKey']);router['post']('/:id/contacts',auth[_0x4ae2('0xd')](),controller[_0x4ae2('0x34')]);router[_0x4ae2('0x35')]('/',auth[_0x4ae2('0xd')](),controller['create']);router[_0x4ae2('0x35')]('/create_many',auth[_0x4ae2('0xd')](),controller[_0x4ae2('0x36')]);router['post'](_0x4ae2('0x16'),auth[_0x4ae2('0xd')](),controller[_0x4ae2('0x37')]);var upload=multer({'storage':multer[_0x4ae2('0x38')]({'destination':function(_0x31d376,_0x5b18a8,_0x4a437b){_0x4a437b(null,path[_0x4ae2('0x39')](config[_0x4ae2('0x3a')],'server/files/images/'));},'filename':function(_0x32f3a0,_0x154930,_0x262007){_0x262007(null,util[_0x4ae2('0x3b')](_0x4ae2('0x3c'),Date['now'](),_0x154930[_0x4ae2('0x3d')]));}})});router[_0x4ae2('0x35')](_0x4ae2('0x12'),upload[_0x4ae2('0x3e')]('file'),controller[_0x4ae2('0x3f')]);router[_0x4ae2('0x35')]('/:id/login',auth[_0x4ae2('0xd')](),controller[_0x4ae2('0x40')]);router['post'](_0x4ae2('0x41'),auth[_0x4ae2('0xd')](),controller[_0x4ae2('0x42')]);router[_0x4ae2('0x35')](_0x4ae2('0x43'),auth[_0x4ae2('0xd')](),controller[_0x4ae2('0x44')]);router[_0x4ae2('0x35')]('/:id/unpause',auth['isAuthenticated'](),controller[_0x4ae2('0x45')]);router[_0x4ae2('0x35')](_0x4ae2('0x22'),auth[_0x4ae2('0xd')](),controller[_0x4ae2('0x46')]);router[_0x4ae2('0x35')]('/:id/chat_interactions',auth[_0x4ae2('0xd')](),controller['addChatInteractions']);router[_0x4ae2('0x35')](_0x4ae2('0x47'),auth['isAuthenticated'](),controller['addMailInteractions']);router[_0x4ae2('0x35')](_0x4ae2('0x48'),auth[_0x4ae2('0xd')](),controller[_0x4ae2('0x49')]);router[_0x4ae2('0x35')](_0x4ae2('0x4a'),auth[_0x4ae2('0xd')](),controller['addSmsInteractions']);router[_0x4ae2('0x35')](_0x4ae2('0x4b'),auth[_0x4ae2('0xd')](),controller['addOpenchannelInteractions']);router[_0x4ae2('0x35')](_0x4ae2('0x4c'),auth[_0x4ae2('0xd')](),controller[_0x4ae2('0x4d')]);router['post'](_0x4ae2('0x29'),auth[_0x4ae2('0xd')](),controller[_0x4ae2('0x4e')]);router[_0x4ae2('0x35')](_0x4ae2('0x2b'),auth['isAuthenticated'](),controller[_0x4ae2('0x4f')]);router[_0x4ae2('0x35')](_0x4ae2('0x50'),auth[_0x4ae2('0xd')](),controller[_0x4ae2('0x51')]);router['post'](_0x4ae2('0x2d'),auth['isAuthenticated'](),controller[_0x4ae2('0x52')]);router['post'](_0x4ae2('0x53'),auth[_0x4ae2('0xd')](),controller[_0x4ae2('0x54')]);router['post'](_0x4ae2('0x55'),auth[_0x4ae2('0xd')](),controller[_0x4ae2('0x56')]);router['post'](_0x4ae2('0x33'),auth[_0x4ae2('0xd')](),controller[_0x4ae2('0x57')]);router[_0x4ae2('0x58')](_0x4ae2('0x59'),auth['isAuthenticated'](),controller[_0x4ae2('0x5a')]);router[_0x4ae2('0x58')](_0x4ae2('0x5b'),auth[_0x4ae2('0xd')](),controller[_0x4ae2('0x5c')]);router['delete'](_0x4ae2('0x16'),auth[_0x4ae2('0xd')](),controller[_0x4ae2('0x5d')]);router[_0x4ae2('0x5e')](_0x4ae2('0x22'),auth[_0x4ae2('0xd')](),controller[_0x4ae2('0x5f')]);router[_0x4ae2('0x5e')](_0x4ae2('0x59'),auth[_0x4ae2('0xd')](),controller[_0x4ae2('0x60')]);router[_0x4ae2('0x5e')](_0x4ae2('0x61'),auth['isAuthenticated'](),controller['removeChatInteractions']);router[_0x4ae2('0x5e')](_0x4ae2('0x47'),auth[_0x4ae2('0xd')](),controller[_0x4ae2('0x62')]);router[_0x4ae2('0x5e')](_0x4ae2('0x48'),auth[_0x4ae2('0xd')](),controller[_0x4ae2('0x63')]);router[_0x4ae2('0x5e')](_0x4ae2('0x4a'),auth[_0x4ae2('0xd')](),controller['removeSmsInteractions']);router[_0x4ae2('0x5e')](_0x4ae2('0x4b'),auth[_0x4ae2('0xd')](),controller[_0x4ae2('0x64')]);router[_0x4ae2('0x5e')]('/:id/whatsapp_interactions',auth['isAuthenticated'](),controller[_0x4ae2('0x65')]);router[_0x4ae2('0x5e')](_0x4ae2('0x29'),auth['isAuthenticated'](),controller['removeFaxAccounts']);router[_0x4ae2('0x5e')](_0x4ae2('0x2b'),auth[_0x4ae2('0xd')](),controller[_0x4ae2('0x66')]);router[_0x4ae2('0x5e')]('/:id/openchannel_accounts',auth[_0x4ae2('0xd')](),controller[_0x4ae2('0x67')]);router[_0x4ae2('0x5e')](_0x4ae2('0x2d'),auth[_0x4ae2('0xd')](),controller[_0x4ae2('0x68')]);router[_0x4ae2('0x5e')](_0x4ae2('0x53'),auth[_0x4ae2('0xd')](),controller[_0x4ae2('0x69')]);router[_0x4ae2('0x5e')]('/:id/whatsapp_accounts',auth[_0x4ae2('0xd')](),controller[_0x4ae2('0x6a')]);router[_0x4ae2('0x5e')](_0x4ae2('0x33'),auth[_0x4ae2('0xd')](),controller[_0x4ae2('0x6b')]);router[_0x4ae2('0x35')]('/:id/messengerSoundNotification',auth[_0x4ae2('0xd')](),controller['messengerSoundNotification']);module[_0x4ae2('0x6c')]=router;