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