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