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