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