8455f96b977236ae2d1e4ae86586f9b7b2f34231
[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 _0xba4a=['./user.controller','get','isAuthenticated','index','/describe','describe','/whoami','whoami','/presence','getPresence','/:id','show','/:id/avatar','getAvatar','/:id/open_tabs','getContacts','/:id/queues_rt','getVoiceQueuesRt','/:id/groups','/:id/recordings','/:id/screen_recordings','getScreenRecordings','/:id/chat/interactions','getChatInteractions','getOpenchannelInteractions','/:id/mail/interactions','/:id/fax/interactions','/:id/whatsapp/interactions','getWhatsappInteractions','/:id/teams','/:id/lists','getLists','getAgents','getVoicePrefixes','/:id/fax_accounts','getFaxAccounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/sms_accounts','/:id/chat_websites','getChatWebsites','/:id/whatsapp_accounts','getWhatsappAccounts','/:id/square_projects','getSquareProjects','getScheduledCalls','/:id/api_key','getApiKey','/:id/contacts','post','create','/create_many','bulkCreate','/:id/queues','diskStorage','join','root','server/files/images/','format','%s-%s','now','originalname','single','file','addAvatar','/:id/login','login','/:id/logout','logout','/:id/pause','pause','unpause','/:id/chat_interactions','addMailInteractions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','addWhatsappInteractions','addFaxAccounts','addMailAccounts','addOpenchannelAccounts','addChatWebsites','addWhatsappAccounts','addSquareProjects','createApiKey','put','update','changePassword','delete','removeQueues','removeTeams','destroy','removeChatInteractions','removeMailInteractions','removeFaxInteractions','removeOpenchannelInteractions','/:id/whatsapp_interactions','removeFaxAccounts','removeMailAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeSquareProjects','removeApiKey','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x5aeef2,_0x3c08de){var _0xf69362=function(_0x28c3fb){while(--_0x28c3fb){_0x5aeef2['push'](_0x5aeef2['shift']());}};_0xf69362(++_0x3c08de);}(_0xba4a,0x153));var _0xaba4=function(_0x10e449,_0x5ac327){_0x10e449=_0x10e449-0x0;var _0x20b06d=_0xba4a[_0x10e449];return _0x20b06d;};'use strict';var multer=require(_0xaba4('0x0'));var util=require(_0xaba4('0x1'));var path=require(_0xaba4('0x2'));var timeout=require(_0xaba4('0x3'));var express=require(_0xaba4('0x4'));var router=express['Router']();var fs_extra=require(_0xaba4('0x5'));var auth=require(_0xaba4('0x6'));var interaction=require(_0xaba4('0x7'));var config=require(_0xaba4('0x8'));var controller=require(_0xaba4('0x9'));router[_0xaba4('0xa')]('/',auth[_0xaba4('0xb')](),controller[_0xaba4('0xc')]);router[_0xaba4('0xa')](_0xaba4('0xd'),auth[_0xaba4('0xb')](),controller[_0xaba4('0xe')]);router[_0xaba4('0xa')](_0xaba4('0xf'),auth[_0xaba4('0xb')](),controller[_0xaba4('0x10')]);router[_0xaba4('0xa')](_0xaba4('0x11'),auth[_0xaba4('0xb')](),controller[_0xaba4('0x12')]);router['get'](_0xaba4('0x13'),auth[_0xaba4('0xb')](),controller[_0xaba4('0x14')]);router['get'](_0xaba4('0x15'),controller[_0xaba4('0x16')]);router[_0xaba4('0xa')](_0xaba4('0x17'),auth[_0xaba4('0xb')](),controller['getOpenTabs']);router[_0xaba4('0xa')]('/:id/contacts',auth[_0xaba4('0xb')](),controller[_0xaba4('0x18')]);router[_0xaba4('0xa')]('/:id/queues',auth[_0xaba4('0xb')](),controller['getQueues']);router[_0xaba4('0xa')](_0xaba4('0x19'),auth[_0xaba4('0xb')](),controller[_0xaba4('0x1a')]);router[_0xaba4('0xa')](_0xaba4('0x1b'),auth['isAuthenticated'](),controller['getGroups']);router[_0xaba4('0xa')](_0xaba4('0x1c'),auth[_0xaba4('0xb')](),controller['getRecordings']);router[_0xaba4('0xa')](_0xaba4('0x1d'),auth['isAuthenticated'](),controller[_0xaba4('0x1e')]);router[_0xaba4('0xa')](_0xaba4('0x1f'),auth[_0xaba4('0xb')](),controller[_0xaba4('0x20')]);router[_0xaba4('0xa')]('/:id/openchannel/interactions',auth[_0xaba4('0xb')](),controller[_0xaba4('0x21')]);router[_0xaba4('0xa')](_0xaba4('0x22'),auth[_0xaba4('0xb')](),controller['getMailInteractions']);router['get']('/:id/sms/interactions',auth[_0xaba4('0xb')](),controller['getSmsInteractions']);router[_0xaba4('0xa')](_0xaba4('0x23'),auth[_0xaba4('0xb')](),controller['getFaxInteractions']);router['get'](_0xaba4('0x24'),auth[_0xaba4('0xb')](),controller[_0xaba4('0x25')]);router[_0xaba4('0xa')](_0xaba4('0x26'),auth[_0xaba4('0xb')](),controller['getTeams']);router[_0xaba4('0xa')](_0xaba4('0x27'),auth[_0xaba4('0xb')](),controller[_0xaba4('0x28')]);router[_0xaba4('0xa')]('/:id/agents',auth[_0xaba4('0xb')](),controller[_0xaba4('0x29')]);router[_0xaba4('0xa')]('/:id/prefixes',auth[_0xaba4('0xb')](),controller[_0xaba4('0x2a')]);router[_0xaba4('0xa')](_0xaba4('0x2b'),auth['isAuthenticated'](),controller[_0xaba4('0x2c')]);router[_0xaba4('0xa')](_0xaba4('0x2d'),auth[_0xaba4('0xb')](),controller[_0xaba4('0x2e')]);router[_0xaba4('0xa')](_0xaba4('0x2f'),auth[_0xaba4('0xb')](),controller[_0xaba4('0x30')]);router[_0xaba4('0xa')](_0xaba4('0x31'),auth[_0xaba4('0xb')](),controller['getSmsAccounts']);router[_0xaba4('0xa')](_0xaba4('0x32'),auth[_0xaba4('0xb')](),controller[_0xaba4('0x33')]);router[_0xaba4('0xa')](_0xaba4('0x34'),auth[_0xaba4('0xb')](),controller[_0xaba4('0x35')]);router[_0xaba4('0xa')](_0xaba4('0x36'),auth[_0xaba4('0xb')](),controller[_0xaba4('0x37')]);router[_0xaba4('0xa')]('/:id/scheduled_calls',auth[_0xaba4('0xb')](),controller[_0xaba4('0x38')]);router[_0xaba4('0xa')](_0xaba4('0x39'),auth[_0xaba4('0xb')](),controller[_0xaba4('0x3a')]);router['post'](_0xaba4('0x3b'),auth[_0xaba4('0xb')](),controller['addContacts']);router[_0xaba4('0x3c')]('/',auth['isAuthenticated'](),controller[_0xaba4('0x3d')]);router['post'](_0xaba4('0x3e'),auth['isAuthenticated'](),controller[_0xaba4('0x3f')]);router['post'](_0xaba4('0x40'),auth[_0xaba4('0xb')](),controller['addQueues']);var upload=multer({'storage':multer[_0xaba4('0x41')]({'destination':function(_0x5aaf8b,_0x494556,_0x274165){_0x274165(null,path[_0xaba4('0x42')](config[_0xaba4('0x43')],_0xaba4('0x44')));},'filename':function(_0x44b194,_0x3b2548,_0xeaf657){_0xeaf657(null,util[_0xaba4('0x45')](_0xaba4('0x46'),Date[_0xaba4('0x47')](),_0x3b2548[_0xaba4('0x48')]));}})});router['post'](_0xaba4('0x15'),upload[_0xaba4('0x49')](_0xaba4('0x4a')),controller[_0xaba4('0x4b')]);router[_0xaba4('0x3c')](_0xaba4('0x4c'),auth[_0xaba4('0xb')](),controller[_0xaba4('0x4d')]);router[_0xaba4('0x3c')](_0xaba4('0x4e'),auth[_0xaba4('0xb')](),controller[_0xaba4('0x4f')]);router[_0xaba4('0x3c')](_0xaba4('0x50'),auth[_0xaba4('0xb')](),controller[_0xaba4('0x51')]);router['post']('/:id/unpause',auth[_0xaba4('0xb')](),controller[_0xaba4('0x52')]);router[_0xaba4('0x3c')](_0xaba4('0x26'),auth[_0xaba4('0xb')](),controller['addTeams']);router['post'](_0xaba4('0x53'),auth[_0xaba4('0xb')](),controller['addChatInteractions']);router['post']('/:id/mail_interactions',auth[_0xaba4('0xb')](),controller[_0xaba4('0x54')]);router['post']('/:id/fax_interactions',auth[_0xaba4('0xb')](),controller['addFaxInteractions']);router[_0xaba4('0x3c')](_0xaba4('0x55'),auth[_0xaba4('0xb')](),controller[_0xaba4('0x56')]);router['post'](_0xaba4('0x57'),auth[_0xaba4('0xb')](),controller[_0xaba4('0x58')]);router['post']('/:id/whatsapp_interactions',auth[_0xaba4('0xb')](),controller[_0xaba4('0x59')]);router[_0xaba4('0x3c')](_0xaba4('0x2b'),auth[_0xaba4('0xb')](),controller[_0xaba4('0x5a')]);router[_0xaba4('0x3c')](_0xaba4('0x2d'),auth[_0xaba4('0xb')](),controller[_0xaba4('0x5b')]);router['post'](_0xaba4('0x2f'),auth[_0xaba4('0xb')](),controller[_0xaba4('0x5c')]);router['post'](_0xaba4('0x31'),auth[_0xaba4('0xb')](),controller['addSmsAccounts']);router[_0xaba4('0x3c')]('/:id/chat_websites',auth[_0xaba4('0xb')](),controller[_0xaba4('0x5d')]);router[_0xaba4('0x3c')](_0xaba4('0x34'),auth[_0xaba4('0xb')](),controller[_0xaba4('0x5e')]);router['post'](_0xaba4('0x36'),auth[_0xaba4('0xb')](),controller[_0xaba4('0x5f')]);router[_0xaba4('0x3c')](_0xaba4('0x39'),auth[_0xaba4('0xb')](),controller[_0xaba4('0x60')]);router[_0xaba4('0x61')](_0xaba4('0x13'),auth[_0xaba4('0xb')](),controller[_0xaba4('0x62')]);router[_0xaba4('0x61')]('/:id/password',auth[_0xaba4('0xb')](),controller[_0xaba4('0x63')]);router[_0xaba4('0x64')](_0xaba4('0x40'),auth[_0xaba4('0xb')](),controller[_0xaba4('0x65')]);router[_0xaba4('0x64')](_0xaba4('0x26'),auth[_0xaba4('0xb')](),controller[_0xaba4('0x66')]);router[_0xaba4('0x64')](_0xaba4('0x13'),auth[_0xaba4('0xb')](),controller[_0xaba4('0x67')]);router['delete'](_0xaba4('0x53'),auth[_0xaba4('0xb')](),controller[_0xaba4('0x68')]);router[_0xaba4('0x64')]('/:id/mail_interactions',auth[_0xaba4('0xb')](),controller[_0xaba4('0x69')]);router[_0xaba4('0x64')]('/:id/fax_interactions',auth[_0xaba4('0xb')](),controller[_0xaba4('0x6a')]);router[_0xaba4('0x64')](_0xaba4('0x55'),auth[_0xaba4('0xb')](),controller['removeSmsInteractions']);router[_0xaba4('0x64')](_0xaba4('0x57'),auth[_0xaba4('0xb')](),controller[_0xaba4('0x6b')]);router['delete'](_0xaba4('0x6c'),auth[_0xaba4('0xb')](),controller['removeWhatsappInteractions']);router['delete'](_0xaba4('0x2b'),auth['isAuthenticated'](),controller[_0xaba4('0x6d')]);router[_0xaba4('0x64')]('/:id/mail_accounts',auth['isAuthenticated'](),controller[_0xaba4('0x6e')]);router['delete'](_0xaba4('0x2f'),auth[_0xaba4('0xb')](),controller[_0xaba4('0x6f')]);router['delete'](_0xaba4('0x31'),auth[_0xaba4('0xb')](),controller[_0xaba4('0x70')]);router[_0xaba4('0x64')](_0xaba4('0x32'),auth['isAuthenticated'](),controller['removeChatWebsites']);router[_0xaba4('0x64')](_0xaba4('0x34'),auth['isAuthenticated'](),controller['removeWhatsappAccounts']);router[_0xaba4('0x64')](_0xaba4('0x36'),auth['isAuthenticated'](),controller[_0xaba4('0x71')]);router[_0xaba4('0x64')](_0xaba4('0x39'),auth[_0xaba4('0xb')](),controller[_0xaba4('0x72')]);module[_0xaba4('0x73')]=router;