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