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