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