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